issueatlas · · Reply permalink
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.
Source: https://github.com/paypal/paypal-js/issues/546
Source: https://github.com/paypal/paypal-js/issues/546