Checkout

Accept a payment for an amount you specify, server-to-server — Blitz handles the buyer-facing payment flow, then notifies you by webhook once it completes.

Create a checkout

POST/api/commerce/integration/checkout

Requires an API key with the checkout:write scope.

create-checkout.sh
curl -X POST https://api.nest.useblitz.co/api/commerce/integration/checkout \
  -H "Authorization: Bearer bk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "amountMinorUnits": "2500",
    "currency": "USD",
    "provider": "STRIPE",
    "returnUrl": "https://yourstore.com/orders/123/confirmation",
    "checkoutMode": "REDIRECT",
    "externalOrderRef": "your-internal-order-id",
    "idempotencyKey": "unique-per-order"
  }'

Response:

response.json
{
  "orderId": "pay_...",
  "provider": "STRIPE",
  "checkoutMode": "REDIRECT",
  "redirectUrl": "https://checkout.stripe.com/..."
}

Redirect vs. embedded

checkoutMode: "REDIRECT" (the default) returns a redirectUrl — send the buyer there to complete payment; they land back on your returnUrl with ?order={orderId} appended. checkoutMode: "EMBEDDED" (Stripe only — rejected for PayPal) instead returns a clientSecret for Stripe Elements, and no redirect happens unless the payment method itself requires one (e.g. 3DS).

Embedding the hosted checkout page

This is a separate option from checkoutModeabove, and doesn't require the integration API at all. If you have a Blitz-hosted checkout link (e.g. a product checkout link from your merchant dashboard, of the form https://useblitz.co/checkout/{slug}), you can drop that page directly into an <iframe> by appending ?embed=trueto the URL. The embedded version renders without Blitz's page chrome and is served with frame-ancestors *, so it can be framed from any origin. Without ?embed=true, the same page refuses to be framed at all.

Use this when you want Blitz's full hosted checkout UI inline on your page with no integration work. Use checkoutMode: "EMBEDDED" instead when you want to build your own checkout UI around Stripe Elements.

Fields

  • amountMinorUnits — positive integer string, in minor units (cents for USD).
  • providerSTRIPE or PAYPAL.
  • returnUrl — required, HTTPS. Your own order-confirmation page — reaching it is not itself proof of payment; check real status via the status endpoint below or a webhook.
  • idempotencyKey — strongly recommended. Retrying with the same key returns the existing order instead of creating a duplicate.

Check order status

GET/api/commerce/checkout/orders/:orderId/status

Public — no API key required. Poll this from your returnUrl, or use a webhook instead.

Returns { status, amountMinorUnits, currency }. status reaches PAIDonce the payment is confirmed — that's the only signal that should trigger fulfillment on your side, not the redirect itself.