Paypal Subscriptions Rest API consistently returns 400 using Guzzle or cURL implementations for PHP.

Bjorn5
New Community Member

Hey,

I've been attempting to implement the new subscriptions REST API and the subscriptions endpoint always fails with the following information:

{"name":"INVALID_REQUEST","message":"Request is not well-formed, syntactically incorrect, or violates schema.","debug_id":"21c938f94cfc1","details":[{"location":"body","issue":"Unrecognized token 'plan_id': was expecting ('true', 'false' or 'null') line: 1, column: 9"}],"links":[]}

Weirdly enough I am able to get it to work with a straight cURL request but when PHP enters the fold it just doesn't. I think it must be a formatting issue somewhere or something else that is missing. Any help would be appreciated, thanks!

Login to Me Too
1 REPLY 1

buyaApp
Contributor
Contributor

the clue is with the body statement with token field 'plan_id'.  My field is 'items'.  So it does not like our formatting with those two JSON fields.  But it does work with Curl.  So we do need some help here.  

Login to Me Too

Haven't Found your Answer?

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