How to get next billing date of subscription?

I’ve been using the API here GET /v2/subscriptions/{subscription_id} - Square API Explorer to get a subscription. However I see that it doesn’t return the next billing date. If I go to my subscriptions at Sign In, I can see the next billing date is shown. How can I obtain this value from the SDK?

Hi @devropes! :wave: You can determine the next billing date using the charged_through_date property, which is the last day of the current billing period. You’ll want to check if the object also has canceled_date set though, to check if a subscription is being canceled after the current billing period.

This is all I get from the result. I don’t see a charged_through_date. I should mention that I have set up my subscription plans with a trial.

  "subscription": {
    "id": "xxxxxxxxxxxxxxxx",
    "location_id": "xxxxxxxxxx",
    "plan_id": "xxxxxxxxxxxxxxx",
    "customer_id": "xxxxxxxxxxxxxxxxxx",
    "start_date": "2022-08-13",
    "status": "ACTIVE",
    "version": 1,
    "created_at": "2022-08-13T04:29:49Z",
    "timezone": "UTC",
    "source": {
      "name": "Sandbox for sq0idp-xxxxxxxxxxxxxxx"

If there’s now charge through date or cancelation date the subscription will continue till it’s canceled. :slightly_smiling_face: