Skip to main content
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

string
Unique identifier. Prefixed with chk_.
string
Always "checkout".
string
The customer being charged.
string
For product checkouts. The product being purchased.
number
For direct checkouts. The amount to charge.
string
For direct checkouts. Currency code, e.g. "USD".
string
open, completed, expired, or failed.
string
URL to redirect the customer to for payment.
string
URL the customer is sent to after payment.
string
Optional description shown on the checkout page.
object
Arbitrary key-value data.
string
ISO 8601 timestamp. Checkout sessions expire after 24 hours.
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

string
required
The product to charge for.
string
Existing customer ID. If omitted, provide customer_email or customer_phone to create one.
string
Email to look up or create a customer.
string
Phone number to look up or create a customer.
string
URL to redirect the customer to after payment.
string
Description shown on the checkout page.
object
Arbitrary key-value data.

Direct checkout

number
required
Amount to charge.
string
required
Asset code, e.g. "NGN".
Same optional fields as product checkout (customer_id, customer_email, customer_phone, redirect_url, description, metadata).

Retrieve a checkout

GET /checkout/{id}