Checkout
The Checkout object
tokenstringoptionalCheckout token used to capture the order.
paymentIntentstringoptionalStripe PaymentIntent ID when using Stripe checkout.
clientSecretstringoptionalStripe client secret when using Stripe checkout.
ephemeralKeystringoptionalStripe ephemeral key when returned for mobile checkout.
customerIdstringoptionalGateway customer ID.
invoiceobjectoptionalQPay invoice payload when using QPay checkout.
checkoutstringoptionalPublic checkout ID returned by QPay checkout initialization.
{
"token": "checkout-token",
"paymentIntent": "pi_123",
"clientSecret": "pi_123_secret_456",
"ephemeralKey": "ek_test_123",
"customerId": "cus_123"
}/v1/checkouts/beforeBefore ❗
Initializes a checkout preview for a cart, customer, gateway, and delivery or pickup option. The response prepares gateway-specific client data or a checkout token before the order is captured.
gatewaystringoptionalPayment gateway ID or code.
customerstringoptionalCustomer public ID for guest checkout. When Customer-Token is present this value must identify the authenticated customer or checkout returns 403.
cartstringoptionalCart public ID or unique identifier. Network checkout validates member stores, online state, products, locations, currency consistency, and the network multi-cart policy before payment initialization.
service_quotestringoptionalService quote ID used by the request.
cashbooleanoptionalCash value for this checkout request.
pickupbooleanoptionalPickup address, place ID, or pickup payload for the order.
tipnumberoptionalTip amount applied to the checkout.
delivery_tipnumberoptionalTip amount allocated to delivery.
/v1/checkouts/beforecurl https://api.fleetbase.io/v1/checkouts/before?gateway=stripe&customer={{customer_id}}&cart={{cart_id}}&service_quote={{service_quote_id}}&pickup=false \
-H "Authorization: Bearer flb_live_…"/v1/checkouts/beforeBefore Cash Pickup Checkout
Initializes a cash (cash-on-delivery) pickup checkout. A pickup checkout with the cash gateway needs no delivery service quote, so the service_quote parameter is omitted. The response returns the checkout id and token; no gateway client data is prepared for cash.
gatewaystringoptionalPayment gateway code — cash for a cash-on-delivery checkout.
customerstringoptionalCustomer ID associated with the request.
cartstringoptionalCart value for this checkout request.
pickupbooleanoptionalSet true for a pickup order; a cash pickup checkout needs no service quote.
/v1/checkouts/beforecurl https://api.fleetbase.io/v1/checkouts/before?gateway=cash&customer={{customer_id}}&cart={{cart_id}}&pickup=true \
-H "Authorization: Bearer flb_live_…"/v1/checkouts/captureCapture checkout as order
Captures a checkout token and creates the corresponding order. Capture is idempotent: an already completed checkout returns its existing order, while a concurrent capture still in progress returns 409 so the client can retry safely.
Stripe checkouts are captured only after Fleetbase retrieves the server-linked PaymentIntent and verifies that it succeeded and matches the checkout amount, currency, customer, and live/test mode. An incomplete payment returns 402, a missing or mismatched PaymentIntent returns 422, and a temporary Stripe verification failure returns 502. Clients must confirm the PaymentIntent before calling this endpoint and must not send or trust a client-selected PaymentIntent ID during capture.
Because a contract run cannot complete a card payment, this example captures the cash pickup checkout created by Before Cash Pickup Checkout, which needs no provider payment; the unpaid Stripe checkout's 402 refusal is asserted by Capture Stripe checkout without payment.
tokenstringrequiredCheckout token returned by checkout initialization.
transactionDetailsobjectoptionalOptional gateway transaction details to store with the resulting transaction and order metadata.
notesstringoptionalOptional notes stored on the created order.
/v1/checkouts/capturecurl -X POST https://api.fleetbase.io/v1/checkouts/capture \
-H "Authorization: Bearer flb_live_…" \
-H "Content-Type: application/json" \
-d '{
"token": "{{cash_checkout_token}}"
}'/v1/checkouts/captureCapture Stripe checkout without payment
Documents the refusal contract for capturing a Stripe checkout whose PaymentIntent has not succeeded: the API answers 402 with "Stripe payment has not been completed." and creates no order. Client-supplied transaction details can never substitute for the provider's verified payment state.
tokenstringrequiredCheckout token of a Stripe checkout whose PaymentIntent has not succeeded.
/v1/checkouts/capturecurl -X POST https://api.fleetbase.io/v1/checkouts/capture \
-H "Authorization: Bearer flb_live_…" \
-H "Content-Type: application/json" \
-d '{
"token": "{{checkout_token}}"
}'/v1/checkouts/capture-qpayCapture QPay Callback
Processes a QPay checkout callback. Fleetbase verifies the checkout and gateway, checks the QPay invoice payment state, and creates the order when payment is confirmed.
checkoutstringrequiredPublic checkout ID being confirmed by QPay.
respondbooleanoptionalWhether Fleetbase should return the payment check payload in the HTTP response.
testenumoptionalSandbox-only test scenario to simulate. One of success, error.
/v1/checkouts/capture-qpaycurl -X POST https://api.fleetbase.io/v1/checkouts/capture-qpay \
-H "Authorization: Bearer flb_live_…" \
-H "Content-Type: application/json" \
-d '{
"checkout": "{{checkout_id}}",
"respond": true,
"test": "success"
}'/v1/checkouts/capture-qpayCapture QPay Callback via GET
Processes a QPay checkout callback from query parameters. Sandbox requests can pass test to simulate success or failure.
checkoutstringoptionalCheckout value for this checkout request.
respondbooleanoptionalRespond value for this checkout request.
teststringoptionalTest value for this checkout request.
/v1/checkouts/capture-qpaycurl https://api.fleetbase.io/v1/checkouts/capture-qpay?checkout={{checkout_id}}&respond=true&test=success \
-H "Authorization: Bearer flb_live_…"/v1/checkouts/statusGet Checkout Status
Returns the status of a checkout by checkout ID or token.
checkoutstringoptionalCheckout value for this checkout request.
tokenstringoptionalToken used to authenticate or capture the checkout.
/v1/checkouts/statuscurl https://api.fleetbase.io/v1/checkouts/status?checkout={{checkout_id}}&token={{checkout_token}} \
-H "Authorization: Bearer flb_live_…"/v1/checkouts/stripe-setup-intentCreate Stripe Setup Intent
Creates a Stripe SetupIntent for a storefront customer. The response includes Stripe client data for saving a payment method.
namestringrequiredDisplay name for the resource.
descriptionstringoptionalHuman-readable description of the resource.
statusenumoptionalLifecycle status to apply to the resource. One of active, inactive.
metastringoptionalArbitrary metadata stored with the resource.
/v1/checkouts/stripe-setup-intentcurl -X POST https://api.fleetbase.io/v1/checkouts/stripe-setup-intent \
-H "Authorization: Bearer flb_live_…" \
-H "Content-Type: application/json" \
-d '{
"customer": "{{customer_id}}"
}'/v1/checkouts/stripe-update-payment-intentUpdate Stripe Payment Intent
Recalculates and updates an existing Stripe PaymentIntent for the current cart and checkout options. The response includes refreshed Stripe client data and a new checkout token.
namestringoptionalDisplay name for the resource.
descriptionstringoptionalHuman-readable description of the resource.
statusenumoptionalLifecycle status to apply to the resource. One of active, inactive.
metastringoptionalArbitrary metadata stored with the resource.
/v1/checkouts/stripe-update-payment-intentcurl -X PUT https://api.fleetbase.io/v1/checkouts/stripe-update-payment-intent \
-H "Authorization: Bearer flb_live_…" \
-H "Content-Type: application/json" \
-d '{
"customer": "{{customer_id}}",
"cart": "{{cart_id}}",
"service_quote": "{{service_quote_id}}",
"payment_intent_id": "{{payment_intent_id}}",
"pickup": false,
"tip": 0,
"delivery_tip": 0
}'