Cannot start a PayPal subscription

avi_vas
Contributor
Contributor

I created a subscription plan:

www.paypal.com_billing_plans_products_PROD-1Y184387SF453801E.png

After clicking Copy Code, I pasted it in my HTML page:

<div id="paypal-button-container-P-855600647D495860NMXSO6MA"></div>
<script src="https://www.paypal.com/sdk/js?client-id=sb&vault=true&intent=subscription" data-sdk-integration-source="button-factory"></script>
<script>
paypal.Buttons({
style: {
shape: 'pill',
color: 'white',
layout: 'vertical',
label: 'subscribe'
},
createSubscription: function(data, actions) {
return actions.subscription.create({
/* Creates the subscription */
plan_id: 'P-855600647D495860NMXSO6MA'
});
},
onApprove: function(data, actions) {
alert(data.subscriptionID); // You can add optional success message for the subscriber here
}
}).render('#paypal-button-container-P-855600647D495860NMXSO6MA'); // Renders the PayPal button
</script>

When I click "PayPal Subscribe", I get the following error in the console:

Uncaught Error: Create Subscription Api response error:

{
    "name": "RESOURCE_NOT_FOUND",
    "message": "The specified resource does not exist.",
    "debug_id": "f709778651899",
    "details": [
        {
            "issue": "INVALID_RESOURCE_ID",
            "description": "Requested resource ID was not found."
        }
    ],
    "links": [
        {
            "href": "https://developer.paypal.com/docs/api/v1/billing/subscriptions#RESOURCE_NOT_FOUND",
            "rel": "information_link",
            "method": "GET"
        }
    ]
}

 I get this error whether or not sandbox mode is enabled

Login to Me Too
0 REPLIES 0

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.