FleetbaseFleetbase

Checkout

Checkout endpoints turn a cart into a payable order flow. Use them to initialize gateway-specific payment data, check checkout status, capture payment callbacks, and create orders from completed checkouts.

The Checkout object

A checkout token represents a prepared storefront checkout session for a cart, customer, gateway, and delivery or pickup option.
Attributes
tokenstringoptional

Checkout token used to capture the order.

paymentIntentstringoptional

Stripe PaymentIntent ID when using Stripe checkout.

clientSecretstringoptional

Stripe client secret when using Stripe checkout.

ephemeralKeystringoptional

Stripe ephemeral key when returned for mobile checkout.

customerIdstringoptional

Gateway customer ID.

invoiceobjectoptional

QPay invoice payload when using QPay checkout.

checkoutstringoptional

Public checkout ID returned by QPay checkout initialization.

The Checkout object
{
  "token": "checkout-token",
  "paymentIntent": "pi_123",
  "clientSecret": "pi_123_secret_456",
  "ephemeralKey": "ek_test_123",
  "customerId": "cus_123"
}
GET/v1/checkouts/before

Before ❗

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.

Query parameters
gatewaystringoptional

Payment gateway ID or code.

customerstringoptional

Customer ID associated with the request.

cartstringoptional

Cart value for this checkout request.

service_quotestringoptional

Service quote ID used by the request.

cashbooleanoptional

Cash value for this checkout request.

pickupbooleanoptional

Pickup address, place ID, or pickup payload for the order.

tipnumberoptional

Tip amount applied to the checkout.

delivery_tipnumberoptional

Tip amount allocated to delivery.

GET/v1/checkouts/before
curl https://api.fleetbase.io/v1/checkouts/before?gateway=&customer=&cart=&service_quote=&cash=&pickup=&tip=&delivery_tip= \
  -H "Authorization: Bearer flb_live_…"
POST/v1/checkouts/capture

Capture 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.

Body parameters
tokenstringrequired

Checkout token returned by checkout initialization.

transactionDetailsobjectoptional

Optional gateway transaction details to store with the resulting transaction and order metadata.

notesstringoptional

Optional notes stored on the created order.

POST/v1/checkouts/capture
curl -X POST https://api.fleetbase.io/v1/checkouts/capture \
  -H "Authorization: Bearer flb_live_…" \
  -H "Content-Type: application/json" \
  -d '{
  "token": "{{checkout_token}}"
}'
POST/v1/checkouts/capture-qpay

Capture 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.

Body parameters
checkoutstringrequired

Public checkout ID being confirmed by QPay.

respondbooleanoptional

Whether Fleetbase should return the payment check payload in the HTTP response.

testenumoptional

Sandbox-only test scenario to simulate. One of success, error.

POST/v1/checkouts/capture-qpay
curl -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"
}'
GET/v1/checkouts/capture-qpay

Capture QPay Callback via GET

Processes a QPay checkout callback from query parameters. Sandbox requests can pass test to simulate success or failure.

Query parameters
checkoutstringoptional

Checkout value for this checkout request.

respondbooleanoptional

Respond value for this checkout request.

teststringoptional

Test value for this checkout request.

GET/v1/checkouts/capture-qpay
curl https://api.fleetbase.io/v1/checkouts/capture-qpay?checkout={{checkout_id}}&respond=true&test=success \
  -H "Authorization: Bearer flb_live_…"
GET/v1/checkouts/status

Get Checkout Status

Returns the status of a checkout by checkout ID or token.

Query parameters
checkoutstringoptional

Checkout value for this checkout request.

tokenstringoptional

Token used to authenticate or capture the checkout.

GET/v1/checkouts/status
curl https://api.fleetbase.io/v1/checkouts/status?checkout={{checkout_id}}&token={{checkout_token}} \
  -H "Authorization: Bearer flb_live_…"
POST/v1/checkouts/stripe-setup-intent

Create Stripe Setup Intent

Creates a Stripe SetupIntent for a storefront customer. The response includes Stripe client data for saving a payment method.

Body parameters
namestringrequired

Display name for the resource.

descriptionstringoptional

Human-readable description of the resource.

statusenumoptional

Lifecycle status to apply to the resource. One of active, inactive.

metastringoptional

Arbitrary metadata stored with the resource.

POST/v1/checkouts/stripe-setup-intent
curl -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}}"
}'
PUT/v1/checkouts/stripe-update-payment-intent

Update 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.

Body parameters
namestringoptional

Display name for the resource.

descriptionstringoptional

Human-readable description of the resource.

statusenumoptional

Lifecycle status to apply to the resource. One of active, inactive.

metastringoptional

Arbitrary metadata stored with the resource.

PUT/v1/checkouts/stripe-update-payment-intent
curl -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
}'
Checkout | Fleetbase