Skip to main content
POST
/
payments
/
purchases
/
create-purchase-url
Create Purchase URL
curl --request POST \
  --url https://api.stack-auth.com/api/v1/payments/purchases/create-purchase-url \
  --header 'Content-Type: application/json' \
  --data '
{
  "customer_type": "user",
  "customer_id": "user_1234567890abcdef",
  "product_id": "prod_premium_monthly",
  "return_url": "https://myapp.com/purchase-success"
}
'
{
  "url": "<string>"
}

Documentation Index

Fetch the complete documentation index at: https://stackauth-e0affa27-chore-move-mcp-to-a-sep-app.mintlify.app/llms.txt

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

Body

application/json
customer_type
string
required

The type of customer making the purchase

Example:

"user"

customer_id
string
required

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

Example:

"user_1234567890abcdef"

product_id
string

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

Example:

"prod_premium_monthly"

product_inline
object

Inline product definition. Either this or product_id should be given.

return_url
string

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

Example:

"https://myapp.com/purchase-success"

Response

200 - application/json

Successful response

url
string
required

The secure checkout URL for completing the purchase