v1

latestOpenAPI 3.1.02026-07-24770322.0 KB

Cancel Subscription

This API endpoint cancels a subscription with status active or notStarted

post/v1/subscriptions/{id}/cancel

Path parameters

idstring required

Unique ID of the subscription to cancel.

Response

200

idstring
objectstring
createdAtstring
collectionMethodstring
statusstring
recipientIdstring
clientIdstring
companyIdstring
memostring
taxPercentagenumber
currencystring
intervalstring
intervalCountinteger
daysUntilDueinteger
canceledAtstring
updatedAtstring

Example response

{
  "id": "sub_01HN4V8K5P7RNQJ6MGXKDZ8T2W",
  "object": "subscription",
  "createdAt": "2024-02-21T15:31:16.789Z",
  "collectionMethod": "sendInvoice",
  "status": "canceled",
  "recipientId": "d0000000-d7a5-473d-a75b-9821a8f4e180",
  "clientId": "d0000000-d7a5-473d-a75b-9821a8f4e180",
  "companyId": "d0000000-d7a5-473d-a75b-9821a8f4e180",
  "memo": "Monthly service subscription",
  "taxPercentage": 8.5,
  "currency": "USD",
  "interval": "month",
  "intervalCount": 1,
  "daysUntilDue": 30,
  "canceledAt": "2024-02-21T15:31:16.789Z",
  "paymentPreferences": {
    "allowedPaymentMethodTypes": [
      "creditCard"
    ],
    "absorbTransactionFee": [
      {
        "type": "creditCard"
      }
    ]
  },
  "lineItems": [
    {
      "priceId": "K5P7RNQJ6",
      "productId": "d0000000-d7a5-473d-a75b-9821a8f4e191",
      "description": "Professional Plan",
      "quantity": 1
    }
  ]
}