Need help with All status related with Subscriptions API?

I’m using Subscription API in Square Python SDK to create a subscription model. I am starting the subscription at a later phase by setting start date as future date.
Than using the subscriptions.updated webhook to update the status of subscriptions from PENDING to ACTIVE when they are actually charged.

For Cancel subscription I don’t know which status it is being used as square uses Schedule to cancel as default method.
Below is my log of the webhook where the status showing still ACTIVE.

Webhook received and verified: {"merchant_id":"MLV40AZWCSJBM","type":"subscription.updated","event_id":"af95d3c7-4b69-3b2e-abf3-ec5d0d42bc29","created_at":"2024-06-26T11:29:32.058Z","data":{"type":"subscription","id":"fcdb3de3-ed1d-4d7f-b528-36d13e4445f6","object":{"subscription":{"canceled_date":"2024-07-26","card_id":"ccof:CA4SEGVk8dydUu1YVrdUOknQA88oAg","charged_through_date":"2024-07-26","created_at":"2024-06-26T11:15:55Z","customer_id":"98MX7M8P10JWJ18F24J1703PMW","id":"fcdb3de3-ed1d-4d7f-b528-36d13e4445f6","invoice_ids":["inv:0-ChCeEpL756n_Uhzv4EMryuSYENkJ"],"location_id":"L655HC47K33ZY","monthly_billing_anchor_date":26,"phases":[{"order_template_id":"z4NzVZEJHZJK7ticXIuHTS6Cld4F","ordinal":0,"plan_phase_uid":"46IQTR2ZRGFB4P6QZWS42IO5","uid":"605b60ac-2d77-4181-ac48-8554952a8919"}],"plan_variation_id":"BC7YR4URYBJCD7RFK4PS2N2H","source":{"application_id":"sandbox-sq0idb-8FEocT_f4vLwpO2c8YlNaQ","application_name":"Sandbox for sq0idp-c5DMcnvitc6TR9nEU9lynA","name":"BC7YR4URYBJCD7RFK4PS2N2H"},"start_date":"2024-06-26","status":"ACTIVE","tenant":"BUYER","timezone":"UTC","version":2}}}}

Let me know What should I do here …

: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

Use Webhooks to Integrate with a Payroll System
Gift Card Webhooks
Refunds API Webhooks

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.

When a subscription is canceled, the status should change to “CANCELED”. However, the status change might not be immediate if the cancellation is scheduled for a future date. In your webhook log, the “canceled_date” is set to “2024-07-26”, which suggests that the cancellation is scheduled for this future date. Until that date, the status of the subscription will remain “ACTIVE”. Once the “canceled_date” is reached, the status should update to “CANCELED”.

You can continue to use the subscriptions.updated webhook to track this status change. When the cancellation occurs, you should receive a webhook event with the updated status.

This answer was reviewed by @Bryan-Square.

1 Like