Server returned HTTP response code: 400

GopalMehra12
Contributor
Contributor
java.io.IOException: Server returned HTTP response code: 400 for URL: https://api.sandbox.paypal.com/v1/payments/billing-plans/1

{"name":"VALIDATION_ERROR","debug_id":"a624dea723ee2","message":"Invalid request. See details.","information_link":"https://developer.paypal.com/docs/api/payments.billing-plans#errors","details":[{"field":"template id is invalid","issue":"Incorrect Plan Id."}]}
 
 
Login to Me Too
1 ACCEPTED SOLUTION

Accepted Solutions
Solved

OUSS-MAN
New Community Member
To solve this issue on the PayPal platform, it seems that the problem lies with the invalid Plan Id being used. Here's how you can address it: Verify that you have created the correct plan in your PayPal account. Ensure that the Plan Id used in the request is correct and matches the plan you created. Confirm that you have sufficient permissions to access and modify this plan. After verifying these aspects, retry the request with the correct Plan Id. This should bypass the 400 error. If the issue persists, it's advisable to reach out to PayPal's support team for further assistance and guidance.

View solution in original post

Login to Me Too
3 REPLIES 3

MTS_Jennifer
Moderator
Moderator

Hello @GopalMehra12 

Thank you for posting to the PayPal Merchant Community. If you are integrating subscriptions API, make certain that you are creating a product, and then a plan, before creating the subscription.

Here is the api documentation:

https://developer.paypal.com/docs/subscriptions/integrate/

If you are attempting to create a billing agreement and save the payment method, I have ensured your sandbox account is enabled for Reference Transactions.

Here is the documentation:

https://developer.paypal.com/docs/checkout/save-payment-methods/purchase-later/

Thank you,

Jennifer

MTS

PayPal

Login to Me Too
Solved

OUSS-MAN
New Community Member
To solve this issue on the PayPal platform, it seems that the problem lies with the invalid Plan Id being used. Here's how you can address it: Verify that you have created the correct plan in your PayPal account. Ensure that the Plan Id used in the request is correct and matches the plan you created. Confirm that you have sufficient permissions to access and modify this plan. After verifying these aspects, retry the request with the correct Plan Id. This should bypass the 400 error. If the issue persists, it's advisable to reach out to PayPal's support team for further assistance and guidance.
Login to Me Too

GopalMehra12
Contributor
Contributor

Yes OUSS_MANN .I 've got the solution the wrong plan id is getting generated due to unsufficient permissions after granting required permissions and after generating appropriate plan id .Now The exeption is fixed thanks for the response - Gopal

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.