Pending Plan Change Actions

Hi
In our application we have three plans. A monthly, a quarterly, and an annual recurring plan.
I am building the plan change capability. An annual customer should be able to go monthly, a monthly plan customer should be able to go annual or quarterly etc.

Everything paid is paid already. So I queue up a plan-swap action using the swap-plan endpoint on subscriptions. The swap-plan takes place only on the billing date. So the customer’s plan ID is the old one until billing rolls over and the new plan kicks in. At that point I see the new plan and value on the API.

When I issue a swap-plan I think the API response is an action ID for that plan-swap action which has an effective date.

This means I can hit the subscriptions/[id of sub]/actions/[id of action] with a DELETE request and it will cancel that pending action and revert back to the way it was.

This will be important for me because if someone on monthly decides to go quarterly, and then subsequently decides no, to go annual instead, I have to cancel the action to go quarterly before I issue the swap-plan to go annual or the API throws me an error that there is already a pending swap.

I cannot seem to find any endpoint to hit to view the pending actions for a subscription so I can validate if there is a pending action I need to clear before I hit the swap again.

And moreover in the core Square dashboard, there is nothing on the screen to indicate that a customer is pending a plan swap, and I can’t seem to view or control that in dashboard (this would indicate to me that there’s no API for this, because if there was one, surely it’d be in use in the dashboard.

If someone updates a customer’s plan in the Square-side dashboard, again it creates that pending action, and my own app can’t see the action for this anywhere so it can’t cancel it and replace it with a more appropriate action.

How can I view pending actions on the subscription so I can cancel them?

I have solved my own problem

I hit with a query parameter

subscriptions/[sub_id]?include=actions

And the actions come down with the ID

Glad to hear you figured it out. Thanks for sharing your solution. :slightly_smiling_face: