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 ID associated with the request.
cartstringoptionalCart value for this checkout request.
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=&customer=&cart=&service_quote=&cash=&pickup=&tip=&delivery_tip= \
-H "Authorization: Bearer flb_live_…"/v1/checkouts/captureCapture checkout as order
Captures a checkout token and creates the corresponding order. The response returns the completed order or the existing order when the checkout was already captured.
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": "{{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
}'