Skip to main content
POST
Error

Autorizações

Authorization
string
header
obrigatório

A contact session token, uk_ct_…. Belongs to one of the developer's own users, and reads only that user's data.

Cabeçalhos

X-Customer-Id
string<uuid>

The customer this call is acting inside — the same arrangement as X-Organization-Id, one plane down. Switching customers is navigation, not a mutation: nothing is stored, you send a different header, and the membership JOIN behind it decides what you may do there. An id you are not a member of matches no row and answers 404. Absent, the contact's oldest membership answers.

Idempotency-Key
string

Forwarded to the payment gateway as its idempotency key, so a retry of this call does not charge twice or move a subscription twice.

This is not the guarantee Idempotency-Key carries on the API-key surface: nothing is stored here and a replay is not answered with the original response. It is passed through, and what it buys is whatever the gateway does with it — for Stripe, the original result is replayed for 24 hours.

Send a fresh key per act you mean to perform, and the same key with the same body when you are retrying one. The gateway compares the parameters, so a key reused for a different act is refused there rather than replayed.

Maximum string length: 255

Parâmetros de caminho

id
string<uuid>
obrigatório

The cancellation record's id, from the POST that recorded the reason. It identifies; the caller's membership is what authorizes — another team's id answers 404.

Corpo

application/json
at_period_end
boolean
padrão:true

Keep access until the paid period ends. Defaults to true — the date the confirmation screen just promised.

Resposta

The record as it now stands and the subscription re-read from the gateway.

cancellation
object

One person's answer to "why are you leaving", and what happened next.

It is recorded before any gateway is asked anything, so a record exists whether or not the cancellation was ever carried out — and a record nobody carried out is the only churn signal that arrives while the customer is still a customer.

subscription
object