INTERNAL_SERVER_ERROR when trying to Create Subscriptions


Can’t work out what’s going on here, seems to trigger when the plan_variation_id is populated, beforehand would get the API errors you’d expect for missing data etc.

This is happening in both the API Explorer for me and the PHP SDK.

Sandboxed App ID is: sandbox-sq0idb-CZ8JPWAB_B_AdmGxs17ogA

This is what I’m trying in the explorer:

$price_override_money = new \Square\Models\Money();

$body = new \Square\Models\CreateSubscriptionRequest(‘L7QKV9PNWZ30Y’, ‘MCN2MQM2H121Z5B6PDGX0QZDD4’);

$api_response = $client->getSubscriptionsApi()->createSubscription($body);

if ($api_response->isSuccess()) {
$result = $api_response->getResult();
} else {
$errors = $api_response->getErrors();

This is the result:

“errors”: [
“detail”: “An internal error has occurred, and the API was unable to service your request.”,
“category”: “API_ERROR”

So, tried this in production with the relevant details for that enviroment and it worked, so not sure why Sandbox isn’t playing ball?

Not particularly keen on fooling about in production as you can imagine!

I took a look at the logs and it looks like your trying to pass an item variation instead of a subscription plan. We still shouldn’t be throwing a 5xx but you’ll need to create a subscription plan and variation first then create the subscription. :slightly_smiling_face:

Perhaps it’s worth sorting out that 5xx error so it’s more helpful.

So, I wanted to create some plans in the Dashboard for testing, rather than the API, how on earth do I even create this mystical “plan_variation_id” … I have a Subscription plan with the ID:


So, where are variations in the dashboard? I only see items.


Looking at the live account for my client, the design of the Subscriptions > Plans interface is completely different to my Sandbox, with columns for price, frequency, trial period etc.

None of this thing makes sense, man I wish they used Stripe, navigating the Dashboard is painful. :frowning:

The sandbox Dashboard should match production. What’s your application ID so we can take a look?

As for creating the subscription plan and plan_variation_id you can reference our Subscription Plans and Variations. :slightly_smiling_face: