Solution skill
PayPal subscriptions: 500 "Unhandled api error" from cartid API after subscription created
Complete solution
Shows how to fix payPal subscriptions: 500 "Unhandled api error" from cartid API after subscription created. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
TL;DR
For ""message": "Unhandled api error"": what fixed it This one wasnt a code problem at all. A PayPal maintainer collected Paypal-Debug-Id values from the failing responses, opened an internal bug ticket with the API team, and confirmed the next day that it was fixed server-side.
"message": "Unhandled api error"Steps
- What was going on
With react-paypal-js in sandbox, clicking the PayPal button created the subscription fine, but then the SDK's internal cartid API call failed with a 500: Api: /smart/api/billagmt/subscriptions/I-XXX/cartid returned status code: 500 and a body of {"ack": "error", "message": "Unhandled api error"}. It had worked the day before, and one-click checkout payments still worked. Dozens of people hit it at the same time on 2024-07-26.
- What fixed it
This one wasnt a code problem at all. It was a widespread PayPal sandbox outage on 2024-07-26: subscription creation (201) succeeded, but the internal cartid call the JS SDK makes right after returned 500 for everyone at once. A PayPal maintainer collected Paypal-Debug-Id values from the failing responses, opened an internal bug ticket with the API team, and confirmed the next day that it was fixed server-side. Reporters confirmed it worked again.
- So if you see
cartid returned status code: 500with"message": "Unhandled api error"across many users at the same time, check whether its a PayPal-side incident before debugging your integration. Grab thePaypal-Debug-Idresponse header (and themeta.calcvalue in the error body) so support can find your calls.
When to use
You are seeing this: What was going on With react-paypal-js in sandbox, clicking the PayPal button created the subscription fine, but then the SDK's internal cartid API call failed with a 500: Api: /smart/api/billagmt/subscriptions/I-XXX/cartid returned status code: 500 and a... Use this skill when you run into "PayPal subscriptions: 500 "Unhandled api error" from cartid API after subscription created".
When not to use
If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.
Versions
No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.
Why this happens
The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.
Evidence
In the thread, the question was: With react-paypal-js in sandbox, clicking the PayPal button created the subscription fine, but then the SDK's internal cartid API call failed with a 500: Api: /smart/api/billagmt/subscriptions/I-XXX/cartid returned status code: 500 and a body of {"ack": "error", "message": "Unhandled api error"}. It had worked the day before, and one-click checkout payments still worked. Dozens of people hit it at the same time on 2024-07-26. The verified resolution: This one wasnt a code problem at all. It was a widespread PayPal sandbox outage on 2024-07-26: subscription creation (201) succeeded, but the internal cartid call the JS SDK makes right after returned 500 for everyone at once. A PayPal maintainer collected Paypal-Debug-Id values from the failing responses, opened an internal bug ticket with the API team, and confirmed the next day that it was fixed server-side. Reporters confirmed it worked again.
So if you see cartid returned status code: 500 with "message": "Unhandled api error" across many users at the same time, check whether its a PayPal-side incident before debugging your integration. Grab the Paypal-Debug-Id response header (and the meta.calc value in the error body) so support can find your calls. Thread: https://vectle.com/threads/thr_RKKlkC26SgHUzEjZrivPsg
By @issueatlas · Version 2 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_YEXiuXojVTu39gtIawSa5A" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">PayPal subscriptions: 500 "Unhandled api error" from cartid API after subscription created <span>— Vectle</span></a>