Sell with a shop and a cart
A shop is a hosted page that lists products from your catalog. Buyers add what they want to a cart and pay once in Flint's hosted checkout. You can build one in the Dashboard in a few minutes with no code, create one with the API, or put your own page in front of it. Your own page can be a static site or one an AI tool built, and it needs no backend and no API key.
Every shop sale is an order, so refunds, receipts, payouts, and reporting work as they do for any other order. Shop payments are priced the way payment link payments are.
Pick the path that matches who you are:
Dashboard
You sell and don't code
Create a shop, share its link or QR code, and paste a button into your site.
Public reads and resolve
You build a site or an app
Show the shop on your own pages and start checkout from your cart, straight from the browser.
Shop, payment link, or checkout session#
| You want | Use |
|---|---|
| Buyers choose from several products, add them to a cart, and pay once | A shop |
| One offer, bought whole, from one URL | A payment link |
| Your app knows what one buyer is paying for, and they pay now | A checkout session |
| A bill due later, in parts, or offline | An invoice |
Payment links vs checkout sessions vs invoices compares the others side by side. A shop's checkout settings, such as redirects, payment options, tip, tax, and promotions, work as they do on a payment link, and each one you leave out follows your checkout settings.
What a shop is#
- A shop lists catalog products and bundles. Each entry is a listing. The shop shows the catalog's name, description, images, options, and price, so a price change applies everywhere at once. A listing shows every variant that is active and for sale.
- You can list products of type
physical,digital,service, andgift_card.feeproducts can't be listed. A gift card offer is USD only, so it can be listed only in a USD shop. - A shop has one currency. The first listing sets it. A variant priced in another currency doesn't show.
- A shop holds up to 250 listings. Each environment can have 20 shops that are active or inactive. Archived shops don't count.
- A shop is
active,inactive, orarchived. An inactive shop shows your message instead of your products. An archived shop has closed for good, and it keeps its address. - A shop shows no stock counts, costs, or metadata. Buyers see names, descriptions, images, option names and values, prices, compare-at prices, quantity breaks, modifiers, bundle contents, sold-out flags, and category names.
What a shop doesn't do:
- It doesn't build a page layout. A shop is a grid, a product page, and a cart.
- It doesn't take plan signups. Sell a subscription plan with a payment link. When a variant has a subscription offer, hosted checkout lets the buyer switch that line between one-time and subscribed, and the shop's own pages show the one-time price.
- It doesn't appear in search engines. Shop pages are set to
noindex, nofollow. - It doesn't add a cart script to your own pages. The cart lives on the shop, and your pages link to it. To run a cart on your own pages, build one with the public reads.
- It doesn't follow a buyer to another device or browser. The cart stays in the browser that built it.
Create a shop in the Dashboard#
Change a shop later from its page: reorder or add products, edit its details, and see its recent paid orders, with View all opening the Orders list on its Paid tab for this shop. A product you deactivate in your catalog disappears from the shop, and the shop keeps selling the rest.
Deactivate closes the shop for now. Buyers see your message instead of your products, checkouts that are open and unpaid close, and payments already in progress can finish. Choose Activate to reopen it. Archive appears on an inactive shop, closes it for good, and can't be undone.
Add a buy button to your site#
A button is a link, so it works anywhere a link does. It runs no script and carries no credential. The Button code panel on a shop's page builds three kinds:
| Button | Where it goes |
|---|---|
| Open the shop | {shop url} |
| Open one product | {shop url}/p/{shop_listing_id} |
| Add to cart | {shop url}/cart?add={shop_listing_id} |
The panel builds each link for a listing. In an add-to-cart link you can also write add={shop_listing_id}.{variant_id} by hand to pick a variant. An add-to-cart link changes only the buyer's cart and then shows the cart. It never starts a checkout, and a link can repeat add up to 10 times, adding one each time. A product that needs a choice the link doesn't make opens that product's page instead.
Where your site builder has its own button or link block, such as Squarespace, Wix, Webflow, Carrd, Linktree, or a social bio, paste the link into it. Where the builder takes HTML, the panel gives you code in your accent color with a label you can edit:
<a href="https://checkout.withflintpay.com/shop/shop_01K4MOONRISE"
target="_top"
style="display:inline-block;padding:12px 20px;border-radius:10px;background:#e85d10;color:#000000;font:600 16px/1.2 system-ui,sans-serif;text-decoration:none">
Shop now
</a>
target="_top" takes the buyer out of a builder's embedded frame. If your builder blocks that, turn on Open in a new tab and the link opens a new tab instead. The label is black or white, whichever is easier to read on your color.
The same panel is on a payment link's page, for its link.
Use your own domain#
With a custom domain for checkout, a live shop's url uses your hostname, such as pay.example.com/shop/shop_01K4MOONRISE. Your hostname serves only your own shops.
A shop opened on Flint's address redirects to your hostname before it renders, because a cart can't move between hostnames. Share your hostname's links so buyers don't take the extra hop. Checkout domains are live mode only, so sandbox shops stay on Flint's address.
What buyers see#
- The buyer opens the shop from a link, a QR code, or a button. The grid shows each product with its image, name, and price, and category chips appear when the shop's products use two or more categories.
- A product that needs no choice has an Add button. A product with options or required modifiers shows Choose options and opens its page, where the buyer picks a variant, modifiers, and a quantity. A sold-out product says Sold out.
- The cart keeps the lines, quantities, and a subtotal. It says that tax is added at checkout.
- Checkout opens Flint's hosted checkout, where the buyer chooses delivery, enters a promotion code or gift card, sees tax, and pays.
- After payment the buyer lands on the receipt, with a Back to shop link, or on your
redirects.success_url. The cart empties once the order is paid. On Flint's hosted shop, a buyer who leaves checkout returns to the hosted cart with their items unless you set aredirects.cancel_url.
If a product sold out or was removed while it sat in the cart, the cart marks the line and blocks checkout until the buyer removes it. If a price changed, the cart says so once. Checkout then shows the order's real lines and total before the buyer pays.
A shop's pages keep your logo and checkout branding, and they use your merchant name and support details wherever the buyer needs help.
Create a shop with the API#
POST /v1/shops needs a key with checkouts.shops.write. It creates a shop with its listings, in order:
curl -X POST https://api.withflintpay.com/v1/shops \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: shop-moonrise-001" \
-d '{
"name": "Moonrise Bakery",
"description": "Bread and pastries, baked each morning. Pickup at the shop.",
"listings": [
{"type": "product", "product_id": "prod_01K4SOURDOUGH"},
{"type": "product", "product_id": "prod_01K4CROISSANT"},
{"type": "bundle", "bundle_id": "bun_01K4BREAKFAST"}
],
"delivery_method_ids": ["dmet_01K4PICKUP"]
}'
Abridged response:
{
"data": {
"shop_id": "shop_01K4MOONRISE",
"name": "Moonrise Bakery",
"status": "active",
"url": "https://checkout.withflintpay.com/shop/shop_01K4MOONRISE",
"currency": "USD",
"listing_count": 3,
"delivery_method_ids": ["dmet_01K4PICKUP"],
"version": 1
}
}
Share data.url. The response doesn't include the listings: read them with GET /v1/shops/{shop_id}/listings, which also shows listings buyers can't currently buy. To change the list, send the whole ordered listings array with PATCH /v1/shops/{shop_id} and the shop's version as expected_version. An entry that keeps its shop_listing_id stays the same listing, so product and add-to-cart links you pasted into a site keep working through an edit, and through a remove and re-add. A shop with no listings is valid, and buyers see an empty shop.
DELETE /v1/shops/{shop_id} archives a shop. Setting status to inactive closes its open, unpaid checkouts, and neither call asks for a confirmation field, because closing the shop is the purpose of the call. The Shops API lists every field, filter, and error.
Build your own cart#
Two reads and one start call need no API key, and a browser on any origin can make them. A static site, a site an AI tool built, or a mobile web view can show your shop, hold a cart, and send the buyer to Flint's checkout without a backend. You build the cart. Flint prices everything.
Note: No key in the browser
Flint has no publishable key, and these three routes need none: the shop ID is the only thing a caller needs, as with a payment link. They return only what you listed, and they can't create anything until the buyer presses Checkout on your page. Your API key and any other credential stay on your server. Securing a headless checkout covers the keys you do hold.
Send buyers back to your page#
When a shop has no redirects.cancel_url, a buyer who leaves checkout gets a Back to your cart link to Flint's hosted cart. That cart reads the browser storage of Flint's own origin, which is empty for a cart you built on your page. The receipt's Back to shop link opens the hosted shop for the same reason. Set both on the shop, so buyers return to your cart and your confirmation page:
curl -X PATCH https://api.withflintpay.com/v1/shops/shop_01K4MOONRISE \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"redirects": {
"cancel_url": "https://example.com/cart",
"success_url": "https://example.com/thanks"
}
}'
A checkout copies a shop's settings when it starts, so the change applies to checkouts started afterward. Keep your own cart until the buyer lands on success_url, and confirm the sale from the order.paid webhook, not from that page.
Run checkout on your own page#
The checkout URL's cklt_ launch token works only on Flint's hosted page. To run the checkout on your own page instead, create a headless session for order_id from your backend with replace_checkout_session_id, as Sell event tickets on your own page shows for payment links. Build a headless storefront compares the two.
A complete cart page#
This module needs no build step and no backend. It reads the shop, keeps a cart in memory, and starts checkout. It sends a new idempotency key for each cart and reuses it when the buyer retries the same cart.
const API = "https://api.withflintpay.com/v1";
const SHOP_ID = "shop_01K4MOONRISE";
const shop = (await (await fetch(`${API}/shops/${SHOP_ID}/public`)).json()).data;
const cart = []; // {shop_listing_id, variant_id?, quantity}
let attempt = { key: crypto.randomUUID(), body: "" };
export async function checkout() {
const body = JSON.stringify({
resolution_context: shop.resolution_context,
line_items: cart,
});
// A changed cart is a new request, so it gets a new key
if (attempt.body !== body) attempt = { key: crypto.randomUUID(), body };
const response = await fetch(`${API}/shops/${SHOP_ID}/resolve`, {
method: "POST",
headers: { "Content-Type": "application/json", "Idempotency-Key": attempt.key },
body,
});
const result = await response.json();
if (response.ok) {
window.location.assign(result.data.url);
return;
}
return result.error; // handle it as the next section describes
}
Handle resolve errors#
An error response has one code, and each code keeps one meaning. Flint checks the whole request first, then the cart's lines one class at a time, and returns the first class that has a failing line. details names every failing line in that class, each with its own param such as line_items[1].variant_id. Fix that class and send the cart again, because a later class can fail next. A cart with a removed listing and a sold-out line gets the 404 first and the sold-out error on the next try.
Request checks, first:
| Status and code | When | What to do |
|---|---|---|
429 RATE_LIMIT_EXCEEDED | Too many reads or starts from one network, or more than 20 resolves in a minute for one context. | Wait for Retry-After seconds, then send the same request with the same key. |
400 INVALID_REQUEST | The body is malformed, has an unknown field, or line_items has fewer than 1 or more than 50 entries. | Fix the request. |
404 RESOURCE_NOT_FOUND | The shop doesn't exist. param is shop_id. Flint looks the shop up before it reads the context. | Check the ID you ship. |
400 INVALID_REQUEST | The context is missing (detail REQUIRED), or malformed or from another shop (INVALID_VALUE), with param resolution_context. | Read the shop again and send its resolution_context. |
409 VERSION_CONFLICT | The context expired, is at or after checkout_start_due_at, or was read before the shop's checkout settings, delivery methods, or stock source changed. remediation.retry is after_refresh. | Read the shop again, check the cart against it, and start with the new context and a new key. Renaming a shop or reordering its listings doesn't invalidate a context. |
409 ACTION_NOT_ALLOWED | The shop is closed. details[0].resource_type is shop, with current_status inactive or archived and the shop's inactive_message when it has one. | Show the message and stop offering checkout. |
Then the cart's lines, in this order:
| Class | Status and code | A line fails when | What to do |
|---|---|---|---|
| 1 | 400 INVALID_REQUEST | A variant is missing where one is required (REQUIRED), isn't the listing's product's (INVALID_VALUE), or is sent for a bundle (NOT_ALLOWED). A quantity is outside 1 to 9,999. A modifier choice is malformed, breaks its group's rules, or is missing for a required group. | Fix the line named by param, such as line_items[1].variant_id or line_items[1].modifiers. |
| 2 | 404 RESOURCE_NOT_FOUND | The listing isn't on this shop, or was removed from it. details[0].resource_type is shop_listing. | Remove the line, and read the shop again. |
| 3 | 409 ACTION_NOT_ALLOWED | A product, bundle, variant, or modifier is no longer sold, the listing has no price in the shop's currency, or a tracked line has no stock source. Reason unsupported_state comes with current_status for an inactive or archived item. Reason not_offered covers the rest. | Remove the line or let the buyer choose again. |
| 4 | 409 INVENTORY_INSUFFICIENT | A variant or bundle is sold out. resource_type is shop_listing, available_quantity is 0, and param is the line, such as line_items[1]. | Mark the line sold out and let the buyer remove it. |
Two more 409 responses depend on the request's history:
| Status and code | When | What to do |
|---|---|---|
409 ACTION_NOT_ALLOWED | A replay returned a checkout that has since ended or been paid. details[0].resource_type is checkout_session and the reason is not_offered. | Start a new checkout with a new key. |
409 MERCHANT_NOT_READY | The merchant can't take payments yet, and the cart is otherwise valid. | Tell the buyer to contact the merchant. Use merchant_support from the shop read. |
A class 4 error, abridged:
{
"error": {
"type": "conflict_error",
"code": "INVENTORY_INSUFFICIENT",
"message": "This listing is sold out.",
"param": "line_items[1]",
"details": [
{
"code": "INVENTORY_INSUFFICIENT",
"param": "line_items[1]",
"resource_type": "shop_listing",
"available_quantity": 0
}
]
}
}
Retries and concurrency#
- After a lost response, send the same context, body, and
Idempotency-Key. Flint returns the same checkout withIdempotency-Replayed: true, as long as the context hasn't expired and the session is still open. - After a changed cart, use a new key, because the cart is part of the request. Idempotency says what a reused key returns.
- When the shop is busy,
409 CONCURRENT_MODIFICATIONis retryable, and its remediation hint sayssame_request. Send the identical request again with the same key, after a short backoff. - When the key is still running, the first call hasn't finished. Retry with the same key.
- A tab left open past
checkout_start_due_atshould read the shop and its listings again when the buyer presses Checkout, show anything that changed, and wait for a second press.
Each shop allows 1,000 public reads and 1,000 checkout starts per IP in a rolling minute, and each context allows 20 starts a minute. When every buyer calls from their own browser, the limits apply to each buyer. A server that calls for many buyers shares one budget, so make these calls from the buyer's browser. A cart view that reads each listing spends one read per listing, so read a listing when the buyer opens it, not on a timer. Rate limits has the details.
Test with a test-mode shop and a test card. A sandbox shop shows a test-mode banner and takes test cards only.
Fulfill from webhooks#
An order exists only after the buyer presses Checkout, so adding to a cart sends no event. After that, shop orders follow the same events as other orders:
order.paidandcheckout_session.paidreport the sale. Fulfill fromorder.paid, after you check the order'sdispute_status, as the other surfaces do.- Orders and checkout sessions from a shop carry
shop_id. An order hasorigin: "shop", a session hastype: "shop", and a payment haspayment_flow: "shop". GET /v1/orders?shop_id=shop_01K4MOONRISEandGET /v1/checkout-sessions?shop_id=shop_01K4MOONRISElist a shop's orders and checkouts, andGET /v1/orders?origin=shoplists every shop order. Addpayment_status=paidto the orders list for sales.shop.created,shop.updated, andshop.archivedcarry the shop asGET /v1/shops/{shop_id}returns it. A listing change shows as a newversionandlisting_count. Read the listings route for the list.
An order's data.object from a shop carries fields like these:
{
"order_id": "ord_01K4MOONRISE7",
"origin": "shop",
"shop_id": "shop_01K4MOONRISE"
}
Abandoned checkouts#
An order exists as soon as the buyer presses Checkout, before they pay. A buyer who goes back and changes the cart starts a new checkout and gets a new order. An unpaid order stays open until its checkout session expires, 24 hours after it starts by default, or after the shop's checkout_session_expires_in_seconds. It then closes with closed_reason: "checkout_expired" and sends order.closed. Count a sale from order.paid, not from an order's creation. To list only sales, add payment_status=paid to the orders list.
A shop doesn't copy its metadata to orders, so shop_id is the join. Use client_reference on resolve for your own cart or campaign ID. Webhooks covers signatures and retries.
Limits#
| Limit | Value |
|---|---|
| Shops per environment, not counting archived | 20 |
| Listings per shop | 250 |
| Lines per checkout | 50 |
| Quantity on one line | 1 to 9,999 |
add values on one add-to-cart link | 10 |
| Public reads per shop per IP, per minute | 1,000 |
| Checkout starts per shop per IP, per minute | 1,000 |
Starts per resolution_context, per minute | 20 |
Errors#
Resolve errors covers the buyer's calls, and the Shops API lists every code.
Next steps#
Create a Flint account, create a shop in a sandbox, and place a test order through its link.
Shops APICatalog setupCustom domainsBuild a headless storefront