Skip to content

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.

Create a shop in the Dashboard

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.

Build your own cart

You wantUse
Buyers choose from several products, add them to a cart, and pay onceA shop
One offer, bought whole, from one URLA payment link
Your app knows what one buyer is paying for, and they pay nowA checkout session
A bill due later, in parts, or offlineAn 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, and gift_card. fee products 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, or archived. 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#

  1. Open Shops and choose Create shop#

    Shops is in the commerce section of the sidebar, beside Payment links. Create a Flint account if you don't have one. Try each step in a sandbox first.

  2. Name it and choose products#

    Give the shop a name and, if you like, a description and a cover image. Then choose products and bundles from your catalog. Search the list, use Select all, and drag items into the order buyers see. Choose Add a product to create a product in place, and it comes back selected.

    If a product needs a delivery choice or tracks inventory, the builder shows a Delivery section or a Stock section. Pick the delivery options buyers can choose from, or add one in place. Set where stock comes from. A product that can't be listed shows the reason.

  3. Create it and share it#

    Choose Create shop. A new shop is active as soon as you create it. The next page leads with the shop's address and a Copy button, then Share, Open shop, a QR code, and Button code.

    Put the address in a social bio, an email, or a post. Print the QR code on a flyer or a menu. A link pasted into a chat or a bio shows a card with your cover image or logo and the shop's name. A single product's link shows that product.

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:

ButtonWhere 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:

HTML
<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#

  1. 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.
  2. 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.
  3. The cart keeps the lines, quantities, and a subtotal. It says that tax is added at checkout.
  4. Checkout opens Flint's hosted checkout, where the buyer chooses delivery, enters a promotion code or gift card, sees tax, and pays.
  5. 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 a redirects.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
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:

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.

  1. Read the shop#

    cURL
    curl https://api.withflintpay.com/v1/shops/shop_01K4MOONRISE/public
    

    Abridged response:

    JSON
    {
      "data": {
        "shop": {
          "shop_id": "shop_01K4MOONRISE",
          "version": 3,
          "name": "Moonrise Bakery",
          "status": "active",
          "url": "https://checkout.withflintpay.com/shop/shop_01K4MOONRISE",
          "currency": "USD"
        },
        "listings": [
          {
            "shop_listing_id": "shl_01K4LISTSOURDOUGH",
            "type": "product",
            "product_id": "prod_01K4SOURDOUGH",
            "name": "Sourdough loaf",
            "price_range": {
              "min_unit_price_money": {"amount": 800, "currency": "USD"},
              "max_unit_price_money": {"amount": 800, "currency": "USD"}
            },
            "compare_at_price_money": null,
            "is_sold_out": false,
            "requires_selection": false,
            "category_handles": []
          }
        ],
        "categories": [],
        "merchant_name": "Moonrise Bakery",
        "show_flint_mark": true,
        "resolution_context": "shrc_v1.example",
        "checkout_start_due_at": "2026-11-25T11:58:00Z",
        "resolution_context_expires_at": "2026-11-25T12:00:00Z"
      }
    }
    

    listings has the listings buyers can buy, in the order you set. It's empty while the shop is inactive or archived, and the response still carries status and inactive_message so your page can say so. Each entry has:

    • price_range, from the lowest to the highest variant price. Both ends are equal when there is one price.
    • compare_at_price_money, for a product with one variant that has a compare-at price.
    • is_sold_out, true when every choice the buyer could make is sold out. It's advisory: it takes no hold, and Flint checks stock again when the buyer pays.
    • requires_selection, true when the buyer must choose a variant or a required modifier before adding. When it's false, resolve accepts the listing with only a quantity.
    • category_handles, matching the handles in categories, for filter chips.

    resolution_context is a private credential for starting this buyer's checkout. Read the shop once for each buyer, keep the context in memory, and keep it out of URLs, logs, analytics, and shared caches. Start checkout before checkout_start_due_at. Both reads send Cache-Control: private, no-store, so don't cache them in a CDN.

  2. Read a listing when the buyer needs to choose#

    cURL
    curl https://api.withflintpay.com/v1/shops/shop_01K4MOONRISE/listings/shl_01K4LISTCROISSANT/public
    

    The response has the summary fields plus description, images, and, for a product, product_options and available_variants. Each variant has its variant_id, name, selected_options, unit_price_money, compare_at_price_money, quantity_price_breaks, image, is_sold_out, and available_modifiers. A bundle has available_modifiers and bundle_components instead. Variants priced in another currency are left out.

    A listing that isn't on the shop, isn't for sale, or belongs to a shop that isn't active returns 404 RESOURCE_NOT_FOUND.

  3. Keep the cart on your page#

    The cart is yours. Hold each line as shop_listing_id, variant_id when the product has more than one variant for sale, quantity from 1 to 9,999, and any modifiers. A cart can have up to 50 lines, and you can repeat a listing with different modifiers.

    To show a subtotal that matches the order, price each line the way Flint does. Use the variant's unit_price_money, or the tier from quantity_price_breaks with the largest minimum_quantity that doesn't exceed the line's quantity, then add modifier prices. A modifier's unit_price_delta_money is multiplied by the modifier's own quantity first when its group has allow_quantities. The group's pricing_scope then decides the rest: a per_item price is multiplied by the line's quantity, and a per_line price is added once. Lines don't combine quantities, and the subtotal leaves out discounts, delivery, tax, and tip, which checkout adds. The server prices everything again when you start checkout, so a changed cart in the browser can only ask for something the shop sells at the price it sells for.

  4. Start the buyer's checkout#

    When the buyer presses Checkout, send the context and the lines with a new, random Idempotency-Key:

    cURL
    curl -X POST https://api.withflintpay.com/v1/shops/shop_01K4MOONRISE/resolve \
      -H "Content-Type: application/json" \
      -H "Idempotency-Key: 04e2e86d-9f39-4dce-9e54-54bc798584ed" \
      -d '{
        "resolution_context": "shrc_v1.example_resolution_context",
        "line_items": [
          {"shop_listing_id": "shl_01K4LISTSOURDOUGH", "quantity": 2},
          {"shop_listing_id": "shl_01K4LISTCROISSANT", "variant_id": "var_01K4ALMOND", "quantity": 4}
        ]
      }'
    

    Flint creates the order and a hosted checkout session and responds with 201 Created:

    JSON
    {
      "data": {
        "checkout_session_id": "cs_01K4MOONRISE7",
        "status": "open",
        "type": "shop",
        "shop_id": "shop_01K4MOONRISE",
        "order_id": "ord_01K4MOONRISE7",
        "expires_at": "2026-11-25T11:44:01Z",
        "url": "https://checkout.withflintpay.com/checkout/cs_01K4MOONRISE7#checkout_token=cklt_v1..."
      }
    }
    

    Open url exactly as returned, and keep its #checkout_token fragment. In a browser, that is one line:

    JavaScript
    window.location.assign(body.data.url);
    

    modifiers on a line uses the shape payment link resolve takes: {"type": "catalog", "modifier_id": "mod_...", "quantity": 1} for a modifier in a group, or {"type": "text", "text": {"modifier_group_id": "mg_...", "value": "Extra hot"}} for a text note. Leave modifiers out for a group's defaults. Send an array, including an empty one, to select exactly what it holds. A resolve can also carry client_reference, which Flint copies to the session and order, and prefill: {"email": "..."}.

    Each call creates a real order and checkout session, so call it when the buyer chooses to check out, not to show prices. Every press with a new cart creates another order, and an unpaid one closes by itself when its session expires. See abandoned checkouts.

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

JavaScript
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 codeWhenWhat to do
429 RATE_LIMIT_EXCEEDEDToo 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_REQUESTThe 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_FOUNDThe 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_REQUESTThe 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_CONFLICTThe 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_ALLOWEDThe 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:

ClassStatus and codeA line fails whenWhat to do
1400 INVALID_REQUESTA 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.
2404 RESOURCE_NOT_FOUNDThe 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.
3409 ACTION_NOT_ALLOWEDA 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.
4409 INVENTORY_INSUFFICIENTA 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 codeWhenWhat to do
409 ACTION_NOT_ALLOWEDA 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_READYThe 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:

Response
{
  "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 with Idempotency-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_MODIFICATION is retryable, and its remediation hint says same_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_at should 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.paid and checkout_session.paid report the sale. Fulfill from order.paid, after you check the order's dispute_status, as the other surfaces do.
  • Orders and checkout sessions from a shop carry shop_id. An order has origin: "shop", a session has type: "shop", and a payment has payment_flow: "shop".
  • GET /v1/orders?shop_id=shop_01K4MOONRISE and GET /v1/checkout-sessions?shop_id=shop_01K4MOONRISE list a shop's orders and checkouts, and GET /v1/orders?origin=shop lists every shop order. Add payment_status=paid to the orders list for sales.
  • shop.created, shop.updated, and shop.archived carry the shop as GET /v1/shops/{shop_id} returns it. A listing change shows as a new version and listing_count. Read the listings route for the list.

An order's data.object from a shop carries fields like these:

JSON
{
  "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#

LimitValue
Shops per environment, not counting archived20
Listings per shop250
Lines per checkout50
Quantity on one line1 to 9,999
add values on one add-to-cart link10
Public reads per shop per IP, per minute1,000
Checkout starts per shop per IP, per minute1,000
Starts per resolution_context, per minute20

Errors#

  • HTTP 409
    The environment already has 20 shops that are active or inactive. Archive one, then create the new shop.
  • HTTP 409
    VERSION_CONFLICTRefresh, then retry
    expected_version on a shop update is stale, or a resolution context is stale. Read the shop again and retry with what it returns.
  • HTTP 409
    configuration_required: a listed product needs a delivery method or a stock source before the shop can be active. remediation.next_actions says what to set.
  • HTTP 400
    A listing is a fee product, a bundle with a gift card, or has no price in the shop's currency (NOT_ALLOWED), or a PATCH of listings or delivery_method_ids has no expected_version (REQUIRED).

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 APIEvery field, route, filter, and error for shops, listings, and the keyless reads.Catalog setupCreate the products and bundles a shop lists.Custom domainsServe shops and checkout from your own hostname.Build a headless storefrontRun your own checkout or customer account behind a shop's orders.

Was this helpful?