v21

OpenAPI 3.1.0raw.githubusercontent.com2026-08-011060456.0 KB
Payments

Create Purchase URL

Creates a secure checkout URL for purchasing a product.

post/payments/purchases/create-purchase-url

Request body

customer_type'user' | 'team' | 'custom' required

The type of customer making the purchase

customer_idstring required

The ID of the customer (user ID, team ID, or custom customer ID)

product_idstring

The ID of the product to purchase. Either this or product_inline should be given.

return_urlstring

URL to redirect to after purchase completion. Must be configured as a trusted domain in the project configuration.

Example request

{
  "customer_type": "user",
  "customer_id": "user_1234567890abcdef",
  "product_id": "prod_premium_monthly",
  "return_url": "https://myapp.com/purchase-success"
}

Response

Successful response

urlstring required

The secure checkout URL for completing the purchase