Internal Server Error; Subscriptions API

We are trying to integrate the subscriptions API and it works fine except in the following scenario I’m about to describe.

Use Case: We are trying to implement proration manually since it’s not fully supported by Square. Our workflow in an existing subscription upgrade scenario involves

  • calculating the prorated amount at the time of upgrade and charging the customer for that
  • cancelling the customer’s previous subscription
  • creating a new subscription ( for the customer with a start date that is the end date of the previous subscription )

The workflow is also the same for downgrades as well except there’s no proration involved

Upon creating a new subscription at the final step, sometimes it works, sometimes it returns a 500 error and I receive no details as to what the problem is

:wave: I’m Square Dev AI, here to help answer your question!
Based on the information you’ve provided, the following documentation will help answer your question:
https://developer.squareup.com/docs/app-marketplace/requirements/subscriptions-api

Additional Documentation

Subscription Plan Checkout
Customers API Workflows
Onboard to Square Appointments

If this documentation helped you find a solution, please check the box indicating that this reply solves the problem.
Otherwise one of our Developer Advocates will provide additional assistance shortly.

What’s your application ID that your using to get this error? :slightly_smiling_face:

sandbox-sq0idb-EEv2wgamZ-O2iav-xKfhsw

Hell Bryan and Square team, when can we expect a response on this question? We are currently blocked from completing our integration by this 500 error, and unable to continue development due lack of any further detail on the nature of the problem in the error returned by your API.

Hello, were you able to look into this problem for us? We cannot get any further information from the API responses and cannot find anything in the API documentation that indicates a problem on our side.

When your creating a subscription are you including an order_templete_id? :slightly_smiling_face:

No, I am not including that

Okay, are you using the new subscription model that has a subscription_variation_id? :slightly_smiling_face:

Is that the subscription plan variation id? If so, then yes I am

Introducing a delay between the new subscription plan and the new subscription seems to resolve the issue