I am attemting to use the paypal subscription api. But am not sure I understand how everything is wired up. Under my paypal account, I selected Pay & Get Paid/Subscriptions and created a product. There is a subscription plan and product id for it. MyProduct Product Id: Guid <== assume it is: F1AF6C22953D4208AC9194C54395C558 When I navigate to the developer dashboard/My Apps & Credentials, I have created a SandBox App MySubsubscriptionAPP Selecting the MySubscriptionAPP brings me to a page where I am presented with Sandbox Account : emailaccountId ClientId: <ClientId> Secret: <ClientSecret> I then proceed to https://developer.paypal.com/docs/api/overview/ Where I use Postman to retrieve an access token. I am able to retrieve an access_token so now I'm trying to become familiar with the API. It is here that everything stops working. On the same page, in the subscription API section, I am attempting to retrieve the plan that I created using Postman: get https://api-m.sandbox.paypal.com/v1/billing/plans body is: { "product_id" : "F1AF6C22953D4208AC9194C54395C558", "plan_ids": 3, "page_size": 10, "page": 1, "total_required": true } The result is: { "plans": [], "links": [ { "href": "https://api.sandbox.paypal.com/v1/billing/plans?page_size=10&page=1", "rel": "self", "method": "GET", "encType": "application/json" } ] } It is not returning my Subscription Plan. At this point, I am thinking that I need to create a sandbox subscription so I attempt to create a subscription: post https://api-m.sandbox.paypal.com/v1/billing/plans the body is using a different guid for the product Id. { "product_id": "22C4AD7B18864C9E8DEF391269444741", "name": "My Product Subscription", "status": "Active", "description": "Fixed price yearly subscription", "plan_id": "F1AF6C22953D4208AC9194C54395C558", "billing_cycles": [ { "frequency": { "interval_unit": "DAY", "interval_count": 15 }, "tenure_type": "TRIAL", "sequence": 1, "total_cycles": 1, "pricing_scheme": { "fixed_price": { "value": "0", "currency_code": "USD" } } }, { "frequency": { "interval_unit": "MONTH", "interval_count": 1 }, "tenure_type": "REGULAR", "sequence": 2, "total_cycles": 36, "pricing_scheme": { "fixed_price": { "value": "250", "currency_code": "USD" } } } ], "payment_preferences": { "auto_bill_outstanding": true, "setup_fee": { "value": "0", "currency_code": "USD" }, "setup_fee_failure_action": "CONTINUE", "payment_failure_threshold": 3 }, "taxes": { "percentage": "0", "inclusive": false } } The result is: { "name": "INVALID_REQUEST", "message": "Request is not well-formed, syntactically incorrect, or violates schema.", "debug_id": "738311a82933f", "details": [ { "field": "/plan_id", "value": "F1AF6C22953D4208AC9194C54395C558", "location": "body", "issue": "INVALID_PARAMETER_SYNTAX", "description": "The value of a field does not conform to the expected format." } ], "links": [ { "href": "https://developer.paypal.com/docs/api/v1/billing/subscriptions#INVALID_REQUEST", "rel": "information_link", "method": "GET" } ] } It seems that I am not understanding something. My questions are two fold. 1. Should I be able to get the plan I created in my paypal account in the sandbox? 2. If I want to create a sandbox Subscription plan, what do I use for the plan_id and product_id? My end goal is to allow a user to subscribe to the Paypal subscription plan, and have my application query the subscription database with the users account id to determine if the subscription is active.
... View more