Refunds

Refunds return funds to a buyer for an order, a succeeded payment intent, or a captured gift card redemption. Target an order_id, a payment_intent_id, explicit tender_allocations, or a standalone gift_card_load_id, and refund the full remaining value or a partial amount. For an order funded by gift cards and processor payments, Flint defaults to the original gift cards first. Explicit allocations are exhaustive and cannot exceed each original tender's remaining refundable value.

tender_allocations reports each original tender's amount, refunded tip, status, and failure. Gift card entries also identify the original card and redemption, the original or replacement destination, and the cards credited. payment_refunds contains only processor payment outcomes, so a gift card-only refund has no payment_intent_id and no payment_refunds entries.

An Idempotency-Key is required with tender_allocations or gift_card_load_id, and for an order_id-only refund of an order funded by gift cards. Flint keeps a refund's key for as long as the refund exists. Replacement codes appear only in the create response's top-level gift_card_codes, outside data, and can be recovered by replaying the original request for 24 hours. Ordinary refund reads and events omit them.

Refunds fit the orders-first model: when you refund against an order, Flint updates the order's refunded amounts and refund_status, while its workflow status and payment_status stay as they were. You can refund specific line items and charges, and Flint works out the tax that goes back. reason is optional. A refund's status starts pending or is already succeeded, and ends succeeded, partially_succeeded, or failed; follow it with the refund.updated webhook.

The Refunds guide covers line-item refunds, the status lifecycle, and failures. For how refunds fit the order lifecycle, see the Orders-first guide.

To refund a standalone gift card purchase funded by a Flint payment, supply its original gift_card_load_id. Omit order, line item, charge, tax, and tender targets. If supplied, payment_intent_id must match the load's original payment. amount_money refunds paid consideration, which can differ from face value. Omit it to refund the load's remaining consideration. An Idempotency-Key is required.

If the same standalone payment also contains cash that never funded a gift card, you can refund that cash through payment_intent_id without a load target. This refund cannot consume consideration assigned to a card or cash reserved by another pending refund.

Flint reserves the corresponding unspent value before the cash refund starts. A pending or unknown processor outcome retains that hold. Confirmed success removes the reserved value; confirmed failure releases it. Refunding spent or otherwise reserved purchase value returns GIFT_CARD_PURCHASE_REFUND_CONFLICT. Read the load's purchase_refunds for each allocation, paid consideration, face value, and outcome. If returned value moved to a replacement card, a new cash refund still targets the original funding load, and Flint reserves the unspent value on whichever cards now hold it. purchase_refunds[].value_allocations lists the loads the value came from, and a replacement card's load reports pending cash refund holds in purchase_refund_value_holds. For cards sold on a Flint order, refund their original order line items.

If a succeeded purchase refund later fails, Flint restores the removed value to the original card when all reversed value belonged to that load. If value was reversed from descendant loads, or the original card is closed or cannot accept the value within its balance cap, Flint creates replacement cards that retain the original funding history and restrictions. The load's purchase_refunds[].recovery identifies the destinations. Replaying the original refund creation request recovers replacement codes for 24 hours after recovery. Ordinary reads and events contain destination identities only.

For gift cards sold on a Flint order line item, if the refunded cash had not issued a whole gift card, a late failure returns cash instead of creating another card. Read unissued_gift_card_recoveries on the refund. To return that cash, create a new refund with its payment_intent_id, order_id, and a line_items entry containing its order_line_item_id and the amount to return. Use a new Idempotency-Key. Flint returns recovered cash before removing value from cards funded by that payment. source_remaining_amount_money includes cash reserved by pending refunds; subtract source_pending_amount_money to find the amount currently available. These source amounts describe the entire settlement_allocation_id, so entries sharing that identity are not additive.

The Refund object#

Every field on a refund, as returned by retrieve and carried by the endpoints below.

Attributes

amount_moneyobjectRequired

Monetary amount represented as integer minor units plus an ISO 4217 currency code.

created_atstring

RFC3339 timestamp.

credit_note_idstring
customerobject or null
customer_idstring
external_reference_idstring

Caller-owned identifier for this resource in an external system.

failure_reasonenum

Flint-normalized refund failure reason. Unknown provider values are returned as refund_failed.

  • expired_or_canceled_card
  • lost_or_stolen_card
  • insufficient_funds
  • insufficient_available_balance
  • declined
  • merchant_request
  • payment_disputed
  • payment_refund_failed
  • payment_refund_not_attempted
  • refund_failed
idempotency_keystring
invoice_idstring
line_item_allocationsarray of object
merchant_idstring
metadatamap of string
orderobject or null
order_idstring
payment_intentobject or null
payment_intent_idstring
payment_refundsarray of object
reasonenum or null
  • duplicate
  • fraudulent
  • requested_by_customer
  • defective_product
  • wrong_item_shipped
  • never_received
  • not_as_described
  • arrived_too_late
  • customer_changed_mind
  • better_price_found
  • accidental_order
  • other
  • null
reason_messagestring
refund_idstringRequired
refund_methodenum
  • original_payment
refunded_tip_moneyobjectRequired

Monetary amount represented as integer minor units plus an ISO 4217 currency code.

return_idstring
return_resolution_idstring
review_idstring
statusenumRequired
  • pending
  • in_transit
  • succeeded
  • failed
  • requires_action
  • canceled
  • partially_succeeded
tax_breakdown_refundsarray of object
tender_allocationsarray of object
unissued_gift_card_recoveriesarray of object

Cash returned after an unissued gift card purchase refund failed. Return it through a new refund against payment_intent_id and order_line_item_id. It does not issue another card. Source remaining and pending amounts describe the entire original settlement allocation; repeated entries for that source are not additive.

updated_atstring

RFC3339 timestamp.

JSON
{
  "amount_money": {
    "amount": 1000,
    "currency": "USD"
  },
  "created_at": "2026-03-17T14:30:00Z",
  "customer_id": "cus_123",
  "merchant_id": "mer_123",
  "metadata": {
    "ticket_id": "tkt_123"
  },
  "order_id": "ord_123",
  "payment_intent_id": "pi_123",
  "payment_refunds": [
    {
      "amount_money": {
        "amount": 1000,
        "currency": "USD"
      },
      "payment_intent_id": "pi_123",
      "refunded_tip_money": {
        "amount": 100,
        "currency": "USD"
      },
      "status": "succeeded"
    }
  ],
  "reason": "requested_by_customer",
  "refund_id": "ref_123",
  "refund_method": "original_payment",
  "refunded_tip_money": {
    "amount": 100,
    "currency": "USD"
  },
  "status": "succeeded",
  "updated_at": "2026-03-17T14:30:00Z"
}

List refunds#

GET/v1/refunds

Requires scope commerce.refunds.read or commerce.refunds.write

Returns a paginated list of refunds for the authenticated merchant.

Query parameters

page_sizeinteger

Page size, default 20, max 100.

page_tokenstring

Cursor returned by the previous list response.

order_idstring

Filter by order ID.

payment_intent_idstring

Filter by payment intent ID.

customer_idstring

Filter by customer ID.

statusenum

Filter by refund status.

  • pending
  • in_transit
  • succeeded
  • failed
  • requires_action
  • canceled
  • partially_succeeded
reasonarray of enum

Repeat the parameter to filter by multiple refund reasons.

  • duplicate
  • fraudulent
  • requested_by_customer
  • defective_product
  • wrong_item_shipped
  • never_received
  • not_as_described
  • arrived_too_late
  • customer_changed_mind
  • better_price_found
  • accidental_order
  • other
refund_methodenum

Filter by refund method.

  • original_payment
min_amountinteger

Inclusive lower bound in minor units. Requires currency.

max_amountinteger

Inclusive upper bound in minor units. Requires currency.

currencystring

ISO 4217 currency for min_amount and max_amount.

external_reference_idstring

Exact-match filter on the caller-owned external reference ID.

return_idstring

Filter by linked Return ID.

return_resolution_idstring

Filter by linked ReturnResolution ID.

querystring

Search across refund_id, external_reference_id, and reason_message. Text fields match any part of the value, and %, _ and \ are ordinary characters, not wildcards. IDs match from the start and need the type prefix, such as ord_01.

sort_byenum

Sort field.

  • created_at
  • updated_at
  • amount
sort_directionenum

Sort direction.

  • asc
  • desc
created_afterstring

RFC3339 lower bound for created_at.

created_beforestring

RFC3339 upper bound for created_at.

updated_afterstring

RFC3339 lower bound for updated_at.

updated_beforestring

RFC3339 upper bound for updated_at.

Response · 200

dataarray of objectRequired
metaobject
next_page_tokenstring
request_idstring
curl https://api.withflintpay.com/v1/refunds \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY"
JSON
{
  "data": [
    {
      "amount_money": {
        "amount": 1000,
        "currency": "USD"
      },
      "created_at": "2026-03-17T14:30:00Z",
      "customer_id": "cus_123",
      "merchant_id": "mer_123",
      "metadata": {
        "ticket_id": "tkt_123"
      },
      "order_id": "ord_123",
      "payment_intent_id": "pi_123",
      "payment_refunds": [
        {
          "amount_money": {
            "amount": 1000,
            "currency": "USD"
          },
          "payment_intent_id": "pi_123",
          "refunded_tip_money": {
            "amount": 100,
            "currency": "USD"
          },
          "status": "succeeded"
        }
      ],
      "reason": "requested_by_customer",
      "refund_id": "ref_123",
      "refund_method": "original_payment",
      "refunded_tip_money": {
        "amount": 100,
        "currency": "USD"
      },
      "status": "succeeded",
      "updated_at": "2026-03-17T14:30:00Z"
    }
  ],
  "next_page_token": "example",
  "request_id": "bce56cba-0827-44aa-bb56-4f200ba15ee6"
}

Create refund#

POST/v1/refundsIdempotent

Requires scope commerce.refunds.write

Creates a refund for an order or payment intent. This is a financial operation.

Request body

Send at least one of these

amount_moneyobject

Monetary amount represented as integer minor units plus an ISO 4217 currency code.

chargesarray of object
external_reference_idstring

Caller-owned identifier for this resource in an external system.

gift_card_load_idstring

Original standalone gift card funding load paid by a Flint payment. Refunds its paid consideration and removes the corresponding eligible unspent face value. Requires Idempotency-Key; cannot be combined with order, line item, charge, tax or tender targets.

line_itemsarray of object
metadatamap of string
order_idstringRequired
payment_intent_idstring
reasonenum

Optional. When omitted, no reason is recorded or sent to the processor, and the buyer's refund email has no reason line.

  • duplicate
  • fraudulent
  • requested_by_customer
  • defective_product
  • wrong_item_shipped
  • never_received
  • not_as_described
  • arrived_too_late
  • customer_changed_mind
  • better_price_found
  • accidental_order
  • other
reason_messagestring
refund_methodenum
  • original_payment
tax_breakdown_refundsarray of object
tender_allocationsarray of one of

Exhaustive allocations to original tenders. Amounts sum to amount_money when supplied; otherwise their sum determines the refund. Selected line-item, charge and flat-tax components must be covered by their original tenders. Additional untargeted value follows the default tender order. Gift card destinations default to original. Select replacement when the original card is closed or cannot accept the full credit within its balance cap.

Response · 201

dataobjectRequired
gift_card_codesarray of object

Replacement card codes recovered from the original command for 24 hours. Omitted after the recovery window and never returned by ordinary refund reads or events.

metaobject
request_idstring
curl -X POST https://api.withflintpay.com/v1/refunds \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: a-unique-key" \
  -d '{
    "amount_money": {
      "amount": 1000,
      "currency": "USD"
    },
    "metadata": {
      "ticket_id": "tkt_123"
    },
    "order_id": "ord_123",
    "reason": "requested_by_customer"
  }'

Get refund#

GET/v1/refunds/{refund_id}

Requires scope commerce.refunds.read or commerce.refunds.write

Returns a single refund by ID.

Path parameters

refund_idstringRequired

Flint refund ID.

Query parameters

expandarray of enum

Supported expansions: customer, order, payment_intent, payment_refunds.payment_intent. Expansion requires commerce.refunds.read plus the read scope for each expanded resource. Limits: at most 10 unique expand paths per request; path depth at most 2. To-many expansions are capped at 20 related objects per path. Repeat expand, for example expand=customer&expand=order, or pass one comma-separated value.

  • customer
  • order
  • payment_intent
  • payment_refunds.payment_intent

Response · 200

dataobjectRequired
metaobject
request_idstring
curl https://api.withflintpay.com/v1/refunds/ref_123 \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY"
JSON
{
  "data": {
    "amount_money": {
      "amount": 1000,
      "currency": "USD"
    },
    "created_at": "2026-03-17T14:30:00Z",
    "customer_id": "cus_123",
    "merchant_id": "mer_123",
    "metadata": {
      "ticket_id": "tkt_123"
    },
    "order_id": "ord_123",
    "payment_intent_id": "pi_123",
    "payment_refunds": [
      {
        "amount_money": {
          "amount": 1000,
          "currency": "USD"
        },
        "payment_intent_id": "pi_123",
        "refunded_tip_money": {
          "amount": 100,
          "currency": "USD"
        },
        "status": "succeeded"
      }
    ],
    "reason": "requested_by_customer",
    "refund_id": "ref_123",
    "refund_method": "original_payment",
    "refunded_tip_money": {
      "amount": 100,
      "currency": "USD"
    },
    "status": "succeeded",
    "updated_at": "2026-03-17T14:30:00Z"
  },
  "request_id": "bce56cba-0827-44aa-bb56-4f200ba15ee6"
}

Update refund#

PATCH/v1/refunds/{refund_id}Idempotent

Requires scope commerce.refunds.write

Updates refund metadata.

Path parameters

refund_idstringRequired

Flint refund ID.

Request body

metadatamap of string or null

Caller-owned metadata. Omit this field to leave metadata unchanged. Send an object to merge by key, set a key to null to remove it, or set metadata to null to clear all metadata. An empty object makes no change. Empty strings are stored. Keys starting with flint_ are reserved and cannot be written through the public API.

Response · 200

Same response as Get refund.

curl -X PATCH https://api.withflintpay.com/v1/refunds/ref_123 \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: a-unique-key" \
  -d '{
    "metadata": {
      "reviewed_by": "ops"
    }
  }'

Was this helpful?