cancel
Showing results for 
Search instead for 
Did you mean: 

Who Me Too'd this topic

Can't Create Subscription Product

ipconfigurable
New Community Member

I've been trying to create a subscription product for a button on my webpage but have run into some errors that I can't seem to find answers for on Google.

 

What I have tried:

 

I retrieved an access token using this command from this page

 

 

curl -v https://api.sandbox.paypal.com/v1/oauth2/token -H "Accept: application/json" -H "Accept-Language: en_US" -u "client_id:secret" -d "grant_type=client_credentials"

 

 

(I removed the slashes “\” at the line endings and moved everything to one line because the command prompt didn’t seem to run them correctly. I also replaced “client_id” with my app id and “secret” with my app secret leaving the colon between them).

 

That gave me this:

 

 

{"scope":"https://uri.paypal.com/services/invoicing https://uri.paypal.com/services/disputes/read-buyer https://uri.paypal.com/services/payments/realtimepayment https://uri.paypal.com/services/disputes/update-seller https://uri.paypal.com/services/payments/payment/authcapture openid https://uri.paypal.com/services/disputes/read-seller https://uri.paypal.com/services/payments/refund https://api.paypal.com/v1/vault/credit-card https://api.paypal.com/v1/payments/.* https://uri.paypal.com/payments/payouts https://api.paypal.com/v1/vault/credit-card/.* https://uri.paypal.com/services/subscriptions https://uri.paypal.com/services/applications/webhooks","access_token":"A21AAFhs-YZory3SFkTsoj_oHmJ9ix5oVWdrclEJ7Xtqvt15A6LlbRPZhBS391z6Jzs3Kb30aYzaHbbNF9XPEjTPCCWoDokBA","token_type":"Bearer","app_id":"removed","expires_in":32400,"nonce":"2019-12-27T00:35:26ZvOsLgtjrs2Sx7Gz1rUyiAQuvJwLKSPvEZbZP2_Ud0MQ"}

 

 

 

I use the generated access token in the next command.

 

Then I tried to use the command from this page:

 

 

curl -v -X POST https://api.sandbox.paypal.com/v1/catalogs/products -H "Content-Type: application/json" -H "Authorization: Bearer A21AAFhs-YZory3SFkTsoj_oHmJ9ix5oVWdrclEJ7Xtqvt15A6LlbRPZhBS391z6Jzs3Kb30aYzaHbbNF9XPEjTPCCWoDokBA" -d '{"name":"Video Streaming Service","description": "Video streaming service","type": "SERVICE","category": "SOFTWARE","image_url": "https://example.com/streaming.jpg","home_url": "https://example.com/home"}'

 

 

Which gave me this:

 

 

{"name":"INVALID_REQUEST","message":"Request is not well-formed, syntactically incorrect, or violates schema.","debug_id":"da8f20e6f976e","details":[{"location":"body","issue":"Unexpected character (''' (code 39)): expected a valid value (number, String, array, object, 'true', 'false' or 'null') line: 1, column: 2"}],"links":[]}

 

 

So then I tried removing the “Bearer” part of the access token (I thought it might be throwing off the syntax checker or something). That gave me this:

 

 

{"name":"AUTHENTICATION_FAILURE","message":"Authentication failed due to invalid authentication credentials or a missing Authorization header.","links":[{"href":"https://developer.paypal.com/docs/api/overview/#error","rel":"information_link"}]}

 

 

So I’m kind of at a loss here. Maybe I need to look into the forward slashes not working properly? Or is there some blatant error I’m making that I’m unaware of?

 

Thank you for any assistance you can provide.


Login to Me Too
Who Me Too'd this topic