Examples
Integration examples with synchronized language switchers across each page.
Browse examples by use case. Select your language once: all code blocks on the page update together.
Create an order token
interface OrderTokenResponse {
token: string;
}
const apiKey = process.env.BOLT_API_KEY;
if (!apiKey) throw new Error("Missing BOLT_API_KEY");
const response = await fetch("https://api-sandbox.boltapp.com/v1/merchant/orders", {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-API-Key": apiKey,
},
body: JSON.stringify({ cart: { total_amount: 1000, currency: "USD", items: [] } }),
});
const order = (await response.json()) as OrderTokenResponse;Authorize a payment
const apiKey = process.env.BOLT_API_KEY;
if (!apiKey) throw new Error("Missing BOLT_API_KEY");
await fetch("https://api-sandbox.boltapp.com/v1/merchant/transactions/authorize", {
method: "POST",
headers: { "Content-Type": "application/json", "X-API-Key": apiKey },
body: JSON.stringify({ auto_capture: true }),
});By platform
| Platform | Guide |
|---|---|
| Shopify | Quickstart |
| BigCommerce | Quickstart |
| Direct API | Quickstart |
| Gaming (Unity) | Gaming checkout |