Skip to content

Return resolutions

Approving a Return says merchandise may come back. A resolution says what the buyer gets for it: money back, store credit, different merchandise, the same merchandise again, or nothing. You preview it, create it, and confirm it, and Flint then moves the money and creates the orders, waiting for the merchandise first when the decision says to.

When a return policy resolves a line automatically, Flint creates and confirms a refund, store_credit, or no_monetary_action resolution for you (see What automatic decides). They follow the same lifecycle as the ones you create.

Choose an outcome#

resolution_typeWhat the buyer gets
refundMoney back on the original payment. Gift card value goes back to the original card unless you choose new gift cards
store_creditThe returned value on new Flint gift cards instead of the original payment. See Store credit
exchangeDifferent merchandise, with the difference refunded or paid by the buyer
replacementThe same merchandise sent again, settled the same way as an exchange
no_monetary_actionNothing. Use it when goods come back and no value is owed
correctionAn adjustment to a resolution that already settled. See Fixing one after it settled

Every type except correction names the Return lines it covers in line_items, each with a return_line_item_id and a whole-number quantity, up to 100 lines. The quantity must be approved on the Return and not already claimed by another resolution.

Preview, create, confirm#

  1. Preview the outcome#

    A preview prices an option without changing anything: it approves nothing, reserves nothing, and starts nothing. Use it to show the buyer what they would get, or to check the amounts before you commit. Send the Return's version as resolution.expected_return_version to make sure you price the Return you just read.

    cURL
    curl -X POST https://api.withflintpay.com/v1/return-previews \
      -H "Authorization: Bearer YOUR_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "mode": "resolution",
        "resolution": {
          "return_id": "ret_1kmn0aExample",
          "expected_return_version": 4,
          "resolution_type": "refund",
          "line_items": [
            { "return_line_item_id": "retli_1kmn0aExample", "quantity": 1 }
          ],
          "adjustments": [
            {
              "adjustment_type": "restocking_fee",
              "value_effect": "deduction",
              "status": "applied",
              "assessed_amount_money": { "amount": 500, "currency": "USD" },
              "applied_amount_money": { "amount": 500, "currency": "USD" },
              "reason": "inspection_result",
              "return_line_item_id": "retli_1kmn0aExample"
            }
          ]
        }
      }'
    
    Response
    {
      "data": {
        "mode": "resolution",
        "resolution": {
          "return_id": "ret_1kmn0aExample",
          "resolution_type": "refund",
          "based_on_return_version": 4,
          "calculated_at": "2026-10-28T17:02:11Z",
          "line_items": [
            {
              "return_line_item_id": "retli_1kmn0aExample",
              "quantity": 1,
              "release_timing": "after_receipt",
              "returned_total_money": { "amount": 5400, "currency": "USD" }
            }
          ],
          "adjustments": [
            {
              "adjustment_type": "restocking_fee",
              "value_effect": "deduction",
              "status": "applied",
              "assessed_amount_money": { "amount": 500, "currency": "USD" },
              "applied_amount_money": { "amount": 500, "currency": "USD" },
              "reason": "inspection_result",
              "return_line_item_id": "retli_1kmn0aExample"
            }
          ],
          "replacement_line_items": [],
          "returned_total_money": { "amount": 5400, "currency": "USD" },
          "deduction_money": { "amount": 500, "currency": "USD" },
          "credit_adjustment_money": { "amount": 0, "currency": "USD" },
          "replacement_total_money": { "amount": 0, "currency": "USD" },
          "buyer_refund_amount_money": { "amount": 4900, "currency": "USD" },
          "buyer_payment_amount_money": { "amount": 0, "currency": "USD" }
        }
      },
      "request_id": "req_1kmn0aExample"
    }
    

    based_on_return_version names the Return version the preview was calculated against, so a preview made before the Return changed is recognizably stale. A stale expected_return_version returns 409 VERSION_CONFLICT with param: resolution.expected_return_version.

  2. Create the resolution#

    Creating it proposes the outcome and reserves the line quantity, so two resolutions can't claim the same approved units. Send the fields you previewed, apart from return_id, including the same expected_return_version.

    cURL
    curl -X POST https://api.withflintpay.com/v1/return-resolutions \
      -H "Authorization: Bearer YOUR_API_KEY" \
      -H "Content-Type: application/json" \
      -H "Idempotency-Key: resolution-ret_1kmn0a-refund" \
      -d '{
        "return_id": "ret_1kmn0aExample",
        "expected_return_version": 4,
        "resolution_type": "refund",
        "line_items": [
          { "return_line_item_id": "retli_1kmn0aExample", "quantity": 1 }
        ],
        "adjustments": [
          {
            "adjustment_type": "restocking_fee",
            "value_effect": "deduction",
            "status": "applied",
            "assessed_amount_money": { "amount": 500, "currency": "USD" },
            "applied_amount_money": { "amount": 500, "currency": "USD" },
            "reason": "inspection_result",
            "return_line_item_id": "retli_1kmn0aExample"
          }
        ]
      }'
    

    If the Return changed since the preview, create fails with 409 VERSION_CONFLICT, param: expected_return_version, the Return's ID, and its current_version, instead of committing an amount the buyer never saw. Read the Return again, preview again, and create against the new version. The fence is optional, but without it you can't tell that the amounts moved.

    The new resolution is proposed. Nothing runs yet. While it's proposed you can change its line_items, replacement_line_items, adjustments, and gift_card_refund_destination with PATCH /v1/return-resolutions/{return_resolution_id}, or cancel it to free its quantity. Writes has the PATCH rules.

  3. Confirm it#

    Confirming freezes the amounts and starts the effects. Send the resolution's version as expected_version to confirm the version you reviewed, or an empty body.

    cURL
    curl -X POST https://api.withflintpay.com/v1/return-resolutions/retres_1kmn0aExample/confirm \
      -H "Authorization: Bearer YOUR_API_KEY" \
      -H "Content-Type: application/json" \
      -H "Idempotency-Key: confirm-retres_1kmn0a" \
      -d '{}'
    

    After this call the amounts are settled facts. To change them later, use a correction.

Confirmed is not the same as paid#

A confirmed resolution can stay pending for days, and that is usually correct. execution_blockers says what it waits for. Each blocker has a code, and line gates also carry the return_line_item_id.

BlockerCleared by
handoff_pendingThe buyer handing the parcel to a carrier
receipt_pendingThe warehouse recording the merchandise arriving
inspection_pendingAn inspection and its acceptance decision
manual_release_pendingA call to /release
buyer_payment_pendingThe buyer paying an exchange balance
refund_pendingThe Refund settling
replacement_order_pendingFlint creating the replacement Order
fulfillment_pendingThe replacement Order's fulfillment_status reaching fulfilled or not_applicable

The first four come from release_timing, which the decision sets on each line and the resolution's line_items echo. It gates every resolution type, including exchanges and replacements, and it is how you avoid paying out for goods that never arrive.

release_timingThe resolution runs
after_approvalAs soon as you confirm it
after_handoffWhen the buyer hands the merchandise to a carrier
after_receiptWhen the merchandise arrives
after_inspectionWhen an inspection accepts it, or on arrival when the line's inspection is waived
manualWhen you call /release

The gate counts units. A resolution waits until enough of the line's units have been handed off, received, or accepted to cover it and every resolution released before it on that line, up to the line's return_required_quantity.

A resolution held by manual timing is requires_action with action_reason: manual_release, and supported_actions lists release. Release it once you're satisfied:

cURL
curl -X POST https://api.withflintpay.com/v1/return-resolutions/retres_1kmn0aExample/release \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: release-retres_1kmn0a" \
  -d '{ "reason": "merchant_approved" }'

Resolution status#

Return resolution statusStartFinal
  • proposed moves to pending on confirm
  • proposed moves to canceled on cancel
  • pending moves to requires_action on waits on a person
  • requires_action moves to pending on person acts
  • pending moves to completed on value delivered
  • pending moves to failed on effect fails
  • failed moves to pending on retry
  • failed moves to canceled on cancel
  • pending moves to canceled on cancel before an effect starts
  • requires_action moves to canceled on cancel before an effect starts

Two cases skip pending when you confirm. A resolution held by manual timing goes straight to requires_action, and a no_monetary_action resolution with nothing to wait for goes straight to completed. A pending or requires_action resolution can also be canceled until it starts an effect, as Canceling an unpaid exchange describes for exchanges and replacements.

status on return resolution
Final values do not change again
  • proposed
    Created, not confirmed. Nothing runs. You can edit or cancel it.
  • pending
    Confirmed, and executing or waiting on execution_blockers.
  • requires_action
    Waiting on a person. action_required_by says who and action_reason says why: manual_release for a merchant release, buyer_payment while the buyer's exchange payment needs them. Once they act, it returns to pending.
  • completedFinal
    The buyer has the value: every linked Refund succeeded, any balance was collected, and any replacement Order's fulfillment_status is fulfilled or not_applicable.
  • failed
    Execution stopped. failure_code says whether retry can help. See When a resolution fails.
  • canceledFinal
    Canceled. Its quantity is free for another resolution.

supported_actions lists what you can do now: confirm, cancel, release, retry, and checkout_session. It's empty while the parent Return isn't open, except for checkout_session. Check it before calling an action instead of calling to find out.

partially_completed isn't a resolution status. Only the Return's resolution_status reports it, when value was delivered on some lines and not others. See The value.

Fees#

Restocking and return shipping charges aren't separate objects. They are adjustments on the resolution, so they stay in the same arithmetic as the refund.

adjustment_typeUsual value_effect
restocking_feededuction
return_shipping_feededuction
other_feededuction
goodwill_creditcredit
price_correctionEither
otherEither

Each adjustment needs adjustment_type, value_effect, assessed_amount_money, applied_amount_money, and a reason. status defaults to applied. To waive a fee and keep a record of it, send status: "waived" with applied_amount_money of zero and a waiver_reason. applied_amount_money can't exceed assessed_amount_money.

The amounts combine one way for every type:

Text
returned_total_money + credit_adjustment_money - deduction_money - replacement_total_money

A positive result is buyer_refund_amount_money. A negative one is buyer_payment_amount_money, which only an exchange or replacement can have. A deduction scoped to a return_line_item_id can't exceed that line's returned total, and all deductions together can't exceed the returned total plus credits. Either fails with 400 INVALID_REQUEST, detail code INVALID_VALUE, naming the adjustment's applied_amount_money.amount. A resolution carries at most 50 adjustments.

When a policy resolves a line automatically, Flint adds the policy's fees for you with reason: "return_policy". On a resolution you create yourself, send the fees you want to charge; the Return line's eligibility.policy_adjustment_proposals lists what its policy proposes. An adjustment with reason: "return_policy" needs the return_line_item_id of a line that a policy covers.

The Return's financial_summary reports the totals separately as deduction_money and credit_adjustment_money, apart from returned_total_money and refunded_money, so nothing is netted out of sight. Updating adjustments covers keeping, adding, and removing them with PATCH.

Store credit#

A store_credit resolution refunds the returned value onto new Flint gift cards instead of the original payment. It is priced, held by release_timing, and confirmed exactly like a refund. Confirming creates an ordinary linked Refund that issues the new cards and makes no processor refund, so you keep the cash and the original processing fee isn't returned. buyer_refund_amount_money is the value issued on the new cards. Refund to store credit covers what it changes on the order and your balance.

cURL
curl -X POST https://api.withflintpay.com/v1/return-resolutions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: resolution-ret_1kmn0a-store-credit" \
  -d '{
    "return_id": "ret_1kmn0aExample",
    "expected_return_version": 4,
    "resolution_type": "store_credit",
    "line_items": [
      { "return_line_item_id": "retli_1kmn0aExample", "quantity": 1 }
    ]
  }'

Store credit is available when every payment on the order that still has refundable value can fund it:

  • Gift card payments qualify.
  • Card, Apple Pay, Google Pay, and Link payments qualify when they succeeded, are in USD, and have no open or lost chargeback.
  • Affirm and ACH debit payments don't qualify.

Flint checks this when you preview, create, or confirm a store credit resolution, and when a decision or process call resolves a line automatically. A refused request returns 409 ACTION_NOT_ALLOWED with reason: store_credit_unavailable, and details[0] names the order. Eligibility previews leave store_credit out of allowed_resolution_types for an order that can't fund it, so a policy that allows store credit offers it only where the order supports it.

If a bank return has already given the buyer their money back, creating or confirming a refund resolution returns 409 ACTION_NOT_ALLOWED with reason: payment_disputed. If the return decision allows no_monetary_action, cancel any proposed refund resolution and use that resolution type to close the return. If the line requires a refund, contact Flint support for help closing the return.

If the order stops qualifying after you confirm, for example because a chargeback opened, the resolution fails with failure_code: store_credit_unavailable. Retrying can't fix that. Cancel the resolution, then create a refund resolution to return the value to the original payment.

Where gift card value goes#

Return refunds use the same tender allocation as direct refunds. Without explicit tender_allocations on a direct refund, Flint refunds original gift cards first, then processor payments. Named line items, charges, and flat tax go back to the tender that paid for them; discounts reduce the line value before it is allocated. Return refunds follow this rule too, after deducting fees.

For a $40.00 order, suppose one $20.00 line was paid with a $15.00 gift card and $5.00 on a card, and a second $20.00 line was paid entirely by card. Returning the first line refunds $15.00 to the gift card and $5.00 to the card, matching a direct refund of that line. A refund with no named components uses the remaining gift-card value first: a $10.00 refund credits the gift card when it still has $10.00 refundable. When both tenders paid part of a named line, its frozen settlement allocations determine each tender's share. Shipping goes back to the tender that paid the shipping charge when you include it in a refund; returning merchandise alone doesn't refund shipping.

A refund, an exchange, and a correction choose where the gift-card allocation goes. gift_card_refund_destination takes original, the default, which credits the gift card that paid, or new_gift_card, which issues that value on new gift cards. Value paid any other way goes back to the original payment either way.

cURL
curl -X POST https://api.withflintpay.com/v1/return-resolutions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: resolution-ret_1kmn0a-new-card" \
  -d '{
    "return_id": "ret_1kmn0aExample",
    "expected_return_version": 4,
    "resolution_type": "refund",
    "gift_card_refund_destination": "new_gift_card",
    "line_items": [
      { "return_line_item_id": "retli_1kmn0aExample", "quantity": 1 }
    ]
  }'
Resolutiongift_card_refund_destination
refund, exchangeAccepted and echoed on the resolution
correction of anything but store_creditAccepted and echoed on the resolution
store_credit, and a correction of itRejected. Value always goes on new gift cards
replacement, no_monetary_actionRejected

Send it on create, on a resolution in POST /v1/returns/{return_id}/process, on PATCH while the resolution is proposed, or on retry after a failed refund. A rejected field returns 400 INVALID_REQUEST with a NOT_ALLOWED detail at gift_card_refund_destination and conflicting_fields: ["resolution_type"].

Flint never moves gift card value to new cards on its own. When the original card is closed or can't take the amount within its balance cap, the resolution fails with gift_card_refund_destination_required and you choose.

Delivering the gift card#

New gift cards are bearer credentials, so the buyer needs each card's code. Who sends it follows your customer_email_delivery.returns setting:

SettingWho delivers the card
flint_sends, the defaultFlint emails each new card to the Return's buyer email once the Refund succeeds
merchant_sends, or a Return with no buyer emailYou do

This covers every new card a Return issues: store credit, and gift card value sent to new_gift_card. Find the Refund through the resolution's refund_ids; its tender_allocations[].destination_cards lists each card's gift_card_id. To deliver a card yourself, call POST /v1/gift-cards/{gift_card_id}/rotate-code, which returns a new code once, or POST /v1/gift-card-notifications to have Flint email it to a recipient you choose. Both need the commerce.gift_cards.secrets.write scope. See Gift cards.

The resolution is completed once the value is on the new cards. The email doesn't hold it up, and an email that fails leaves it completed.

Choose replacement merchandise#

An exchange or a replacement lists what the buyer gets in replacement_line_items, up to 100 lines, and needs a pricing_basis that says how the merchandise is priced. Each line has a type that decides how it names the merchandise:

typeSend
variantvariant_id and quantity
bundlebundle_id and quantity
customname, unit_price_money, quantity, and fulfillment, for merchandise outside your catalog. description and sku are optional
pricing_basisCatalog lines are priced at
original_priceThe net amount paid after discounts for matching selected returned units. An exact variant or bundle matches first, then variants of the same product in request line order
current_priceThe variant's or bundle's current catalog price, without carrying over the original purchase discounts
merchant_agreed_priceThe unit_price_money you send on every replacement line

With original_price, each returned source line contributes its own paid amount for the units it supplies. If a replacement draws on two lines with different paid prices, Flint sums their allocated amounts. Partial quantities use the same allocation as a refund, including its cent remainders. Flint does not round a unit price and multiply it back. Replacement tax is calculated separately.

For example, a $32.00 item bought with a $4.80 discount contributes $27.20 toward an exchange. A same-product size swap with original_price preserves that $27.20 merchandise value. With current_price, a replacement still listed at $32.00 leaves $4.80 to pay before any tax difference.

A merchant request missing pricing_basis returns 400 INVALID_REQUEST with detail code REQUIRED and param: pricing_basis. On a preview the parameter is resolution.pricing_basis. If original_price cannot find enough matching selected returned units, the response is 400 INVALID_REQUEST, detail code INVALID_VALUE, naming replacement_line_items[i].

custom lines are always priced at their own unit_price_money.

Custom replacements use the same fulfillment input as custom order lines. Send {"requirement":"none"} when nothing is delivered. For example:

Response
{
  "type": "custom",
  "name": "Replacement service credit",
  "quantity": 1,
  "unit_price_money": { "amount": 2500, "currency": "USD" },
  "fulfillment": { "requirement": "none" }
}

Send fulfillment on custom lines in previews, creates, process requests, and replacement collection PATCHes, including lines kept by return_replacement_line_item_id. Catalog replacements take fulfillment requirements from their catalog profile.

Replacement orders inherit the original Order's inventory_routing_source. They do not route from the Return's receiving location or choose a fallback source. If the original Order has no routing source and a replacement tracks inventory, preview, create, and process return 409 ACTION_NOT_ALLOWED with reason configuration_required; the error names the original Order. Set its inventory_routing_source before trying again. Stock availability is checked when inventory is reserved for collection or fulfillment, following the inherited source's routing rules.

cURL
curl -X POST https://api.withflintpay.com/v1/return-resolutions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: resolution-ret_1kmn0a-exchange" \
  -d '{
    "return_id": "ret_1kmn0aExample",
    "expected_return_version": 4,
    "resolution_type": "exchange",
    "pricing_basis": "current_price",
    "line_items": [
      { "return_line_item_id": "retli_1kmn0aExample", "quantity": 1 }
    ],
    "replacement_line_items": [
      { "type": "variant", "variant_id": "var_1kmn0bExample", "quantity": 1 }
    ]
  }'

A line without type returns 400 INVALID_REQUEST with param naming it, such as replacement_line_items[0].type. A field from another type, such as bundle_id on a variant line, returns a NOT_ALLOWED detail. Send the same lines on previews and on a resolution in POST /v1/returns/{return_id}/process. On PATCH, every line sends type, including a line you keep by its return_replacement_line_item_id.

The resolution prices the replacement Order, tax included, in replacement_total_money. An exchange for something cheaper refunds the difference through a linked Refund. An exchange for something more expensive leaves a balance the buyer pays. Exchanging a $54.00 return for a $70.20 jacket leaves $16.20, which the resolution reports as buyer_payment_amount_money of 1620.

Previewing or creating an exchange with a USD balance from $0.01 to $0.99 returns 400 INVALID_REQUEST. Choose a different replacement or add a credit to bring the balance to zero. Flint also refuses to confirm a saved proposal in that range.

Tax on replacement merchandise#

The replacement Order keeps the original order's tax mode, tax destination, exemption selection, and delivery tax template. Flint calculates replacement tax on its replacement prices, then compares the tax-inclusive replacement total with the returned value. Preview and create use the same calculation.

For an order using external tax with provided components, omit replacement_line_items[].tax to reuse the original calculation for the matching returned variant or bundle. A different variant of the same product uses that product's original calculation when the matching lines agree. Percentage components apply to the replacement's discounted amount; inclusive components stay included in its price. Replacement lines accept percentage components. Original order-level flat taxes and charges are not copied to the replacement Order.

To supply different tax, or exchange into merchandise without a matching original calculation, include tax.calculation on each replacement line. It accepts the same price_mode and components as an external-tax order line, including zero-percent components for non-taxable merchandise:

Response
{
  "type": "variant",
  "variant_id": "var_1kmn0aExample",
  "quantity": 1,
  "tax": {
    "calculation": {
      "price_mode": "additive",
      "components": [{
        "jurisdiction": {
          "code": "US-CA",
          "country": "US",
          "state": "CA",
          "level": "state",
          "name": "California"
        },
        "tax_type": "sales_tax",
        "percent": 7.25
      }]
    }
  }
}

Merchant previews, creates, and proposed replacement edits accept this field. Omit it on an edit to keep the proposed line's frozen calculation. An order using a tax calculation callback gets its replacement components from that callback instead. Omit tax for automatic-tax orders and callback orders.

Buyer previews reuse matching calculations without accepting buyer-supplied tax. If no unambiguous calculation matches and no callback supplies one, the preview returns 409 ACTION_NOT_ALLOWED with reason configuration_required; the merchant must price the replacement. The buyer's request cannot change the tax destination.

A customer session previews only catalog merchandise: variant and bundle lines with an ID and quantity. name, description, sku, unit_price_money, tax, and pricing_basis are merchant-only. Omit pricing_basis: buyer replacements use original_price. Buyer exchanges use original_price when every replacement matches selected returned merchandise by variant, bundle, or product; otherwise the whole exchange uses current_price. See Let the buyer compare outcomes.

When the buyer owes money#

When an exchange leaves a balance, Flint creates the replacement Order and applies the returned value to it, links a Return-scoped PaymentIntent to the resolution, and holds buyer_payment_pending until the buyer pays. While the payment needs the buyer, the resolution is requires_action with action_required_by: buyer and action_reason: buyer_payment, and supported_actions lists checkout_session.

Launch a checkout for the balance:

cURL
curl -X POST https://api.withflintpay.com/v1/checkout-sessions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: checkout-retres_1kmn0a" \
  -d '{
    "type": "return_resolution",
    "return_resolution_id": "retres_1kmn0aExample",
    "return_url": "https://account.example.com/returns/ret_1kmn0aExample"
  }'

POST /v1/checkout-sessions with type: return_resolution needs the commerce.returns.resolutions.write scope. It returns 201 when it creates the checkout session and 200 when it returns the open one again. Both return the session in data, with its hosted url and no checkout_auth_token. Send the buyer to url. A retry with the same Idempotency-Key repeats the first response, including its status. With a customer session, launch the same checkout from POST /v1/me/checkout-sessions with the same body.

Besides type and return_resolution_id, the body takes only surface, redirects, payment_return_url, page_origin, and return_url. return_url brings the buyer back after paying. It must be an HTTPS address of your customer account: /{merchant_id} on Flint's account host, your active custom account domain, or the host of your customer_account.merchant_account_url. Anything else fails with 400 INVALID_REQUEST on return_url. On hosted checkout it is the same as redirects.success_url, so keep them consistent if you send both.

The balance is fixed. The checkout doesn't quote or select delivery and adds no shipping charge, and the replacement Order's total doesn't change. You arrange delivery yourself with fulfillments. For a replacement that ships or is delivered locally, Flint copies the original Order's delivery address when it has one, without the original delivery selection, method, or charge. When it has none, give the destination as recipient when you create the fulfillment.

type: return_resolution is the only way to collect a return balance. type: order for the replacement Order fails with 409 ACTION_NOT_ALLOWED and reason return_checkout, and details[0].current_resource names the resolution to launch from.

On the replacement Order, return_credit_settlements lists the value applied from the returned items, each with amount_money, return_id, return_resolution_id, and created_at. That credit is already included in settlement_amounts.paid_money, so show it on the receipt as return credit alongside the buyer's payment. Written-off invoice debt doesn't fund an exchange: the source order's settlement_amounts.written_off_money reduces what the buyer owed but adds no paid value to carry over.

Collect the balance in your own checkout#

Send "surface": "headless" to collect the balance in a checkout you build. A headless session takes payment_return_url instead of redirects, and needs it when the session offers Affirm. Send page_origin to support a gift card challenge.

cURL
curl -X POST https://api.withflintpay.com/v1/checkout-sessions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: checkout-retres_1kmn0a-headless" \
  -d '{
    "type": "return_resolution",
    "return_resolution_id": "retres_1kmn0aExample",
    "surface": "headless",
    "page_origin": "https://shop.example.com",
    "payment_return_url": "https://shop.example.com/returns/ret_1kmn0aExample/paid"
  }'

The launch response has type: return_resolution and omits url. Use checkout_auth_token to read the session and its payment_collection. Send action: confirm_payment_intents to POST /v1/orders/{order_id}/pay with the payment intent for the return balance. Build your own checkout shows the request.

A resolution has one open checkout session at a time. A request for the open session's 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 fails with 409 ACTION_NOT_ALLOWED and reason in_progress when one is.

When the payment fails#

If the buyer's payment is canceled or expires, the resolution becomes failed with failure_code: payment_failed, and supported_actions lists retry:

cURL
curl -X POST https://api.withflintpay.com/v1/return-resolutions/retres_1kmn0aExample/retry \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: retry-retres_1kmn0a-payment" \
  -d '{ "reason": "payment_method_updated" }'

Retrying starts a new payment attempt. Earlier PaymentIntent IDs stay on payment_intent_ids, and a late event from an abandoned attempt can't settle the new one. Launch /checkout-sessions again for the new attempt.

Exchanges and replacements wait for fulfillment#

An exchange or replacement is completed only when its replacement Order is fulfilled. The fulfillment_pending blocker names that Order in linked_resource. The resolution stays pending, and the Return stays open with a resolution_pending completion blocker, until the Order's fulfillment_status is fulfilled or not_applicable. An Order with nothing to fulfill counts at once. Otherwise every unit's fulfillment must be completed: delivery for a shipment with packages, the handover for pickup. Report delivery with package actions, or send complete on the fulfillment when you don't track packages. return.completed arrives after the Order is fulfilled, not when it is created.

Fulfillment can't start until the replacement Order is paid:

Replacement OrderHow it becomes paid
The buyer owes a balanceThe buyer pays it through the checkout session. The resolution holds buyer_payment_pending and fulfillment_pending together, then only fulfillment_pending once the payment succeeds
The returned value covers the whole totalFlint marks it paid when it applies the return credit. No call is needed
The total is zeroCall POST /v1/orders/{order_id}/pay on the replacement Order with no payment_source. A zero balance moves no money. Until you do, nothing can be fulfilled and the Return stays open

If the replacement Order's fulfillment is canceled, the goods won't be sent: the resolution becomes failed with failure_code: replacement_fulfillment_canceled, and the Return shows a resolution_failed completion blocker. Flint treats the Order as canceled when its fulfillment_status is canceled, or closed because some units were canceled and the rest completed. A canceled fulfillment can't be undone. To send the goods another way, such as from another warehouse, fail the fulfillment with release_quantity: true and create a new one instead of canceling it. See Cancel, fail, and try again.

Canceling an unpaid exchange#

You can cancel an exchange or replacement resolution whose balance is unpaid even after Flint has created its replacement Order, as long as creating that Order is the only effect that completed. The Order must have no successful or in-progress payment, fulfillment, refund, or other use. A PaymentIntent still waiting for a payment method doesn't block it. supported_actions lists cancel only while the resolution is eligible.

cURL
curl -X POST https://api.withflintpay.com/v1/return-resolutions/retres_1kmn0aExample/cancel \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: cancel-retres_1kmn0a" \
  -d '{ "reason": "expired" }'

Canceling ends the Order's open checkout session, reverses its return credit, closes the replacement Order with closed_reason: "return_resolution_canceled", and cancels the resolution and its effects together. The buyer's checkout link stops working, and the Return no longer asks them to pay that balance. The returned quantity and value become available for another resolution. Repeating a successful cancellation returns the canceled resolution and doesn't reverse the credit again.

For an unpaid exchange confirmed with a USD balance below $0.50, starting payment returns 409 ACTION_NOT_ALLOWED with reason configuration_required. If an earlier attempt is active, cancel it first. If its unpaid PaymentIntent still has a card attached, cancel the PaymentIntent before canceling the unpaid resolution. Create a new resolution with a collectible balance or cover the difference with a credit.

reason is required: buyer_request, merchant_request, duplicate, expired, created_in_error, or other, with an optional reason_message. If a payment succeeded or is in progress, a fulfillment started, or another effect completed, canceling returns 409.

The same steps recover an unpaid exchange or replacement whose payment is refused because the tax exemption on its replacement Order expired, was archived, or changed after you confirmed. Starting payment for the balance returns 409 ACTION_NOT_ALLOWED with reason configuration_required, and the confirmed prices stay as they were. If Flint already accepted an unconfirmed payment attempt, the refusal leaves it open, and Flint doesn't cancel it for you. Resolution cancellation is blocked while an attempt is active, so first cancel that attempt with POST /v1/orders/{order_id}/payment-attempts/{order_payment_attempt_id}/cancel if one is open. Then cancel the unpaid resolution, create a new one with POST /v1/return-resolutions, and confirm the new one with POST /v1/return-resolutions/{return_resolution_id}/confirm. The new resolution is priced with current tax, so check buyer_payment_amount_money before confirming. A canceled resolution is terminal, so never confirm it. An exchange or replacement with nothing for the buyer to pay is unaffected. See When an exemption expires.

Other resolutions follow the general rule: you can cancel one until it starts an effect that can't be withdrawn, and a failed one only when it never created a Refund, PaymentIntent, or Order. A resolution waiting on fulfillment_pending has already created its Order, so it offers no cancel unless it is an unpaid exchange or replacement as above. Cancellation reasons covers who can read the reason afterward.

When a resolution fails#

A resolution that can't finish becomes failed with a failure_code and a failure_message. The code tells you whether retrying can help. When it can, supported_actions includes retry. When it can't, retry is missing, and POST /v1/return-resolutions/{return_resolution_id}/retry returns 409 ACTION_NOT_ALLOWED with current_status: failed.

failure_codeWhat happenedRetryWhat to do
gift_card_refund_destination_requiredThe original gift card is closed, or the amount would pass its balance capYesRetry with gift_card_refund_destination: "new_gift_card". See below
store_credit_unavailableThe order's payments can no longer fund store creditNoCancel the resolution, then create a refund resolution
refund_creation_failedFlint couldn't create the Refund after retryingYesRetry
refund_failedThe Refund was created and failedYesRead failure_message, fix the cause, then retry. Retry creates a new Refund
refund_line_value_unavailableAnother refund already covered part of the line, so this one can't be paidNoCancel the resolution, then resolve fewer units or choose an outcome without a refund
payment_intent_creation_failedFlint couldn't create the buyer's PaymentIntent after retryingYesRetry. It resumes the payment
payment_failedThe buyer's payment was canceled or expiredYesRetry, then launch the checkout session again
replacement_order_creation_failedFlint couldn't create the replacement Order after retryingYesRetry
replacement_fulfillment_canceledThe replacement Order's fulfillment was canceled or closed, so the goods won't be sentNoAvoid it by failing a fulfillment you want to replace instead of canceling it
resolution_effect_failedAnother execution failureYesRetry, and contact support if it repeats

Retrying replays the failed effect, so retrying refund_line_value_unavailable or store_credit_unavailable would only ask for the same impossible refund. Cancel those instead, which releases the quantity for a new resolution. New codes can be added, so show failure_message for a code you don't recognize and don't retry it automatically. The failure code reference covers canceling a failed resolution that already created a Refund.

retry takes a required reason: dependency_recovered, payment_method_updated, operator_retry, or other. Read it later from the Return's activities.

Recover a gift card that can't take the refund#

A Refund can't credit a closed gift card, or one the amount would push past its balance cap. Flint doesn't issue new cards in its place without your say, so the resolution fails at once with failure_code: gift_card_refund_destination_required. Retry with the new destination:

cURL
curl -X POST https://api.withflintpay.com/v1/return-resolutions/retres_1kmn0aExample/retry \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: retry-retres_1kmn0a-new-card" \
  -d '{
    "reason": "operator_retry",
    "gift_card_refund_destination": "new_gift_card"
  }'

Flint saves the destination on the resolution before it starts the new attempt, so a later retry keeps it. The gift card value goes on new cards, the rest goes back to the original payment, and the new cards are delivered like store credit. Retry takes the field only for the types that take it on create, and only when the failed step is the refund. Otherwise it returns 400 INVALID_REQUEST with a NOT_ALLOWED detail on gift_card_refund_destination.

Fixing one after it settled#

Confirmed money movements are never edited backward. To change an outcome that already happened, reopen the Return and add a correction resolution that names the completed resolution it corrects.

Reopen the completed Return:

cURL
curl -X POST https://api.withflintpay.com/v1/returns/ret_1kmn0aExample/reopen \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: reopen-ret_1kmn0a-correction" \
  -d '{ "reason": "correction_required" }'

Then create the correction:

cURL
curl -X POST https://api.withflintpay.com/v1/return-resolutions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: correction-retres_1kmn0aOriginal" \
  -d '{
    "return_id": "ret_1kmn0aExample",
    "resolution_type": "correction",
    "corrects_return_resolution_id": "retres_1kmn0aOriginal",
    "adjustments": [
      {
        "adjustment_type": "price_correction",
        "value_effect": "credit",
        "status": "applied",
        "assessed_amount_money": { "amount": 500, "currency": "USD" },
        "applied_amount_money": { "amount": 500, "currency": "USD" },
        "reason": "manual_correction"
      }
    ]
  }'

A correction is adjustments only, with at least one applied adjustment above zero. line_items, replacement_line_items, and pricing_basis are rejected, because a correction adjusts value instead of deciding again what came back. Its target must be completed and belong to the same Return.

A correction pays out like the resolution it corrects. A correction of store_credit issues its credit on new gift cards and rejects gift_card_refund_destination. Any other correction refunds the original payment and takes its own gift_card_refund_destination for the part paid by gift card.

A net credit creates an ordinary linked Refund once confirmed. A deduction can reduce that credit to zero, but a correction can't leave the buyer owing money: a buyer pays through a checkout, and a correction has no order to check out.

Confirm the correction, wait for it to reach completed, then complete the Return again with POST /v1/returns/{return_id}/complete. Reopening sets the Return's completion_mode to manual, so it doesn't complete on its own. To list every correction of a resolution, call GET /v1/return-resolutions?corrects_return_resolution_id=retres_1kmn0aOriginal.

How this lands elsewhere#

A resolution that refunds, including store credit and the refunded difference on an exchange, creates a Refund on the order that collected the payment. The Refund carries return_id and return_resolution_id, which are also filters on GET /v1/refunds; refunds you create directly carry neither. For store credit and for gift card value sent to new cards, the Refund's tender_allocations report destination: "new_gift_card" and the cards in destination_cards. Refund reads never include gift card codes, so deliver the card as above. A refund that the processor or your balance rejects is still recorded and linked, with status: "failed" and a failure_reason. See When a refund fails.

When a buyer returns an exchange replacement for a refund, Flint returns any paid balance to the replacement order's payment methods. Carried exchange credit goes back to the original order's payment methods. Each Refund has its own webhook events and buyer receipt. The resolution's refund_ids lists the linked Refunds. If a payment fails to refund, Flint keeps that share for the resolution. Retry the resolution to send the outstanding amount. If the Return was already completed, reopen it first.

In a refund preview, tender_estimates shows each payment method's amount and, for an exchange replacement, the order_id that collected it. If the original payments can't cover the refund, refund_shortfall_money shows the difference. Creating or confirming the resolution returns 409 LIMIT_EXCEEDED until you record a deduction or settle the shortfall outside Flint.

The Refund's reason comes from the Return lines' return_reason_handle:

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
other, a reason you defined, or lines with different reasonsother

For the buyer's own wording, read the Return line, not the Refund.

Exchanges and replacements create a real Order, linked as replacement_order_id, which is fulfilled and shipped like any other. To track those orders from a list, call GET /v1/return-resolutions?resolution_type=exchange&expand=replacement_order: each row with a replacement_order_id carries the order summary as replacement_order. See Expand the replacement order in the list.

These events report a resolution's progress:

Endpoints#

  • POST/v1/return-previewsRequired API key scopes: commerce.returns.operations.write, commerce.returns.policies.write, commerce.returns.read, commerce.returns.reasons.write, commerce.returns.resolutions.write or commerce.returns.writeReference for POST /v1/return-previews

    Price a resolution without changing anything.

  • POST/v1/return-resolutionsRequired API key scope: commerce.returns.resolutions.writeReference for POST /v1/return-resolutions

    Propose a resolution and reserve its quantity.

  • PATCH/v1/return-resolutions/{return_resolution_id}Required API key scope: commerce.returns.resolutions.writeReference for PATCH /v1/return-resolutions/{return_resolution_id}

    Change a proposed resolution's lines, adjustments, or gift card destination.

  • POST/v1/return-resolutions/{return_resolution_id}/confirmRequired API key scope: commerce.returns.resolutions.writeReference for POST /v1/return-resolutions/{return_resolution_id}/confirm

    Freeze the amounts and start the effects.

  • POST/v1/return-resolutions/{return_resolution_id}/releaseRequired API key scope: commerce.returns.resolutions.writeReference for POST /v1/return-resolutions/{return_resolution_id}/release

    Release a resolution held by manual timing.

  • POST/v1/checkout-sessionsRequired API key scopes: checkouts.checkout_sessions.write, commerce.invoices.write or commerce.returns.resolutions.writeReference for POST /v1/checkout-sessions

    Launch a checkout for the buyer's balance with type: return_resolution.

  • POST/v1/return-resolutions/{return_resolution_id}/retryRequired API key scope: commerce.returns.resolutions.writeReference for POST /v1/return-resolutions/{return_resolution_id}/retry

    Retry a failed resolution.

  • POST/v1/return-resolutions/{return_resolution_id}/cancelRequired API key scope: commerce.returns.resolutions.writeReference for POST /v1/return-resolutions/{return_resolution_id}/cancel

    Cancel a resolution and free its quantity.

  • GET/v1/return-resolutionsRequired API key scopes: commerce.returns.operations.write, commerce.returns.policies.write, commerce.returns.read, commerce.returns.reasons.write, commerce.returns.resolutions.write or commerce.returns.writeReference for GET /v1/return-resolutions

    List resolutions by Return, type, status, or the resolution they correct.

Next steps#

RefundsThe lifecycle of the Refund a resolution creates.Return policies and reasonsLet a policy propose fees and resolve lines for you.Return resolutions API referenceEvery field, rule, and route.

Negotiated prices#

For current_price exchanges, catalog variants use the return customer’s active direct list, then segment list, then variant schedule, selecting the break for each replacement line’s quantity. The proposed replacement order freezes those terms.

Show a buyer what an exchange replaces#

GET /v1/me/return-resolutions/{return_resolution_id} already includes replacement_line_items[].name and quantity. These are the frozen replacement items, not the original items the buyer sends back. Show them beside buyer_payment_amount_money before asking the buyer to pay.

Read line_items[].release_timing to explain the condition for processing the replacement: after_approval, after_handoff, after_receipt, after_inspection, or manual. Every covered line must meet its condition. Use execution_blockers for what is still outstanding. These fields are also available on merchant reads.

Release timing is not a promised shipment date. After release, the replacement Order must be paid and fulfilled. For example, say that replacement processing starts after the items are received when the gate is after_receipt; do not promise that the package ships immediately on receipt or payment.

Was this helpful?