Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.stellartools.dev/llms.txt

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

A checkout session is a short-lived payment page. You create one, redirect the customer to the payment_url, and StellarTools handles the rest. On completion, the customer is sent to your redirect_url.

The checkout object

id
string
Unique identifier. Prefixed with chk_.
object
string
Always "checkout".
customer_id
string
The customer being charged.
product_id
string
For product checkouts. The product being purchased.
amount
number
For direct checkouts. The amount to charge.
asset_code
string
For direct checkouts. Asset code, e.g. "XLM".
status
string
open, completed, expired, or failed.
payment_url
string
URL to redirect the customer to for payment.
redirect_url
string
URL the customer is sent to after payment.
description
string
Optional description shown on the checkout page.
metadata
object
Arbitrary key-value data.
expires_at
string
ISO 8601 timestamp. Checkout sessions expire after 24 hours.
created_at
string
ISO 8601 timestamp.

Create a checkout

POST /checkout?type=product or POST /checkout?type=direct Use type=product to charge for a product you’ve defined. Use type=direct to charge an arbitrary amount without a product.

Product checkout

curl "https://api.stellartools.dev/checkout?type=product" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "customer_id": "cus_01jx...",
    "product_id": "prod_01jx...",
    "redirect_url": "https://yourapp.com/success"
  }'
product_id
string
required
The product to charge for.
customer_id
string
Existing customer ID. If omitted, provide customer_email or customer_phone to create one.
customer_email
string
Email to look up or create a customer.
customer_phone
string
Phone number to look up or create a customer.
redirect_url
string
URL to redirect the customer to after payment.
description
string
Description shown on the checkout page.
metadata
object
Arbitrary key-value data.

Direct checkout

curl "https://api.stellartools.dev/checkout?type=direct" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "customer_id": "cus_01jx...",
    "amount": 50,
    "asset_code": "XLM",
    "redirect_url": "https://yourapp.com/success"
  }'
amount
number
required
Amount to charge.
asset_code
string
required
Asset code, e.g. "XLM".
Same optional fields as product checkout (customer_id, customer_email, customer_phone, redirect_url, description, metadata).

Retrieve a checkout

GET /checkout/{id}
curl https://api.stellartools.dev/checkout/chk_01jx... \
  -H "x-api-key: YOUR_API_KEY"