1. Billing
UsageRail API
  • HTTP check
    • Check a request
      POST
  • Customers
    • Create a customer
      POST
    • Get a customer
      GET
    • Claim an email or external ID
      POST
    • Get a customer's usage
      GET
  • Keys
    • Create a key
      POST
    • Revoke a key
      DELETE
  • Billing
    • Change a customer's plan
      POST
    • Open Stripe Checkout
      POST
    • Adjust a prepaid balance
      POST
  • Portal
    • Create a portal sign-in link
      POST
  • Schemas
    • Error
    • CheckRequest
    • CheckResult
    • Consumer
    • Usage
  1. Billing

Open Stripe Checkout

POST
/v1/consumers/{id}/checkout
Opens a Stripe Checkout page in your own Stripe account, for a paid plan (plan_id) or a credit pack (credit_pack_id). A customer who isn't on a prepaid plan yet also needs plan_id with a credit pack. success_url and cancel_url must use https; for local development, http://localhost works too.

Request

Authorization
Bearer Token
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
or
Path Params

Header Params

Body Params application/jsonRequired

Examples

Responses

🟢200
application/json
The Checkout page to send the customer to.
Bodyapplication/json

🟠400Error
🟠404Error
🟠409Error
🔴502Error
Request Request Example
Shell
JavaScript
Java
Swift
curl --location 'https://api.usagerail.com/v1/consumers//checkout' \
--header 'Idempotency-Key;' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
    "plan_id": "plan_8ZtQ2wLm",
    "interval": "month",
    "success_url": "https://example.com/billing/done",
    "cancel_url": "https://example.com/billing"
}'
Response Response Example
200 - Example 1
{
    "url": "string"
}
Modified at 2026-11-21 14:07:45
Previous
Change a customer's plan
Next
Adjust a prepaid balance
Built with