Skip to content

Invoicing

An invoice bills a specific customer for a specific amount and tracks what they still owe until it is paid, written off, or voided. You create a draft, issue it, and Flint emails a hosted payment page, charges a saved card, or waits for you to record a check or wire. Flint then follows up on its own: reminders, an overdue notice, late fees, and card retries.

Use an invoice for net-30 consulting work, B2B sales that go through an approval chain, and any balance that might arrive late, in parts, or by check. When the money is due right now, use a checkout session. When many buyers should share one URL, use a payment link. Payment links vs checkout sessions vs invoices compares the three.

B2B wholesale with invoicing walks through a wholesale sale end to end: price lists, a resale exemption, a deposit on net 30 terms, checks, a credit note, and receivables aging.

For a CSV of issued invoices over a period, create an invoices_itemized_v1 report. It includes current payment, credit, write-off, refund, and outstanding amounts with stable invoice, customer, order, and subscription IDs.

For automatic tax outside the US, invoices freeze the VAT, GST, HST, and provincial tax rows in USD. When the buyer accounts for the tax under a reverse charge, issue freezes snapshot.tax_reverse_charge with the buyer's tax ID, and the invoice PDF and its credit notes print "Reverse charge" with that ID. See Reverse charge for business buyers. Add the seller's registration numbers to settings.tax_identity so they appear on the invoice. See Canada coverage.

Disputes on invoice payments#

A lost card chargeback does not reduce paid_money, reopen outstanding_money, or change currently_due_money or status. A paid invoice stays paid; a partially paid invoice keeps the same remaining balance. Reminders, late fees, and automatic collection do not restart because of the loss. To collect the lost amount again, create a new invoice.

A later win restores no invoice balance because the loss removed no payment. Refund behavior is unchanged, and a lost dispute still consumes refund capacity. Track the outcome on the dispute.

An ACH bank return reverses the returned payment amount. It reduces paid_money and net_collected_money, restores outstanding_money, and reopens a paid invoice with invoice.reopened. The invoice is open when no collected payments remain, or partially_paid when other payments remain. An overdue invoice becomes collectible again. Flint skips a paid receipt when it already knows the payment was returned.

How an invoice works#

Every invoice is backed by an order, the record of what was sold. Point the invoice at an order you already have, or pass quick_pay and Flint creates the order for you. The invoice adds the receivable on top: who owes, how much, by when, and what has come in.

A buyer-initiated invoice from issue to paymentResponse
Your serverFlintCustomerPOST /v1/invoices with issueopen invoice with invoice_number and public_urlinvoice email with a Pay invoice buttonreminders on your cadence while a balance remainspays on the hosted invoice pageinvoice_payment_attempt.succeeded and invoice.paid webhooks
  1. Your server sends POST /v1/invoices with issue to Flint
  2. Flint returns open invoice with invoice_number and public_url to Your server
  3. Flint sends invoice email with a Pay invoice button to Customer
  4. Flint sends reminders on your cadence while a balance remains to Customer
  5. Customer sends pays on the hosted invoice page to Flint
  6. Flint sends invoice_payment_attempt.succeeded and invoice.paid webhooks to Your server

A draft can be edited freely. Issuing it assigns the invoice number, freezes the billing content, and makes the balance collectible. From then on, payments, credit, and closing actions move its status:

Invoice statusStartFinal
  • draft moves to open on issue
  • draft moves to voided on void
  • open moves to voided on void
  • open moves to partially_paid on partial payment
  • open moves to paid on full payment
  • partially_paid moves to paid on balance cleared
  • partially_paid moves to voided on void after full refund
  • open moves to credited on credit clears balance
  • open moves to uncollectible on write off
  • partially_paid moves to uncollectible on write off
  • uncollectible moves to paid on record full recovery
  • paid moves to partially_paid on payment or credit reversal
  • paid moves to open on payment reversal
  • partially_paid moves to open on payment reversal
  • credited moves to open on credit reversal
status on invoice
Final values do not change again
  • draft
    Editable, with no invoice number and nothing collectible. outstanding_money equals total_money.
  • open
    Issued, with nothing collected yet. The customer can pay.
  • partially_paid
    Some money came in and a balance remains.
  • paid
    The balance reached zero with collected payments applied. A payment or credit reversal can reopen it, which sends invoice.reopened.
  • credited
    Credit notes cleared the balance and no collected payments remain. A credit reversal can reopen it.
  • uncollectible
    You wrote off the remaining balance.
  • voidedFinal
    Canceled before collection or after a deposit was fully refunded. outstanding_money is 0.

Refunds don't change status. They move refund_status (none, partially_refunded, refunded), so a paid invoice that was refunded reads status: "paid" and refund_status: "refunded". The Invoices reference lists every field on the object.

Read the invoice's required supported_actions before choosing a lifecycle action: issue, collect, void, or mark_uncollectible. A late fee has its own list for waive, and a manual payment has one for reverse. An empty array means no action applies. These lists depend on stored state, never on your credential or scopes, so check the user's permissions separately before offering buttons. Expanded summaries and webhook data.object carry the field; webhook lists describe the state when the event was recorded. Lifecycle refusal details include supported_actions alongside current_status and the current_resource reference. BuyerInvoice responses omit it and describe buyer tasks in buyer_actions. See Available actions for the routes.

An ACH debit that's processing must finish before you can void or write off its invoice. Canceling its payment intent, order payment attempt, or invoice payment attempt returns 409 ACTION_NOT_ALLOWED with reason in_progress; none lists cancel in supported_actions. Wait for the debit to succeed or fail, then refund it if it succeeds. A canceled payment releases its invoice attempt so it no longer blocks voiding or writing off the invoice.

Two ownership rules keep the books unambiguous:

  • One invoice per order. An order can have at most one invoice that isn't voided. A second draft against the same order fails with 409 ALREADY_EXISTS, and details[0].current_resource names the existing invoice.
  • The invoice owns collection. From the moment the draft exists, the invoice is the only way to collect on its order. Generic checkout sessions and payment intents for the order are rejected with RESOURCE_IN_USE, and the order can't be edited until the invoice is closed or voided.

The balance#

Every amount is a Money object in the currency's minor unit. Invoice pricing is in pricing_amounts. Payments and balances are in settlement_amounts, an InvoiceSettlementAmounts extension of the shared SettlementAmounts core. Unless a path says otherwise, the settlement fields below are inside that object.

FieldWhat it holds
pricing_amounts.total_moneyWhat the invoice bills. Fixed at issue; a draft previews the order's total. Excludes late fees.
settlement_amounts.late_fee_moneyLate fees assessed after issue, minus waivers. Itemized in late_fees, and it keeps fees that were later paid or written off.
settlement_amounts.paid_moneyMoney collected online or recorded as manual payments, minus reversed payments, including payments toward late fees. Refunds don't reduce it.
settlement_amounts.credited_moneyCredit note credit allocated to the invoice, minus reversed allocations.
settlement_amounts.written_off_moneyThe balance written off when the invoice was marked uncollectible, including unpaid late fees.
settlement_amounts.outstanding_moneyWhat is still owed.
settlement_amounts.currently_due_moneyThe part of outstanding_money due now, and what the next checkout session or collect call charges. For an open or partially_paid invoice without a payment schedule, it equals outstanding_money. A draft has nothing currently due, so it's zero.
settlement_amounts.refunded_moneyMoney returned to the buyer after collection.
settlement_amounts.net_collected_moneypaid_money minus refunded_money, never below zero. Card chargeback losses do not reduce this invoice amount.

In every status except voided, the balance follows one identity, never below zero:

Text
outstanding_money = pricing_amounts.total_money + late_fee_money - paid_money - credited_money - written_off_money

outstanding_money is 0 on paid, credited, uncollectible, and voided invoices. A voided invoice keeps its billed total_money. Refunds return money already collected, so they aren't part of the identity and never reopen the balance.

A $2,500.00 invoice that took a $37.50 late fee, a $1,500.00 check, and a $500.00 credit note reads:

JSON
{
  "status": "partially_paid",
  "pricing_amounts": {
    "total_money": {"amount": 250000, "currency": "USD"}
  },
  "settlement_amounts": {
    "paid_money": {"amount": 150000, "currency": "USD"},
    "refunded_money": {"amount": 0, "currency": "USD"},
    "written_off_money": {"amount": 0, "currency": "USD"},
    "outstanding_money": {"amount": 53750, "currency": "USD"},
    "credited_money": {"amount": 50000, "currency": "USD"},
    "late_fee_money": {"amount": 3750, "currency": "USD"},
    "net_collected_money": {"amount": 150000, "currency": "USD"}
  }
}

Tax on the invoice#

The tax inside total_money is in pricing_amounts, split into additive_tax_money and inclusive_tax_money, with jurisdiction rows in snapshot.tax_breakdowns. Only additive tax adds to the total: inclusive tax is already inside the prices. An invoice with a $120.00 line whose price includes $20.00 of tax, and a $100.00 line taxed $10.00 on top, bills $230.00:

JSON
{
  "pricing_amounts": {
    "subtotal_money": {"amount": 22000, "currency": "USD"},
    "discount_money": {"amount": 0, "currency": "USD"},
    "charge_money": {"amount": 0, "currency": "USD"},
    "tax_money": {"amount": 3000, "currency": "USD"},
    "additive_tax_money": {"amount": 1000, "currency": "USD"},
    "inclusive_tax_money": {"amount": 2000, "currency": "USD"},
    "requested_tip_money": {"amount": 0, "currency": "USD"},
    "total_money": {"amount": 23000, "currency": "USD"}
  }
}

tax_money is the sum of both kinds, 3000. Tax on an invoice covers when tax is calculated and frozen.

VAT in local currency#

EU and UK rules require an invoice to state its VAT in the currency of the country that charges it. When an issued invoice has VAT above zero for an EU member state or the UK, issue converts it and freezes the result in snapshot.tax_currency_conversions, one entry per currency:

JSON
{
  "snapshot": {
    "tax_currency_conversions": [
      {
        "currency": "EUR",
        "exchange_rate": 0.8956560681,
        "rate_date": "2026-11-06",
        "rate_source": "ecb",
        "tax_money": {"amount": 1702, "currency": "EUR"},
        "taxable_money": {"amount": 8957, "currency": "EUR"}
      }
    ]
  }
}

This invoice bills $100.00 with $19.00 of German VAT. At the ECB rate for November 6, 2026, that's €17.02 of VAT on €89.57.

  • Currency. The euro for member states that use it, including Bulgaria and Croatia. The national currency for Czechia (CZK), Denmark (DKK), Hungary (HUF), Poland (PLN), Romania (RON), and Sweden (SEK). Sterling for the UK.
  • Rate. For the EU, the European Central Bank's euro reference rate, the latest one on or before the issue date. Other currencies go through the euro: USD to EUR, then EUR to the national currency. For the UK, HMRC's exchange rate for the month of issue. The issue date is issued_at in the invoice's timezone. rate_source is ecb or hmrc, and rate_date is the ECB reference day or the first day of the HMRC month.
  • Amounts. exchange_rate is units of currency for one USD, rounded half up to 10 decimal places. tax_money is the sum of the invoice's VAT rows for that currency. taxable_money is the sum of the taxable amounts of the line items and charges those rows tax; a line item or charge with more than one row counts once, at its largest taxable amount. Flint adds each up in USD, multiplies by exchange_rate, and rounds half up to the currency's minor units, so you can reproduce both figures from the invoice.
  • Where it shows. The invoice PDF, the hosted invoice, and the buyer's invoice page in the account app show the converted taxable amount, the converted VAT, and the rate with its source and date. Credit notes against the invoice reuse its rate. Orders, receipts, payments, and reports stay in USD.

The conversion is frozen at issue and never recalculated. tax_currency_conversions is [] when no conversion applies: reverse charge, which records zero VAT, tax outside the EU and the UK, and invoices issued before Flint recorded conversions. Flint uses the ECB rate for every member state; Germany's monthly average rate isn't available.

If the rate for the issue date isn't available, issue fails with 503 SERVICE_UNAVAILABLE, remediation.retry: same_request, and a message naming the currency. Nothing is issued, numbered, or emailed, and the invoice stays a draft. Retry later with the same Idempotency-Key. A scheduled issue keeps retrying on its own until the rate is available, and the invoice stays a scheduled draft meanwhile.

Create an invoice draft#

POST /v1/invoices takes exactly one source, selected by type: order with an order_id, or quick_pay with the order details. It requires an Idempotency-Key header, because a create that also issues an automatic-collection invoice charges the customer. Reuse a key only to retry the same request; the retry returns the original invoice instead of creating another.

From an existing order#

Use order_id when the order already exists, for example a quote your app assembled line by line. The order must be open, with no payments, refunds, or other active invoice. The invoice bills the order's customer.

cURL
curl -X POST https://api.withflintpay.com/v1/invoices \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Idempotency-Key: invoice-po-1042-001" \
  -d '{
    "type": "order",
    "order_id": "ord_1kmn0aExample",
    "collection": {"mode": "buyer_initiated"},
    "payment_due": {"type": "date", "due_date": "2026-12-01"},
    "recipient_email": "ap@example.com",
    "po_number": "PO-1042",
    "memo": "Net 30. Thank you for your business."
  }'

An order-backed invoice locks its order from the moment the draft exists, so order edits return 409 RESOURCE_IN_USE. To change the line items, void the draft, edit the order, and create a new invoice. The draft previews the order, and issue freezes it.

Quick Pay#

Use quick_pay when there is no order yet and the invoice is the sale, the common case for services. Flint creates the backing order from what you send:

cURL
curl -X POST https://api.withflintpay.com/v1/invoices \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Idempotency-Key: invoice-consulting-nov-001" \
  -d '{
    "type": "quick_pay",
    "quick_pay": {
      "customer_id": "cus_1kmn0aExample",
      "line_items": [{
        "type": "custom",
        "name": "Consulting, November 2026",
        "quantity": 1,
        "unit_price_money": {"amount": 250000, "currency": "USD"},
        "fulfillment": {"requirement": "none"},
        "product_type": "service"
      }]
    },
    "collection": {
      "mode": "buyer_initiated",
      "payment_policy": {"enabled_payment_options": ["card", "ach_debit"]}
    },
    "payment_due": {"type": "date", "due_date": "2026-12-01"},
    "recipient_email": "ap@example.com",
    "memo": "Net 30. Thank you for your business.",
    "metadata": {"engagement": "acme-q4"}
  }'
Response
{
  "data": {
    "invoice_id": "inv_1kmn0aExample",
    "order_id": "ord_1kmn0aExample",
    "customer_id": "cus_1kmn0aExample",
    "status": "draft",
    "version": 1,
    "refund_status": "none",
    "collection_block_status": "none",
    "subscription_id": null,
    "collection": {
      "mode": "buyer_initiated",
      "payment_policy": {
        "enabled_payment_options": [
          "card",
          "ach_debit"
        ]
      }
    },
    "payment_due": {
      "type": "date",
      "due_date": "2026-12-01"
    },
    "due_date": "2026-12-01",
    "recipient_email": "ap@example.com",
    "is_overdue": false,
    "schedule_entries": [],
    "metadata": {
      "engagement": "acme-q4"
    },
    "pricing_amounts": {
      "total_money": {"amount": 250000, "currency": "USD"}
    },
    "settlement_amounts": {
      "paid_money": {"amount": 0, "currency": "USD"},
      "refunded_money": {"amount": 0, "currency": "USD"},
      "written_off_money": {"amount": 0, "currency": "USD"},
      "outstanding_money": {"amount": 250000, "currency": "USD"},
      "credited_money": {"amount": 0, "currency": "USD"},
      "late_fee_money": {"amount": 0, "currency": "USD"},
      "net_collected_money": {"amount": 0, "currency": "USD"}
    }
  }
}

customer_id goes inside quick_pay; the create request has no top-level customer_id. It links the invoice to a customer, so the document carries their name and billing details and GET /v1/invoices?customer_id=... finds it.

A line you describe yourself, without a catalog variant_id or bundle_id, must say whether it needs fulfilling. Send "fulfillment": {"requirement": "none"} for services and anything else with nothing to ship. Without it, the request returns 400 INVALID_REQUEST with param naming the line's fulfillment.

That same line also sends product_type, which tells Flint what kind of sale it is: service for work you perform, fee for a fee, or physical or digital for goods, the values a catalog product uses. Bank debit is offered only when Flint can tell the sale is goods or services. Leave product_type out and the line is unclassified: it reads back as null, and Flint doesn't guess from fulfillment. An invoice with an unclassified line takes card but not ach_debit, unless another line is a physical or digital product. Fee lines alone can't take bank debit either. A catalog line takes its type from the product and rejects product_type. The type doesn't change tax, delivery, or inventory. An issued invoice keeps the classification it was issued with, so to offer bank debit on one issued without it, void it and issue a corrected invoice. See ACH debit.

Quick pay also takes the order inputs that order creation takes, with the same validation. Errors name the field under quick_pay, such as quick_pay.tax.location.

FieldUse it for
discountsPromotions or manual discounts on the backing order.
requested_tipA tip to request from the buyer.
buyer_noteA note the customer sees, captured in snapshot.buyer_note.
internal_noteA note for your team. Buyer reads leave it out.
taxTax inputs, such as tax.location when automatic tax depends on where the buyer is.
delivery_destinationWhere the order's items are shipped.
inventory_routing_sourceWhere stock comes from when a line tracks inventory. Required then.

When any line resolves to a variant with inventory_tracking: "tracked", set quick_pay.inventory_routing_source to a fixed location, an allocation policy, or an immutable policy revision, the same input shape an order takes:

JSON
"quick_pay": {
  "line_items": [{"type": "variant", "variant_id": "var_1kmn0aExample", "quantity": 2}],
  "inventory_routing_source": {"type": "fixed_location", "location_id": "loc_1kmn0aExample"}
}

Flint handles the stock as it does for any order: it holds the quantity when a payment begins, commits it when the payment succeeds, and releases it when the payment fails or the invoice is voided. A tracked line without a source returns 400 INVALID_REQUEST with detail REQUIRED and param quick_pay.inventory_routing_source, and nothing is created. See Inventory for routing policies.

Billing fields#

These fields are optional at create and editable while the invoice is a draft:

FieldWhat it does
collectionHow the invoice is collected. See Choose how it is collected.
payment_dueHow the due date is set: type is none, date with due_date, payment_terms with invoice_payment_term_id, customer_default, or merchant_default. See Payment terms.
schedule_entriesA deposit, installments, and a final balance. See Payment schedules.
recipient_emailWhere Flint emails the invoice and its reminders. When omitted at creation, defaults to the linked customer's email. Send null at creation to leave it unset; PATCH can replace or clear it. Required at issue when delivery resolves to email.
cc_emailsAddresses copied on the invoice email and every reminder.
referenceYour reference, such as a job or project number. Printed on the invoice and PDF.
po_numberThe buyer's purchase order number, which accounts-payable teams match against. Printed.
service_dateThe date of the service, YYYY-MM-DD. Printed exactly as sent, so "2026-03-01" reads March 1 in every timezone.
memoA message to the customer. Defaults to invoices.default_memo.
footerFine print at the bottom. Defaults to invoices.default_footer.
remit_to_addressWhere the buyer sends checks. Defaults to the invoice settings remit-to address.
scheduled_issue_atHas Flint issue and email the draft at a future time. See Schedule the issue.
metadata, external_reference_idYour own correlation data, never printed. external_reference_id is an exact-match list filter, so use it as your sync key.

The response includes snapshot, the customer-facing billing content: line items, discounts, charges, tip, tax, and totals. A draft previews the order, including your current business name in snapshot.merchant_display_name. Issue freezes it.

invoice_number is absent on drafts. Issue assigns it, sequential per merchant, with test and live mode numbered separately. Set a prefix with invoices.invoice_number_prefix in your settings.

Choose how it is collected#

collection.mode decides who starts the payment. It is fixed at issue.

modeWho pays, and howUse it when
buyer_initiatedThe customer pays on the hosted invoice page, or in your own checkout, with the options in payment_policy.You send a bill and the customer decides when to pay.
automaticFlint charges a saved card, as a charge the customer is not present for. The customer can also pay by card from the hosted page.The customer agreed to be charged, such as on a retainer.
externalMoney arrives outside Flint, and you record it as manual payments. The hosted page shows the invoice without a way to pay online.The customer pays by check, wire, or cash.
merchant_defaultResolves to invoices.default_collection_mode from your settings, or buyer_initiated when it isn't set.You want your settings to decide.

payment_policy is accepted only with buyer_initiated. enabled_payment_options takes card, apple_pay, google_pay, affirm, and ach_debit. payment_option_limits caps an option by invoice total, and show_cost_comparison shows the buyer what a lower-cost option saves; it needs ach_debit and at least one of card, apple_pay, or google_pay.

Payment options resolve in this order: an explicit collection.payment_policy, then invoices.payment_policy, then your checkout payment options. When all three are absent, the platform default is card, apple_pay, and google_pay. An explicitly empty option list is rejected. The resolved policy is stored when the draft is written, so later settings changes do not change existing drafts or issued invoices.

Apple Pay and Google Pay appear only where the buyer's device supports them, the page uses HTTPS, and the payment domain is registered. Account readiness, platform blocks, and invoice amount limits still apply. Automatic invoices offer card-only recovery, and external invoices offer no online payment.

payment_method_id is accepted only with automatic: the customer's saved card to charge. Leave it out and Flint charges the customer's default card, chosen at issue. See Automatic collection.

Defaults and reading back what you wrote#

Every invoice read carries the resolved collection and payment_due objects, in the same shape the create and update requests take. You can read an invoice, change a field, and send the objects back unchanged on PATCH.

Reads never return merchant_default or customer_default. Flint resolves them when the draft is written, and the invoice keeps the result, so later settings changes don't rewrite an existing receivable:

You sendFlint resolves it to
collection.mode: merchant_defaultinvoices.default_collection_mode, or buyer_initiated when it isn't set. A resolved buyer_initiated takes invoices.payment_policy, then your checkout payment options, then the platform default of card, apple_pay, and google_pay.
payment_due.type: merchant_defaultpayment_terms with invoices.default_invoice_payment_term_id, or none when no default term is set.
payment_due.type: customer_defaultpayment_terms with the customer's default_invoice_payment_term_id. Without a customer that has one, the write returns 409 ACTION_NOT_ALLOWED with reason configuration_required.

Leaving out collection or payment_due is the same as sending merchant_default. This draft resolved both:

JSON
{
  "collection": {"mode": "automatic", "payment_method_id": null},
  "payment_due": {"type": "payment_terms", "invoice_payment_term_id": "ipt_1kmn0aExample"}
}

A read collection carries only the fields its mode uses: payment_policy for buyer_initiated, and payment_method_id for automatic, which is null on a draft when no card was chosen. A read payment_due carries due_date only for date, and invoice_payment_term_id only for payment_terms.

The top-level due_date is the effective calendar due date for every type. due_date_from is inclusive and due_date_to is exclusive; both take YYYY-MM-DD. It is what is_overdue, the due_date_from and due_date_to filters, and sort_by=due_date use. A payment_terms draft has no top-level due_date until issue computes it from the term, counted in the invoice's timezone.

Payment is due through the end of the due date in the invoice's timezone. An unpaid invoice becomes overdue at the start of the next day in that time zone.

Sending payment_terms again on a draft captures the term's current revision into payment_terms_snapshot, so edits you made to the term since apply from then on. Sending merchant_default or customer_default again resolves it again from the current settings.

A due_date sent on create or PATCH must be today or later in the invoice timezone. A past date returns 400 INVALID_REQUEST with detail INVALID_VALUE and param naming the date field. If a stored draft's due date passes before issue, issue returns 409 ACTION_NOT_ALLOWED with reason configuration_required; follow next_actions to PATCH the draft, then issue it again.

Payment terms#

A payment term is a reusable due-date rule, with an optional late fee. Create one once and reference it from invoices, set it as your default in invoices.default_invoice_payment_term_id, or set it on a customer as default_invoice_payment_term_id:

cURL
curl -X POST https://api.withflintpay.com/v1/invoice-payment-terms \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Idempotency-Key: term-net-30-001" \
  -d '{
    "name": "Net 30",
    "calculation": {"type": "net_days", "days": 30},
    "late_fee_policy": {
      "type": "percentage",
      "percent": 1.5,
      "grace_period_days": 10,
      "application_mode": "manual"
    }
  }'
calculation.typeDue date
on_receiptThe calendar date of issue.
net_daysdays after issue, 0 to 365.
day_of_monthThe next day of the month, 1 to 31, on or after the issue date.
day_of_next_monthday of the month after issue.
days_after_month_enddays after the last day of the month of issue.

Every due_date is a calendar date (YYYY-MM-DD) in the invoice's timezone, the merchant's timezone as it was when the draft was written, or UTC when the merchant had none. A schedule entry becomes collectible at the start of that date. Outstanding payments become overdue only after the date ends. An at_issue deposit is collectible and charged at issue. A day past the end of a short month clamps to its last day.

The late_fee_policy is fixed with amount_money, or percentage with percent (greater than 0, at most 100) applied to the unpaid balance. grace_period_days is 0 to 365; an on_receipt term with a late fee requires at least 1. Grace days count from the start of the due date, and fees are never eligible before that date ends. Late fees covers assessment.

An invoice copies the term into payment_terms_snapshot when the draft is written, and the policy is frozen at issue, so editing a term (PATCH /v1/invoice-payment-terms/{invoice_payment_term_id}) changes only invoices that capture it later. DELETE archives a term; a term that is still a default returns 409 RESOURCE_IN_USE with the defaults to change in blocking_resources.

Payment schedules#

schedule_entries splits the invoice into an optional deposit, installments, and a final balance. This $2,500.00 invoice takes 30% at issue and the rest on its due date:

cURL
curl -X POST https://api.withflintpay.com/v1/invoices \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Idempotency-Key: invoice-kitchen-remodel-001" \
  -d '{
    "type": "quick_pay",
    "quick_pay": {
      "customer_id": "cus_1kmn0aExample",
      "line_items": [{
        "type": "custom",
        "name": "Kitchen remodel design",
        "quantity": 1,
        "unit_price_money": {"amount": 250000, "currency": "USD"},
        "fulfillment": {"requirement": "none"}
      }]
    },
    "payment_due": {"type": "date", "due_date": "2026-12-15"},
    "recipient_email": "ap@example.com",
    "schedule_entries": [
      {
        "kind": "deposit",
        "amount_specification": {"type": "percentage", "percent": 30},
        "due": {"type": "at_issue"}
      },
      {
        "kind": "balance",
        "amount_specification": {"type": "remaining_balance"},
        "due": {"type": "invoice_due_date"}
      }
    ]
  }'
A 30% deposit on a $2,500.00 invoice
  • Deposit, due at issueschedule_entries[0].total_money
    30% of the total
    $750.00
  • Balance, due December 15schedule_entries[1].total_money
    $1,750.00
  • Invoice totalpricing_amounts.total_money
    $2,500.00

A schedule must follow these rules, or the write returns 400 INVALID_REQUEST with param naming the entry, such as schedule_entries[1].due.type:

  • At most 14 entries. Only the first can be a deposit, followed by up to 12 installment entries, and the last is always the balance.
  • A deposit or installment collects a fixed amount_money or a percentage of pricing_amounts.total_money (up to four decimal places). Together they must leave a positive amount for the balance, which uses remaining_balance.
  • A deposit is due at_issue or on a date, an installment on a date, and the balance on the invoice_due_date or a date. invoice_due_date needs the invoice to have a due date. Due dates can't go backward.
  • The invoice must have a positive total.

Each entry carries its own total_money, paid_money, credited_money, written_off_money, and outstanding_money, plus a status computed when you read it. Online collection always takes the first entry whose due date has started and that still has a balance, and currently_due_money is that entry's outstanding amount. Entries that aren't due yet can't be paid online early. To total what is overdue, add the outstanding_money of the entries whose status is overdue.

To replace a draft's schedule, send the complete schedule_entries array on PATCH with the invoice's current version as expected_version, which is required whenever schedule_entries is present. Include an entry's invoice_schedule_entry_id to keep that entry, and omit it to add a new one. [] clears the schedule; leaving the field out keeps it. On an issued invoice, each entry's due.due_date holds its resolved date: the issue date for at_issue, and the invoice's due_date for invoice_due_date.

An invoice with automatic tax can use any schedule. Issuing freezes the tax, and each entry's total_money includes its share. See Tax on an invoice.

Edit a draft#

PATCH /v1/invoices/{invoice_id} updates the billing fields with sparse semantics: fields you leave out are unchanged. Send null to clear recipient_email, reference, po_number, memo, footer, service_date, scheduled_issue_at, or external_reference_id. cc_emails takes the complete list, and [] removes every address. Reads always include the clearable fields, with null when unset, and return cc_emails and schedule_entries as [] when empty.

cURL
curl -X PATCH https://api.withflintpay.com/v1/invoices/inv_1kmn0aExample \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "expected_version": 1,
    "cc_emails": ["accounting@example.com"],
    "footer": "Questions? Contact billing@yourcompany.com"
  }'

expected_version is required with schedule_entries or quick_pay. A stale version returns 409 VERSION_CONFLICT with the current version in details[0].current_version.

To replace pricing on a Quick Pay draft, send the invoice version as expected_version. If you also read the backing order with GET /v1/orders/{order_id}, you can send its version as expected_order_version to require that exact order version. In quick_pay, send the complete line_items and any discounts or tax you want on the invoice. Use custom lines that require no fulfillment and keep the invoice's currency. Flint updates the order and the invoice together and keeps the linked customer. To keep the order’s existing tax exemption selection, omit tax.exemption. This applies to drafts without catalog lines, charges, tips, delivery, or payment activity. Change the scheduled issue time in a separate request.

Edit billing fields while the invoice is a draft. After issue, you can change reminders_paused and platform_fee_rule while it is open or partially_paid. Editing billing fields after issue returns 409 ACTION_NOT_ALLOWED with reason unsupported_state. To correct an issued invoice, issue a credit note, or void it and issue a new one.

Charge a platform fee#

Set platform_fee_rule on POST /v1/invoices using the partner app install token that creates the invoice. Both order and quick_pay invoices accept it, including when the merchant created the backing order. The merchant must approve a cap that covers the rule.

Flint prices each online payment separately, including payments from invoice checkout, automatic collection, saved-card retries, and collect. For a rule of 2% plus $0.30, a $20.00 deposit asks for $0.70 and an $80.00 balance payment asks for $1.90. The amount collected includes any late fee paid. An offline payment you record carries no platform fee.

To change the rule, send the whole replacement and the last invoice version as expected_version on PATCH /v1/invoices/{invoice_id}.

Response
{
  "expected_version": 3,
  "platform_fee_rule": {
    "percent": 2,
    "fixed_fee_money": {"amount": 30, "currency": "USD"},
    "maximum_fee_money": {"amount": 400, "currency": "USD"}
  }
}

Only the install that created the invoice can set or remove its rule. Send null with expected_version to remove it. Leaving the field out keeps the current rule. A change applies to payments created afterward.

Merchants read the active rule with its partner_app_id on the invoice. Buyer invoice responses omit it. Setting or replacing a rule in live mode requires an active platform_fees capability. If your app owner has yet to accept a Flint Platform Agreement version that covers rules, Flint refuses the write with 409 ACTION_NOT_ALLOWED and reason platform_onboarding_required. The creating install can still remove its rule with null and expected_version while the invoice is editable. See Checks when you set a rule and Find platform fees by invoice.

Issue the invoice#

If the order total changed since the draft was saved, issue refreshes the draft, clears any scheduled issue, and returns 409 VERSION_CONFLICT. Read the draft again and review the new total. Send its version as expected_version when you issue it. If the new total makes the payment schedule invalid, correct the schedule first.

cURL
curl -X POST https://api.withflintpay.com/v1/invoices/inv_1kmn0aExample/issue \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Idempotency-Key: issue-inv-1kmn0a-001" \
  -d '{"delivery_mode": "email"}'
Response
{
  "data": {
    "invoice_id": "inv_1kmn0aExample",
    "status": "open",
    "invoice_number": "1042",
    "issued_at": "2026-11-01T17:20:04Z",
    "delivery_mode": "email",
    "public_url": "https://checkout.withflintpay.com/i/inv_1kmn0aExample#invoice_token=...",
    "settlement_amounts": {
      "outstanding_money": {"amount": 250000, "currency": "USD"}
    }
  }
}

data is the full Invoice, shortened here. Issue does all of this in one operation:

  1. Moves draft to open, assigns invoice_number, and stamps issued_at.
  2. Freezes the billing snapshot. When the order has tax enabled, tax is recalculated first, and EU and UK VAT is also stated in local currency. From then on, nothing that happens to the order changes what the customer was billed.
  3. Computes due_date from the payment term, and resolves the schedule's due dates.
  4. Creates the hosted invoice link and returns it as public_url.
  5. Delivers the invoice according to delivery_mode, and schedules reminders, the overdue notice, and late fees.
  6. For an automatic invoice, schedules the saved-card charge at the later of issue and the start of the due date. An at_issue deposit charges at issue.

delivery_mode decides whether Flint emails the invoice:

delivery_modeWhat happens
emailFlint emails recipient_email and every cc_emails address, and emails reminders on your cadence. Requires customer_email_delivery.invoices to be flint_sends; otherwise returns 409 ACTION_NOT_ALLOWED, reason merchant_managed_email.
caller_managedFlint sends nothing. You deliver public_url yourself and send reminders when invoice.reminder_due arrives.
merchant_defaultcaller_managed when customer_email_delivery.invoices is merchant_sends, otherwise email. This is the default.

The resolved mode is returned as delivery_mode. Email delivery needs recipient_email. If the stored draft has none, issue returns 409 ACTION_NOT_ALLOWED, reason configuration_required, with error_source: merchant and next_actions to PATCH the draft's recipient_email. Create-and-issue still returns 400 INVALID_REQUEST with detail REQUIRED at recipient_email when no recipient can be resolved.

After you PATCH the recipient, send the issue request again, even with the same Idempotency-Key. Flint refuses a missing recipient before it starts the issue, so the retry is checked against the updated draft, as Retry after an error describes.

POST /v1/invoices/{invoice_id}/issue requires Idempotency-Key.

Warning: Issuing succeeds even when the email doesn't

The invoice is open and collectible once issue returns. The email is a separate delivery attempt: read it with GET /v1/invoices/{invoice_id}/delivery-attempts. Resend a failed email with send-reminder, not by issuing again. Delivery outcomes says when a resend is safe.

Issue checks the order again, because it is the last moment to catch a conflict. It fails when the order is no longer billable or has competing collection activity, such as an open checkout session or payment intent, with the blocking resources in details[0].blocking_resources. Resolve the conflict, then issue again. The refusal's next_steps says whether you can reuse its Idempotency-Key.

If an existing invoice's frozen tax calculation no longer matches its order, collection fails with 409 ACTION_NOT_ALLOWED and reason invoice_finalized. Void the invoice, then create and issue a new invoice for the order. See Tax on an invoice.

Create and issue in one call#

When nobody needs to review the draft, add issue to POST /v1/invoices. Flint creates the invoice and issues it in the same request, with the same checks and delivery as the issue endpoint:

cURL
curl -X POST https://api.withflintpay.com/v1/invoices \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Idempotency-Key: invoice-consulting-dec-001" \
  -d '{
    "type": "quick_pay",
    "quick_pay": {
      "customer_id": "cus_1kmn0aExample",
      "line_items": [{
        "type": "custom",
        "name": "Consulting, December 2026",
        "quantity": 1,
        "unit_price_money": {"amount": 250000, "currency": "USD"},
        "fulfillment": {"requirement": "none"}
      }]
    },
    "recipient_email": "ap@example.com",
    "issue": {"delivery_mode": "email"}
  }'

The response is 201 with the invoice already open, carrying invoice_number, issued_at, and public_url. issue.delivery_mode defaults to merchant_default, so "issue": {} is enough.

  • If issuing would fail a check, such as email delivery without recipient_email, nothing is created. Fix the request and send it again.
  • If Flint created the invoice but issuing failed partway, for example because tax couldn't be recalculated, the invoice stays a draft, and the error's details name it with resource_type invoice and its resource_id. Retry with the same Idempotency-Key: Flint finishes issuing that invoice instead of creating a second one, and never sends the email or starts an automatic charge twice. The same holds when the request timed out before you got a response.
  • If the email fails, the invoice is still open. Check the attempt's failure_reason in Delivery outcomes before resending with send-reminder.
  • issue can't be combined with scheduled_issue_at. Sending both returns 400 INVALID_REQUEST with detail NOT_ALLOWED and param issue.

A retry of a completed request with the same key returns the original response. The replay includes public_url only under the one-time secret rules, for create, issue, and regenerate-public-link alike. Otherwise, read the current link with GET /v1/invoices/{invoice_id}. If you lost track of a create entirely, find it with GET /v1/invoices?idempotency_key={key}, as Recovery by key describes.

Schedule the issue#

Set scheduled_issue_at on a draft and Flint issues and emails it at that time:

cURL
curl -X PATCH https://api.withflintpay.com/v1/invoices/inv_1kmn0aExample \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{"scheduled_issue_at": "2026-12-01T14:00:00Z"}'

The time must be in the future, or the request returns 400 INVALID_REQUEST with detail INVALID_VALUE. A scheduled issue delivers by email, so the draft needs recipient_email, and scheduling returns 409 ACTION_NOT_ALLOWED with reason merchant_managed_email while customer_email_delivery.invoices is merchant_sends. Flint checks delivery when you schedule and again when the time arrives. If the issue fails then, the invoice stays a draft, scheduled_issue_at is cleared, and invoice.issue_failed reports it.

To cancel, send "scheduled_issue_at": null. Issuing the draft yourself or voiding it also clears the schedule.

What the customer receives#

The invoice email is titled "New invoice" and carries the invoice number, amount due, due date, PO number, memo, and footer, with a "Pay invoice" button that opens the hosted page. For an automatic invoice, the button reads "View invoice" and the email says when the saved card is charged. Reminders use the same layout under "Invoice reminder".

The hosted page at public_url shows the frozen invoice document. A buyer_initiated invoice offers the payment options its policy allows, and an automatic invoice offers card payment. A partially paid invoice shows what remains, and a closed invoice explains that nothing is left to pay. The first view stamps viewed_at, records a viewed activity, and sends invoice.updated. Later views send no new invoice event.

The link works like a key: anyone who has it can view and pay the invoice. It stays valid past the due date. If a link leaks, or an email was forwarded where it shouldn't have gone, replace it:

cURL
curl -X POST https://api.withflintpay.com/v1/invoices/inv_1kmn0aExample/regenerate-public-link \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Idempotency-Key: regen-inv-1kmn0a-001"

The old link and any checkout credentials created from it stop working immediately. The open checkout session and its payment history are kept. The response is the Invoice with the new link in data.public_url, and reminders always carry the current link. Before issue there is no link to replace, and the request returns 409 ACTION_NOT_ALLOWED with reason status_not_reached.

Build your own invoice page#

With an invoice ID and its access token, the invoice_token in the public_url fragment, your page can read the same buyer-safe document the hosted page shows. Keep the token private and send it as the bearer credential:

cURL
curl https://api.withflintpay.com/v1/me/invoices/inv_01J00000000000000000000000 \
  -H "Authorization: Bearer INVOICE_ACCESS_TOKEN"

Render issue_rows and balance_rows in the order returned, without merging rows or computing replacements. Each row has kind, a signed amount_money, and is_informational. The non-informational issue rows sum to pricing_amounts.total_money, and when balance rows are present, their non-informational rows sum to outstanding_money. A closing total or amount_due row is informational and states the sum. An opening or sole total row counts toward the sum. Balance rows are empty when nothing changed after issue, or when the invoice is voided. Show promotion_code, taxable_money, occurred_at, and credit_note_number when a row includes them. Tax is rounded line by line, so a tax row's amount_money can differ from percent of taxable_money. When it does, the hosted page and PDF add "rounded per line" after the taxable amount.

FieldWhat to do with it
payment_optionsThe supported online payment methods, including for a future scheduled payment. Check buyer_actions to see whether the buyer can pay now.
collection_modeWhether collection is buyer_initiated, automatic, or external.
active_payment_attemptA payment in progress, such as a bank debit still processing, in the InvoicePaymentAttempt shape.
payment_option_cost_comparisonThe lower-cost option, the option it is compared with, and a positive estimated_savings_money, when present. For a schedule, savings use the amount the checkout collects.
merchant_logo, merchant_icon, theme, show_flint_mark, merchant_supportYour branding and contact details. The theme comes from your branding settings. Unset fields are omitted.

Download the document with GET /v1/me/invoices/{invoice_id}/pdf. To take payment, call POST /v1/me/checkout-sessions with the same token, type: invoice and the invoice_id, and use the checkout session it returns. The token opens only its own invoice: any other invoice_id returns 404 RESOURCE_NOT_FOUND, and an expired or revoked token returns 401 INVALID_CREDENTIAL. A customer session can call all three routes too. GET /v1/me/invoices lists invoices without the document fields.

A token read stamps viewed_at once. Starting checkout with the token stamps it only once checkout is created or reused. Customer-session reads leave viewed_at alone. If you regenerate the link while checkout is starting, the request returns 409 ACTION_NOT_ALLOWED with reason terminal_status and param Authorization; ask the buyer to open the current link. Responses on the token routes carry the Flint-Mode and Flint-Merchant-Id headers, and Flint-Sandbox-Id in test mode.

Collect payment#

Only one payment attempt can be active on an invoice at a time, across every way of paying. Each attempt is recorded and listed, including ones that failed.

Each payment Flint collects for an invoice, from the hosted page, your own checkout, or a saved card, carries the processing fee plus an invoice_collection add-on fee: 0.40% of the payment at published rates. A subscription's invoice carries subscription_collection instead. A payment you record carries neither. merchant_net_money on the payment intent is what you keep.

Pay from the hosted invoice#

Customers usually pay from the email or the hosted page, and you don't need to call anything. When your own surface starts the payment, such as a "Pay now" button in your customer portal, open an invoice checkout session:

cURL
curl -X POST https://api.withflintpay.com/v1/checkout-sessions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{"type": "invoice", "invoice_id": "inv_1kmn0aExample"}'
Response
{
  "data": {
    "checkout_session_id": "cs_1kmn0aExample",
    "type": "invoice",
    "status": "open",
    "invoice_id": "inv_1kmn0aExample",
    "url": "https://checkout.withflintpay.com/checkout/cs_1kmn0aExample#checkout_token=..."
  }
}

type: invoice needs the commerce.invoices.write scope. Send the buyer to url. Hosted launches omit checkout_auth_token. For your own checkout UI, send "surface": "headless"; the response returns checkout_auth_token instead of a hosted URL, as Collect an invoice or a return balance describes.

The endpoint works for buyer_initiated and automatic invoices that are open or partially_paid with an amount due now; an automatic invoice takes cards only. It returns the current open session when one still matches the invoice's balance, with 200 and nothing created. Otherwise it creates a session and attempt and returns 201. The status code is the only signal of reuse. A retry with the same Idempotency-Key repeats the first response, including its status.

To bring the buyer back to your customer account after they pay, send return_url:

cURL
curl -X POST https://api.withflintpay.com/v1/checkout-sessions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{"type": "invoice", "invoice_id": "inv_1kmn0aExample", "return_url": "https://account.cedarandstone.com/invoices/inv_1kmn0aExample"}'

return_url must be an HTTPS address in your customer account: a path under /{merchant_id} on account.withflintpay.com, your active custom account domain, or the host of customer_account.merchant_account_url when you host the account yourself. Test mode also accepts http://localhost and http://127.0.0.1 on any port. Anything else returns 400 INVALID_REQUEST on return_url. A reused session takes a new return_url until a payment starts on it, then keeps the one it has.

Each session records its try as an invoice payment attempt; read them with GET /v1/invoices/{invoice_id}/payment-attempts, and the invoice with GET /v1/invoices/{invoice_id}. expected_amount_money is what it collects: the outstanding balance, or the due schedule entry's outstanding amount, named by invoice_schedule_entry_id. Card attempts, including Apple Pay, Google Pay, and Affirm, have rail: card; bank debits have rail: ach_debit. An ACH debit stays processing until it settles or fails. Final statuses are succeeded, failed, canceled, and expired, and succeeded means the attempt completed successfully even if a balance remains.

Issuing an invoice fixes the order's delivery and address. Buyers can't change either, including by quoting delivery, selecting another method, or releasing a selection. These writes return 409 ACTION_NOT_ALLOWED with reason configuration_required; details[0] identifies the invoice. Reading the current delivery stays available. Ask the merchant to void the invoice and issue a new one to change delivery or the address.

Set delivery through the delivery field on PATCH /v1/orders/{order_id} before issuing, or on POST /v1/orders when creating the order. Issue returns 409 ACTION_NOT_ALLOWED with reason configuration_required when a shippable order has no delivery selection or charge, or when automatic or external tax needs a delivery address that isn't set. An invoice checkout collects the fixed balance and doesn't offer the merchant's default delivery methods. For buyer-chosen shipping, use an ordinary checkout session or a payment link.

If an earlier session still has payment work resolving, the endpoint returns OPERATION_IN_PROGRESS instead of starting a competing payment. The hosted page waits and checks again on its own.

Note: Collect invoiced orders only through the invoice

Use type: invoice, never a type: order checkout session or a payment intent for the order. Generic attempts are rejected while the invoice is open, and this endpoint keeps the payment tied to the invoice's balance, events, and webhooks.

Pay in your own checkout#

To collect the invoice in a checkout you build, send "surface": "headless" to the same endpoint, or to POST /v1/me/checkout-sessions with a customer session. Offering Affirm also needs payment_return_url.

cURL
curl -X POST https://api.withflintpay.com/v1/checkout-sessions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Idempotency-Key: pay-inv-1kmn0a-headless" \
  -d '{"type": "invoice", "invoice_id": "inv_1kmn0aExample", "surface": "headless"}'

The response is the checkout session with checkout_auth_token and no hosted url. Pay the session with the checkout credential, as Build your own checkout describes.

If a checkout card declines, the invoice payment attempt becomes failed with last_payment_error. Collect a new credential and send action: "pay" on the same session with a new Idempotency-Key. Flint reuses the session's single unconfirmed payment intent; you don't need to select it explicitly. A payment still processing, such as ACH debit, must finish before another payment starts. See Retry after a decline.

An invoice has one open checkout session at a time. A request for the session's current surface returns it with a new credential and 200. A request for the other surface replaces the session when no payment is in progress on it, and returns 409 ACTION_NOT_ALLOWED with reason in_progress when one is.

Automatic collection#

An automatic invoice picks its card at issue: collection.payment_method_id, or the customer's default card. With neither, issue returns 409 ACTION_NOT_ALLOWED with reason configuration_required. Flint charges the card at the later of issue and the start of the due date, including each schedule entry, as a charge the customer is not present for. Only reusable saved cards work; ACH debit and Affirm aren't available for automatic charges. Save a card and charge it later covers saving the card.

To charge the card again before the next scheduled retry:

cURL
curl -X POST https://api.withflintpay.com/v1/invoices/inv_1kmn0aExample/collect \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Idempotency-Key: collect-inv-1kmn0a-001" \
  -d '{}'

The response is 200 with invoice and invoice_payment_attempt, whether or not the charge succeeded, so read the attempt's status. A declined charge returns the attempt as failed with last_payment_error, whose code, message, failed_at, and remediation match a payment intent's. Replaying the same Idempotency-Key returns the same attempt without charging again; use a new key to try again.

Send payment_method_id to charge another active saved card of the same customer for this attempt only; future automatic charges still use the card chosen at issue. collect works only on automatic invoices. The buyer can still pay with a different card from the hosted page.

Track and cancel payment attempts#

Each online collection has a PaymentIntent. Read its status, last_payment_error, and supported_actions for the payment outcome. Its invoice_id names the invoice, and invoice_schedule_entry_id names the installment when it collects one. These owner links appear on payment intent reads, lists, and webhooks.

List an invoice's attempts with GET /v1/invoices/{invoice_id}/payment-attempts, newest first, or fetch one by ID. The attempt's payment_intent_id identifies the payment to read or cancel:

cURL
curl -X POST https://api.withflintpay.com/v1/payment-intents/pi_1kmn0aExample/cancel \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Idempotency-Key: cancel-invoice-payment-001"

Cancel requires payments.payment_intents.write and returns the PaymentIntent. A successful cancellation releases the invoice's active collection slot. A processing payment, including ACH debit, returns 409 ACTION_NOT_ALLOWED with reason in_progress. A settled payment returns the same code with reason terminal_status; refund it instead.

A second collect while a collection is active returns 409 PAYMENT_ATTEMPT_ACTIVE. details[0] names the payment_intent with resource_id, current_status, and supported_actions. Cancel it when cancel is listed, or wait for its outcome before collecting again. A canceled or expired payment keeps that outcome; a payment awaiting buyer authentication keeps requires_action instead of being reported as a decline.

The invoice payment attempt routes and invoice events remain available. collect keeps its name, request, and response shape.

Record an offline payment#

When a check clears, a wire lands, or cash changes hands, record it so the balance reflects it. The monthly allowance for orders paid outside Flint never prevents recording a payment. Orders past the allowance cost $1 each. Live accounts follow these rules:

  • The allowance is 20 orders plus 1 order for every $1,000 collected through Flint that month, rounded down. An account that collects $12,500 through Flint in a month has an allowance of 32 orders.
  • Collected through Flint is live USD payments by card, Apple Pay, Google Pay, ACH debit, and Affirm, counted in the month they were captured, minus refunds that succeeded that month, whatever month the payment was captured. It never goes below zero. Disputes and ACH returns do not reduce it.
  • An order counts once when it is paid in full and at least one payment on it was recorded outside Flint. Installments, retries, and replays do not count again, and reversing a payment does not remove the count.
  • The month runs from the first to the last day of the calendar month in New York time, and the count and the allowance start over on the first. Sandbox payments do not count.
  • Each counted order past the allowance costs $1. Flint bills the month's orders past the allowance as one event_fee entry in merchant billing, 48 hours after the month ends, for example 46 counted orders against an allowance of 32 is 14 orders, or $14.00. Orders recorded after that entry posts still count as usage, but Flint doesn't rebill the month.
  • Billing for orders past the allowance starts with the first full calendar month, New York time, that this policy covers on your account. A month that started before the exact time the policy was assigned to the account has no charge, so a new account or a policy assigned at any time after a month started begins billing the next month. A policy that takes effect exactly at the start of a month bills that month in full. A negotiated agreement can change the allowance and the price, or remove the allowance.
  • A past-due balance made up only of these fees is collected like any other, but it never holds payouts.

Each recording creates an invoice manual payment:

cURL
curl -X POST https://api.withflintpay.com/v1/invoices/inv_1kmn0aExample/manual-payments \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Idempotency-Key: manual-pay-check-4521" \
  -d '{
    "amount_money": {"amount": 150000, "currency": "USD"},
    "received_at": "2026-11-20T00:00:00Z",
    "payment_reference": "check-4521",
    "note": "Check #4521, received by mail"
  }'
Response
{
  "data": {
    "invoice_manual_payment": {
      "invoice_manual_payment_id": "omp_1kmn0aExample",
      "invoice_id": "inv_1kmn0aExample",
      "amount_money": {"amount": 150000, "currency": "USD"},
      "received_at": "2026-11-20T00:00:00Z",
      "payment_reference": "check-4521",
      "note": "Check #4521, received by mail",
      "status": "recorded"
    },
    "invoice": {
      "invoice_id": "inv_1kmn0aExample",
      "status": "partially_paid",
      "version": 3,
      "settlement_amounts": {
        "paid_money": {"amount": 150000, "currency": "USD"},
        "outstanding_money": {"amount": 100000, "currency": "USD"}
      }
    }
  }
}

The response is 201, shortened here. Keep invoice_manual_payment_id, which starts with omp_: you need it to retrieve or reverse the payment. The invoice's new version is the next manual payment's expected_invoice_version or reversal's expected_version.

  • amount_money must be positive, in the invoice currency, and no more than the remaining balance. A currency mismatch returns 400 INVALID_REQUEST with detail NOT_ALLOWED, and too much returns LIMIT_EXCEEDED. One payment can cover principal and late fees; send the full amount received.
  • received_at dates the payment for your records and defaults to now.
  • payment_reference holds your check, wire, or bank reference, up to 255 characters, stored as sent. note takes up to 4,096 characters.

A payment that leaves a balance moves the invoice to partially_paid and sends invoice.partially_paid, every time. A payment that clears the balance moves it to paid, stamps paid_at, and sends invoice.paid. Each recording also sends invoice_manual_payment.created. The order sends order.partially_paid the first time it is partly paid and order.paid once it is paid in full.

Recording is refused with OPERATION_IN_PROGRESS only while an online payment is resolving, because the customer may be paying a balance your check just changed. Wait for it to finish and retry. An open checkout where the customer hasn't started paying doesn't block. After a partial payment, the next checkout collects the new balance. A payment that clears the balance closes the open checkout with reason invoice_paid_elsewhere, so the hosted page can't collect twice.

Idempotency-Key is required, and a retry with the same key never records a second payment. If you can't tell whether a request took effect, for example after IDEMPOTENCY_RECOVERY_REQUIRED, look it up with GET /v1/invoices/{invoice_id}/manual-payments?idempotency_key={key} before recording again under a new key.

Allowance warning#

When recording a payment puts an order past the month's allowance, the response is still 201 and carries a warning in meta.warnings:

JSON
{
  "data": {"invoice_manual_payment": {"...": "..."}, "invoice": {"...": "..."}},
  "meta": {
    "warnings": [
      {
        "code": "external_paid_orders_over_allowance",
        "severity": "warning",
        "message": "This order is past the monthly allowance for orders paid outside Flint. The payment is recorded, and the month's final count settles after it ends.",
        "resource_type": "order",
        "resource_id": "ord_1kmn0aExample",
        "resets_at": "2026-12-01T05:00:00Z"
      }
    ]
  }
}
  • resource_id is the order the payment belongs to. resets_at is the end of the New York calendar month in which Flint counted that order, which is when the count and the allowance start over.
  • Flint compares the order's place in the month's count with the allowance at the time you record the payment. Card volume collected later in the month can raise the allowance, and refunds can lower it, so the warning doesn't say whether the order is billed. The month's final count settles after it ends.
  • A retry with the same Idempotency-Key returns the original result, including resets_at for the original month, even after the month has changed. It doesn't count another order.
  • Recording the payment never depends on the warning. If Flint can't work out the warning, the payment is still recorded and the response has no warning, so a missing warning doesn't show that the order is within the allowance.
  • Sandbox payments, accounts without an allowance, and payments on orders within the allowance have no warning.

Flint also sends a Dashboard notification and an email as a month's usage nears and passes the allowance. Orders paid outside Flint has the thresholds.

List and retrieve manual payments#

Manual payments are separate from online payment attempts. List an invoice's manual payments, reversed ones included, newest received_at first, then by descending invoice_manual_payment_id:

cURL
curl "https://api.withflintpay.com/v1/invoices/inv_1kmn0aExample/manual-payments" \
  -H "Authorization: Bearer YOUR_API_KEY"

A page holds 20 payments by default; pass next_page_token as page_token for the next one. Retrieve one with GET /v1/invoices/{invoice_id}/manual-payments/{invoice_manual_payment_id}. An ID that doesn't belong to that invoice returns 404 RESOURCE_NOT_FOUND.

status is a closed vocabulary: recorded while the payment counts toward paid_money, and reversed once it has been reversed. reversed is final. A reversed payment also carries reversed_at, and reversal_note when one was sent.

Reverse a manual payment#

If a check bounces or a payment was recorded by mistake, reverse that payment by its ID:

cURL
curl -X POST https://api.withflintpay.com/v1/invoices/inv_1kmn0aExample/manual-payments/omp_1kmn0aExample/reverse \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Idempotency-Key: reverse-check-4521" \
  -d '{"reversal_note": "Check #4521 returned NSF"}'

Every body field is optional: expected_version, reversed_at, and reversal_note. reversed_at defaults to now and can't be earlier than the payment's received_at (400 INVALID_REQUEST, detail INVALID_VALUE). The response is 200 with the reversed payment in data.invoice_manual_payment and the updated invoice in data.invoice.

A reversal undoes the whole payment. To correct an amount, reverse the payment and record the right one. It is a bookkeeping correction, not a refund: it undoes recorded offline money only, never card money, and removes exactly what that payment contributed to the invoice, its order, and any gift card value it funded, even when another payment has the same amount.

The amount returns to outstanding_money. A paid invoice goes back to partially_paid, or to open when no collected payments remain, and a partially_paid invoice goes back to open when its last collected payment is reversed. If the invoice was written off, the reversal restores written_off_money instead. Reversing full recovery changes paid back to uncollectible and sends invoice.marked_uncollectible. Each reversal sends invoice_manual_payment.reversed; invoice.reopened reports a return to open or partially_paid. To return card money, refund it instead.

Idempotency-Key is optional here, because a payment can be reversed only once. With a key, a retry returns the same result, even if the first response was lost. Without one, reversing an already reversed payment returns 409 ACTION_NOT_ALLOWED with reason terminal_status. A draft or voided invoice returns ACTION_NOT_ALLOWED with reason unsupported_state, and a resolving online payment returns OPERATION_IN_PROGRESS.

Collection blocks#

Invoices you create are never blocked; their collection_block_status reads none. Flint creates a blocked invoice only for a subscription renewal that can't get stock, when the matching inventory.origin_policies entry in your settings sets subscription_inventory_block_action to inventory_blocked_open_invoice. The invoice records the renewal as a receivable while the subscription waits:

  1. Created and issued. At the renewal, Flint creates an invoice for the renewal order and issues it without charging anything. It has status: "open", collection_block_status: "inventory_blocked", collection.mode: "external", payment_due.type: "none" with no due_date, and delivery_mode: "caller_managed", so Flint emails nothing. Its subscription_id names the subscription, and the subscription's inventory_wait.invoice_id points at it. You receive invoice.issued, invoice.collection_blocked, and subscription.updated.
  2. While blocked. collect, both checkout session routes, recording a manual payment, and send-reminder return 409 ACTION_NOT_ALLOWED with reason inventory_wait. The renewal order does not list pay in supported_actions. Automatic reminders do not fire, and the hosted page tells the buyer that payment is temporarily unavailable. You can still read the invoice, download its PDF, and list its activities.
  3. At the daily stock check. Flint checks once a day. When a check finds enough stock, Flint voids the invoice with collection_block_status: "resolved", then charges the renewal on its order the way any renewal is charged. You receive invoice.collection_block_resolved and invoice.voided, then order.paid and subscription.payment_succeeded when the charge succeeds. The invoice itself is never paid and sends no invoice.paid.

The wait also ends if the subscription's items change, or the cycle is skipped, paused, or canceled; see Renewals that need attention. To find a subscription's invoices, filter GET /v1/invoices by subscription_id.

Follow up on an unpaid invoice#

Issuing an invoice schedules its follow-up. While a balance remains, Flint sends reminders on your cadence, sends invoice.overdue after due_date ends, raises a late fee when the payment term carries one, and retries a saved card. Each step checks first that the invoice is still collectible: a payment that lands first cancels the rest, and nothing fires on a paid, voided, uncollectible, or credited invoice.

is_overdue is computed when you read the invoice. It is true on an open or partially_paid invoice whose due_date has ended in its timezone with a balance remaining, or, with a schedule, when an entry is overdue.

Reminder cadence#

Reminders come from invoices.reminder_policy in your settings, up to 20 rules. Each rule is an offset in days from the due date, negative for a heads-up before it:

Response
{
  "invoices": {
    "reminder_policy": {
      "rules": [
        {"days_from_due": -3},
        {"days_from_due": 7},
        {"days_from_due": 21}
      ]
    }
  }
}

Reminders run at 23:59:59 on the configured local date in the invoice's timezone, including across daylight saving changes. Rules on or before the local issue date are skipped. The timezone is the merchant's timezone from when the draft was written, or UTC when the merchant had none. With no rules, no automatic reminders go out. For email delivery, automatic reminders and late fee notices or assessments wait for the first invoice email to be sent. Each action stops waiting without running if the first email is still unsent 24 hours after issue.

The policy is frozen onto the invoice at issue. Editing your settings changes the cadence for invoices you issue later and leaves the ones already out alone.

Each reminder sends invoice.reminder_due, carrying the invoice. With delivery_mode: "email", Flint has already emailed the reminder, unless customer_email_delivery.invoices was switched to merchant_sends after issue, when the attempt is suppressed. With caller_managed, Flint sends nothing, and the event is your cue to send it yourself. Branch on the invoice's delivery_mode and one handler covers both.

Pause and resume#

When a customer replies, promises a check, or disputes the bill, stop the reminders without touching the schedule:

cURL
curl -X PATCH https://api.withflintpay.com/v1/invoices/inv_1kmn0aExample \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Idempotency-Key: pause-inv-1kmn0a-001" \
  -d '{"reminders_paused": true}'

The response is the invoice, with reminders_paused and reminders_paused_at. Pausing or resuming sends invoice.updated. Send false to resume; reminder times that passed while paused don't fire. Sending the current value succeeds without a change or a new invoice event. Send reminders_paused alone, with expected_version, or with a versioned platform_fee_rule change. It works only on an open or partially_paid invoice with a balance; otherwise it returns 409 ACTION_NOT_ALLOWED with reason field_locked and param reminders_paused.

Pausing stops automatic reminders only. send-reminder still works, and invoice.overdue and invoice.late_fee_due still fire.

Late fees#

When the invoice's payment term carries a late_fee_policy, Flint sends invoice.late_fee_due once the grace period after due_date has passed with a balance remaining. On a scheduled invoice, it fires per overdue entry. What happens next depends on the policy's application_mode:

  • manual, the default: the event is a notice. Assess the fee yourself, from your webhook handler or after a review.
  • automatic: Flint assesses the fee itself, after any resolving payment finishes, and sends the customer a fee notice when invoice email delivery is enabled.

To assess a fee, call the late fees endpoint. Send {} for an invoice without a schedule, or the overdue entry's invoice_schedule_entry_id for a scheduled one. The late_fee_due activity names the entry.

cURL
curl -X POST https://api.withflintpay.com/v1/invoices/inv_1kmn0aExample/late-fees \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Idempotency-Key: late-fee-inv-1kmn0a-001" \
  -d '{}'

Flint calculates the fee from the frozen policy and the unpaid balance at that moment, excluding earlier fees, so a payment that arrived after the notice lowers the fee. A 1.5% fee on a $2,500.00 balance is $37.50. The response is the invoice, with the fee in late_fees: its base_outstanding_money, amount_money, and its paid, waived, written-off, and outstanding amounts.

Each invoice, or each schedule entry, takes at most one fee, even with a different idempotency key and even after a waiver. The fee raises late_fee_money and the outstanding balance, and appears as a dated addition on the hosted invoice and PDF; the issued line items, tax, and total_money stay as they were. A manually assessed fee doesn't start a payment or send an email. Fees are one-time amounts without compounding or tax.

The endpoint returns 409 ACTION_NOT_ALLOWED with reason status_not_reached before the grace period has passed, and not_offered when the invoice has no late fee policy or no balance to charge it on.

To waive what is still unpaid on a fee:

cURL
curl -X POST https://api.withflintpay.com/v1/invoices/inv_1kmn0aExample/late-fees/inlf_1kmn0aExample/waive \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Idempotency-Key: waive-inlf-1kmn0a-001" \
  -d '{"reason_message": "Courtesy waiver"}'

reason_message is required, 1 to 4,096 characters, and visible only to you. A waiver leaves money already collected in place; refund it through the Refunds API. Listen for invoice.late_fee_assessed and invoice.late_fee_waived to track the balance.

Saved-card retries#

When an automatic invoice's charge declines, Flint retries the card chosen at issue on invoices.autopay_retry_policy.retry_day_offsets: up to five offsets, 1 to 30 days after the failure. Like the reminder policy, the retry schedule is frozen at issue. If your account can't take payments when a charge or retry is due, Flint waits and tries again each day until it can, without using up a retry or telling the customer the payment failed. Call collect to try sooner.

Send one yourself#

cURL
curl -X POST https://api.withflintpay.com/v1/invoices/inv_1kmn0aExample/send-reminder \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Idempotency-Key: reminder-inv-1kmn0a-001"

send-reminder emails a collectible invoice, open or partially_paid with a balance, as a new delivery attempt. Use it to resend after a failed email, or after you speak with the customer. Check the earlier attempt's failure_reason first; Delivery outcomes says when a resend is safe. The response is the Invoice; read the attempt with GET /v1/invoices/{invoice_id}/delivery-attempts. Another status returns 409 ACTION_NOT_ALLOWED with reason unsupported_state, or not_offered when nothing is collectible.

To run your own chase list instead of the built-in cadence, leave reminder_policy empty and query the receivables:

cURL
curl -G https://api.withflintpay.com/v1/invoices \
  -H "Authorization: Bearer YOUR_API_KEY" \
  --data-urlencode "is_overdue=true" \
  --data-urlencode "status=open,partially_paid" \
  --data-urlencode "sort_by=due_date" \
  --data-urlencode "sort_direction=asc"

Call send-reminder for each result, and check each invoice's reminder_sent activities to avoid sending too many.

Close or correct an invoice#

SituationActionResult
The invoice shouldn't exist: a duplicate, a wrong amount, a canceled dealVoid itvoided, nothing owed, order released
Part of the bill was wrong, before or after paymentIssue a credit noteBalance reduced, or a refund linked to the note
The customer won't pay the restMark it uncollectibleuncollectible, balance written off
The customer paid by card and should get money backRefundstatus unchanged, refund_status updated

Void an invoice#

cURL
curl -X POST https://api.withflintpay.com/v1/invoices/inv_1kmn0aExample/void \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Idempotency-Key: void-inv-1kmn0a-001"

Void works on drafts, open invoices, and partially_paid invoices whose collected payments have all been refunded (refund_status: "refunded"). Anything else returns 409 ACTION_NOT_ALLOWED with reason unsupported_state. Void sets outstanding_money to 0, stamps voided_at, cancels any scheduled issue and follow-up, sends invoice.voided, and releases the backing order so it can be edited or collected again. The hosted page stays reachable and tells the customer there is nothing to pay. Void is final.

When money has already moved:

  • Paid in part by check or wire: reverse each manual payment, which returns the invoice to open, then void it.
  • Paid by card: refund it first; the invoice keeps its paid or partially_paid status, and refund_status records the refund. After refunding a deposit in full, void the partially_paid invoice to cancel the remaining balance, automatic charges, and reminders. Refunding alone does not cancel the invoice. The payment and schedule amounts keep the collection history; settlement_amounts.refunded_money records the returned money.
  • An issued credit note against it: void returns 409 RESOURCE_IN_USE with the credit note IDs in details[0].blocking_resources. Reverse the note's allocations and void the credit note, then void the invoice.

A declined payment doesn't block void. Flint cancels the invoice's unused payment intents and closes its checkout with reason invoice_voided. Cancellation is retried automatically if the payment processor is temporarily unavailable. An open checkout where the customer hasn't started paying also closes with the invoice.

Payment work that could still collect money blocks void. OPERATION_IN_PROGRESS names the payment in blocking_resources while Flint finishes processing it. A payment awaiting authentication, capture, or cancellation returns ACTION_NOT_ALLOWED with reason in_progress; finish or cancel the named payment first. Payment records that Flint must reconcile return ACTION_NOT_ALLOWED with reason reconciliation_required; contact Flint support with the request ID. While this work blocks collection changes, supported_actions omits void and mark_uncollectible.

Void accepts expected_version. A stale version returns 409 VERSION_CONFLICT with details[0].current_version. If a related record, such as the order or checkout, changes while the void runs, void returns 409 CONCURRENT_MODIFICATION and nothing is voided; send the same request again with the same Idempotency-Key.

Mark an invoice uncollectible#

When an issued balance won't be paid, write it off:

cURL
curl -X POST https://api.withflintpay.com/v1/invoices/inv_1kmn0aExample/mark-uncollectible \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Idempotency-Key: write-off-inv-1kmn0a-001"

It works on open and partially_paid invoices with a balance; anything else returns 409 ACTION_NOT_ALLOWED with reason unsupported_state. Flint writes off the remaining balance, including unpaid late fees, stamps uncollectible_at and closed_at, closes any open checkout, cancels the follow-up, and sends invoice.marked_uncollectible. A declined payment doesn't block the write-off: Flint cancels its unused payment intent. Payment work that could still collect money must finish or be canceled first. The request names it in blocking_resources and returns the same payment conflicts as void.

A $100.00 invoice with $40.00 paid closes with $60.00 in written_off_money and 0 in outstanding_money.

If money arrives later, record a manual payment up to the written-off balance. A $20.00 recovery raises paid_money to $60.00 and lowers written_off_money to $40.00; the invoice stays uncollectible. Recovering the full balance changes it to paid. Reversing a manual payment restores its amount to written_off_money. Online collection, reminders, and late fees do not restart.

The backing order reports $40.00 in paid_money, $60.00 in settlement_amounts.written_off_money, and $0 in outstanding_money, and its payment_status stays partially_paid because only $40.00 was paid. A write-off isn't money: it doesn't raise net_collected_money or create overpaid_money, and it can't be refunded or used to fund an exchange.

Refund an invoiced order#

Refund card or bank money through the Refunds API against the backing order. When the refund corrects the bill itself, such as a line billed at the wrong rate, refund a credit note instead: the customer gets a numbered document, and the refund carries its credit_note_id and invoice_id.

Either way, the invoice records refunds separately from its balance: refunded_money grows and refund_status moves through partially_refunded to refunded. status doesn't change and the balance doesn't reopen.

Refund status events fire only when refund_status changes. For two partial refunds followed by a refund of the remaining amount:

  1. The first partial refund changes refund_status from none to partially_refunded and sends invoice.partially_refunded.
  2. The second partial refund increases refunded_money but leaves refund_status unchanged, so it sends invoice.updated.
  3. The final refund changes refund_status to refunded and sends invoice.refunded.

A correction that returns refund_status to none sends invoice.updated. Refund status events have no companion invoice.updated, and replaying a refund fact that leaves the invoice unchanged sends no new invoice event. Follow refund.* for each refund's own progress.

Download the PDF#

cURL
curl https://api.withflintpay.com/v1/invoices/inv_1kmn0aExample/pdf \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -o invoice-1042.pdf

The PDF renders from the invoice's snapshot. For a draft it previews the current content; from issue on, it is the frozen billing document, unaffected by later changes to the order. The endpoint returns application/pdf directly, so save it to a file or pass it through to your own back office. In test mode, the PDF carries a "Test mode" band.

Handle webhook events#

Deliveries and payments happen long after your API call returns, so webhooks are how your system finds out. Register an endpoint for the invoice events you need:

cURL
curl -X POST https://api.withflintpay.com/v1/webhook-endpoints \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Idempotency-Key: webhook-invoicing-001" \
  -d '{
    "url": "https://example.com/webhooks/flint",
    "enabled_events": [
      "invoice.updated",
      "invoice.issued",
      "invoice.issue_failed",
      "invoice.partially_paid",
      "invoice.paid",
      "invoice.credited",
      "invoice.reopened",
      "invoice.voided",
      "invoice.marked_uncollectible",
      "invoice.partially_refunded",
      "invoice.refunded",
      "invoice_payment_attempt.succeeded",
      "invoice_payment_attempt.failed",
      "invoice_manual_payment.created",
      "invoice_manual_payment.reversed",
      "invoice_delivery_attempt.failed"
    ],
    "description": "Invoice lifecycle"
  }'

invoice.issue_failed and invoice.marked_uncollectible each report their change without a companion invoice.updated. Handle the named event directly.

What data.object carries depends on the event's prefix:

Eventsdata.object
invoice.*The invoice, as GET /v1/invoices/{invoice_id} returns it after the change, without public_url.
invoice_payment_attempt.*The payment attempt, with its invoice_id.
invoice_manual_payment.*The manual payment, as GET /v1/invoices/{invoice_id}/manual-payments/{invoice_manual_payment_id} returns it, with its invoice_id.
invoice_delivery_attempt.*The delivery attempt, as the delivery attempts list returns it, with its invoice_id.
Response
{
  "object": {
    "invoice_id": "inv_1kmn0aExample",
    "order_id": "ord_1kmn0aExample",
    "customer_id": "cus_1kmn0aExample",
    "invoice_number": "1042",
    "status": "partially_paid",
    "refund_status": "none",
    "delivery_mode": "email",
    "settlement_amounts": {
      "outstanding_money": {"amount": 100000, "currency": "USD"}
    }
  }
}

That is the data of an invoice.partially_paid event, shortened. Most invoice.* handlers need no follow-up fetch.

One change can send several events, and Flint doesn't guarantee the order they arrive in:

  • Recording a manual payment sends invoice_manual_payment.created and invoice.partially_paid or invoice.paid.
  • A successful online payment sends invoice_payment_attempt.succeeded and invoice.partially_paid or invoice.paid.
  • Reversing a manual payment sends invoice_manual_payment.reversed and, when the status changes, invoice.reopened.
  • Applying a credit note allocation sends credit_note_allocation.created, credit_note.updated for the note's changed allocated_money (or credit_note.issued when allocating on issue), and an invoice event: invoice.credited or invoice.paid if it closes the balance, otherwise invoice.updated for the changed credit and outstanding amounts.
  • Reversing a credit note allocation sends credit_note_allocation.reversed, credit_note.updated, and invoice.reopened when the status changes, otherwise invoice.updated for the changed amounts. The invoice status event has no companion invoice.updated.

Each event's data.object is a snapshot from its own change, so read the invoice's status from the invoice.* event, and fetch the invoice when you need its current state. invoice_payment_attempt.succeeded fires once per successful attempt, including one that pays only part of the balance.

The backing order also sends order.partially_refunded and order.refunded when the order's refund_status changes, and each refund sends its own refund.succeeded, refund.partially_succeeded, or refund.failed. Credit notes have their own events, listed in Credit notes. See Webhooks for signature verification and retries.

Inspect delivery and history#

Two lists give each invoice a paper trail: delivery attempts for every email, and activities for everything else.

Delivery outcomes#

Every email, the first send and each reminder, is a delivery attempt with delivery_type (send or reminder), the addresses used, and a status of pending, sent, failed, or suppressed:

cURL
curl "https://api.withflintpay.com/v1/invoices/inv_1kmn0aExample/delivery-attempts" \
  -H "Authorization: Bearer YOUR_API_KEY"

sent means the email service accepted the message. Delivery attempts don't report a later bounce, so a message the recipient's mail server rejected afterward still reads sent.

failure_reason is present only when status is failed, and suppression_reason only when it is suppressed. Flint doesn't return the email service's error text. Both fields can gain values, so treat one you don't recognize as you would an unknown status.

StatusReasonWhat happenedWhat to do
failedrejectedThe email service refused the message, for example because the address is invalid. Older failed attempts recorded before reasons existed also read rejected.The invoice stays collectible. An issued invoice's recipient can't be changed, so a resend reaches the same address. Give the customer the public_url from GET /v1/invoices/{invoice_id} another way.
faileddelivery_unknownFlint couldn't confirm the send. The email may have been delivered.Contact support before resending: send-reminder sends another email, so a recipient who got the first one receives a second.
failedcanceledFlint canceled the email before sending it, for example because the invoice changed, or because the customer was deleted while it was pending.Read the invoice. While it is collectible, send-reminder sends a new email with the current link. After a customer deletion, contact the customer another way.
suppressedmerchant_managed_emailYou send this email yourself: customer_email_delivery.invoices is merchant_sends.Send the invoice from your own system, driven by the invoice.* events. The setting covers reminders too, including send-reminder.
suppressedrecipient_unsubscribedThe recipient unsubscribed from this kind of email.Flint doesn't email an unsubscribed recipient. Contact the customer another way.

Each outcome sends one event carrying the attempt: invoice_delivery_attempt.sent, .failed, or .suppressed. When a customer deletion cancels a pending email, the attempt sends invoice_delivery_attempt.failed with failure_reason: "canceled". Its recipient is already erased: the event carries no to_email or cc_emails, and data.previous_attributes holds only the earlier status and failure_reason. Each successful send also sends invoice.sent; a reminder sends only the attempt event. Retrying the same delivery outcome sends no new invoice event.

Activities#

Activities are the invoice's timeline: when it was created, issued, sent, viewed, paid, reminded, overdue, charged a late fee, credited, or voided. Each has an activity_type, created_at, the actor_type that caused it (merchant, buyer, or system), and details for its type, such as the invoice_delivery_attempt_id and to_email of a sent email, the payment_intent_id and amount_money of an applied payment, or the invoice_schedule_entry_id of an overdue entry. When a customer says they never got the invoice, start here:

cURL
curl "https://api.withflintpay.com/v1/invoices/inv_1kmn0aExample/activities?activity_type=delivery_sent,reminder_sent" \
  -H "Authorization: Bearer YOUR_API_KEY"

Activities list newest first; pass sort_direction=asc for chronological order. activity_type filters to one or more types, repeated or comma-separated. An activity this API version doesn't describe yet reads activity_type: "other", so handle unknown values instead of failing on them. You can't filter on other. The Invoices reference lists every activity type and its fields.

Query and reconcile#

GET /v1/invoices is your receivables report. Filters combine, and all of them apply before pagination:

ParameterWhat it selects
statusOne or more of draft, open, partially_paid, paid, voided, uncollectible, or credited
customer_id, order_id, subscription_idInvoices for a customer, the invoice on an order, or a subscription's invoices
collection_modeOne or more of buyer_initiated, automatic, or external
is_overdue, has_outstanding_balanceOverdue invoices, and invoices with (true) or without (false) a balance
due_date_from, due_date_toCalendar-date window in each invoice's timezone (UTC when the merchant had none when the draft was written). Both take YYYY-MM-DD; due_date_from is inclusive and due_date_to is exclusive
issued_after, issued_before, created_after, created_before, updated_after, updated_beforeRFC 3339 windows. _after includes the instant and _before excludes it
external_reference_id, invoice_numberExact match on your sync key or the printed invoice number
querySearch across invoice ID, invoice number, external reference, recipient email, reference, po_number, and the customer's name and email
sort_by, sort_directioncreated_at, updated_at, due_date, invoice_number, or settlement_amounts.outstanding_money, ascending or descending

An aging report with the biggest balances first is one call:

cURL
curl -G https://api.withflintpay.com/v1/invoices \
  -H "Authorization: Bearer YOUR_API_KEY" \
  --data-urlencode "has_outstanding_balance=true" \
  --data-urlencode "sort_by=settlement_amounts.outstanding_money" \
  --data-urlencode "sort_direction=desc"

Add expand=customer,order to a list or a single read to include the customer and order summaries, which needs those resources' read scopes too:

cURL
curl "https://api.withflintpay.com/v1/invoices/inv_1kmn0aExample?expand=customer,order" \
  -H "Authorization: Bearer YOUR_API_KEY"

Lists return 20 results by default, up to 100 with page_size; pass next_page_token as page_token for the next page. See Pagination and the Invoices reference for exact-match and multi-value filter rules.

Test and live invoices are separate. An invoice_id from the other mode returns 404 RESOURCE_NOT_FOUND, so check which mode's key created an invoice that seems to be missing.

Test the flow end to end#

Run the whole loop with a test key, flint_test_...:

  1. Issue an invoice#

    Create a quick pay invoice with "issue": {"delivery_mode": "email"}, as in Create and issue in one call. The response carries public_url.

  2. Pay it as the customer#

    Open public_url in a browser: it is what your customer sees, and the invoice now has viewed_at. Click "Pay invoice" and pay with this test card:

    Test cardAny future expiry, any CVC.
  3. Confirm the result#

    Your webhook endpoint receives invoice_payment_attempt.succeeded and invoice.paid, and GET /v1/invoices/{invoice_id} shows status: "paid" with outstanding_money at 0.

  4. Try the offline path#

    Issue a second invoice with "collection": {"mode": "external"}. Record a partial manual payment and watch invoice.partially_paid arrive, then record the rest and watch invoice.paid.

  5. Reverse and recover#

    Reverse the second payment by its invoice_manual_payment_id. invoice_manual_payment.reversed arrives, and invoice.reopened with status: "partially_paid" and the amount back in outstanding_money. Record the payment again, and the invoice closes with another invoice.paid.

Warning:

If a payment option is missing on the hosted page in test mode, check the matching merchant capability and the invoice's frozen payment_policy, then reload the page.

Declines, 3D Secure, and other card scenarios are in Testing.

Errors you will encounter#

Every error uses the standard error envelope. Invalid input returns 400 with type: "validation_error", and state conflicts return 409 with type: "conflict_error". For ACTION_NOT_ALLOWED, branch on details[0].reason.

  • HTTP 400
    Creating: send exactly one of order_id or quick_pay (detail NOT_ALLOWED at quick_pay, with conflicting_fields: ["order_id"]); leave out scheduled_issue_at when sending issue; set quick_pay.inventory_routing_source for tracked stock (detail REQUIRED). Schedules: param names the entry that breaks a rule. Creating and issuing, scheduling, or reminding by email: set recipient_email first if the linked customer has no email (detail REQUIRED). Issuing a stored draft without a recipient returns 409 ACTION_NOT_ALLOWED instead. Recording: send the invoice currency (detail NOT_ALLOWED). Headless checkout with Affirm: send payment_return_url.
  • HTTP 409
    Creating: the order already has the invoice in details[0].current_resource. Use it, or void it first.
  • HTTP 409
    The invoice, its order, or its payment can't take this action in its current state. Branch on details[0].reason, using the table below.
  • HTTP 409
    Creating or issuing: the order has an open checkout session, an active payment intent, or recorded manual payments, listed in details[0].blocking_resources. Close the session or cancel the payment intent; an order with manual payments can't be invoiced. Collecting outside the invoice: use POST /v1/checkout-sessions with type: invoice. Voiding: void the issued credit notes listed first.
  • HTTP 409
    OPERATION_IN_PROGRESSRetry the same request
    An online payment is resolving while you collect, record or reverse a manual payment, mark uncollectible, or void; or another write changed the draft while issue ran. Retry the same request once it finishes.
  • Collecting: an active payment intent is named by resource_type: payment_intent, resource_id, current_status, and supported_actions. Cancel it when allowed or wait. Marking uncollectible: a payment attempt is in progress. Cancel it or wait for it to finish.
  • Recording: amount_money is more than the remaining balance.
  • HTTP 409
    VERSION_CONFLICTRefresh, then retry
    The expected_version you sent is stale. details[0] carries resource_type invoice, resource_id, and current_version. Read the invoice and retry with its version and a new Idempotency-Key.
  • HTTP 409
    CONCURRENT_MODIFICATIONRetry the same request
    Another write changed the invoice or a related record while your request ran, and nothing changed. Send the same request again with the same Idempotency-Key.
  • HTTP 404
    The invoice, or a manual payment that belongs to it, doesn't exist in this mode.
  • Flint can't confirm whether the original request took effect. Look it up with the route's idempotency_key filter before sending it again under a new key, as Recovery reads describes.

ACTION_NOT_ALLOWED reasons on invoice routes:

ReasonWhenWhat to do
payment_collectedCreating or issuing an invoice for an order that already has payments or refunds.Invoice orders before collecting on them.
terminal_statusThe order is closed, the manual payment is already reversed, or the invoice link was replaced.Read the resource. For a replaced link, use the current public_url.
unsupported_stateThe invoice's status doesn't allow the action, such as editing after issue or voiding a paid invoice. current_status names the status.Use the action that fits the status. See Close or correct an invoice.
status_not_reachedThe invoice isn't issued yet, or a late fee's grace period hasn't passed.Issue first, or wait.
not_offeredNothing is collectible now, or no late fee policy applies.Read currently_due_money and the payment term.
field_lockedreminders_paused sent on an invoice that isn't collectible.Pause reminders only on open or partially_paid invoices with a balance.
configuration_requiredEmail issue has no recipient, an automatic invoice has no card, customer_default terms found no customer term, or the default delivery methods can't deliver every item.Follow next_actions to PATCH the draft's recipient_email, or fix the setting or customer, then retry.
merchant_managed_emailExplicit email issue, create-and-issue, or scheduling an issue while customer_email_delivery.invoices is merchant_sends.Use caller_managed or merchant_default, or switch the family to flint_sends.
inventory_waitThe invoice is a renewal waiting on stock.Wait; see Collection blocks.
invoice_finalizedThe backing order of an automatic-tax invoice changed after issue.Void the invoice and issue a new one.
in_progressA payment is underway on the checkout surface you tried to switch, or the ACH debit you tried to cancel was already sent to the bank.Finish or cancel the payment, or wait for the debit to settle or fail.

Endpoints#

Invoices API referenceEvery field and endpoint, including activity types and recovery by key.Credit notesCorrect an issued invoice, with a linked refund when it was already paid.Payment links vs checkout sessions vs invoicesChoose the right way to collect.

Stripe invoices have no late fee field. Stripe invoice late fees compares revising a Stripe invoice to add the fee with Flint payment terms that carry one.

Export receivables aging#

Create a receivables_aging_v1 report with an as_of_date and currency to export unpaid invoice balances across current and 30-day aging buckets. Installments use their own due dates, and partial payments, credits, write-offs, and late fees are included as of the cutoff. See Receivables aging for the request, CSV columns, and reconciliation to invoice and customer receivables.

Negotiated prices#

Invoice quick_pay catalog lines use the supplied customer’s negotiated price lists and quantity breaks, then freeze those terms on the order.

List assessed late fees with GET /v1/invoices/{invoice_id}/late-fees, using page_size and page_token. Results are sorted by fee ID in ascending order. Manual payment creates accept expected_invoice_version from the invoice's last read; a stale value returns 409 VERSION_CONFLICT.

Was this helpful?