Skip to main content
POST
Cancel a subscription.

Authorizations

x-api-key
string
header
required

API key for authentication. You can find your API key in the Creem dashboard under Settings > API Keys.

Path Parameters

id
string
required

The unique identifier of the subscription

Body

application/json

Subscription cancellation options

mode
enum<string>

The mode of cancellation (immediate or scheduled), default can be configured in the store billing settings.

Available options:
immediate,
scheduled
Example:

"immediate"

onExecute
enum<string>

The action to execute when canceling (cancel or pause) when mode is scheduled, ignored when mode is immediate or not provided

Available options:
cancel,
pause
Example:

"cancel"

Response

Successfully canceled a subscription

id
string
required

Unique identifier for the object.

mode
enum<string>
required

String representing the environment.

Available options:
test,
prod,
sandbox
object
string
required

String representing the object's type. Objects of the same type share the same value.

Example:

"subscription"

product
required

The product associated with the subscription.

customer
required

The customer who owns the subscription.

collection_method
enum<string>
required

The method used for collecting payments for the subscription.

Available options:
charge_automatically
Example:

"charge_automatically"

status
enum<string>
required

The current status of the subscription.

Available options:
active,
canceled,
unpaid,
paused,
trialing,
scheduled_cancel,
past_due
Example:

"active"

created_at
string<date-time>
required

The date and time when the subscription was created.

Example:

"2024-01-01T00:00:00Z"

updated_at
string<date-time>
required

The date and time when the subscription was last updated.

Example:

"2024-09-12T12:34:56Z"

items
object[]

Subscription items.

last_transaction_id
string

The ID of the last paid transaction.

Example:

"tran_3e6Z6TzvHKdsjEgXnGDEp0"

last_transaction
object

The last paid transaction.

last_transaction_date
string<date-time>

The date of the last paid transaction.

Example:

"2024-09-12T12:34:56Z"

next_transaction_date
string<date-time>

The date when the next subscription transaction will be charged.

Example:

"2024-09-12T12:34:56Z"

current_period_start_date
string<date-time>

The start date of the current subscription period.

Example:

"2024-09-12T12:34:56Z"

current_period_end_date
string<date-time>

The end date of the current subscription period.

Example:

"2024-09-12T12:34:56Z"

canceled_at
string<date-time> | null

The date and time when the subscription was canceled, if applicable.

Example:

"2024-09-12T12:34:56Z"

discount
object

The discount applied to the subscription, if any.

metadata
object

Metadata for the subscription in the form of key-value pairs.

Example: