Skip to main content
POST
https://api.bunship.com
/
api
/
v1
/
organizations
/
{orgId}
/
billing
/
checkout
Create Checkout Session
curl --request POST \
  --url https://api.bunship.com/api/v1/organizations/{orgId}/billing/checkout \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "priceId": "<string>",
  "successUrl": "<string>",
  "cancelUrl": "<string>"
}
'
{
  "success": true,
  "data": {
    "sessionId": "cs_live_abc123...",
    "url": "https://checkout.stripe.com/c/pay/cs_live_abc123..."
  }
}
Creates a Stripe Checkout session for the organization to subscribe to a pricing plan. Returns a session URL to redirect the user to Stripe’s hosted checkout page.

Auth

Requires a valid Bearer token. User must be a member of the organization.

Path Parameters

orgId
string
required
Organization identifier.

Request Body

priceId
string
required
Stripe Price ID for the plan to subscribe to (e.g., "price_1abc123").
successUrl
string
URL to redirect to after successful checkout. Must match the configured application origin.
cancelUrl
string
URL to redirect to if the user cancels checkout. Must match the configured application origin.

Response

success
boolean
Always true on success.
data
object
{
  "success": true,
  "data": {
    "sessionId": "cs_live_abc123...",
    "url": "https://checkout.stripe.com/c/pay/cs_live_abc123..."
  }
}

Example

curl -X POST https://api.bunship.com/api/v1/organizations/org_cld2abc123def456/billing/checkout \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..." \
  -H "Content-Type: application/json" \
  -d '{
    "priceId": "price_1abc123",
    "successUrl": "https://app.bunship.com/billing?success=true",
    "cancelUrl": "https://app.bunship.com/billing"
  }'