Skip to main content
POST
/
api
/
v1
/
subscriptions
/
checkout
Create Checkout Session
curl --request POST \
  --url https://api.entityml.com/api/v1/subscriptions/checkout \
  --header 'Content-Type: application/json' \
  --data '
{
  "user_id": "<string>",
  "email": "<string>",
  "success_url": "<string>",
  "cancel_url": "<string>",
  "tier": "<string>"
}
'
{
  "checkout_url": "<string>"
}

Documentation Index

Fetch the complete documentation index at: https://docs.entityml.com/llms.txt

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

Request

user_id
string
required
User ID that will own the subscription.
email
string
required
Customer email address.
success_url
string
required
URL Stripe should redirect to after successful checkout.
cancel_url
string
required
URL Stripe should redirect to after cancellation.
tier
string
Subscription tier. Valid values: starter or pro. Default: starter.

Response

checkout_url
string
Stripe-hosted checkout URL.

Example

from entityml import EntityMLClient

client = EntityMLClient()
session = client.billing.create_checkout_session(
    user_id="YOUR_USER_ID",
    email="you@example.com",
    success_url="https://entityml.com/dashboard?checkout=success",
    cancel_url="https://entityml.com/subscribe",
    tier="pro",
)
print(session["checkout_url"])

Example response

{
  "checkout_url": "https://checkout.stripe.com/c/pay/cs_test_..."
}