Internal Server Error in Checkout API

When sending the request via API Explorer it works fine.

content-length: 193
content-type: application/json
square-version: 2023-07-20
user-agent: SquareExplorerGateway/1.0 SquareProperty ApiExplorer

{
“quick_pay”: {
“name”: “License Subscription”,
“price_money”: {
“amount”: 7500,
“currency”: “AUD”
},
“location_id”: “LMAJBQ64XYST9”
},
“checkout_options”: {
“subscription_plan_id”: “2MB3Z3FIJH25EH3GQO3MTL3D”
}
}

But when sending an (essentially) identical request from Salesforce it returns a 500 error response.

content-length: 193
square-version: 2023-07-20
content-type: application/json
cache-control: no-cache
accept-encoding: gzip
pragma: no-cache
accept: */*;
user-agent: SFDC-Callout/60.0

{
“quick_pay”: {
“price_money”: {
“currency”: “AUD”,
“amount”: 7500
},
“name”: “License Subscription”,
“location_id”: “LMAJBQ64XYST9”
},
“checkout_options”: {
“subscription_plan_id”: “2MB3Z3FIJH25EH3GQO3MTL3D”
}
}

Appid = sq0idp-R0O0vYzAbJ03lrh1CnEZ0A

I’ve fiddled with headers but to no avail. Anyone got any insight?

Is the subscription_id your passing in the actual subscription_id or the subscription_variation_id? :slightly_smiling_face:

It’s the subscription plan Id taken from https://squareup.com/dashboard/subscriptions/plans/2MB3Z3FIJH25EH3GQO3MTL3D

What gets me is that it works fine from the API Explorer…

The team has identified the issue and is going to be deploying a fix for this. :slightly_smiling_face:

The error related to a missing READ_ITEMS permission from the app. The API now returns a response indicating the missing permission rather than a 500 Server Error.