This guide covers a direct Checkout API integration. If you use the
@fluid-app FairShare SDK, see Choosing a cart
surface for its Public SDK API workflow.Base URL and authentication
Every request goes tohttps://api.fluid.app. The checkout surface is versioned: paths sit under /api/checkout/v2026-04/.
The cart operations in this flow are scoped by the cart_token in the path and
need no company Bearer token. Creating a cart, querying a product, and
retrieving a finished order are also public operations.
A few cart operations, such as setting the volume rep, also need a Bearer token. See Know which cart operations need a token.
The create-cart response returns the
cart_token used in every cart-level
path. Treat it as a secret and send it only to Fluid.The checkout flow
1
Find a product and a variant
A cart is built from product variants, so you start by resolving the The response lists the product’s purchasable variants; see the Query product endpoint reference for its full shape. To browse or search the whole catalog instead of fetching one product, use the Storefront products API, documented under the Storefront endpoints reference.
variant_id you want to sell. Query a single product on the checkout surface with POST /api/checkout/v2026-04/products/{id}, passing the shop under metadata.fluid_shop. The {id} segment accepts a product id or slug.2
Create a cart
Create the cart with Creating a cart is a public operation — it needs no Bearer token. A successful call returns the cart, including the
POST /api/checkout/v2026-04/carts. The body requires fluid_shop (the company subdomain) and country_code (an ISO country code). You can seed the cart with an items array in the same call — each item requires a variant_id and a quantity — and attach rep attribution under attribution.cart_token you pass to every subsequent step. A body that fails validation — for example a missing country_code — returns 422.Store the returned
cart_token in your application state. It identifies the cart for the rest of the flow.3
Add and adjust line items
Add more items after creation with You can inspect the cart at any time with
POST /api/checkout/v2026-04/carts/{cart_token}/items. The body takes an items array. For a new line, provide its variant_id and quantity. Mark an item as a subscription by setting subscription to true and naming a subscription_plan_id. See the endpoint reference for the alternative batch shapes.GET /api/checkout/v2026-04/carts/{cart_token}, which returns the current items, totals, and available shipping methods.4
Capture the buyer's contact details
Attach the buyer’s contact information with
PATCH /api/checkout/v2026-04/carts/{cart_token}. The body accepts email, phone, and the marketing opt-ins email_marketing and sms_marketing.5
Set the shipping address
Set the address with
POST /api/checkout/v2026-04/carts/{cart_token}/address. The body requires a type — one of ship_to, bill_to, or both — and carries the address fields under an address object. Send the recipient’s full name in name: this endpoint keeps name and drops first_name and last_name.Setting the address triggers a full recalculation of tax, shipping, and totals, so the cart you get back reflects the destination. Re-read the cart to see the refreshed available shipping methods.
6
Select a shipping method
Once the cart has an address, choose one of its available methods with
PUT /api/checkout/v2026-04/carts/{cart_token}/shipping, passing the shipping_method_id. Selecting a shipping method is idempotent — selecting the same one again is a no-op.7
Apply a discount code (optional)
Apply a promotion with
POST /api/checkout/v2026-04/carts/{cart_token}/discount, passing the discount_code. Applying a discount is not idempotent — applying the same code twice returns an error.8
Collect payment
Card capture and tokenization happen on Fluid’s cart payment surface, which authenticates with the cart token in the path — no Bearer token. A card is attached to the cart itself, and completing the checkout charges it. See the Cart payment endpoints reference for tokenization, 3D Secure, and the wallet flows (Apple Pay, PayPal, and others). If your payment flow returns a payment reference, carry it into the next step as the
payment_uuid query parameter. To try the whole flow without a real card, see Place a test order.9
Complete the checkout
Turn the cart into an order with
POST /api/checkout/v2026-04/carts/{cart_token}/complete. If the payment step returned a payment reference, pass it as the payment_uuid query parameter. Always send an Idempotency-Key header so a retried request never places a second order. A successful call returns 200 with the completed order.The cart lists its checkout agreements under agreements. Accept every agreement whose required is true by passing its id in accepted_agreement_ids, in the JSON request body; a checkout without them is refused with 422.10
Retrieve the order
Read the order back with
GET /api/checkout/v2026-04/orders/{token}, using the order token from the completion response. This endpoint is public, so you can show an order-confirmation page without a Bearer token. The response carries the order’s token and its human-facing order_number.Place a test order
A new company comes with a test card gateway, so you can prove the whole flow works before the merchant’s payments are approved, with no browser and no real card. The test gateway approves every charge and never sends the card to a processor, so no money moves. Everything else treats it as a real order: it sends the same order webhooks and order emails, and any back office, sales channel or droplet already connected sees it. The only test marker is on its payment,test_transaction true in the order webhook’s payments. Give the cart an email address you control, tell the merchant which order was the test, and refund it afterwards (below).
The test gateway is in place once the merchant has confirmed the company’s signup. Build a cart through the shipping step above, with an email and an address, then:
-
Check the cart offers only the test gateway. Read the cart and look at
available_payment_methods. Go on only if every entry hastypecredit_card,testtrue, andbogus_gatewaytrue, and take that entry’suuid. If any entry is a live payment method, stop: a charge could reach a real processor. An empty list means the company has no payment account yet. -
Get a test card token. Call
POST /api/v202506/payments/tokenize_cardwith test card details undercredit_card: a test number such as4242424242424242and any future expiry month and year. Never send a real card to this endpoint: it takes the full card number with no Bearer token. It checks the card locally and returns the token undertransaction.payment_method.token. -
Attach the card to the cart. Call
PUT /api/payments/v2026-04/carts/{cart_token}/payment_methodwithtypecredit_card, the card underpayment_method, and the test gateway’suuidaspayment_account, so the charge can only go to that account. A successful call returns201. Underpayment_method, put the step 2 token intoken, and copy the card’s details from the same step 2payment_method:full_nameintocard_holder,last_four_digitsintolast_four,first_six_digitsintobin,card_networkas it is, andmonthandyearintoexp_monthandexp_year. Keeptoken_providerasvgs, even though this token didn’t come from VGS:vgsis the only provider a card accepts. -
Complete the checkout with the cart’s required agreements in
accepted_agreement_idsand nopayment_uuid. A successful call returns200with the order.
complete is refused with 422, and the error’s code is payment_account_unavailable. No money moves.
When you’ve checked the order, refund it in full and cancel it with POST /api/refunds, using the order’s numeric id from the order response, type all and cancel_order true. This needs the merchant’s Bearer token with permission to update refunds; no cart-token route cancels an order. The refund and the cancellation send their own order webhooks, and customer emails where the company has them turned on.
Related surfaces
- Cart payment — card tokenization, 3D Secure, and wallet payments live on the cart payment surface; see the Cart payment endpoints reference.
- Storefront — browse and search the product catalog on the Storefront endpoints reference.
- Subscriptions — the checkout surface also manages the subscriptions a cart creates; see the subscription operations in the reference.
Next steps
- Browse the Create a cart endpoint reference for full request and response schemas.
- Create a cart, add an item, and read it back to confirm your token handling before wiring up payment.
- Read Checkout for how Fluid’s hosted checkout handles shipping, tax and rep attribution.