Skip to content

Payment links

A payment link is a checkout URL you create once and share with any number of buyers: in an email, on a pricing page, behind a QR code, or in a social bio. Each buyer who opens it gets their own checkout and their own order, so one link can take one payment or thousands. You don't write frontend code or make an API call for each buyer.

UseWhen
Payment linkAnyone with the URL can buy the same offer.
Checkout sessionYour app has a specific order for a specific buyer and sends them to pay it now.
InvoiceA known customer owes a known amount, with a due date, reminders, and a PDF.

Payment links vs checkout sessions vs invoices compares the three in detail. If a site without a backend used Stripe's redirectToCheckout, Stripe redirectToCheckout removed explains why it stopped working and how a payment link replaces it.

A payment link from creation to fulfillmentResponse
Your backendFlintBuyer1. create the payment link, oncethe link and its url2. open the url and continue3. create an order and checkout4. payconfirmation or your success URL5. order.paid webhook
  1. Your backend sends 1. create the payment link, once to Flint
  2. Flint returns the link and its url to Your backend
  3. Buyer sends 2. open the url and continue to Flint
  4. Flint sends 3. create an order and checkout to Flint
  5. Buyer sends 4. pay to Flint
  6. Flint returns confirmation or your success URL to Buyer
  7. Flint sends 5. order.paid webhook to Your backend
  • A link is a template, not a sale. In step 3, Flint creates a new order with origin: "payment_link" and a checkout session with the link's payment_link_id. You fulfill, refund, and report on each order, not on the link.
  • The link's metadata is copied to every order. Tag a link with "campaign": "spring_drop" when you create it, and every order it produces carries that tag. A subscription signup keeps the link ID and campaign metadata. Renewal orders copy the original campaign, and the link's collected totals include their paid amounts.
  • Changes apply to checkouts that start afterward. A buyer already in checkout keeps the items and prices they started with. Deactivating the link closes its open, unpaid checkouts; payments already in progress can finish.

You need a test API key with the checkouts.payment_links.write scope. Reading and listing links needs checkouts.payment_links.read, which the write scope includes.

A standard link needs name and line_items. A subscription signup link sends subscription_plan_id instead of line_items, and a donation link sends payment_link_type: "donation" and no line_items. Sending name alone returns 400 INVALID_REQUEST with detail REQUIRED and param: line_items. This link sells a $35 t-shirt and lets each buyer take up to five:

cURL
curl -X POST https://api.withflintpay.com/v1/payment-links \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Idempotency-Key: payment-link-spring-tee-001" \
  -d '{
    "name": "Spring drop: Limited Tee",
    "description": "Limited release t-shirt",
    "line_items": [{
      "type": "custom_fixed",
      "key": "tee",
      "name": "Limited Tee",
      "unit_price_money": {"amount": 3500, "currency": "USD"},
      "allow_quantity_adjustment": true,
      "min_quantity": 1,
      "max_quantity": 5
    }],
    "buyer_fields": {"require_email": true},
    "redirects": {
      "success_url": "https://example.com/thanks",
      "cancel_url": "https://example.com/shop"
    },
    "metadata": {"campaign": "spring_drop"}
  }'

Flint responds with 201 Created. Abridged:

Response
{
  "data": {
    "payment_link_id": "pl_01K4SPRINGTEE",
    "url": "https://checkout.withflintpay.com/pay/pl_01K4SPRINGTEE",
    "status": "active",
    "payment_link_type": "standard",
    "version": 1,
    "completed_count": 0,
    "name": "Spring drop: Limited Tee",
    "line_items": [{
      "payment_link_line_item_id": "plli_01K4TEE",
      "key": "tee",
      "name": "Limited Tee",
      "quantity": 1,
      "unit_price_money": {"amount": 3500, "currency": "USD"},
      "allow_quantity_adjustment": true,
      "min_quantity": 1,
      "max_quantity": 5,
      "is_catalog_item_unavailable": false
    }],
    "metadata": {"campaign": "spring_drop"}
  }
}

The link takes payments as soon as Flint returns it. Save payment_link_id to manage the link later, and share url exactly as returned. In live mode, if you've set up a custom checkout domain, url uses it.

  • Amounts are integers in the currency's minor unit, so 3500 is $35.00.
  • Idempotency-Key is optional on create. If the response is lost, retrying with the same key returns the original link instead of creating a second one. See Idempotency.
  • key names the line item in checkouts you start from code and on every order line item the link creates. Without one, Flint assigns line_item_1, line_item_2, and so on, in order. Set your own keys so they read well in your reports.
  • Settings you leave out come from your checkout settings when each checkout starts: payment methods, tips, tax, promotions, and how long a checkout stays open. To keep a link's total fixed whatever those settings are, set "tip": {"enabled": false} and "tax": {"enabled": false} on it.

Price each line item#

Each line item gets its price in one of three ways:

Send type custom_fixed with name and unit_price_money. Nothing needs to exist in your catalog first.

JSON
{
  "type": "custom_fixed",
  "key": "tee",
  "name": "Limited Tee",
  "unit_price_money": {"amount": 3500, "currency": "USD"}
}

A custom line can also send product_type, one of physical, digital, service, or fee. It tells Flint what kind of sale the line is, which decides whether a buyer can pay by ACH debit. Leave it out and the line is unclassified, so that order takes card only unless a physical or digital line sits beside it. Catalog lines take their type from the product.

Quantity works the same way for all three. quantity is what the buyer starts with, 1 by default. allow_quantity_adjustment lets the buyer change it between min_quantity and max_quantity, which can each be 1 to 9,999. A buyer can't lower a line item on a standard link to zero; only event tiers can be skipped.

Let buyers choose a variant#

Send variant_ids instead of variant_id to sell one product in several sizes or colors on a single line item. The checkout page shows a control for each of the product's options. The buyer's order gets an ordinary line for the variant they pick, with that variant's price, selected_options, tax, and delivery requirement.

This link offers three sizes of a tee, opens with medium selected, and routes stock from one location. The tee's variants are physical, so the link needs a delivery method, or it returns 409 ACTION_NOT_ALLOWED. A new account has none, so create a delivery method first and send its ID in delivery_method_ids, as the sample does. You can set settings.checkout.default_delivery_method_ids instead; Configure delivery and inventory before sharing describes both:

cURL
curl -X POST https://api.withflintpay.com/v1/payment-links \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Idempotency-Key: payment-link-classic-tee-001" \
  -d '{
    "name": "Classic tee",
    "line_items": [{
      "type": "variant",
      "key": "tee",
      "variant_ids": ["var_01K4TEESMALL", "var_01K4TEEMEDIUM", "var_01K4TEELARGE"],
      "default_variant_id": "var_01K4TEEMEDIUM",
      "quantity": 1,
      "allow_quantity_adjustment": true,
      "max_quantity": 5
    }],
    "delivery_method_ids": ["dmet_01K4STANDARD"],
    "inventory_routing_source": {"type": "fixed_location", "location_id": "loc_01K4WAREHOUSE"}
  }'

The line item in the response, abridged. The variant IDs come back in the order you sent them, and product_id names the product they belong to:

Response
{
  "payment_link_line_item_id": "plli_01K4CLASSICTEE",
  "key": "tee",
  "variant_ids": ["var_01K4TEESMALL", "var_01K4TEEMEDIUM", "var_01K4TEELARGE"],
  "default_variant_id": "var_01K4TEEMEDIUM",
  "product_id": "prod_01K4CLASSICTEE",
  "resolved_name": "Classic tee",
  "resolved_price_range": {
    "min_unit_price_money": {"amount": 2400, "currency": "USD"},
    "max_unit_price_money": {"amount": 2600, "currency": "USD"}
  },
  "quantity": 1,
  "allow_quantity_adjustment": true,
  "max_quantity": 5,
  "is_catalog_item_unavailable": false
}

A line item has one source: variant_id, variant_ids, bundle_id, or an ad hoc name and price. These rules apply to variant_ids:

  • The list. Send 1 to 100 unique var_ IDs. All must be variants of one product, active and available for sale when you save, and priced in one currency. Flint keeps the order you send. Flint doesn't offer "all variants" as a setting, so list every variant you want to sell and add new ones with a PATCH.
  • The default. default_variant_id is optional and must be one of variant_ids. Without it, no variant is selected when the page opens and the buyer must choose. It's allowed only with variant_ids. A PATCH replaces line_items as a whole, so a line you send back without default_variant_id has none. When a checkout start doesn't pick a variant for a line that has a default, Flint uses the default.
  • Everything else on the line. quantity, allow_quantity_adjustment, min_quantity, max_quantity, and key apply to whichever variant the buyer picks. The catalog owns the name, description, price, and tax, as for a variant_id line.
  • One variant per line. A buyer who wants a small and a medium checks out twice, or you add the product as two line items.
  • Standard links only. An event link refuses variant_ids, and donation and subscription signup links have no line items.
  • Stock. If any listed variant tracks inventory, the link needs an inventory_routing_source, the same as a variant_id line, unless settings.inventory.default_routing_source supplies one. Inventory covers how stock is checked and held.

When you read the link, the line returns these fields:

  • resolved_name is the product name, without a variant label.
  • resolved_unit_price_money is omitted, because no single price describes the line. resolved_price_range gives the lowest and highest current price across the listed variants that can be sold now in the line's currency. It's omitted when none can be.
  • is_catalog_item_unavailable is true when none of the listed variants can be sold: the product is inactive or archived, or every listed variant is.

payment_link.created and payment_link.updated carry the same line. The order a buyer's checkout creates has an ordinary variant line, with variant_id, product_id, selected_options, and payment_link_line_item_key, so order webhooks, fulfillment, and refunds work as for any catalog line.

When the catalog changes.

  • A listed variant that becomes inactive or archived drops out of what buyers can choose, and a checkout that picks it is refused. The link keeps selling the others. If it was the default, the page opens with nothing selected. variant_ids still lists its ID.
  • Flint blocks deactivating or archiving a variant only when that would leave a variant_ids line on an active link with no active listed variant. The request returns 409 RESOURCE_IN_USE, and details[0].blocking_resources lists the payment_link. A variant on a variant_id line is blocked as before. Deactivating or archiving the product is blocked while an active link has a variant_ids line for it.
  • Price changes apply to the next read and checkout start, as for variant_id lines.
  • Stock doesn't change the link. A sold-out variant is flagged in the public read, and buyers can still choose the others. When every listed variant is sold out, the line's is_sold_out is true, which makes the link sold out too (see Sold-out state).

Use url wherever a buyer can tap or scan it: buy buttons and pricing pages, email and SMS campaigns, QR codes on packaging and posters, social bios, and support conversations. In test mode the URL opens a checkout that takes test cards.

The URL never changes. When an offer has to end at once for everyone, such as a price change mid-campaign, create a new link and deactivate the old one rather than editing it. Buyers who open the old URL see your inactive_message.

Add client_reference to carry your buyer or cart reference and prefill_email to fill in the next step's email field:

Text
https://checkout.withflintpay.com/pay/pl_01K4SPRINGTEE?client_reference=cart_1842&prefill_email=ada%2Btag%40example.com

URL-encode each value. A bare + in a query string reads as a space, so encode a literal + as %2B, as in the example's ada+tag@example.com. client_reference is an opaque string of 1 to 255 characters, preserved exactly, including spaces and case. Flint copies it to the checkout session and order. Anyone with the URL can change both parameters, so the reference is a claim, not proof of identity. Validate it against your own records before crediting an account. The hosted page drops an empty or over-long reference, a reference containing a NUL character, and a malformed email, and writes a browser console warning that names the parameter. Checkout continues without that value. A resolve request that carries an invalid value returns an error instead.

The prefilled email is editable and unverified. It sets no customer_id, shows no saved customer details, and never links a purchase to an existing customer. Checkout doesn't look the address up or send it a code when the page opens, so opening a link reveals nothing about whether that address has saved details. The order and its payments use the email the buyer submits, which may differ from the prefill.

A link's type decides what the buyer sees before checkout. Set it when you create the link; it can't change afterward.

LinkCreate it withThe buyer sees
Standardline_itemsEach item, with a quantity picker where you allow one
Donationpayment_link_type: "donation"An amount picker
Eventpayment_link_type: "event" and line_items as ticket tiersThe date, venue, and a count for each tier
Subscription signupsubscription_plan_id instead of line_itemsThe plan's recurring price and terms

Take donations#

A donation link asks for one amount. Configure it with the top-level donation fields, not line_items:

cURL
curl -X POST https://api.withflintpay.com/v1/payment-links \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Idempotency-Key: payment-link-annual-fund-001" \
  -d '{
    "name": "Annual Fund",
    "payment_link_type": "donation",
    "donation_suggested_amount_money_options": [
      {"amount": 2500, "currency": "USD"},
      {"amount": 10000, "currency": "USD"},
      {"amount": 50000, "currency": "USD"}
    ],
    "donation_min_amount_money": {"amount": 500, "currency": "USD"},
    "metadata": {"fund": "annual_2026"}
  }'
  • Flint creates the line item. It has the key donation and the link's name as its label. Sending line_items returns 400 INVALID_REQUEST with detail code NOT_ALLOWED.
  • Amounts. Offer up to three suggested amounts, each within donation_min_amount_money and donation_max_amount_money when you set them. Use the same supported currency for the minimum, maximum, and suggested amounts. Flint currently supports USD. An unsupported currency returns 400 INVALID_REQUEST and names the field on create or update. On update, a supported currency that conflicts with a retained amount returns 400 INVALID_REQUEST with detail code NOT_ALLOWED on the submitted field. A maximum must be greater than zero and at least the minimum. A zero minimum is allowed. Omit the maximum on create or send null on update for no upper limit. A maximum outside the range returns 400 INVALID_REQUEST with detail code INVALID_VALUE on donation_max_amount_money.
  • No tips, tax, or promotions. Flint turns them off. Sending "enabled": true for any of them, or a tax.calculation, returns 400 INVALID_REQUEST with detail code NOT_ALLOWED.
  • A thank-you page. Without a redirects.success_url, donors land on Flint's thank-you page after paying.

Donation receipts. Set a receipt note in Dashboard under Settings → Buyer account and emails → Receipts. Set the organization's legal name and EIN under Settings → Invoices → Tax identity. For the API, read the current version with GET /v1/settings, then send settings like these to PATCH /v1/settings:

Response
{
  "expected_version": 3,
  "receipts": {
    "footer_text": "No goods or services were provided in exchange for this contribution."
  },
  "tax_identity": {
    "legal_name": "Example Community Fund",
    "tax_ids": [
      {"country": "US", "identifier_type": "ein", "value": "12-3456789"}
    ]
  }
}

Use your own acknowledgment and tax details. Sending tax_ids replaces the entire list. Keep any existing entries you still use, including their document_tax_id values. The note and seller identity appear on payment receipt emails and PDFs. See receipt notes and seller identity for how Flint handles resends and earlier orders.

Monthly gifts. Donation links collect a single gift. For monthly giving, create a monthly subscription plan for each amount you offer. Create a subscription signup link for each plan by passing its subscription_plan_id. Set plan change options if donors should be able to switch amounts in their buyer account.

Campaign totals. Open the donation link in Dashboard to see Raised. To list its orders through the API, call GET /v1/orders?payment_link_id=YOUR_PAYMENT_LINK_ID.

Sell event tickets#

Price each tier per admission: each purchased unit issues one ticket and uses one place. Event tiers reject catalog bundles and variants with component quantities with a 400 naming the line item field. To sell two admissions, use a tier priced per ticket and let the buyer select a quantity of two.

An event link sells ticket tiers that share a capacity. Its page shows the event's date and venue and a count for each tier. For the whole ticket workflow, from QR codes to check-in staff, door scanners, and refunds, see Sell event tickets with QR code check-in.

cURL
curl -X POST https://api.withflintpay.com/v1/payment-links \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Idempotency-Key: payment-link-spring-gala-001" \
  -d '{
    "name": "Spring Gala",
    "payment_link_type": "event",
    "event_config": {
      "event_at": "2027-05-12T23:00:00Z",
      "timezone": "America/New_York",
      "venue": "Pier 57, New York",
      "max_total_quantity": 500,
      "ticket_prefix": "GAL",
      "send_ticket_emails": true
    },
    "line_items": [
      {
        "type": "custom_fixed",
        "key": "general",
        "name": "General Admission",
        "unit_price_money": {"amount": 7500, "currency": "USD"}
      },
      {
        "type": "custom_fixed",
        "key": "vip",
        "name": "VIP",
        "unit_price_money": {"amount": 20000, "currency": "USD"},
        "max_quantity": 4,
        "max_total_quantity": 20
      }
    ]
  }'

Checkout shows this event as "Wed, May 12, 2027, 7:00 PM EDT (New York time)".

  • Time zone. event_at and timezone are required to create an event link. event_at is an RFC 3339 timestamp, and timezone is an IANA name. Flint shows the event in that time zone at checkout and in ticket emails.

  • Sales end. Ticket sales close at event_at unless you set sales_end_at, for example to stop sales an hour before doors open or to keep selling during the event. See Control availability.

  • Tiers. Each tier starts at 0 and lets the buyer choose up to max_quantity, 10 by default. The buyer can skip tiers but must choose at least one ticket. A tier with min_quantity above 10 needs an explicit max_quantity.

  • Capacity. event_config.max_total_quantity caps tickets across all tiers. Starting payment holds the buyer's tickets until the payment succeeds or fails, and those held tickets count against the cap. Opening checkout doesn't hold tickets, so a buyer can reach the payment step and find too few left. When 20 or fewer tickets remain, the page shows how many are left. The link's total_quantity_sold counts tickets sold.

  • Changing capacity. You can raise event_config.max_total_quantity at any time, or send null to remove the limit. Lowering it below the tickets already sold or held returns LIMIT_EXCEEDED. ticket_prefix can't change after the first ticket is issued.

  • Tickets. After paying, the buyer lands on a ticket confirmation page. Your redirects.success_url, if set, becomes its Continue button. Checkout always asks event buyers for their email. With send_ticket_emails, Flint also emails their tickets. Ticket numbers are ticket_prefix, up to five characters, followed by a three-digit sequence: GAL001, GAL002. Flint issues the numbers after the payment succeeds. Read them from the order's ticketed_event.ticket_numbers; ticketed_event.ticket_status is pending until they exist. Each number is also a ticket record with its own ID.

  • Attendee names. Set event_config.collect_attendee_names to true to name every ticket. In the Dashboard, turn on Collect attendee names in the link's event settings. Hosted Checkout then shows a name field for each ticket, grouped by ticket type, and won't continue until each has a name. If you build your own checkout, resolving the link requires attendee_names: one name per ticket, in line_items order, skipping tiers the buyer didn't choose. For 2 General Admission tickets and 1 VIP ticket, send the 2 General Admission names, then the VIP name. Flint trims each name, which must then be 1 to 200 characters. A missing list returns 400 with param attendee_names; a list with the wrong count returns INVALID_VALUE at attendee_names, and a name that is empty or too long returns INVALID_VALUE at its own position, such as attendee_names[1]. When the setting is off, you can still send attendee_names if you collect names yourself; Flint validates them the same way. When the payment succeeds, Flint copies each name to its ticket's attendee_name. Names never appear in order or checkout metadata. If the order's ticket count changed after resolve, Flint still issues the tickets, with attendee_name set to null.

  • Tier capacity. Set a tier's line_items[].max_total_quantity to cap its admissions across all orders. For a 200-seat show with 20 VIP places, set event_config.max_total_quantity to 200 and the VIP tier's max_total_quantity to 20. max_quantity still limits one order. Each payment reserves both the tier and show capacity. A tier cap must be at least 1 and cannot exceed the show cap when one is set.

  • Tier availability. The public read includes remaining_quantity and is_sold_out on each event tier. Flint subtracts tickets sold and held by payments in progress from the tier and show limits, and returns the lower remainder. It is absent when neither limit is set. A payment that cannot fit its tier returns 409 INVENTORY_INSUFFICIENT, with the tier key in the message and requested and available quantities. Voiding a ticket or fully refunding an order releases its tier capacity as well as its show capacity.

  • Changing a tier cap. Replace line_items, retaining each tier's payment_link_line_item_id and sending expected_version. Omit a tier's max_total_quantity to remove its cap. Lowering a cap below tickets sold or held returns LIMIT_EXCEEDED. Keep the tier's payment_link_line_item_id to rename its key. Tickets and reserved capacity follow that ID. Some earlier purchases were tracked by key. If those tickets or payments in progress still use the old key, changing it returns 400 INVALID_REQUEST with detail NOT_ALLOWED until those admissions are released.

Reschedule an event#

Change event_config.event_at, timezone, or venue with PATCH /v1/payment-links/{payment_link_id}. Existing orders' ticketed_event, buyer tickets, and ticket emails use the new details. Ticket numbers and admission codes stay valid. Each affected order sends order.updated, with the former event details in data.previous_attributes.ticketed_event.

Flint emails each order's ticket holder by default, even when send_ticket_emails is off. To handle notices yourself for one update, include "notify_ticket_holders": false in that PATCH. Omitting it on a later update restores notifications. Repeating unchanged event details sends no notice. Voided tickets receive no change notice.

Response
{
  "event_config": {
    "event_at": "2027-05-14T23:00:00Z",
    "timezone": "America/New_York",
    "venue": "Lantern New Hall"
  },
  "notify_ticket_holders": true
}

To cancel a show, deactivate its link to stop new sales and refund its orders. A ticketed order's refund email names the event and its date. Deactivating a link alone does not refund tickets or send a cancellation notice.

Read individual tickets#

Flint creates one ticket for each ticket the buyer purchased, at the same moment it issues the numbers. A ticket has its own ticket_id with the tkt_ prefix, and you can read it without knowing its order. Use the tickets API with a key that has commerce.tickets.read, or commerce.tickets.write to change tickets; neither scope includes access to orders or refunds.

FieldMeaning
ticket_id, versionThe ticket's ID and a counter that increases on every change.
order_id, payment_link_id, order_line_item_idThe order, the event link, and the ticket tier that was purchased.
tier_nameThe name of the ticket tier the buyer purchased, when available.
ticket_numberThe number printed for the buyer, such as GAL001. Numbers are never reused, and a number alone doesn't admit anyone.
statusissued, checked_in, or voided. voided is final.
supported_actionsThe actions the ticket accepts now: check_in and void while issued, undo_check_in and void while checked_in, and none once voided.
attendee_nameThe attendee's name, or null. Set or clear it with PATCH /v1/tickets/{ticket_id}.
checked_in_at, check_in_methodWhen and how the ticket was admitted. null unless status is checked_in.
voided_atWhen the ticket was voided. null unless status is voided.
admission_code_last4The last four characters of the ticket's admission code.

An admission code is a secret that identifies one ticket. Merchant reads, lists, and webhooks never include it. Only the ticket's buyer gets the full code, and only where they proved themselves. The paid checkout session's own paying credential reads it on its order's tickets; a checkout link you read from the checkout session, or request after payment, doesn't. GET /v1/me/tickets returns it to a buyer whose email Flint verified, by signing in to Flint's hosted account or through the paid checkout, on orders whose buyer_email is that email. Ticket and receipt emails sent to the order's buyer_email, with no one copied, show each valid ticket's code with a QR code that holds it. Access links, customer sessions and checkout links you create never carry codes, and a receipt you send to another address lists the ticket numbers without them. To deliver tickets from your own pages, issue a code with rotate-code. Flint doesn't log it, and it stays out of URLs and filters, so look a ticket up by sending the code in a request body.

  • GET /v1/tickets/{ticket_id} returns one ticket.
  • GET /v1/tickets lists tickets, newest first. Filter by payment_link_id, order_id, status (one or several values), and checked_in_after or checked_in_before. query matches part of the ticket number, the attendee name, the buyer's name, or the buyer's email, ignoring case. Set sort_by to created_at (the default) or attendee_name, and sort_direction to asc or desc. expand=order adds an order summary and also requires commerce.orders.read. See Pagination.
  • POST /v1/tickets/lookup returns the ticket for the admission_code in the request body, whatever its status. Flint accepts the code in lowercase, with spaces or hyphens, and reads O as 0 and I or L as 1. A code that isn't 16 valid characters returns 400 INVALID_REQUEST with detail code INVALID_VALUE, and a code that matches no ticket in the key's environment returns 404 RESOURCE_NOT_FOUND, both with param set to admission_code. A code from another merchant, or from the other environment, is not found.
cURL
curl "https://api.withflintpay.com/v1/tickets?payment_link_id=pl_01K4GALA&status=issued&sort_by=attendee_name&sort_direction=asc" \
  -H "Authorization: Bearer YOUR_API_KEY"

Check in and void tickets#

A key with commerce.tickets.write runs the door. To scan from the Dashboard or give staff check-in-only access, see Run the door.

  • POST /v1/tickets/{ticket_id}/check-in admits an issued ticket once. Send the scanned admission_code to confirm it belongs to the ticket, or no code to check the ticket in by hand. A repeated or concurrent check-in returns 409 ACTION_NOT_ALLOWED with reason already_applied and current_status: checked_in, and a wrong code returns 400 INVALID_REQUEST with detail code INVALID_VALUE without changing the ticket.
  • POST /v1/tickets/{ticket_id}/undo-check-in returns a checked-in ticket to issued.
  • POST /v1/tickets/{ticket_id}/void permanently voids a ticket and frees its seat: total_quantity_sold drops by one, as it does for a refund, and the link's version doesn't change. Voiding refunds nothing and doesn't change the order's ticketed_event.
  • POST /v1/tickets/{ticket_id}/rotate-code replaces the ticket's admission code and returns the new one in admission_code. If you send your own tickets with send_ticket_emails off, use it to get each ticket's code.

A voided ticket refuses every other change with reason unsupported_state; voiding it again returns already_applied. See Tickets for the codes, versions, and retries.

Flint sends ticket.created when it issues a ticket, ticket.checked_in when one is checked in, ticket.voided when you or a full refund void one, and ticket.updated for other changes, such as an attendee name edit, an undone check-in, or a replaced code. Every event carries the ticket as a read returns it, without the code.

Sell event tickets on your own page#

Event links are the only way to issue tickets, so a venue that renders its own ticket page still starts from the link. Resolving the link returns a hosted session, and that session's cklt_ launch token is a credential only for Flint's hosted page. Used as a buyer credential on your own page, it returns 403 FORBIDDEN with reason checkout_launch_token_restricted, and creating a headless session for the resolved order returns 409 ALREADY_EXISTS, because the hosted session is open. Replace the hosted session with a headless one from your backend instead:

  1. Read the public link, then resolve it with the buyer's tier quantities, as in Start checkout from your own page. Call resolve from your backend so the order and session IDs come from Flint's response, not from the browser. If the link collects attendee names, send attendee_names in the same request. Resolving for every buyer from one backend shares its outbound IP budget: 1,000 reads and 1,000 resolves per link per rolling minute. Keep a separate resolution_context per buyer; each context allows 20 resolves per minute. Pace a busy on-sale within these rate limits and honor Retry-After on 429.

    cURL
    curl -X POST https://api.withflintpay.com/v1/payment-links/pl_01K4GALA/resolve \
      -H "Content-Type: application/json" \
      -H "Idempotency-Key: 6f1d0c7e-2b8a-4c55-9d1e-3a7b5e2c9a10" \
      -d '{
        "resolution_context": "plrc_v1.example_resolution_context",
        "quantity_overrides": {"general": 2}
      }'
    

    Keep data.checkout_session_id and data.order_id. Discard data.url and never send it to the buyer: opening it would start the hosted checkout you are about to replace.

  2. Replace the hosted session with a headless session

    With your API key, create a session for the resolved order and name the hosted session in replace_checkout_session_id:

    cURL
    curl -X POST https://api.withflintpay.com/v1/checkout-sessions \
      -H "Authorization: Bearer YOUR_API_KEY" \
      -H "Idempotency-Key: gala-tickets-cart-123" \
      -H "Content-Type: application/json" \
      -d '{
        "type": "order",
        "order_id": "ord_01K4GALA2",
        "surface": "headless",
        "replace_checkout_session_id": "cs_01K4GALA2",
        "page_origin": "https://tickets.example.com"
      }'
    

    The response is a headless session with a checkout_auth_token that starts with ckat_. Keep it on your backend, as Build your own checkout describes. The hosted session becomes invalidated with terminal_reason: "superseded", so a buyer who has its URL can no longer pay in it. The link's checkout settings, such as prefill, payment methods, tip, and expiration, apply only to the hosted session, so send what you need on this create request. Save the buyer's email on the session as they type it, as Build your own checkout describes, so Flint can email their tickets. If the buyer already started paying in the hosted session, the call returns 409 ACTION_NOT_ALLOWED with reason in_progress. Wait for that payment to resolve: if it succeeds the order is paid and needs no replacement, and if it fails, retry the replacement.

  3. Take the payment and read the codes

    Collect the card and pay the order with the checkout credential, as Start the payment describes. After the payment succeeds, Flint issues the tickets, and the same credential lists them:

    cURL
    curl "https://api.withflintpay.com/v1/tickets?order_id=ord_01K4GALA2" \
      -H "Authorization: Bearer ckat_1kmn0aExample"
    

    Each ticket that isn't voided carries its admission_code, so your page can show the code or a QR code that holds it. The list accepts only order_id; any other filter, search, sort, or expand is refused, and another order's ID returns 403. If the list is empty right after payment, read the order again: its ticketed_event.ticket_status is pending until the tickets exist. Merchant API keys never receive admission codes, and a credential taken from a checkout link you read or request after payment doesn't either, so keep the ckat_ credential from the create response. Admission codes covers the other ways to deliver them.

The sale counts the same as a hosted one. The link's completed_count, total_quantity_sold, and sales summary include it, and its order keeps origin: "payment_link" and payment_link_id. The headless session itself has type: "order" and no payment_link_id, so list a link's sales with GET /v1/tickets?payment_link_id=... or through its orders, not through its checkout sessions.

Send subscription_plan_id instead of line_items, and the link becomes a signup page for a subscription plan. Each completed checkout starts a subscription for that buyer:

cURL
curl -X POST https://api.withflintpay.com/v1/payment-links \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Idempotency-Key: payment-link-coffee-club-001" \
  -d '{
    "name": "Coffee club signup",
    "subscription_plan_id": "plan_01K4COFFEE",
    "metadata": {"channel": "pricing_page"}
  }'

Create one link per plan and use it everywhere that plan is sold, such as pricing pages and upgrade prompts. The plan must be active: an inactive or archived plan returns 409 ACTION_NOT_ALLOWED with reason archived or unsupported_state. While the link is active, the plan can't be set to inactive or archived. The link reports payment_link_type: "standard" with its subscription_plan_id, and you can't add line_items to it later.

The buyer's email decides which customer owns the subscription only when no customer has that email: Flint then creates one. When the email belongs to an existing customer, the buyer confirms it with a six-digit code Flint emails them before checkout takes payment or saves the card, and hosted checkout shows that step. The buyer enters the code, then presses Pay again; their payment details are kept. A typed or prefilled email never attaches a subscription to an existing customer without that verification. To sign up a known customer without a code, create a checkout session for them with customer_id instead of sharing the link. When nothing is due at signup, such as a free trial without a setup fee, checkout saves the card without charging it. Tips are off on signup links unless you turn them on. Subscription billing covers plans, trials, and renewals.

Ask buyers questions#

Custom fields add your own questions to the link's page: a shirt size, a meal choice, an accessibility note. Each field has a custom_field_type of text, textarea, dropdown, or checkbox, and works on every link type.

A checkbox answer in custom_field_values must be "true" or "false". A required checkbox must be checked, with an answer of "true". Flint's hosted checkout sends "false" for an optional box the buyer leaves unchecked.

cURL
curl -X POST https://api.withflintpay.com/v1/payment-links \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Idempotency-Key: payment-link-workshop-001" \
  -d '{
    "name": "Letterpress Workshop",
    "line_items": [{
      "type": "custom_fixed",
      "key": "seat",
      "name": "Workshop seat",
      "unit_price_money": {"amount": 12000, "currency": "USD"}
    }],
    "custom_fields": [
      {
        "key": "experience_level",
        "label": "Experience level",
        "custom_field_type": "dropdown",
        "required": true,
        "options": ["Beginner", "Intermediate", "Advanced"]
      },
      {
        "key": "accessibility_needs",
        "label": "Accessibility needs",
        "custom_field_type": "textarea",
        "placeholder": "Optional",
        "max_length": 500
      }
    ],
    "metadata": {"campaign": "fall_workshops"}
  }'

Flint records the answers on the order, and on its checkout sessions, in custom_field_answers. Each answer keeps the field's payment_link_custom_field_id, key, label, and custom_field_type from when checkout started, so editing or removing a field later doesn't change answers already recorded. value is a string for text, textarea, and dropdown answers, and true or false for checkbox answers:

Response
{
  "metadata": {"campaign": "fall_workshops"},
  "custom_field_answers": [
    {
      "payment_link_custom_field_id": "plcf_01K4W8TSHRTS2ZEQ7XN5V3D2JA",
      "key": "experience_level",
      "label": "Experience level",
      "custom_field_type": "dropdown",
      "value": "Beginner"
    }
  ]
}

Answers come in the order the link shows its fields. Optional fields the buyer left blank are left out. Answers are read-only and returned only to merchant credentials, including webhook delivery; buyers never see them in API responses. Deleting the customer removes them. Orders created before Flint recorded answers in custom_field_answers return an empty list and keep their answers in metadata as custom_field_<key>; Flint doesn't rebuild them from the link, because its questions may have changed since.

The buyer can't continue to payment without answering a required field. Answers don't use the order's metadata space, so each field has its own limits:

LimitValue
Custom fields on a link20
Field key243 characters, no leading or trailing spaces
text answer255 characters by default; set max_length from 1 to 4,096
textarea answer1,000 characters by default; set max_length from 1 to 4,096
dropdown option4,096 characters
Link metadata pairs44, because Flint uses 6 of an order's 50 metadata pairs
Link metadata and Flint's metadata32,768 bytes

Custom fields don't count toward the two metadata limits. If a link goes over a limit, Flint rejects it with 400 INVALID_REQUEST and detail code INVALID_VALUE. Remove fields, shorten them, or trim metadata.

On update, these limits apply to the link after Flint merges your changes. The metadata object you send in a PATCH is also limited before merging: at most 50 keys, counting null deletions, each key up to 256 characters, and 32,768 bytes of keys plus values.

Configure delivery and inventory before sharing#

Creating a link, activating it, or editing its line_items, delivery_method_ids, or inventory_routing_source checks that the current configuration allows checkout. Missing or incompatible delivery configuration, or a routing source with no location that permits inventory allocation, returns 409 ACTION_NOT_ALLOWED with reason configuration_required and retry none.

Set delivery_method_ids on the link or settings.checkout.default_delivery_method_ids to cover each item's delivery profile. Pickup-only profiles need a pickup method; digital or service fulfillment resolved without a checkout choice needs no delivery method. A bundle must cover every component that requires a delivery choice. A variant_ids line remains usable when at least one offered variant has compatible configuration.

A method you add to delivery_method_ids must be usable now. If its revision, the rate callback revision or signing key it prices with, or a Location address it uses is revoked, the write returns 409 ACTION_NOT_ALLOWED with reason dependency_revoked before the configuration checks, and details[0].blocking_resources names the method and what holds the revoked part. Methods the link already lists stay on it; buyers see them as unavailable until you publish a corrected revision.

Every required line must have a usable option. Event buyers can skip adjustable tiers, so an unusable optional tier does not block these writes when another tier can be checked out. A link whose every permitted selection is unusable is refused.

Tracked goods also need an inventory_routing_source with at least one active location whose inventory_allocation_enabled is true. Untracked and ad hoc items need no allocation check. Temporary stock shortages do not prevent creating or editing the link; stock is checked again when a buyer starts checkout.

Read details[0].resource_type and resource_id to find the blocking configuration, and follow remediation.next_actions when a separate write is required. Clearing delivery_method_ids uses the checkout defaults and fails if those defaults cannot cover delivery. You can still rename, edit metadata, or deactivate a link that needs configuration.

For a pinned inventory policy revision, enable allocation at an active location in that revision or change the link's inventory_routing_source, for example to the current policy revision. Publishing a new policy revision does not change the link's pin.

Customize the checkout page#

Every setting can be sent on create and changed later. The API reference describes each field.

AreaFieldsWhat it controls
Brandingtheme.title, theme.primary_color, theme.accent_color, imageThe page title, colors, and a product or campaign image. A color you leave out comes from your checkout branding settings.
Copydescription, custom_text.order_summary_messageText beside the offer and in the order summary.
Payment methodspayments.enabled_payment_options, payments.payment_noteWhich of card, apple_pay, google_pay, affirm, and ach_debit the page offers, from those your settings allow, and a note near the pay button.
Buyer detailsbuyer_fields.require_email, buyer_fields.require_phone, buyer_fields.require_billing_address, buyer_fields.address_autocomplete_enabledWhether checkout requires the buyer's email, phone number, or billing address, and whether address entry suggests addresses. A field you leave out follows your checkout settings.
Tipstip.enabled, tip.tip_percent_options, tip.smart_tips_enabledThe tip prompt. Percent options are exactly three values from 1 to 100, and a preselected percent must be one of them. Fixed amounts share one currency; a checkout shows only those in its own currency.
Taxtax.enabled, tax.calculationWhether checkout calculates tax, and how: {"mode": "automatic"}, or {"mode": "external", "components_source": "callback"} to ask your tax calculation callback for each checkout's order. External tax needs components_source: callback. Without calculation, checkouts follow tax.default_calculation in settings, where a provided default means automatic. On update, "calculation": null clears it. A subscription plan link's subscriptions copy the tax the link sets; without it they follow settings.
Promotionspromotion_config.automatic_enabled, promotion_config.codes_enabledAutomatic promotions, and whether the page shows promotion code entry.
Deliverydelivery_method_idsThe delivery methods offered for physical catalog items. Without a list, the link uses your checkout default.
Legallegal.terms_of_service_url, legal.require_terms_of_service, legal.refund_policy_url, legal.shipping_policy_urlPolicy links, and whether the buyer must agree to your terms.
Redirectsredirects.success_url, redirects.cancel_url, redirects.expired_urlWhere the buyer goes after paying, after leaving, and after their checkout expires. Flint adds checkout_session_id and order_id query parameters to the success URL.
Checkout lifetimecheckout_session_expires_in_secondsHow long each checkout the link starts stays open.
Your referencesmetadata, external_reference_id, client_reference on resolveTags copied to every order, your own ID for the link, and the buyer or cart reference for one checkout. GET /v1/payment-links?external_reference_id=... finds the link.

Buyer details are deliberately limited, because anyone with the URL can open the link. A shipping address is asked for when the buyer picks a delivery option that ships, so there is no separate setting for it. Use prefill_email on the hosted URL or prefill.email on resolve to fill in an editable email. To bind a known customer with customer_id, create a checkout session for that buyer instead.

When a link's checkouts take tax from your callback and no callback is selected in tax.calculation_callback_id, opening the link returns 409 ACTION_NOT_ALLOWED with reason configuration_required and resource_type tax_calculation_callback, so the buyer can't reach a checkout whose tax can't be calculated.

promotion_config.codes_enabled follows your checkout settings when you leave it out. When both leave code entry unset, resolved sessions retain null and offer entry only while an active code promotion exists in the same environment. Read can_apply_promotion_code on the session; a promotion activated after checkout opened appears on its next read. A valid code still applies with null, whatever the hint last reported. Send true or false to override them for this link, or null in a PATCH to follow your settings again. If your settings turn promotion codes off, sending true returns 409 ACTION_NOT_ALLOWED with reason configuration_required. If you turn codes or automatic promotions off later, links saved with true keep opening without them, and edits to other fields still succeed. Open checkout sessions stop accepting codes too.

Control availability#

A link keeps taking payments until you stop it or its sales end. There is no delete; use one of these instead.

Schedule sales. Set sales_start_at to an RFC 3339 timestamp with a time zone offset. Before that instant, the public link returns is_before_sales_start: true, hosted Checkout shows the opening time, and resolve returns 409 ACTION_NOT_ALLOWED with details[0].reason set to sales_not_started. The opening time is in payment_link.sales_start_at. Read the link again at or after that time to get a fresh resolution context. The start must be earlier than the sales end, including an event's start when no explicit end is set. To clear it, send "sales_start_at": null in a PATCH.

Set a sales end. sales_end_at is an RFC 3339 timestamp after which the link stops starting checkouts. It works on every link type. Event links without it stop selling at event_at. Send null in a PATCH to remove it, or a later time to sell again. Buyers who open the link afterward see "Sales have ended", or your inactive_message when the link has one. A buyer who opened checkout before the end has 15 minutes after it to start paying.

cURL
curl -X PATCH https://api.withflintpay.com/v1/payment-links/pl_01K4SPRINGTEE \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{"sales_end_at": "2027-04-30T23:59:59Z"}'

Deactivate it. Set status to inactive, and set inactive_message (up to 500 characters) to tell buyers why:

cURL
curl -X PATCH https://api.withflintpay.com/v1/payment-links/pl_01K4SPRINGTEE \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "status": "inactive",
    "inactive_message": "The spring drop has ended. Follow us for the next one."
  }'

Buyers who open the URL see "This link isn't taking payments" and your message. Set status back to active to reopen the link at the same URL.

Cap completions. max_completions stops new checkouts once that many buyers have paid. Use it for "first 100 customers" offers and capped registrations. When payment starts, Flint also counts payments in progress, so buyers paying at the same moment can't go over the cap. A link that reaches its cap stays active, and new buyers see "This link has reached its limit". Raise max_completions, or send null to remove it, to reopen the link. You can't set it below the link's completed_count.

Limit each checkout. checkout_session_expires_in_seconds is the lifetime of each checkout session the link starts, not of the link. From 60 to 86,400, it limits how long each buyer's checkout stays open after it starts. It defaults to your checkout settings, or 24 hours. redirects.expired_url is where a buyer lands if their checkout expires. The link keeps taking new checkouts after one expires; to stop the link selling at a set time, use sales_end_at.

When a buyer's checkout expires unpaid, Flint sends checkout_session.expired. For standard, donation, and event links, it also closes the order with closed_reason: "checkout_expired", releases its discounts and inventory reservations, and sends order.closed. The buyer can open the link again for a new checkout.

A PATCH changes only the fields you send. metadata merges by key: set a key to null to remove it, or send "metadata": null to clear it. Send null to clear description, external_reference_id, image, inactive_message, max_completions, donation_min_amount_money, or donation_max_amount_money. Any other field sent as null returns 400 INVALID_REQUEST (detail INVALID_VALUE). When you replace tip.tip_percent_options or tip.smart_tip_money_options without sending a new preselection, the link's preselection is dropped if it isn't one of the new options.

cURL
curl -X PATCH https://api.withflintpay.com/v1/payment-links/pl_01K4SPRINGTEE \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "description": "Final week",
    "max_completions": 250
  }'

line_items, custom_fields, and delivery_method_ids are replaced as a whole. Send the complete list you want, with the link's current version as expected_version:

  • Include an item's payment_link_line_item_id, or a field's payment_link_custom_field_id, to keep it.
  • Leave the ID out to add a new one.
  • Leave an existing one out to remove it.
cURL
curl -X PATCH https://api.withflintpay.com/v1/payment-links/pl_01K4SPRINGTEE \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "expected_version": 3,
    "line_items": [{
      "type": "custom_fixed",
      "payment_link_line_item_id": "plli_01K4TEE",
      "name": "Limited Tee",
      "unit_price_money": {"amount": 3000, "currency": "USD"},
      "allow_quantity_adjustment": true,
      "min_quantity": 1,
      "max_quantity": 5
    }]
  }'

Every saved change increases version by one and sends a payment_link.updated webhook carrying the link, with its new version and status; creating a link sends payment_link.created. If the link changed after you read it, Flint returns 409 VERSION_CONFLICT with the link's details[0].current_version, including when another write lands while the request runs; read the link again and retry with its new version. If the write loses a race and your version still matches, Flint returns 409 CONCURRENT_MODIFICATION without param; send the same request again with the same Idempotency-Key. While a link is active, you can change an item's name, price, and quantities, but not add or remove items or change their keys or catalog sources. Those changes return 409 ACTION_NOT_ALLOWED with reason field_locked. On a variant_ids line, the product is the catalog source, so you can change variant_ids and default_variant_id on an active link as long as every listed variant belongs to the line's product. Switching a line between variant_id, variant_ids, and bundle_id, or to another product, still returns the error. Checkouts already started keep the variant line they were created with. To add or remove items, or change their keys or catalog sources, send "status": "inactive" in the same PATCH as the new line_items, then reactivate the link.

You can't change a link's payment_link_type or subscription_plan_id. Create a new link instead.

Warning: Deactivation closes unpaid checkouts

Edits to items, prices, and settings apply to checkouts that start after the update saves. Deactivating a link closes its open, unpaid hosted and headless checkouts. It also stops new payments for orders from the link, including payments made by your server. A payment already in progress can finish. Reactivating the link allows new checkouts; it does not reopen closed ones.

Fulfill and reconcile#

The buyer's success page is for the buyer. A buyer can close the tab before it loads, and anyone can open your success URL, so fulfill from webhooks or a read from your backend. Subscribe your webhook endpoint to these events:

  • order.paid
    The order is paid in full. Fulfill from this event, after you check dispute_status.
  • checkout_session.paid
    The buyer's checkout was paid. Carries checkout_session_id, order_id, and payment_intent_ids.
  • order.created
    Sent when a buyer continues to checkout, before they pay. Don't treat it as a sale.
  • checkout_session.expired
    A buyer's checkout ended without payment.
  • order.closed
    Sent after a paid order completes, and when a checkout expires unpaid. closed_reason is usually paid or checkout_expired.
  • ticket.created
    An event link issued a ticket. Sent for each ticket, never with its admission code.
  • ticket.checked_in
    A ticket was checked in at the door.
  • ticket.voided
    You voided a ticket, or a full refund voided it.
  • ticket.updated
    A ticket's attendee name, check-in, or admission code changed.

The order.paid event carries the order, with its amounts and line items. Read the order again when you need its current state:

cURL
curl https://api.withflintpay.com/v1/orders/ord_01K4WORKSHOP \
  -H "Authorization: Bearer YOUR_API_KEY"

Abridged:

Response
{
  "data": {
    "order_id": "ord_01K4WORKSHOP",
    "origin": "payment_link",
    "payment_link_id": "pl_01K4WORKSHOP",
    "client_reference": "cart_1842",
    "payment_status": "paid",
    "checkout_session_ids": ["cs_01K4WORKSHOP"],
    "metadata": {"campaign": "fall_workshops"},
    "custom_field_answers": [{
      "payment_link_custom_field_id": "plcf_01K4W8TSHRTS2ZEQ7XN5V3D2JA",
      "key": "experience_level",
      "label": "Experience level",
      "custom_field_type": "dropdown",
      "value": "Beginner"
    }],
    "line_items": [{
      "name": "Workshop seat",
      "quantity": 2,
      "payment_link_line_item_key": "seat"
    }]
  }
}
  • origin: "payment_link" marks orders that came from any link, and payment_link_id names the link. The order.created, order.paid, and order.closed payloads carry payment_link_id too.
  • client_reference on order.paid is the buyer or cart reference sent on the hosted URL or resolve request. It is null when none was sent. It is immutable and readable only by merchant credentials, including webhook delivery. It is separate from external_reference_id and metadata. Payment intents lead to it through order_id; they carry no copy.
  • metadata holds the link's metadata. The buyer's answers are in custom_field_answers, which is read-only and returned only to merchant credentials. Orders created before Flint recorded answers there keep them in metadata as custom_field_<key> and return an empty custom_field_answers.
  • Each line item's payment_link_line_item_key is the key of the link line item it came from, so match lines to the link's line items with it instead of by name. It is null on lines that didn't come from a link line item, including lines added to the order later and lines on orders from subscription signup links.

To reconcile in bulk:

  • GET /v1/checkout-sessions?payment_link_id=pl_... lists every checkout one link started, with its order_id and status.
  • GET /v1/orders?payment_link_id=pl_... lists the orders one link created. Add payment_status=paid for its sales.
  • GET /v1/orders?origin=payment_link lists every order from any link. Split them by the metadata you set, such as campaign.
  • The link's completed_count is the number of paid checkouts, and total_quantity_sold counts an event's tickets. Neither counts fully refunded orders.

When an order is fully refunded, Flint returns its capacity to the link: completed_count drops by one, and the order's ticketed_event.ticket_status becomes voided. Each of the order's tickets that is still valid becomes voided, and an event's total_quantity_sold drops only by the number of tickets voided this way. A ticket you voided earlier already freed its seat, so the refund doesn't free it again. Released ticket numbers aren't reissued, so the next buyer gets a new number. An order refunded before its tickets were issued is voided with no ticket_numbers. A partial refund returns no capacity, because Flint can't tell which tickets it covered.

Start checkout from your own page#

Opening url starts checkout on Flint's page. To show the offer on your own page first, such as a storefront that lets the buyer choose a quantity or an amount, read the link's public view and start the checkout yourself. Neither call takes an API key, and both allow calls directly from a browser on any origin. Their per-IP rate limit applies per buyer when each buyer calls from their own browser.

  1. cURL
    curl https://api.withflintpay.com/v1/payment-links/pl_01K4SPRINGTEE/public
    

    The response has the link's buyer-facing fields under payment_link, without your metadata or redirect URLs, plus:

    • resolution_context, a private credential for starting this buyer's checkout. Keep it out of URLs, logs, analytics, and shared caches.
    • checkout_start_due_at, the authoritative cutoff for starting a new checkout. Start before this returned timestamp; at or after it, read the link again for a fresh context.
    • resolution_context_expires_at, when the context credential expires. An already committed checkout can still be replayed between the start cutoff and this expiry.
    • checkout_theme, the theme checkout will use: your checkout branding with the link's title, primary_color, and accent_color overrides. It also includes background_color, text_color, font_family, and corner_radius from branding settings. Style your page with it so the two match. It's omitted when neither your branding nor the link's theme sets a value. The link's own theme accepts only the three overrides.
    • merchant_logo and merchant_icon, when set, as Image objects with a url, width, and height. The link's image is payment_link.image.
    • merchant_support, how the buyer can reach the merchant for help: the support email, phone (E.164), and url (absolute http or https) the merchant set. Each field is optional, and the object is omitted when the merchant set none. Show these support links wherever your page tells the buyer to contact the merchant, including when the link is inactive, at its completion limit, sold out, or past its sales end.
    • show_flint_mark, whether Flint's hosted pages show the Powered by Flint mark. false means your agreement with Flint removes it.
    • is_past_sales_end, true once the link's sales end has passed.
    • remaining_quantity and is_sold_out for event links, counting tickets held by payments in progress, and subscription_preview for subscription signup links.
    • is_sold_out for other active links with an inventory_routing_source: true when any catalog line can't be bought at its minimum quantity (see Sold-out state).

    resolved_line_items has one entry for each catalog-backed line item (a variant, bundle, or variant choice line), with its current catalog values, matched to the link's line item by key. Ad hoc custom_fixed and custom_variable lines have no entry. It's present only for an active link, so an inactive link, a donation link, and a subscription signup link omit it.

    For a line item where the buyer chooses a variant, the matching resolved_line_items entry (same key) has catalog_object_type: "variant" and the product_id, and no variant_id. Its resolved_name, resolved_description, and image come from the product. resolved_unit_price_money and the line-level available_modifiers are omitted, because both can differ by variant. Read them from these two arrays instead:

    • product_options lists the product's active options in position order, each with option_id, name, and values (option_value_id and value, in position order). Values that no entry in available_variants uses are left out. It's an empty array when the product has no options.
    • available_variants lists the listed variants that can be sold now, in the order of variant_ids. Each has:
      • variant_id, the value to send in variant_selections.
      • name, the name the order line gets: the product name plus the variant's label.
      • selected_options, the variant's option values, each with option_id, option_name, option_value_id, and value.
      • unit_price_money, the variant's current price.
      • image, the variant's image, or the product's when it has none. Omitted when neither has one.
      • is_sold_out, true when the variant tracks inventory and the link's inventory_routing_source can't supply the line's starting quantity: min_quantity when the buyer can adjust quantity, otherwise quantity. Always false for a variant that doesn't track inventory, and false while the variant's inventory item allows backorders and its limit has room left. See Sold-out state.
      • available_modifiers, the modifier groups for this variant. Omitted when it has none.

    The variant's is_sold_out is a hint for your page. It takes no hold and publishes no counts, so a variant that shows as available can still sell out before the buyer pays. All variants in available_variants are priced in the line's currency: the currency of default_variant_id when that variant can be sold, otherwise of the first variant that can be. A variant priced in another currency, or one that is inactive or archived, is left out rather than reported as unavailable. One unsellable variant never fails the read. If none of the listed variants can be sold, the read fails the way it does for an unsellable variant_id item, with param such as line_items[0].variant_ids.

    Sold-out state#

    Every resolved_line_items entry has a required, output-only is_sold_out boolean. A line's minimum quantity is min_quantity when the buyer can adjust quantity, otherwise quantity.

    • A fixed variant line is true when the variant tracks inventory and the link's inventory_routing_source can't supply the minimum quantity. If the variant's inventory item has backorder.enabled, the line stays false while the item's backorder.limit_quantity has room left, or while the item has no limit, even with nothing available.
    • A bundle line is true when any tracked component can't be supplied at the minimum quantity of bundles. Bundle components never backorder.
    • A line where the buyer chooses a variant is true only when every entry in available_variants has is_sold_out: true.
    • A line that doesn't track inventory, including an ad hoc line, is always false.

    A fixed_location source counts that location's available stock. An allocation policy counts stock across the locations the policy can allocate from. The read never returns stock counts.

    An order from a link backorders and pre-orders like any other order: its lines carry backordered_quantity, release_date, and expected_ship_date, as Backordered and pre-ordered lines describes. The link reports none of them. Sell pre-orders and backorders covers when the buyer is charged and how the units ship.

    A buyer buys every line on a link together, so one sold-out line makes the link unavailable. The top-level is_sold_out is true for an active, non-event link with an inventory_routing_source when any catalog line has is_sold_out: true. Lines that don't track inventory, including ad hoc lines, never count, and they don't offset a sold-out line. A line where the buyer chooses a variant counts only when every listed variant is sold out; if some variants are sold out and no other line is, the link stays open. Starting checkout on a link where top-level is_sold_out is true is refused with 409 INVENTORY_INSUFFICIENT, with detail code INVENTORY_INSUFFICIENT, resource_type: "payment_link", and available_quantity: 0. Event links keep their own is_sold_out, which counts tickets held by payments in progress.

    The read and the checkout start are advisory checks: they take no hold and publish no counts, so a line that shows as available can still sell out. Flint checks and holds stock for the order's lines when the buyer starts payment, and that check is the one that decides. A line that can't be supplied then fails payment with INVENTORY_INSUFFICIENT.

    For a subscription signup link, use subscription_preview.billing_interval_options for cadence choices. Read subscription_preview.line_items to find the line with allow_quantity_adjustment: true and its min_quantity and max_quantity. That line's quantity is the seat count. Start checkout with the buyer's chosen quantity in subscription_terms.line_items:

    JSON
    {
      "resolution_context": "CONTEXT_FROM_PUBLIC_READ",
      "subscription_terms": {
        "line_items": [
          {"subscription_plan_line_item_id": "spli_1kmn0aExample", "quantity": 7}
        ]
      }
    }
    

    Only the adjustable line may change, within its bounds (defaults 1 and 9,999). Omitted lines keep the plan defaults. Duplicate IDs and IDs outside the plan are refused. The signup order and the recurring terms use the selected quantity.

    A 200 response includes Flint-Mode (test or live) and Flint-Merchant-Id for the link, plus Flint-Sandbox-Id for a sandbox link. Use these response headers to identify the link's mode and merchant. Errors omit them.

    An inactive link still returns 200 with status: "inactive" and its inactive_message, so your page can show the message.

  2. Start the buyer's checkout#

    Send the context with the buyer's choices and a new, random Idempotency-Key:

    cURL
    curl -X POST https://api.withflintpay.com/v1/payment-links/pl_01K4SPRINGTEE/resolve \
      -H "Content-Type: application/json" \
      -H "Idempotency-Key: 04e2e86d-9f39-4dce-9e54-54bc798584ed" \
      -d '{
        "resolution_context": "plrc_v1.example_resolution_context",
        "quantity_overrides": {"tee": 2},
        "client_reference": "cart_1842",
        "prefill": {"email": "ada@example.com"}
      }'
    

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

    JSON
    {
      "data": {
        "checkout_session_id": "cs_01K4TEE2",
        "status": "open",
        "type": "payment_link",
        "payment_link_id": "pl_01K4SPRINGTEE",
        "order_id": "ord_01K4TEE2",
        "expires_at": "2026-10-13T12:44:01Z",
        "url": "https://checkout.withflintpay.com/checkout/cs_01K4TEE2#checkout_token=cklt_v1..."
      }
    }
    
  3. Send the buyer to checkout#

    Redirect the buyer to url exactly as returned. Its #checkout_token fragment lets their browser open the checkout, so don't strip it or rebuild the URL.

    The cklt_ token in url works only on Flint's hosted page. To run the checkout on your own page, such as to sell event tickets there, replace the hosted session with a headless one from your backend instead.

Resolve also accepts optional client_reference and prefill: {"email": "ada@example.com"}. Only email is accepted inside prefill; it must be a valid address of 1 to 320 characters. Invalid references or emails return 400 INVALID_REQUEST with INVALID_VALUE at client_reference or prefill.email. Other prefill fields return UNKNOWN_FIELD. Both are part of the request, so a different reference or email needs a new key.

Every override map is keyed by line item key:

FieldSets
quantity_overridesA quantity within the item's min_quantity and max_quantity. Event tiers can be 0.
unit_price_overridesThe price of an item with allow_unit_price_adjustment. A donation link requires one. donation is the key Flint gives the donation link's one line item, so it appears as line_items[0].key.
custom_field_valuesAnswers keyed by custom field key. Required fields must be answered here. Flint records them on the order and checkout session in custom_field_answers.
modifiersModifier choices keyed by line item key. Each value is { "modifiers": [...] }. Each selection uses { "type": "catalog", "modifier_id": "mod_...", "quantity": 1 } or { "type": "text", "text": { "modifier_group_id": "mg_...", "value": "Extra hot" } }, matching order line item inputs. quantity is optional for catalog choices and rejected for text choices.
variant_selectionsThe variant_id the buyer picked, for an item with variant_ids.

For an item with variant_ids, send the buyer's pick in variant_selections. quantity_overrides and modifiers for that key then apply to the picked variant:

JSON
{
  "resolution_context": "plrc_v1.example_resolution_context",
  "variant_selections": {"tee": "var_01K4TEELARGE"},
  "quantity_overrides": {"tee": 2}
}
  • The picked variant must be one of the item's variant_ids, priced in the line's currency. Its modifiers are checked against that variant's modifier groups.
  • An item with default_variant_id can be left out of the map and uses the default. Without a default, leaving it out returns 400 INVALID_REQUEST with detail REQUIRED and param variant_selections.tee.
  • A key that isn't an item on the link, isn't a variant_ids item, or names a variant outside the offered set returns 400 INVALID_REQUEST with detail INVALID_VALUE and param variant_selections.tee. Read the public link again, show the buyer the current choices, and start over.
  • The order line is created from the picked variant exactly as for a variant_id line: the same price and selected_options snapshot, tax, delivery requirement, and payment_link_line_item_key. A variant turned off since the read is refused with the same error a variant_id line gets.
  • Starting checkout holds no stock. It refuses a link whose top-level is_sold_out is true with 409 INVENTORY_INSUFFICIENT and detail code INVENTORY_INSUFFICIENT, and doesn't check the picked variant's stock otherwise. Flint checks and holds stock for the picked variant when the buyer starts payment, so a variant that sold out in between fails payment with INVENTORY_INSUFFICIENT.
  • variant_selections is part of the request body for idempotency, so a different pick needs a new key.

Each call creates a real order and checkout session, so call it when the buyer chooses to check out, not to show prices.

If a call fails with no response, retry with the same context, body, and Idempotency-Key. Flint returns the same hosted checkout with an Idempotency-Replayed: true header. New hosted responses and their stored receipts include url and omit checkout_auth_token.

If Flint returns 409 VERSION_CONFLICT, the link changed after the buyer's read, and no checkout was created. Read the public link again, show the buyer the current offer, and start over with the new context. Follow the key instruction in next_steps.

Flint allows 1,000 public reads and 1,000 checkout starts per link per IP per rolling minute, plus 20 resolves per resolution_context per minute. Above either limit, it returns 429 RATE_LIMIT_EXCEEDED with Retry-After from 1 to 60 seconds. Read the link once per page view, not on a timer.

Create a link with a test key (flint_test_...), open its url, and pay with a test card:

Test cardAny future expiry, any CVC.
Warning:

If your sandbox can't take card payments yet, checkout shows "no payment methods available" instead of a card form. Check readiness.payments on GET /v1/merchant; once it reports ready, reload the page.

Then check what your backend will rely on in production: your webhook endpoint received order.paid, GET /v1/orders?origin=payment_link lists the paid order with your link's metadata, and the link's completed_count went up by one. Testing covers declines, 3D Secure, and other outcomes.

Errors#

  • HTTP 404
    No payment link has that ID in this mode. Test and live links are separate.
  • HTTP 400
    param names the field: min_quantity is greater than max_quantity (param is line_items[].max_quantity); an event link was created without event_config.event_at or event_config.timezone; a checkout for an event link chose no tickets; or a checkout for a donation link didn't send unit_price_overrides.donation. A PATCH that sends null for a field that can't be cleared has detail INVALID_VALUE.
  • HTTP 400
    param names the field. A variant_id, variant_ids, or bundle_id line item also sent a name, price, description, or tax (NOT_ALLOWED): the catalog owns those. A line item sent a quantity below 1, or an event tier sent one below 0 (INVALID_VALUE): leave it out to use the default. The same applies to a min_quantity or max_quantity below 1, such as line_items[0].min_quantity.
  • HTTP 400
    expected_version is missing from a PATCH that replaces line_items, custom_fields, or delivery_method_ids (details[0].code REQUIRED), or isn't a positive integer (INVALID_VALUE).
  • HTTP 409
    VERSION_CONFLICTRefresh, then retry
    The link changed after you read it. details[0].current_version is its current version. Read it again and retry with that version.
  • HTTP 400
    param names the field in a variant_ids line item. The line also sent variant_id, bundle_id, or ad hoc fields (NOT_ALLOWED, with conflicting_fields), or is on an event link (NOT_ALLOWED). variant_ids is empty, has more than 100 entries, repeats an ID, or has a malformed ID (INVALID_VALUE). A listed variant belongs to a different product or is priced in a different currency than the first one (NOT_ALLOWED, param such as line_items[0].variant_ids[1]). default_variant_id is sent without variant_ids (NOT_ALLOWED) or isn't one of them (INVALID_VALUE). Fix the line and send it again.
  • HTTP 404
    A variant in variant_ids doesn't exist. param is such as line_items[0].variant_ids[1], and details[0].resource_type is product_variant.
  • HTTP 409
    A variant in variant_ids is inactive or archived, or its product is; details[0].reason is unsupported_state. Remove it from the list or turn it on in your catalog. A checkout start that picks, or defaults to, such a variant returns this error with param such as variant_selections.tee.
  • HTTP 409
    The variant a buyer picked sold out before they started payment. Read the public link again and have the buyer choose another.
  • HTTP 409
    Deactivating or archiving a variant or product would leave an active link with nothing to sell. details[0].blocking_resources lists the payment_link.
  • HTTP 409
    An active link's line items can't be added, removed, re-keyed, or pointed at a different catalog item; details[0].reason is field_locked. A variant_ids line can change its list and default within its product. Deactivate the link in the same PATCH.
  • HTTP 409
    The link is deactivated. details[0].current_status is inactive, and details[0].inactive_message carries your inactive_message when the link has one.
  • HTTP 409
    The link reached max_completions; details[0].reason is payment_link_completions.
  • HTTP 409
    details[0].reason is not_offered. The link's sales end has passed: sales_end_at, or event_at for an event link without one. The error's inactive_message carries your inactive_message when the link has one.
  • HTTP 409
    With detail code INVENTORY_INSUFFICIENT, resource_type: "payment_link", and available_quantity: 0, the link has nothing left to sell: an event has no tickets left, or a catalog line on the link can't be bought at its minimum quantity, counting any room under its item's backorder limit. Stop offering the link, or add capacity, stock, or backorder room.
  • HTTP 409
    The event has some tickets left, but fewer than requested. available_quantity says how many.
  • HTTP 409
    event_config.max_total_quantity is below the tickets already sold or held by payments in progress. minimum_quantity gives the minimum accepted value.
  • HTTP 409
    max_completions is below the link's completed_count. minimum_quantity gives the minimum accepted value.
  • HTTP 409
    event_config.ticket_prefix can't change after the event has issued tickets.
  • HTTP 400
    param names the input. event_config was sent for a link that isn't an event link (NOT_ALLOWED). A checkbox answer in custom_field_values isn't exactly "true" or "false". A create or update request for a donation link includes line_items (NOT_ALLOWED): Flint creates and manages the donation line item. A quantity_overrides value is above the item's max_quantity or below its min_quantity. A unit_price_overrides amount is below the item's minimum or above its maximum. A required custom field has no answer in custom_field_values (REQUIRED). A missing or blank resolution_context has detail code REQUIRED; a malformed context or one belonging to another link has INVALID_VALUE. Read GET /v1/payment-links/{payment_link_id}/public and send its resolution_context. The top-level error.remediation.next_actions includes get_payment_link_public with that link's public read URL.
  • HTTP 409
    The key was already used with different choices. See Replay, conflict, or in progress.
  • HTTP 409
    IDEMPOTENCY_KEY_IN_PROGRESSRetry the same request
    A checkout start with this key is still running. See Replay, conflict, or in progress.
  • HTTP 409
    VERSION_CONFLICTRefresh, then retry
    The context has expired, is at or after checkout_start_due_at, or no longer matches the link's delivery methods. Read the public link again using the top-level get_payment_link_public remediation action and send its new context. remediation.retry is after_refresh.
  • HTTP 409
    VERSION_CONFLICTRefresh, then retry
    The link changed after the buyer's read, and no checkout was created. Read the public link again and start over. Follow the key instruction in next_steps.
  • HTTP 409
    The checkout this Idempotency-Key created has ended or been paid, so it can't be returned again. Start a new checkout.
  • HTTP 429
    RATE_LIMIT_EXCEEDEDRetry the same request
    Too many reads or checkout starts for this link from one network. Wait, then retry.

Errors lists every code with its remediation.

Endpoints#

  • POST/v1/payment-linksRequired API key scope: checkouts.payment_links.writeReference for POST /v1/payment-links

    Create a link. GET /v1/payment-links lists links and filters them by status, payment_link_type, has_subscription_plan, and external_reference_id, and by time with created_after, created_before, updated_after, and updated_before. Each _after bound is inclusive and each _before bound is exclusive. query searches IDs, names, and descriptions.

  • POST/v1/payment-links/{payment_link_id}/resolveReference for POST /v1/payment-links/{payment_link_id}/resolve

    Start a buyer's checkout from the link, optionally carrying client_reference and prefill.email. No API key.

Next steps#

A Stripe Payment Link limit counts checkouts, not tickets. Stripe event ticket tiers compares a shared seat counter of your own with event links.

Negotiated prices#

Payment links use variant quantity breaks. Customer verification during checkout preserves the prices already selected for the order; it does not apply a customer’s negotiated list.

Card-testing protection#

Flint limits unsuccessful card attempts by checkout session, card fingerprint, and billing email. The card fingerprint and email budgets apply across sessions. Hosted checkout and server payments also use the buyer IP limit. See card testing for the defaults, the 429 response, and when to deactivate a link.

Was this helpful?