Skip to content
Insy
For developers
Esc
navigateopen⌘Jpreview

Start checkout session with external ID and custom URLs

POST/api/checkout/buy-plan
Authorization
AuthorizationBearer token (API Key) · headerrequired
API Key for programmatic access (format: insy_xxxxx)
Request body
requiredapplication/json
pricingPlanIdstring<uuid>required
Pricing plan ID
externalIdstringrequired
External ID to identify the user in the external system
successUrlstring<uri>required
URL to redirect to on successful checkout
cancelUrlstring<uri>required
URL to redirect to on cancelled checkout
emailstring<email>
Optional email for the checkout user
communityIdstring<uuid>required
Community ID
utmSourcestring
Attribution source (e.g. utm_source) shown in purchase reporting
max length 100
Responses
200Successful response
successbooleanrequired
Whether the request was successful
errorCodestringrequired
The error code returned by the request
Allowed:not_foundbad_requestalready_existsunauthorizedforbiddeninternal_server_errorservice_unavailabletimeoutconflictprecondition_failedunprocessable_entity
messagestringrequired
The message returned by the request
dataBuyPlanResponseDto
Show properties
checkoutUrlstring
Checkout URL
401Invalid, expired, or revoked API key
403Insufficient API key permissions
Try it
Server
Authorization
Bodyapplication/json
Request
curl -X POST "https://api.insy.io/api/checkout/buy-plan" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "pricingPlanId": "123e4567-e89b-12d3-a456-426614174000",
  "externalId": "user_123",
  "successUrl": "https://example.com/success",
  "cancelUrl": "https://example.com/cancel",
  "email": "user@example.com",
  "communityId": "123e4567-e89b-12d3-a456-426614174000",
  "utmSource": "landing-page"
}'
Response
{
  "success": true,
  "errorCode": "not_found",
  "message": "Success",
  "data": {
    "checkoutUrl": "https://checkout.stripe.com/c/pay/cs_test_a1234567890"
  }
}