Skip to main content
POST

Authorizations

Authorization
string
header
required

Bearer API Key, for example Bearer sk_live_xxx.

X-StablePay-Timestamp
string
header
required

Unix timestamp in seconds. Must be within 5 minutes of server time.

X-StablePay-Nonce
string
header
required

Replay-protection nonce, 16-64 characters. Use a fresh UUID per request.

X-StablePay-Signature
string
header
required

Lowercase hex HMAC-SHA256 of {timestamp}.{nonce}.{requestBody} signed with the merchant API Secret. For GET requests, requestBody is an empty string.

Headers

X-StablePay-Timestamp
string
required

Unix timestamp in seconds. Must be within 5 minutes of server time.

X-StablePay-Nonce
string
required

Replay-protection nonce, 16-64 characters. Use a fresh UUID per request.

Required string length: 16 - 64
X-StablePay-Signature
string
required

Lowercase hex HMAC-SHA256 of {timestamp}.{nonce}.{requestBody} signed with the merchant API Secret. For GET requests, requestBody is an empty string.

Path Parameters

subscription_id
string
required

Subscription ID.

Body

application/json
cancel_at_period_end
boolean
default:false

Whether to cancel at the end of the current billing period. Defaults to false for immediate cancellation.

cancellation_reason
string

Cancellation reason.

cancellation_comment
string

Cancellation comment.

Response

Canceled successfully.

Subscription object.

id
string

Subscription ID.

object
string
Example:

"subscription"

customer
string

External customer ID.

store_id
string

Store ID.

currency
string

Currency.

description
string

Subscription description.

status
enum<string>

Subscription status.

Available options:
incomplete,
trialing,
active,
past_due,
canceled,
incomplete_expired
items
object[]

Subscription items.

payment_method_id
string

Default payment method ID.

billing_cycle_anchor
integer<int64>

Billing cycle anchor, Unix seconds.

current_period_start
integer<int64>

Current period start, Unix seconds.

current_period_end
integer<int64>

Current period end, Unix seconds.

canceled_at
integer<int64>

Cancellation time, Unix seconds.

cancel_at
integer<int64>

Scheduled cancellation time, Unix seconds.

latest_invoice
string

Latest invoice ID.

latest_invoice_object
object

Full invoice object returned when expand=latest_invoice.

customer_object
object

Full customer object returned when expand=customer.

payment_method_object
object

Full payment method object returned when expand=payment_method.

checkout_url
string

Initial-payment checkout URL, returned on creation.

metadata
object

Merchant metadata.

created
integer<int64>

Creation time, Unix seconds.

Last modified on April 30, 2026