Skip to content

Refunds

To pay a buyer back, you create a refund against the order they paid: the whole order, an amount, specific line items and charges, or one payment on an order paid in several. Flint works out which payments the money comes from, how much tax goes back, and what the order's refunded totals become. The money returns to the card, wallet, or gift card that paid, or to new gift cards as store credit if you choose.

Read status on the create response, follow the refund with webhooks, and handle the refunds that fail. A bank can still reject a refund after it succeeds.

  • POST/v1/refundsRequired API key scope: commerce.refunds.writeReference for POST /v1/refunds

    Create a refund. Requires an Idempotency-Key.

  • GET/v1/refunds/{refund_id}Required API key scopes: commerce.refunds.read or commerce.refunds.writeReference for GET /v1/refunds/{refund_id}

    Read a refund in its current state.

  • GET/v1/refundsRequired API key scopes: commerce.refunds.read or commerce.refunds.writeReference for GET /v1/refunds

    List and filter refunds, or find one by its Idempotency-Key.

  • PATCH/v1/refunds/{refund_id}Required API key scope: commerce.refunds.writeReference for PATCH /v1/refunds/{refund_id}

    Change a refund's metadata or external_reference_id.

Test keys run the same refund lifecycle without real money. Testing shows how to pay an order you can refund.

To refund an issued credit note on a paid invoice, send refund_type: credit_note and credit_note_id. Omit amount_money to refund all available credit. This needs commerce.credit_notes.write as well as commerce.refunds.write. Credit-note refunds return the invoice's gift card payments first, then card and bank payments, largest remaining first. Each tender is capped by its invoice collections minus prior refunds; tender_allocations reports each leg. See Credit notes.

If you already paid the buyer back outside Flint, such as by check or wire for an invoice paid by manual payment, add processed_by: "merchant" to the credit-note request. Flint records the refund as succeeded and moves no money. See Record a refund you paid outside Flint and who processed a refund.

A refund and a lost dispute both reduce the order's net_collected_money, which is paid_money - refunded_money - dispute_lost_money, which can be negative when refunds and lost disputes exceed payments. Open disputes appear in disputed_money. See Read dispute state on an order.

Refund, return, cancel, or credit note#

POST /v1/refunds only moves money. It doesn't check return eligibility, apply a return policy, or put stock back. Choose the operation that matches what happened:

SituationUse
Money goes back and nothing comes back: a duplicate charge, a service problem, a goodwill credit, an order canceled before it shippedPOST /v1/refunds
Unshipped items come off a paid order, such as an item that ran out of stockAn order edit, which removes the units, releases their stock, and refunds them together. Preview it first to see the refund.
Merchandise comes backA Return, which handles eligibility, receiving, restocking, and the refund
The payment is an uncaptured authorizationCancel the hold. Nothing was captured, so there is nothing to refund.
A paid invoice was wrongA credit note with a refund
You already paid the buyer back by check or wire for a manually recorded invoice paymentA credit note, then a recorded refund

A Return, order edit, or credit note that pays the buyer back creates an ordinary refund on the order that collected the payment. Returning an exchange replacement can create one refund on the replacement order and another on the original order. Refunds from a Return carry return_id and return_resolution_id, refunds from an order edit carry order_edit_id, and refunds from a credit note carry credit_note_id and invoice_id. A refund you create directly has none of these fields.

For most orders, a refund changes the payment and leaves fulfillment quantities as they were. Use an order edit to remove items that will not ship.

For a subscription renewal whose box cannot ship, choose reason out_of_stock on the refund that returns the remaining payment. Once the order is fully refunded, Flint cancels eligible unshipped shipment fulfillments and releases their committed stock. If a fulfillment has an active shipment, void that shipment before canceling the fulfillment. Partial refunds leave the shipment in place.

Choose a refund type#

Every POST /v1/refunds body sets refund_type, and Flint refunds only what that type describes. There is no default.

refund_typeRefundsRequiresNot accepted
fullEverything still refundable on the targetorder_id, payment_intent_id, or gift_card_load_idamount_money, line_items, charges, tax_breakdown_refunds, tender_allocations
amountExactly the amount_money you sendamount_money, plus order_id, payment_intent_id, gift_card_load_id, or tender_allocationsNothing beyond the rules for each target
targetsThe total of the line items, charges, and tax breakdowns you nameAt least one of line_items, charges, or tax_breakdown_refunds, and an order through order_id or a payment_intent_id on an orderamount_money, tender_allocations, gift_card_load_id

Flint checks the body's shape before it looks anything up, so these mistakes refund nothing and return 400 INVALID_REQUEST:

  • No refund_type: detail REQUIRED with param: refund_type. An unknown value: INVALID_VALUE.
  • A field the type doesn't accept: NOT_ALLOWED at that field, with conflicting_fields: ["refund_type"]. A present but empty field counts, so "line_items": [] is rejected on a full refund.
  • amount without amount_money: REQUIRED for amount_money. targets with none of the three lists: REQUIRED for line_items.
  • No order_id, payment_intent_id, gift_card_load_id, or tender_allocations: REQUIRED for order_id.
  • A target field sent as null: INVALID_VALUE. Leave the field out instead.

The refund doesn't echo refund_type. Its amount_money, line_item_allocations, and tender_allocations describe what was refunded, and each tender_allocations[].destination says where that part went.

Refund an order in full#

Send "refund_type": "full" with the order_id. Flint refunds everything still refundable on the order.

cURL
curl -X POST https://api.withflintpay.com/v1/refunds \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Flint-Version: 2026-09-07" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: refund-ord-1042-full" \
  -d '{
    "refund_type": "full",
    "order_id": "ord_01KEZF7C00JBKMARG3P06Z224B",
    "reason": "requested_by_customer"
  }'
Response
{
  "data": {
    "refund_id": "ref_01KEZF7C00H2GAMWD73WZ7K81W",
    "order_id": "ord_01KEZF7C00JBKMARG3P06Z224B",
    "status": "succeeded",
    "reason": "requested_by_customer",
    "amount_money": {"amount": 3098, "currency": "USD"},
    "refunded_tip_money": {"amount": 0, "currency": "USD"},
    "payment_refunds": [
      {
        "payment_intent_id": "pi_01KEZF7C0050JFFB0HNCWWV1G3",
        "amount_money": {"amount": 3098, "currency": "USD"},
        "refunded_tip_money": {"amount": 0, "currency": "USD"},
        "status": "succeeded"
      }
    ],
    "version": 2,
    "created_at": "2026-09-22T17:03:00Z",
    "updated_at": "2026-09-22T17:03:01Z"
  },
  "request_id": "req_01KWM694EG9SNYD9JYR0SQVVP6"
}
  • amount_money is what Flint worked out for the full refund. line_item_allocations on the refund records which line items it covered.
  • payment_refunds has one entry for each card or wallet payment the refund draws from, with its own amount and status. Gift card and store credit outcomes are in tender_allocations instead.
  • When processing finishes during the request, status reports the outcome: succeeded, partially_succeeded, or failed. Otherwise, the response is pending. If Flint can't confirm the completed outcome before responding, it returns the recorded pending response. Follow the refund with GET /v1/refunds/{refund_id} or refund.* events for its current state.

A 201 means Flint recorded a refund, not that the money moved. 409 OPERATION_IN_PROGRESS or 409 IDEMPOTENCY_KEY_IN_PROGRESS means the original operation may still be running and a refund may already exist. Other 4xx responses refuse this attempt before it creates a refund. Check status on every create response, and follow the refund as Track the refund to completion describes.

Retry safely#

Every refund requires an Idempotency-Key. Without one, the request returns 400 INVALID_REQUEST with details[0].param: Idempotency-Key, and nothing is refunded. Save the key with your own record of the refund before you send it.

  • The response was lost. Send the same request with the same key. Flint returns the recorded response, with Idempotency-Replayed: true, without refunding twice, however late the retry arrives. The refund's current status can differ from that response. Read the refund for its current state with GET /v1/refunds?idempotency_key=refund-ord-1042-full.
  • The refund came back failed. A new try is a new refund and needs a new key. Replaying the old key returns the same failed refund and never tries the processor again.
  • The request was refused. The error's next_steps says whether you can reuse its key.

Idempotency covers keys, replays, and recovery reads in full.

Refund part of an order#

Send "refund_type": "amount" with amount_money to refund less than the whole order. Amounts are integers in the currency's minor unit, so 500 is $5.00, and the currency must match the payment's.

cURL
curl -X POST https://api.withflintpay.com/v1/refunds \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Flint-Version: 2026-09-07" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: refund-ord-1042-goodwill" \
  -d '{
    "refund_type": "amount",
    "order_id": "ord_01KEZF7C00JBKMARG3P06Z224B",
    "amount_money": {"amount": 500, "currency": "USD"},
    "reason": "other",
    "reason_message": "Goodwill credit for the late delivery"
  }'

You can refund an order in as many parts as you like. What stays refundable is what the order's succeeded payments collected, including gift card payments, minus refunds that are pending or succeeded, minus any bank returns. If a refund fails, you can refund the amount again if the payment is still eligible. After a failed Affirm refund, any later refund on that payment returns 409 ACTION_NOT_ALLOWED with reason previous_refund_failed. Refunding an Affirm payment explains how to reimburse the buyer and reconcile the refund.

When a subscription plan or seat change uses credit for unused time, the amount applied to the change reduces what you can refund from the original order. The original lines' refundable.total_money and a full refund reflect that reduction. Once successful refunds return all the money collected for the change, the credit becomes refundable on each original order that funded it. You can then send a full refund on an original order to return its remaining balance, including the released credit. If an earlier refund used the line's full quantity, the released value still appears in refundable.total_money. A refund for that value adds no refunded units.

When Renew now applies credit for unused time, you can refund the uncredited amount from the original order. Once the renewal finishes collecting and the subscription is canceled, Flint releases the credit that funded the renewal. Refund the remaining payment from the original order. A cancellation scheduled for the end of the period releases the credit when the cancellation takes effect.

Pending and partial refunds of the change order leave the credit reserved. Credit also stays reserved for older changes that record a combined amount from several original orders without recording how much each one funded.

  • An amount over what's left returns 409 LIMIT_EXCEEDED. On an order funded by gift cards, details[0].maximum_money gives the remainder.
  • Once nothing is left, a refund returns 409 ACTION_NOT_ALLOWED with reason already_applied, or payment_disputed when a dispute or bank return took the money back.
  • An amount that includes a flat order tax Flint can't allocate returns 400 INVALID_REQUEST on amount_money. Send a smaller amount, name the flat tax in tax_breakdown_refunds with its full remaining tax_money, or refund the full remaining amount.

Flint also records which parts of the order an amount covers: line items first, then order charges such as delivery fees, and the tip last. The tip portion shows up in refunded_tip_money on the refund and on each payment_refunds or tender_allocations entry, so your reports can keep sales and tips apart.

For event orders, a partial amount refund leaves tickets valid and their seats sold. A full refund voids all remaining tickets and releases their seats.

Refund specific line items or charges#

When the buyer is refunded for particular items, send "refund_type": "targets" and name them instead of working out the amount. Each line_items entry takes the order's order_line_item_id. With only the ID, Flint refunds the line's remaining value and quantity. Add quantity or amount_money to refund less, but not both: sending both returns 400 INVALID_REQUEST with detail code INVALID_VALUE and param naming the line, such as line_items[0].

When a refund succeeds for a targeted ticket line, Flint voids its refunded whole-ticket quantity and releases those seats. For a partial quantity, Flint selects the lowest-numbered tickets on that line that are still valid. Voided tickets are refused at check-in.

For a quantity refund, Flint rounds that share of the line's remaining paid value half up once in the currency's minor units, matching credit-note quantity corrections. It then rounds the proportional tax and discount shares half up and balances the subtotal. The last quantity takes every remaining minor unit of each component. For a three-unit line with a 4,497 subtotal, 450 discount, and 263 tax, separate one-unit refunds are 1,437, 1,437, and 1,436 minor units. New Return values and refund resolutions use the same rule. Existing refunds and retries keep their stored amounts.

Refund whole units at the price the buyer paid, including their share of any discount and tax:

cURL
curl -X POST https://api.withflintpay.com/v1/refunds \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Flint-Version: 2026-09-07" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: refund-ord-1042-mug" \
  -d '{
    "refund_type": "targets",
    "order_id": "ord_01KEZF7C00JBKMARG3P06Z224B",
    "reason": "defective_product",
    "line_items": [
      {"order_line_item_id": "li_01KEZF7C004XP0V220YVMGQ354", "quantity": 1}
    ]
  }'

The refund's line_item_allocations has one entry for each line it covered. This is the restocking fee refund, for one $12.00 mug with $0.99 tax:

Response
{
  "line_item_allocations": [
    {
      "order_line_item_id": "li_01KEZF7C004XP0V220YVMGQ354",
      "quantity": 1,
      "refunded_money": {"amount": 1099, "currency": "USD"},
      "tax_refund_mode": "automatic",
      "automatic_refund": {
        "subtotal_money": {"amount": 1200, "currency": "USD"},
        "discount_money": {"amount": 0, "currency": "USD"},
        "tax_money": {"amount": 99, "currency": "USD"},
        "total_money": {"amount": 1299, "currency": "USD"}
      },
      "adjustments": [
        {
          "refund_line_item_adjustment_id": "rlia_01KEZF7C00T4N8W2QZ6M3R5K7D",
          "adjustment_type": "restocking_fee",
          "applies_to": "none",
          "amount_money": {"amount": 200, "currency": "USD"},
          "refunded_money": {"amount": 0, "currency": "USD"},
          "remaining_money": {"amount": 200, "currency": "USD"},
          "reason": {"code": "restocking_policy"}
        }
      ]
    }
  ]
}
One mug refunded with a $2.00 restocking fee
  • Subtotalautomatic_refund.subtotal_money
    $12.00
  • Taxautomatic_refund.tax_money
    $0.99
  • Price paidautomatic_refund.total_money
    $12.99
  • Restocking feeadjustments[0].amount_money
    Kept by you
    −$2.00
  • Refunded to the buyerrefunded_money
    $10.99

The order's line item records the same refund in its refunded_quantity and refunded_money. To return a fee you kept, refund it later with the line's adjustment_refunds, naming the adjustment's refund_line_item_adjustment_id; remaining_money is how much of it you can still return.

A line can't be refunded past what's left on it. More units or a larger amount than remain returns 409 LIMIT_EXCEEDED, with param such as line_items[0].amount_money.amount and details[0].maximum_money showing what's left. A line that is already fully refunded returns 409 ACTION_NOT_ALLOWED with reason already_applied.

Charges and tax#

Order charges, such as delivery fees, service fees, and surcharges, are refunded through charges. Each entry takes the order_charge_id and an optional amount_money; without an amount, Flint refunds the charge's full remaining amount. Tips and charges covers how each tracks its refunds.

Tax comes back automatically in proportion to what you refund. Later order refunds by amount or in full skip any tax you kept with an explicit tax refund. To send back less tax than that, or to refund an order-level flat tax, see Sales tax. Tax overrides, meaning top-level tax_breakdown_refunds or a line with tax_refund_mode: "explicit", tax_money, tax_breakdown_refunds, tax_adjustment_reason, or tax_adjustment_audit, also need the commerce.refunds.tax_overrides.write scope.

Combine targets with an amount#

  • With refund_type: "targets", the refund is the sum of the named line items (with their tax), charges, and top-level tax_breakdown_refunds. Tips and flat taxes you don't name stay unrefunded.
  • With refund_type: "amount", you can name targets too. amount_money sets the total and Flint spreads the rest across the order as it does for an amount alone. Targets that add up to more than amount_money return 400 INVALID_REQUEST on amount_money.
  • To send named targets back to specific tenders, use refund_type: "amount" with tender_allocations.
  • Line item and charge targets need an order: send order_id, or a payment_intent_id that belongs to an order.

Refund one payment on a multi-payment order#

An order can be paid in several payments. When you refund by order_id, Flint draws from the payment with the most left to refund first and lists each payment in payment_refunds. A line item you name is refunded first to the payment that paid for it.

To refund one payment, send its payment_intent_id:

cURL
curl -X POST https://api.withflintpay.com/v1/refunds \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Flint-Version: 2026-09-07" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: refund-pi-1042-duplicate" \
  -d '{
    "refund_type": "amount",
    "payment_intent_id": "pi_01KEZF7C0050JFFB0HNCWWV1G3",
    "amount_money": {"amount": 500, "currency": "USD"},
    "reason": "duplicate"
  }'

Send "refund_type": "full" without amount_money to refund everything still refundable on that payment.

  • The payment must be succeeded. Otherwise the request returns 409 ACTION_NOT_ALLOWED. details[0] names the payment intent in resource_type and resource_id with its current_status, and reason is status_not_reached before capture or success, in_progress while it is processing (such as an ACH debit that hasn't cleared), or terminal_status once it is canceled or expired.
  • A payment on an order is refunded on that order like any other refund, and the response includes order_id. You can send both order_id and payment_intent_id; a payment that doesn't belong to that order returns 400 INVALID_REQUEST with detail NOT_ALLOWED.
  • A payment with no order is refunded in the background, so the create response is pending. Follow it with webhooks.

Refund a split payment#

Only the collecting merchant can refund a payment with seller splits. Omit split_reversals to let Flint allocate each seller's share using cumulative refunds and dispute withdrawals, less reinstatements. Flint rounds across the splits so repeated small refunds do not strand cents.

Send split_reversals to choose the amounts instead. The list is exhaustive for every payment the refund covers: an omitted split gives back nothing. Send [] to fund the entire refund yourself.

Response
{
  "refund_type": "amount",
  "payment_intent_id": "pi_01KF4B1Z3X5C7V9B1N3M5Q7W9E",
  "amount_money": {"amount": 4000, "currency": "USD"},
  "split_reversals": [
    {
      "payment_split_id": "psplit_01KF4B2C4D6E8F0G2H4J6K8M0N",
      "amount_money": {"amount": 3000, "currency": "USD"}
    }
  ]
}

Each entry must name an eligible split on a payment this refund covers. Amounts must be positive, use the payment's currency, and fit within the split's unreversed amount. Entries for each payment must total no more than that payment's refund, even when one order refund covers several payments. Flint rejects a wrong, repeated, canceled, or failed split with 400 INVALID_REQUEST and an INVALID_VALUE detail at split_reversals[i].payment_split_id. An amount above a split's remainder returns 409 LIMIT_EXCEEDED at split_reversals[i].amount_money with maximum_money. A per-payment total above its refund returns 400 INVALID_REQUEST and INVALID_VALUE at split_reversals, with maximum_money for that payment's refund.

After you win a dispute, both automatic and named allocations can count seller shares due back from the dispute before reinstated_money shows the return. If the refund needs those funds, it stays pending until Flint can recover the seller shares.

Flint takes back seller shares before returning money to the buyer. A held split is reduced before transfer; a transferred split is reversed. You fund the rest. The original processing fee is not returned. A failed or canceled refund reinstates recovered shares.

On each payment_refunds entry, split_reversals contains the fixed allocation as {payment_split_id, payment_split_reversal_id, amount_money}. It is [] when the payment has splits but no seller share was allocated, and absent for other payments and buyer views. Read the matching entry in PaymentSplit.reversals for its status, shortfall, and reinstatement amounts.

Refund gift card and mixed payments#

When gift cards helped pay an order, a refund by order_id goes back to the original gift cards first. For a $100.00 order paid with a $60.00 gift card and a $40.00 card payment, a $30.00 amount refund credits the gift card. To choose the tenders yourself, send tender_allocations:

cURL
curl -X POST https://api.withflintpay.com/v1/refunds \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Flint-Version: 2026-09-07" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: refund-ord-2077-to-card" \
  -d '{
    "refund_type": "amount",
    "order_id": "ord_01KEZF7C00JBKMARG3P06Z224B",
    "amount_money": {"amount": 3000, "currency": "USD"},
    "tender_allocations": [
      {
        "tender_type": "payment_intent",
        "payment_intent_id": "pi_01KEZF7C0050JFFB0HNCWWV1G3",
        "amount_money": {"amount": 3000, "currency": "USD"}
      }
    ]
  }'

Allocations are exhaustive: a tender you leave out gets nothing.

  • They need refund_type: "amount", and their amounts must add up to amount_money, or the request returns 400 INVALID_REQUEST with an INVALID_VALUE detail.
  • Each allocation can't exceed what that tender collected minus its pending and succeeded refunds. Over that, the request returns 409 LIMIT_EXCEEDED with param: tender_allocations[i].amount_money.amount and the remainder in details[0].maximum_money.
  • Allocations that don't cover the line items, charges, or flat tax you named return 409 LIMIT_EXCEEDED. Flint attributes each named component to the tender that paid for it.
  • A gift card allocation uses tender_type: "gift_card_redemption" and the original gift_card_redemption_id, in USD. A redemption whose status isn't succeeded returns 409 ACTION_NOT_ALLOWED on that ID: reason status_not_reached for a reserved redemption, which needs capturing first, or terminal_status for a canceled or expired one, which spent nothing. An unknown ID returns 404 RESOURCE_NOT_FOUND.

An allocation's destination defaults to original, which credits the card that paid. If that gift card is closed or can't hold the whole amount within its balance cap, the request returns 400 INVALID_REQUEST with detail REQUIRED on tender_allocations[i].destination. Set destination: "new_gift_card" on that allocation and send it with a new key. A gift card redemption made outside a Flint order is refunded the same way, without order_id; see Gift cards.

A gift card credit succeeds as soon as the refund is created, while a card refund can stay pending or fail afterward, so a mixed refund can end partially_succeeded. Read tender_allocations for each outcome. Replaying the original key recovers the refund without crediting the gift card again.

Refund a gift card purchase#

To refund a standalone gift card bought with a Flint payment, send its original gift_card_load_id with refund_type full or amount, and no order, line item, charge, tax, tender, or destinations fields. amount_money is the price paid, not the face value: refunding the full $90.00 of a $100.00 card sold for $90.00 removes $100.00 of unspent value. Spent or reserved value returns 409 LIMIT_EXCEEDED. For a gift card sold on a Flint order, refund its order line item instead. The Refunds API reference covers holds, late failures, and the load's purchase_refunds.

Refund to store credit#

Store credit refunds the buyer onto new Flint gift cards instead of the card that paid. Send destinations with payment_intent: "new_gift_card" on an otherwise ordinary refund:

cURL
curl -X POST https://api.withflintpay.com/v1/refunds \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Flint-Version: 2026-09-07" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: refund-ord-1042-credit" \
  -d '{
    "refund_type": "amount",
    "order_id": "ord_01KEZF7C00JBKMARG3P06Z224B",
    "amount_money": {"amount": 1000, "currency": "USD"},
    "destinations": {"payment_intent": "new_gift_card"}
  }'
Response
{
  "data": {
    "refund_id": "ref_01KEZF7C00H2GAMWD73WZ7K81W",
    "order_id": "ord_01KEZF7C00JBKMARG3P06Z224B",
    "status": "succeeded",
    "reason": null,
    "amount_money": {"amount": 1000, "currency": "USD"},
    "refunded_tip_money": {"amount": 0, "currency": "USD"},
    "payment_refunds": [],
    "tender_allocations": [
      {
        "refund_allocation_id": "rta_01KEZF7C00B6V9X3P2N7Q4M8JD",
        "tender_type": "payment_intent",
        "payment_intent_id": "pi_01KEZF7C0050JFFB0HNCWWV1G3",
        "amount_money": {"amount": 1000, "currency": "USD"},
        "refunded_tip_money": {"amount": 0, "currency": "USD"},
        "status": "succeeded",
        "destination": "new_gift_card",
        "destination_cards": [
          {"gift_card_id": "gc_01KEZF7C00R5M2K8W4T6N9P3QA", "amount_money": {"amount": 1000, "currency": "USD"}}
        ]
      }
    ],
    "gift_card_codes": [
      {"gift_card_id": "gc_01KEZF7C00R5M2K8W4T6N9P3QA", "code": "GIFT_CARD_CODE"}
    ],
    "version": 1
  },
  "request_id": "req_01KWM694EG9SNYD9JYR0SQVVP6"
}

A refund that is entirely store credit is succeeded at once and has no payment_refunds entries. tender_allocations reports the destination and the cards Flint issued.

destinations has two keys, payment_intent and gift_card_redemption, each original (the default) or new_gift_card. It works with every refund_type, and a key for a tender the refund doesn't touch has no effect. It can't be combined with tender_allocations or gift_card_load_id (400 INVALID_REQUEST, detail NOT_ALLOWED, with both fields in conflicting_fields); with explicit allocations, set destination on each one.

A payment can go to store credit when it has succeeded, belongs to an order, is in USD, was paid by card, Apple Pay, Google Pay, or Link, and has no open chargeback. Any other payment, such as Affirm, ACH debit, another currency, or a payment with no order, returns 400 INVALID_REQUEST with detail NOT_ALLOWED on destinations.payment_intent (or tender_allocations[i].destination), and the message names the reason. Refund those to the original payment method. Gift card value can always go to new cards.

What store credit changes:

  • No processor refund. You keep the cash, your balance isn't debited, and the original processing fee isn't returned. The gift card value becomes a gift card liability.
  • The order. The refund uses up the payment's refundable amount and reverses order value and tax like a cash refund, so the same value can't be refunded in cash later.
  • The cards. Flint combines store credit from the refund's tenders on one new card up to the maximum card balance. Value already subject to a dispute or merchant restriction goes on separate cards. For a guest order, Flint also keeps credit issued to the original gift card's owner separate from other store credit. When the order has a customer, every new card is attached to that customer, so GET /v1/gift-cards?customer_id= finds it. A load funded by a payment intent reports source.funding_source_type: "store_credit" with the payment_intent_id, order_id, and refund_id. It can't be refunded as a gift card purchase. If the buyer later disputes that payment, Flint freezes the card's value.
  • Delivery. Flint sends no gift card email for a refund you create. The codes come back in data.gift_card_codes, and a same-key retry returns them again under the one-time secret rules. Refund reads, lists, and events never include them. Treat codes as bearer credentials: deliver them with a gift card notification or your own email, and rotate a code if you didn't save it.

If current replacement gift card codes are temporarily unavailable, the refund response still returns 201 and includes meta.warnings with code replacement_codes_unavailable. Retry the same request with the same Idempotency-Key to receive the codes.

Track the refund to completion#

A refund's status summarizes its payment_refunds and tender_allocations, which each carry their own status:

Refund statusFinal
  • pending moves to succeeded on every part refunded
  • pending moves to partially_succeeded on some parts failed
  • pending moves to failed on every part failed
  • succeeded moves to partially_succeeded on a bank rejects part of the credit
  • succeeded moves to failed on a bank rejects the credit
  • succeeded moves to pending on a bank reverses a Flint return
  • partially_succeeded moves to failed on a bank rejects the rest
status on refund
Final values do not change again
  • pending
    Recorded and on its way to the card network or bank. At least one payment refund or tender allocation is still in progress.
  • succeeded
    Every payment refund and tender allocation succeeded. A bank can still reject a credit it accepted, which moves the refund to partially_succeeded or failed.
  • partially_succeeded
    Some parts succeeded and the rest failed or were canceled. failure_reason is payment_refund_failed; read payment_refunds and tender_allocations for the split. A bank rejection of the rest moves it to failed.
  • failedFinal
    No money went back to the buyer. failure_reason says why, and the amount is refundable again, except for a refund from an order edit, whose money stays held for the edit and goes back through its retry, and a refund with reason: "payment_returned" that failed with failure_reason: "payment_disputed": the buyer won a dispute on the charge. If the dispute covered only part of the charge, Flint creates a separate refund for the rest. A payment_returned refund that failed with refund_abandoned cannot be retried through Flint; Flint hasn't repaid the buyer. Repay them another way if you haven't already.

Only failed is final. Keep handling events for succeeded and partially_succeeded refunds rather than treating them as settled. A refund with processed_by: "merchant" is the exception: no bank is involved, so it is created succeeded and stays that way.

While a refund is succeeded, succeeded_at says when it first got there: when its last payment_refunds or tender_allocations entry first succeeded. For a refund Flint processes, that's when Flint recorded the outcome. Each entry has its own succeeded_at while its own status is succeeded. Both are absent for every other status, so a refund that a bank rejects after it succeeded drops succeeded_at, and shows the same time again if it succeeds again. The tax reports reverse each part's tax at that part's succeeded_at.

Who processed a refund#

processed_by on every refund says who moved or returned the money:

processed_byMeaning
flintFlint moved the money, or is moving it, through a payment processor or a gift card. Every refund except a recorded one has this value.
merchantYou returned the money outside Flint and recorded the refund. No money moved through Flint.

Only a credit-note refund can be recorded, and only for money you collected as a manual payment. Treat processed_by as extensible and tolerate new values.

A recorded refund also returns refunded_at, the time you say you returned the money, and refund_reference when you sent one, such as a check or wire number. Its succeeded_at equals refunded_at. Refunds with processed_by: "flint" omit refunded_at and refund_reference. A recorded refund has payment_refunds: [] and omits payment_intent_id and failure_reason. Flint posts no balance transaction for it.

Payment refund status#

Each payment_refunds and tender_allocations entry has its own status, from a different set of values. partially_succeeded exists only on the refund.

status on payment refund
Final values do not change again
  • pending
    Submitted and in progress.
  • requires_action
    The payment method needs more information before this part can finish. The refund stays pending meanwhile.
  • succeeded
    The processor accepted it. A bank can still reject it later, which moves it to failed.
  • failedFinal
    This part failed. Its failure_reason says why.
  • canceledFinal
    Flint didn't try this payment because another payment in the same refund failed first. Its failure_reason is payment_refund_not_attempted.

Refund events#

Creation sends refund.created. A refund created already succeeded, partially_succeeded, or failed also sends its status event. Each later status transition sends one lifecycle event, and other public changes send refund.updated. The same commit never sends both a status event and refund.updated, and a replay with no public change sends nothing. Each event's data.object is the refund as GET /v1/refunds/{refund_id} returns it, without gift card codes.

  • refund.created
    Flint recorded the refund. Sent for refunds you create, for refunds from Returns and credit notes, and for refunds Flint creates.
  • refund.succeeded
    The status became succeeded. A refund recorded as paid outside Flint is created succeeded, so it sends refund.created and refund.succeeded together, with the same snapshot and version.
  • refund.partially_succeeded
    The status became partially_succeeded.
  • refund.failed
    The status became failed. failure_reason says why, including refund_abandoned when Flint stops trying to return a payment it couldn't accept.
  • refund.updated
    The refund changed and its status didn't: a PATCH to metadata or external_reference_id, the card network accepting a refund that is still pending, or another part failing on a partially_succeeded refund.
  1. What happens: You call POST /v1/refunds on an order
  2. Flint sends: refund.created
    The refund is recorded.
  3. Flint sends: refund.updated
    The card network accepted it and it is still pending. A refund that finishes during the request sends its lifecycle event instead.
  4. Flint sends: order.partially_refundedororder.refunded
    Only when this refund changes the order's refund_status.
  5. Flint sends: order.updated
    When the order's refunded amount changes without a change to refund_status, instead of a refund status event.
  6. Flint sends: payment_intent.updated
    When the refund changes the payment intent's refunded_money or refund_status.
  7. What happens: The refund finishes
  8. Flint sends: refund.succeededorrefund.partially_succeededorrefund.failed
    The refund reached that status.

The order's refund status events report its aggregate refund_status, not each refund. A second partial refund that changes the refunded amount while leaving the order partially_refunded sends order.updated. A refund status event has no accompanying order.updated, so count refunds from refund.* events. Invoice refund projections follow the same rule: invoice.partially_refunded or invoice.refunded when refund_status changes, otherwise invoice.updated when the public invoice changes.

Delivery is at least once and in no guaranteed order. Treat an event as a signal: fetch the refund, act on its current status, and record which statuses you've handled for each refund_id. This handler uses the Node SDK, whose verifyWebhookAsync checks the delivery's JWT signature against Flint's published keys. An endpoint whose signing_methods include hmac can use verifyWebhook with its secret instead:

TypeScript
import { Client } from "@flintpay/node";

const flint = new Client({
  baseUrl: "https://api.withflintpay.com",
  apiKey: process.env.FLINT_API_KEY!,
});

export async function handleFlintWebhook(rawBody: Uint8Array, headers: Headers) {
  const { event, known } = await flint.verifyWebhookAsync(rawBody, headers, {
    endpointIds: [process.env.FLINT_WEBHOOK_ENDPOINT_ID!],
  });
  if (!known) return;
  // Compare event_type directly: TypeScript narrows event on these checks, not on Set.has.
  if (
    event.event_type !== "refund.succeeded" &&
    event.event_type !== "refund.partially_succeeded" &&
    event.event_type !== "refund.failed"
  ) {
    return;
  }

  // Events can arrive out of order. The refund you fetch is the current state.
  const refund = await flint.refunds.get(event.data.object.refund_id);
  if (await alreadyHandled(refund.refund_id, refund.status)) return;

  switch (refund.status) {
    case "succeeded":
      await markRefunded(refund.order_id, refund.amount_money);
      break;
    case "partially_succeeded":
    case "failed":
      // payment_refunds and tender_allocations show which parts went back.
      await flagForSupport(refund.refund_id, refund.payment_refunds, refund.tender_allocations);
      break;
  }
  await recordHandled(refund.refund_id, refund.status);
}

Subscribe to refund.succeeded, refund.partially_succeeded, and refund.failed to see every outcome, including a bank rejecting a refund that already succeeded. Add refund.updated if you mirror metadata or each part's status. Webhooks covers endpoints, signing methods, and retries.

Without webhooks, poll GET /v1/refunds/{refund_id} until the status leaves pending, and check again later to catch a bank rejection. A refund on a payment with no order, or one the card network is slow to accept, can stay pending for a while.

Refunds Flint creates#

Flint refunds a buyer's payment itself when it captured money it can't apply to the order. That happens in two cases:

  • A payment Flint couldn't accept, for example one completed with a payment method other than the one Flint approved. The payment intent ends canceled with cancellation_reason: "payment_returned" and shows the money in captured_money, and the order's payment attempt fails with status_reason: "payment_returned". Flint creates the refund as soon as it proves the charge captured money, refunds that whole charge, and returns your processing fee to your balance separately. An authorization that captured nothing is released instead, with no refund.
  • A late charge, such as a card charge that went through after Flint had reported the payment as failed.

Either way the order stays unchanged. These refunds have:

  • initiated_by: "flint". Every refund you or your integration asks for has initiated_by: "merchant", including refunds Flint makes from your Returns, credit notes, order edits, and declined payment reviews. Treat initiated_by as extensible.
  • reason: "payment_returned". Only Flint sets this reason.
  • order_id set to the order the payment was for. The order never received the money, so these refunds don't count toward the order's refund_status or refunded amounts, or limit how much you can still refund. They appear in the order's refund_ids and in GET /v1/refunds?order_id=.
  • pending_reason, which says why a pending refund is waiting. manual_review means Flint's team is checking the refund before the money goes back, and nothing is needed from you. It's null when the refund isn't pending or is on its way without review. Treat it as extensible.

If a buyer wins a dispute for part of a payment Flint couldn't accept, the first Refund keeps its original amount_money and ends failed with failure_reason: "payment_disputed". Flint creates a second Refund for the principal minus the dispute amount. For example, a $10 payment with a $4 lost dispute has a failed $10 Refund and a new $6 Refund: the dispute repaid $4, and Flint refunds the other $6. Read the Dispute for the amount it repaid. Both Refunds appear in the order's refund_ids and stay excluded from the order's refund totals and capacity. The second Refund starts pending, with pending_reason: "manual_review" if Flint needs to review it. It becomes succeeded when the remainder is returned. Flint refunds its whole application fee; you bear the dispute fee.

They send the same refund.* events as other refunds, and GET /v1/refunds?reason=payment_returned lists them. A refund Flint created already succeeded sends refund.created and refund.succeeded together. You can't change how they move money, but PATCH /v1/refunds/{refund_id} still accepts metadata and external_reference_id for your own records.

A refund for a payment Flint couldn't accept can end failed with failure_reason: "refund_abandoned" when Flint stopped trying to send it to the buyer's payment method. The money is still in your balance. Flint hasn't repaid the buyer. Repay them another way if you haven't already. This refund can't be retried through Flint. Flint returns its whole processing fee. The buyer receives a one-time email under your receipt settings, unless you've already repaid them another way.

It can also fail when the buyer wins a dispute on the charge before Flint sends the refund: the dispute repays them, so Flint's team ends the first Refund failed with failure_reason: "payment_disputed" and creates a second Refund if any principal remains owed. It sends refund.failed and no receipt, and the payment intent keeps the charge in captured_money with the lost dispute in dispute_status. Flint still returns your processing fee, because it couldn't accept the payment: it posts as an adjustment balance transaction that links to the refund. The received dispute fee is yours: on the dispute row, or as a card_dispute event fee in merchant billing when Flint paid the processor's fee. New offers that include card_dispute_countered can also bill a countered fee after evidence is submitted. That event fee is credited only on a full win after the processor returns it to Flint, never on a partial win or loss. Existing offers stay unchanged. If a bank reverses it after it succeeded, it goes back to pending with pending_reason: "manual_review" and sends refund.updated, and its succeeded_at comes back unchanged if it succeeds again. When it succeeds, the buyer gets a refund receipt, under your receipt settings, that says their payment couldn't be applied to the order and was refunded. A payment intent with an accepted charge keeps describing only that charge: Flint's refund of another charge on it names the payment intent but doesn't change its money fields.

A headless checkout reads refunds on GET /v1/checkout-sessions/{checkout_session_id}: all buyer-visible refunds on the session's order, including ordinary store refunds. Each item uses the same BuyerRefund projection as /v1/me/refunds, with parent IDs and coarse buyer-safe failure categories. The array is [] when there are no refunds. For failed with refund_abandoned, tell the buyer the refund could not be completed and to contact the store to get their money back.

What the buyer sees#

When a refund reaches succeeded or partially_succeeded, Flint emails the buyer a refund receipt. It goes to the payment's receipt_email, or else the customer's email, or else the order's buyer_contact.email. It lists the amount, the order number, the refunded line items, and your support contact details. A credit-note refund shows the invoice number in place of the order number, plus the credit note number. For store credit, it names each new gift card by its last four characters and amount, says the credit is available now, and never includes a code. No receipt is sent when the refund is created or when it fails, and a request can't turn it off. Setting customer_email_delivery.order_receipts to merchant_sends stops refund receipts.

Flint sends no receipt for a refund recorded as paid outside Flint, because it moved no money. The buyer still sees the refund in their refund list with processed_by: "merchant", so tell them yourself.

The receipt shows the reason only when it describes the purchase: requested_by_customer, duplicate, defective_product, wrong_item_shipped, never_received, not_as_described, arrived_too_late, accidental_order, or out_of_stock, which reads "Item out of stock". It leaves out fraudulent, customer_changed_mind, better_price_found, and other, and shows no reason line when there is no reason.

succeeded means the card network accepted the refund. The credit usually appears on the buyer's statement within 5 to 10 business days, on their bank's schedule, so say so in your own confirmation. Store credit has no bank delay: the card is usable once the buyer has its code.

What the refund changes on the order#

The order's refunded totals move when the card network accepts the refund, before it reaches succeeded. If the refund then fails, they move back.

Before

Paid order

JSON
{
  "order_id": "ord_01KEZF7C00JBKMARG3P06Z224B",
  "status": "closed",
  "payment_status": "paid",
  "refund_status": "none",
  "refund_ids": [],
  "settlement_amounts": {
    "paid_money": {"amount": 3098, "currency": "USD"},
    "refunded_money": {"amount": 0, "currency": "USD"},
    "disputed_money": {"amount": 0, "currency": "USD"},
    "dispute_lost_money": {"amount": 0, "currency": "USD"},
    "net_collected_money": {"amount": 3098, "currency": "USD"},
    "outstanding_money": {"amount": 0, "currency": "USD"}
  }
}

After a $5.00 refund

Partially refunded

JSON
{
  "order_id": "ord_01KEZF7C00JBKMARG3P06Z224B",
  "status": "closed",
  "payment_status": "paid",
  "refund_status": "partially_refunded",
  "refund_ids": ["ref_01KEZF7C00H2GAMWD73WZ7K81W"],
  "settlement_amounts": {
    "paid_money": {"amount": 3098, "currency": "USD"},
    "refunded_money": {"amount": 500, "currency": "USD"},
    "disputed_money": {"amount": 0, "currency": "USD"},
    "dispute_lost_money": {"amount": 0, "currency": "USD"},
    "net_collected_money": {"amount": 2598, "currency": "USD"},
    "outstanding_money": {"amount": 0, "currency": "USD"}
  }
}
  • refund_status is partially_refunded until everything collected has been refunded, then refunded.
  • status, payment_status, and outstanding_money don't change. The money was collected before it went back, and a refund doesn't add to what's owed.
  • settlement_amounts.refunded_money counts successful refunds. If any refunds are still processing, settlement_amounts.pending_refund_money shows the amount they reserve. That amount reduces what you can refund as soon as Flint records the refund.
  • refund_ids lists every refund on the order, including failed ones. Check each refund's status before you count it.
  • Refunded line items, charges, and tips each record their own refunded_money.
  • Once an order has a refund, edits that change its money, such as adding a line item, return 409 ACTION_NOT_ALLOWED with reason payment_collected. Make further changes as refunds. An open order that was partly paid can still collect its outstanding_money.
  • The order's activity log gets a refund entry when the refund is accepted, and a refund_failed entry when it fails or partly fails.

A payment reports its own totals: refunded_money, which includes store credit and pending refunds, and a refund_status of none, partially_refunded, or refunded.

When a refund fails#

A failed refund means Flint hasn't repaid the buyer. The money is still in your balance. When the card network or your balance rejects a refund during the request, the create response can already be 201 with status: "failed". If it returns pending, follow the refund with GET /v1/refunds/{refund_id} or refund.* events. The failure sends refund.created and refund.failed as for any other failure. failure_reason on the refund, and on each failed or canceled part, says why:

failure_reasonWhat happened
expired_or_canceled_cardThe card can no longer receive credits.
lost_or_stolen_cardThe card was reported lost or stolen.
declinedThe card issuer declined the credit.
insufficient_fundsThe refund couldn't be funded.
insufficient_available_balanceYour available balance couldn't cover the refund. See Refunds are paid from your balance.
payment_disputedThe payment is under dispute, or a bank return took the money back first. The buyer already has it through their bank.
refund_abandonedFlint stopped trying to send this refund to the buyer's payment method. The money is still in your balance. Flint hasn't repaid the buyer. Repay them another way if you haven't already. Set only on a refund with reason: payment_returned.
merchant_requestThe refund was stopped at the merchant's request.
payment_refund_failedOn a partially_succeeded refund: one or more parts failed. Read payment_refunds.
payment_refund_not_attemptedOn a canceled part: Flint didn't try it because another payment in the same refund failed first.
refund_failedThe refund failed with no more specific reason.

To try again after a refund you created failed, fix the cause if you can, confirm with the buyer where they can receive the money, and create a new refund with a new Idempotency-Key for the amount that didn't go back. Read the refund's current parts first: the failed and canceled amounts are refundable again, and the parts that succeeded stay refunded.

This doesn't apply to a refund created by an order edit. It can fail the same way, and the edit stays completed with its units removed. Don't create a replacement with POST /v1/refunds: Flint holds the money an edit refunds for that edit, so a refund you create can't use it. Read the failed refund's failure_reason and parts, then retry the edit's refund when its supported_actions includes retry. The same retry creates the refund if Flint stopped trying to create it.

Warning: Read the parts before you tell the buyer

On a refund across several payments, one failed payment doesn't undo the others. Payments already refunded stay refunded, payments not yet tried become canceled, and the refund ends partially_succeeded or failed. "We returned $30.00 of your $50.00 and are fixing the rest" is a different message from "your refund failed".

A refund can also fail after it succeeded, when the buyer's bank rejects the credit. The refund moves to failed, or to partially_succeeded if other parts succeeded, and the matching event fires. The order's refunded_money goes back down, its activity log gets a refund_failed entry, and a recovery balance transaction returns the amount to your balance. The buyer already has a refund receipt, so tell them yourself.

Affirm refunds must be submitted within 120 days of the payment settling, and after one fails, that payment can't be refunded again through Flint. These return 409 ACTION_NOT_ALLOWED with reason refund_window_expired and previous_refund_failed, respectively. Reimburse the buyer outside Flint, and reconcile a failed Refund. The window starts at the stored capture time and does not move when payment attempts are updated. If the capture time is missing, refund_expires_at is null and Flint lets the provider decide whether the refund is still allowed.

Refunds are paid from your balance#

A refund of a payment whose funds are still pending comes out of your pending balance. Once those funds are available, the refund comes out of your available balance. A refund can take your available balance below zero. New payments cover the shortfall, and Flint can debit your bank account to cover it.

If the payment processor rejects a refund because it cannot fund it from your account, the refund can fail with failure_reason: "insufficient_available_balance". A low available balance by itself does not tell you whether the refund will succeed. If POST /v1/refunds returns a pending refund, read it again or follow its events for the outcome.

If some parts were accepted before another failed, wait for any pending parts to finish, then refund only the unpaid remainder. For refunds from an order edit, use the edit's refund retry.

ACH returns and refunds#

A bank return is the buyer's bank pulling an ACH debit payment back days after it succeeded. It isn't a refund, and it isn't a Return of merchandise. It arrives as a dispute with case_type: "bank_return"; see Disputes.

A bank return reduces what's left to refund on the payment, just as a refund would. Flint handles a refund and a bank return one at a time, so the same money can't go back twice:

  • If the bank return comes first, POST /v1/refunds returns 409 ACTION_NOT_ALLOWED with reason payment_disputed, and no refund is created.
  • If the return arrives after Flint recorded the refund, the refund fails with failure_reason: "payment_disputed". A request still running can return it as a 201 with status: "failed"; if the response is pending, read the refund again or follow its events.

Either way, the buyer already has the money back through their bank. An ACH payment that is still processing can't be refunded yet; wait for it to succeed.

Choose a reason#

reason is optional and doesn't change how the money moves. It feeds your reports, the Dashboard's refund views, and the buyer's receipt. Choose the most specific value that's true:

SituationReasons
Generalrequested_by_customer, duplicate, fraudulent
A problem with the product or deliverydefective_product, wrong_item_shipped, never_received, not_as_described, arrived_too_late
The buyer changed their planscustomer_changed_mind, better_price_found, accidental_order
Units couldn't be supplied, for example because stock ran outout_of_stock
Anything elseother

Any other value returns 400 INVALID_REQUEST with an INVALID_VALUE detail, including payment_returned, which only refunds Flint creates carry. Without a reason, the refund's reason is null. Flint can add reasons over time, so handle a reason you don't recognize like other.

A refund created by a Return takes its reason from the buyer's return reason:

Return reasonRefund reason
defectivedefective_product
wrong_itemwrong_item_shipped
too_small, too_large, damaged_on_arrivalnot_as_described
arrived_latearrived_too_late
changed_mindcustomer_changed_mind
no_longer_neededrequested_by_customer
A custom reason, or lines with different reasonsother

Read the Return for the buyer's own wording.

Notes, references, and metadata#

These create fields help you find a refund later:

  • reason_message: a note of up to 1,024 characters for the people who handle the refund, such as "Buyer sent photos of the cracked mug".
  • external_reference_id: your ID from another system, such as a support ticket or RMA number, 1 to 255 characters. You can filter the refund list by it.
  • refund_reference: on a credit-note refund recorded as paid outside Flint, the check or wire number, 1 to 255 characters, stored exactly as sent. It isn't external_reference_id.
  • metadata: up to 50 key-value pairs of your own.

After creation, PATCH /v1/refunds/{refund_id} changes metadata and external_reference_id, and nothing else:

  • Leave a field out to keep it. Send external_reference_id: null to clear it; an empty string or more than 255 characters returns 400 INVALID_REQUEST with an INVALID_VALUE detail.
  • Keys you send in metadata are merged into the existing ones. Set a key to null to remove it, or send metadata: null to remove them all.
  • A body with neither field returns 400 INVALID_REQUEST with detail REQUIRED and param: body.

A refund's version increases with every change, including status changes from the processor, so send the version you read as expected_version:

cURL
curl -X PATCH https://api.withflintpay.com/v1/refunds/ref_01KEZF7C00H2GAMWD73WZ7K81W \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Flint-Version: 2026-09-07" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: refund-ticket-4821-v1" \
  -d '{"expected_version": 2, "external_reference_id": "ticket_4821"}'

If the refund changed since your read, nothing is saved and the request returns 409 VERSION_CONFLICT with the current version in details[0].current_version. Read the refund again, reapply your change, and send it with the new version. Idempotency-Key is optional on PATCH; if you send one, follow the key instruction in next_steps.

Errors to handle#

Flint checks a refund before any money moves. Validation and state refusals create no refund in that attempt: a 400 means the request itself is wrong, and a 409 means the order or payment can't take this refund right now. 409 OPERATION_IN_PROGRESS or 409 IDEMPOTENCY_KEY_IN_PROGRESS means the original operation may still be running, so a refund may already exist; retry the same request with the same key. Branch on code, then on details[0].reason where the table lists one. A refund that Flint recorded and the processor or your balance then rejected returns 201. The response can already carry status: "failed", or it can be pending while you follow the outcome, as When a refund fails describes.

  • HTTP 400

    param names the input to fix, and the detail code says what's wrong:

    • REQUIRED, INVALID_VALUE, or NOT_ALLOWED for a refund_type problem; see Choose a refund type.
    • INVALID_VALUE on a field: a reason outside the list, or a gift_card_load_id that isn't a standalone load funded by a Flint payment.
    • INVALID_VALUE on an amount: zero or less, a line item with both quantity and amount_money, named targets that add up to more than amount_money, or part of amount_money that can't be allocated to the order.
    • INVALID_VALUE on tender_allocations: they don't add up to amount_money, an entry is missing its tender or amount, or a destination isn't original or new_gift_card.
    • NOT_ALLOWED: a payment_intent_id that doesn't belong to the order_id, an amount_money.currency that isn't the payment's, line items or charges for a payment with no order, destinations with tender_allocations or gift_card_load_id, or store credit for a payment that can't take it.
    • REQUIRED on a gift card destination: the original card is closed or can't hold the amount. Choose new_gift_card.
  • HTTP 409
    The refund asks for more than is left: an amount_money, a line's quantity or amount, a charge amount, a tax breakdown, or a tender allocation. param names the input, such as line_items[0].amount_money.amount, and details[0].maximum_money gives what's left when Flint knows it. Also returned when allocations don't cover the named targets, when a gift card purchase refund would remove spent or reserved value, and when a credit-note refund recorded as paid outside Flint exceeds the invoice's unreturned manual payments (maximum_money is 0 when there are none). Read the order's refunds, or send refund_type: "full" to refund exactly what remains.
  • HTTP 409
    Reason already_applied: earlier refunds used up the order, payment, line, or charge.
  • HTTP 409
    Reason payment_disputed: an open or lost chargeback, or a bank return, took the money back. Respond to or accept the dispute in blocking_resources; refunds work again once it is won or prevented. When exactly one dispute blocks the refund, remediation.next_actions includes get_dispute at /v1/disputes/{dispute_id}.
  • HTTP 409
    Reason status_not_reached: the order has no succeeded payments, the payment hasn't been captured or succeeded, or a gift card redemption is still reserved.
  • HTTP 409
    Reason in_progress: the payment is still processing. Wait for it to succeed.
  • HTTP 409
    Reason terminal_status: the payment or redemption is canceled or expired. An uncaptured hold is canceled, not refunded.
  • HTTP 409
    Reason refund_window_expired: the Affirm refund window has ended. Reason previous_refund_failed: an earlier refund on the payment failed; reconcile that Refund. Reimburse the buyer outside Flint for either reason.
  • HTTP 404
    The order, payment, gift card load, or gift_card_redemption_id that param names doesn't exist in this account and mode.
  • HTTP 403
    The key lacks commerce.refunds.write, or the request overrides tax without commerce.refunds.tax_overrides.write. param names the override field.
  • HTTP 409
    Reason processor_not_configured: the account hasn't finished payment processing setup for this mode, so it can't refund through a processor.
  • HTTP 409
    IDEMPOTENCY_KEY_IN_PROGRESSRetry the same request
    The first request with this key may still be running, so a refund may exist. See Replay, conflict, or in progress.
  • HTTP 409
    The key was already used for a different refund request. See Replay, conflict, or in progress.

Errors use the standard error envelope:

Response
{
  "error": {
    "type": "conflict_error",
    "code": "LIMIT_EXCEEDED",
    "message": "The refund amount exceeds the line item's remaining refundable amount.",
    "param": "line_items[0].amount_money.amount",
    "request_id": "req_01KWM6NAA60S1DKTMHGJQZ86G1",
    "details": [
      {
        "code": "LIMIT_EXCEEDED",
        "param": "line_items[0].amount_money.amount",
        "message": "The refund amount exceeds the line item's remaining refundable amount.",
        "maximum_money": {"amount": 1500, "currency": "USD"}
      }
    ]
  }
}

Expect races. If someone refunds in the Dashboard while your code refunds through the API, one of them gets LIMIT_EXCEEDED or ACTION_NOT_ALLOWED. Read the order's current refunds before deciding whether another one is needed, and use a new key only for a new decision. Refused actions lists what every ACTION_NOT_ALLOWED carries.

Find and reconcile refunds#

GET /v1/refunds lists refunds, newest first, with cursor pagination. Its filters:

  • order_id, payment_intent_id, customer_id, return_id, return_resolution_id, external_reference_id, and idempotency_key
  • status (pending, succeeded, partially_succeeded, or failed) and reason. Repeat the key, separate values with commas, or both.
  • currency, alone or with min_amount and max_amount, which need it. Send one three-letter uppercase code, such as USD.
  • created_after, created_before, updated_after, and updated_before
  • query, which matches text in reason_message and external_reference_id, or the start of a refund_id
  • sort_by (created_at, updated_at, or amount_money) and sort_direction
  • expand with order, customer, or payment_intent

A status that belongs to a refund's parts, such as requires_action or canceled, returns 400 INVALID_REQUEST with an INVALID_VALUE detail, and so does a currency list such as USD,EUR. A daily check for failed refunds:

cURL
curl "https://api.withflintpay.com/v1/refunds?status=failed&created_after=2026-09-01T00:00:00Z" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Flint-Version: 2026-09-07"

GET /v1/refunds/{refund_id} also accepts expand=payment_refunds.payment_intent, so you can read a refund with its order and payments in one call:

cURL
curl "https://api.withflintpay.com/v1/refunds/ref_01KEZF7C00H2GAMWD73WZ7K81W?expand=order" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Flint-Version: 2026-09-07"

For your books, each refund posts a negative refund balance transaction for the amount refunded and is subtracted from your next payout. Its related_resource has resource_type: "refund" and the refund's ID in resource_id. The original payment's processing fee isn't returned, and Flint charges no fee to refund, so a $50.00 card payment with a $2.25 fee, refunded in full, leaves your balance $2.25 lower.

Processing fees explains why, and Reconciliation matches refunds to payouts and bank deposits.

Test refunds#

Sandbox refunds run the same lifecycle as live ones. Pay a test order with , as Testing walks through, then refund it with the requests above, and watch refund.created, refund.succeeded, and order.partially_refunded or order.refunded arrive at your webhook endpoint. Then try the refusals: refund an unpaid order to get ACTION_NOT_ALLOWED with reason status_not_reached, and refund one cent more than what's left to get LIMIT_EXCEEDED.

Next steps#

ReturnsRefund merchandise that comes back, with eligibility and restocking.Refund taxSend back less tax than Flint works out, or refund a flat order tax.DisputesWhen the buyer goes to their bank instead of asking you.Refunds API referenceEvery field, including tax overrides, adjustments, and gift card purchase refunds.

Refund while an order edit is pending#

A pending paid-order edit reserves the credit it will move to the added items. Refunds and returns can use the order's remaining unreserved value. A refund that needs reserved credit returns LIMIT_EXCEEDED with maximum_money. Canceling the edit releases that credit. After completion, refunds of an added line go back to the payments that paid for it, including the original credit and the balance payment.

Was this helpful?