Skip to main content
POST
Generate Cancel Flow Link

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"