Skip to main content
POST
/
api
/
cancel-flow
/
generate
Generate Cancel Flow Link
curl --request POST \
  --url https://api.revtain.com/api/cancel-flow/generate \
  --header 'Content-Type: application/json' \
  --header 'X-API-KEY: <api-key>' \
  --data '
{
  "customerId": "cus_abc123",
  "customerEmail": "customer@example.com",
  "subscriptionId": "sub_789",
  "amount": 2900,
  "currency": "USD",
  "returnUrl": "https://app.yourdomain.com/account"
}
'
{
  "url": "https://api.revtain.com/api/cancel-flow/abc123xyz...",
  "token": "abc123xyz...",
  "expiresAt": "2026-05-23T14:30:00.000Z"
}

Documentation Index

Fetch the complete documentation index at: https://docs.revtain.com/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

X-API-KEY
string
header
required

Your Revtain API key (format: rev_xxx). Provided during onboarding.

Body

application/json
customerId
string
required

Your internal identifier for the customer.

Example:

"cus_abc123"

customerEmail
string<email>

The customer's email address.

Example:

"customer@example.com"

subscriptionId
string

Your internal subscription identifier. Echoed back on the churn webhook.

Example:

"sub_789"

amount
integer

The recurring charge in the smallest currency unit. Used to render the retention offer.

Required range: x >= 0
Example:

2900

currency
string

3-letter ISO 4217 currency code.

Example:

"USD"

returnUrl
string<uri>

Where to send the customer after they complete the flow.

Example:

"https://app.yourdomain.com/account"

Response

Cancel flow link created

url
string<uri>

The hosted retention page URL to send the customer to.

Example:

"https://api.revtain.com/api/cancel-flow/abc123xyz..."

token
string
Example:

"abc123xyz..."

expiresAt
string<date-time>

The URL is valid for 48 hours and can be used once.

Example:

"2026-05-23T14:30:00.000Z"