Problem with generating subscription following documentation

oliviaana2020
Contributor
Contributor

Hello Community , I am trying to integrate PayPal subscribtions via Paypal Rest API.
I had trying in all ways .
Now Trying to follow https://developer.paypal.com/docs/subscriptions/integrate/
( basic integration ) 

I succesfuly do authentificaiton, product generation, plan generation but on creating subscription I get : 

Spoiler
{"name":"INVALID_REQUEST","message":"Request is not well-formed, syntactically incorrect, or violates schema.","debug_id":"ec6f365217c37","details":[{"field":"/name","location":"body","issue":"MISSING_REQUIRED_PARAMETER","description":"A required field is missing."},{"field":"/payment_preferences","location":"body","issue":"MISSING_REQUIRED_PARAMETER","description":"A required field is missing."},{"field":"/billing_cycles","location":"body","issue":"MISSING_REQUIRED_PARAMETER","description":"A required field is missing."},{"field":"/product_id","location":"body","issue":"MISSING_REQUIRED_PARAMETER","description":"A required field is missing."}],"links":[{"href":"https://developer.paypal.com/docs/api/v1/billing/subscriptions#INVALID_REQUEST","rel":"information_l..."}]}
Spoiler
 

Debug ID is "ec6f365217c37".


The request it's {

Spoiler
"plan_id": "P-2W996000170212902L6GJFHY",
"start_time": "2020-11-01T00:00:00Z",
"quantity": "20",
"shipping_amount": {
"currency_code": "USD",
"value": "10.00"
},
"subscriber": {
"name": {
"given_name": "John",
"surname": "<removed>"
},
"email_address": "<removed>",
"shipping_address": {
"name": {
"full_name": "John <removed>"
},
"address": {
"address_line_1": "<removed>",
"address_line_2": "<removed>",
"admin_area_2": "San Jose",
"admin_area_1": "CA",
"postal_code": "95131",
"country_code": "US"
}
}
},
"application_context": {
"brand_name": "example",
"locale": "en-US",
"shipping_preference": "SET_PROVIDED_ADDRESS",
"user_action": "SUBSCRIBE_NOW",
"payment_method": {
"payer_selected": "PAYPAL",
"payee_preferred": "IMMEDIATE_PAYMENT_REQUIRED"
},
"return_url": "https://example.com/returnUrl",
"cancel_url": "https://example.com/cancelUrl"
}
}


I had tryed in each ways of documentations and each time I am unable to create subscription, however in web browser integration look like work . 



Thank you ! 



 

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.