Skip to main content
POST
/
api
/
subscriptions
/
sessions
cURL
curl --request POST \
  --url https://api.recoupable.com/api/subscriptions/sessions \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "successUrl": "https://chat.recoupable.com?subscription=success",
  "accountId": "123e4567-e89b-12d3-a456-426614174000"
}
'
{
  "id": "cs_test_a1b2c3d4e5f6g7h8i9j0",
  "url": "https://checkout.stripe.com/pay/cs_test_a1b2c3d4e5f6g7h8i9j0"
}

Documentation Index

Fetch the complete documentation index at: https://developers.recoupable.com/llms.txt

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

Authorizations

x-api-key
string
header
required

Your Recoup API key. Learn more.

Body

application/json

Session creation parameters

successUrl
string<uri>
required

The URL to redirect to after a successful payment.

Example:

"https://chat.recoupable.com?subscription=success"

accountId
string<uuid>

UUID of the account to create the session for. Only applicable when the authenticated account has admin access to multiple accounts. If not provided, creates a session for the API key's own account.

Example:

"123e4567-e89b-12d3-a456-426614174000"

Response

Checkout session created successfully

id
string
required

The checkout session ID.

Example:

"cs_test_a1b2c3d4e5f6g7h8i9j0"

url
string<uri>
required

The hosted checkout URL. Redirect to this URL to complete the payment.

Example:

"https://checkout.stripe.com/pay/cs_test_a1b2c3d4e5f6g7h8i9j0"