Pandabase
Store APIsSubscriptions

Cancel subscription

POST
/stores/{storeId}/subscriptions/{subscriptionId}/cancel

Cancels a subscription, either at once or at the end of the current billing period depending on the cancelAt value. Requires the SUBSCRIPTIONS_WRITE scope.

Authorization

AuthorizationBearer <token>

Bearer token authentication. Pass the secret directly in the Authorization header. Token secrets start with sk_.

In: header

Path Parameters

storeId*string
Length12 <= length <= 48
subscriptionId*string
Length12 <= length <= 48

Header Parameters

idempotency-key?string
Length8 <= length <= 32

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

curl -X POST "https://example.com/stores/stringstring/subscriptions/stringstring/cancel" \  -H "Content-Type: application/json" \  -d '{}'
{  "ok": true,  "data": {    "id": "sub_h7n4tr3bcfp2v8q1mzj0kxw5",    "status": "CANCELLED",    "billingInterval": "MONTHLY",    "amount": 2900,    "currency": "USD",    "currentPeriodStart": "2026-05-14T12:34:56.000Z",    "currentPeriodEnd": "2026-06-14T12:34:56.000Z",    "nextChargeAt": "2026-06-14T12:34:56.000Z",    "trialEnd": null,    "cancelledAt": "2026-05-14T13:05:00.000Z",    "pausedAt": null,    "endsAt": "2026-06-14T12:34:56.000Z",    "retryCount": 0,    "product": {      "id": "prd_8h4t6sqzy3x9w5n2k1m0vqbf",      "title": "Pro Plan",      "price": 2900    },    "customer": {      "id": "cus_j8h0r1n4tzcbfp2v8q1mzwx5",      "email": "buyer@example.com"    },    "paymentMethod": {      "id": "pmm_n4tr3bcfp2v8q1mzj0kxw5h7",      "brand": "visa",      "lastFour": "4242",      "expMonth": 12,      "expYear": 2030    },    "createdAt": "2026-05-14T12:34:56.000Z"  }}

Last updated on