API Reference

Subscriptions

Your customers' recurring purchases: view them and schedule a cancellation.

A subscription comes from a checkout and is confirmed by the gateway — the API never creates or edits one, it reads them and can schedule one to end.

List subscriptions

GET/api/v1/subscriptionsAbilitysubscriptions.read
Returns the store's subscriptions, newest first.

Query parameters

statusstring
active, past_due or canceled.
per_pageinteger
Items per page, from 1 to 100. Default 20. A value outside that range returns 422.
pageinteger
Page number, from 1 to 10000. Default 1. A value outside that range returns 422.
curl "https://sellitex.com/api/v1/subscriptions?status=active" \
  -H "Authorization: Bearer sk_live_..." \
  -H "Accept: application/json"
Response200
{
  "data": [
    {
      "id": 77,
      "order_id": 123,
      "order_number": "A1B2C3D4E5",
      "buyer_email": "[email protected]",
      "customer_id": 42,
      "status": "active",
      "amount": 1990,
      "currency": "BRL",
      "interval_unit": "months",
      "interval_value": 1,
      "current_period_ends_at": "2026-09-19T14:32:00+00:00",
      "cancel_at_period_end": false,
      "canceled_at": null,
      "created_at": "2026-08-19T14:32:00+00:00",
      "items": [
        {
          "id": 456,
          "product_id": 12,
          "name": "VIP Mensal",
          "price": 1990,
          "quantity": 1
        }
      ]
    }
  ],
  "links": {
    "first": "…?page=1",
    "last": "…?page=1",
    "prev": null,
    "next": null
  },
  "meta": {
    "current_page": 1,
    "from": 1,
    "last_page": 1,
    "per_page": 20,
    "to": 1,
    "total": 1
  }
}

Retrieve a subscription

GET/api/v1/subscriptions/{subscription}Abilitysubscriptions.read
A record that belongs to another store answers 404, exactly like one that doesn't exist.

Path parameters

subscriptionintegerrequired
The subscription id.
curl "https://sellitex.com/api/v1/subscriptions/77" \
  -H "Authorization: Bearer sk_live_..." \
  -H "Accept: application/json"
Response200
{
  "data": {
    "id": 77,
    "order_id": 123,
    "order_number": "A1B2C3D4E5",
    "buyer_email": "[email protected]",
    "customer_id": 42,
    "status": "active",
    "amount": 1990,
    "currency": "BRL",
    "interval_unit": "months",
    "interval_value": 1,
    "current_period_ends_at": "2026-09-19T14:32:00+00:00",
    "cancel_at_period_end": false,
    "canceled_at": null,
    "created_at": "2026-08-19T14:32:00+00:00",
    "items": [
      {
        "id": 456,
        "product_id": 12,
        "name": "VIP Mensal",
        "price": 1990,
        "quantity": 1
      }
    ]
  }
}

Cancel a subscription

POST/api/v1/subscriptions/{subscription}/cancelAbilitysubscriptions.cancel
Schedules the subscription to end when the period already paid for closes — the customer keeps access until then, as with a cancellation from the panel. Calling it again changes nothing.

Path parameters

subscriptionintegerrequired
The subscription id.

Possible refusals

subscription_already_canceled409
The subscription has already ended.
gateway_error502
The gateway did not confirm the cancellation. Nothing was changed; try again.
curl -X POST "https://sellitex.com/api/v1/subscriptions/77/cancel" \
  -H "Authorization: Bearer sk_live_..." \
  -H "Accept: application/json"
Response200
{
  "data": {
    "id": 77,
    "order_id": 123,
    "order_number": "A1B2C3D4E5",
    "buyer_email": "[email protected]",
    "customer_id": 42,
    "status": "active",
    "amount": 1990,
    "currency": "BRL",
    "interval_unit": "months",
    "interval_value": 1,
    "current_period_ends_at": "2026-09-19T14:32:00+00:00",
    "cancel_at_period_end": true,
    "canceled_at": null,
    "created_at": "2026-08-19T14:32:00+00:00",
    "items": [
      {
        "id": 456,
        "product_id": 12,
        "name": "VIP Mensal",
        "price": 1990,
        "quantity": 1
      }
    ]
  }
}

The object

The fields this resource's endpoints return. Money is an integer in cents and dates are ISO 8601, in UTC.

idinteger
The subscription identifier.
order_idinteger
The order that opened the subscription.
order_numberstring
That order's number.
buyer_emailstring
The buyer's e-mail.
customer_idinteger|null
The customer account, when there is one.
statusstring
active, past_due (a charge failed and is being retried) or canceled.
amountinteger|null
What each renewal bills, in cents.
currencystring|null
Currency of the renewals.
interval_unitstring|null
Billing interval unit: minutes, hours, days or months.
interval_valueinteger|null
How many units between charges.
current_period_ends_atstring|null
End of the period already paid for.
cancel_at_period_endboolean
true once the end has been scheduled for the close of the period.
canceled_atstring|null
When the subscription actually ended.
created_atstring
When it was created.
itemsarray
The products the subscription pays for.