Skip to content

Your first return

Take one item back from a paid order and refund it to the original payment. Pick the flow that matches where the item is:

The item isCallsSection
In your hands, at a register or service deskCreate the Return, approve it, then process itItems are here
Still with the customer, who will send it backCreate the Return, approve it, then process it when the item arrivesCustomer will send items back

Both flows end the same way: Flint refunds the original payment and completes the Return once the refund succeeds.

Before you start#

You need:

  • A sandbox API key with commerce.returns.read, commerce.returns.write, commerce.returns.operations.write, and commerce.returns.resolutions.write.
  • A paid order whose item is in a completed fulfillment. Flint returns only fulfilled quantity. To make one, pay an order with a test token, then complete its fulfillment.
  • A Location with a postal address to receive the item at.

The examples return one $24.00 mug with no tax, and assume no return policy covers it, which is true until you create one. Replace the example IDs with your own.

Find the line to return#

Ask Flint what the order can send back. The preview reserves nothing:

cURL
curl -X POST https://api.withflintpay.com/v1/return-previews \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "mode": "eligibility",
    "eligibility": {
      "order_id": "ord_1kmn0aExample",
      "selection": { "selection_type": "all_remaining_fulfilled" }
    }
  }'
Response
{
  "data": {
    "mode": "eligibility",
    "eligibility": {
      "order_id": "ord_1kmn0aExample",
      "status": "review_required",
      "line_items": [{
        "order_line_item_id": "li_1kmn0aExample",
        "fulfillment_id": "ful_1kmn0aExample",
        "name": "Ceramic mug",
        "can_buyer_request": false,
        "eligibility": {
          "status": "review_required",
          "reason": "no_matching_policy",
          "eligible_quantity": 1
        }
      }]
    }
  },
  "request_id": "req_..."
}

Each line gives the order_line_item_id and fulfillment_id to return and how many units can still come back in eligible_quantity. review_required with no_matching_policy means no policy decides the request for you, so you decide it in the calls below.

Choose a return reason#

Every Return line needs the return_reason_id of an active reason. The examples use Flint's built-in changed_mind reason, rrsn_1T6HXAX0CEXP6YA5K1T392KJE6, which needs no note. Return reasons lists all nine built-in IDs. Some, such as defective and other, require a buyer_note on the line.

If your counter doesn't ask why things come back, create one reason of your own for it and send its ID on every line. Creating a reason needs commerce.returns.reasons.write:

cURL
curl -X POST https://api.withflintpay.com/v1/return-reasons \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: reason-in-store-001" \
  -d '{
    "handle": "in_store",
    "name": "Returned in store",
    "is_note_required": false
  }'

Find it again later with GET /v1/return-reasons?handle=in_store.

Items are here#

At a counter the item is already in front of you, approve the Return, then process the receipt, restock, and refund together.

  1. Create the Return#

    cURL
    curl -X POST https://api.withflintpay.com/v1/returns \
      -H "Authorization: Bearer YOUR_API_KEY" \
      -H "Content-Type: application/json" \
      -H "Idempotency-Key: pos-1042-0087-return" \
      -d '{
        "order_id": "ord_1kmn0aExample",
        "line_items": [{
          "order_line_item_id": "li_1kmn0aExample",
          "fulfillment_id": "ful_1kmn0aExample",
          "requested_quantity": 1,
          "return_reason_id": "rrsn_1T6HXAX0CEXP6YA5K1T392KJE6"
        }]
      }'
    
    Response
    {
      "data": {
        "return_id": "ret_1kmn0aExample",
        "order_id": "ord_1kmn0aExample",
        "status": "requested",
        "decision_status": "pending",
        "merchandise_status": "not_required",
        "resolution_status": "not_selected",
        "initiated_by": "integration",
        "completion_blockers": [{
          "code": "decision_pending",
          "message": "This Return line is awaiting a decision.",
          "return_line_item_id": "retli_1kmn0aExample"
        }],
        "line_items": [{
          "return_line_item_id": "retli_1kmn0aExample",
          "order_line_item_id": "li_1kmn0aExample",
          "fulfillment_id": "ful_1kmn0aExample",
          "name": "Ceramic mug",
          "requested_quantity": 1,
          "return_reason_handle": "changed_mind",
          "status": "requested",
          "return_value": {
            "unit_price_money": {"amount": 2400, "currency": "USD"},
            "subtotal_money": {"amount": 2400, "currency": "USD"},
            "discount_money": {"amount": 0, "currency": "USD"},
            "tax_money": {"amount": 0, "currency": "USD"},
            "total_money": {"amount": 2400, "currency": "USD"}
          }
        }]
      },
      "request_id": "req_..."
    }
    

    fulfillment_id is optional when the line shipped in one fulfillment and required when it shipped in more than one. Keep return_id and each line's return_line_item_id for the next call. return_value is what the line is worth back to the buyer, including its share of discounts and tax.

  2. Approve it#

    cURL
    curl -X POST https://api.withflintpay.com/v1/returns/ret_1kmn0aExample/decide \
      -H "Authorization: Bearer YOUR_API_KEY" \
      -H "Content-Type: application/json" \
      -H "Idempotency-Key: pos-1042-0087-decide" \
      -d '{
        "line_items": [{
          "return_line_item_id": "retli_1kmn0aExample",
          "approved_quantity": 1,
          "receiving_location_id": "loc_1kmn0aExample"
        }]
      }'
    

    With no policy covering the line, call /decide before /process. Combining an inline decision and a resolution in /process requires eligible policy capacity and otherwise returns 409 ACTION_NOT_ALLOWED. The separate decision authorizes the return without a policy.

    The omitted decision fields use Flint's defaults: the unit must come back, every resolution type is allowed, no inspection is required, no outcome is automatic, and the refund waits for the receipt (release_timing: after_receipt). receiving_location_id is required when the item must come back. Decide a request by hand lists every decision field.

  3. Process it#

    cURL
    curl -X POST https://api.withflintpay.com/v1/returns/ret_1kmn0aExample/process \
      -H "Authorization: Bearer YOUR_API_KEY" \
      -H "Content-Type: application/json" \
      -H "Idempotency-Key: pos-1042-0087-process" \
      -d '{
        "receipt": {
          "receiving_location_id": "loc_1kmn0aExample",
          "received_at": "2026-10-28T14:30:00Z",
          "source_system": { "source_system_type": "pos", "external_source_id": "register-1042" },
          "external_reference_id": "pos-txn-0087"
        },
        "line_items": [{
          "return_line_item_id": "retli_1kmn0aExample",
          "received_quantity": 1,
          "resolution": { "resolution_type": "refund", "quantity": 1 }
        }]
      }'
    
    Response
    {
      "data": {
        "return": {
          "return_id": "ret_1kmn0aExample",
          "status": "open",
          "decision_status": "approved",
          "merchandise_status": "resolved",
          "resolution_status": "pending",
          "completion_mode": "automatic",
          "completion_blockers": [{
            "code": "resolution_pending",
            "message": "Approved buyer value has not been resolved.",
            "return_line_item_id": "retli_1kmn0aExample",
            "return_resolution_id": "retres_1kmn0aExample"
          }],
          "return_receipt_ids": ["retrc_1kmn0aExample"],
          "return_inspection_ids": [],
          "return_disposition_ids": ["retdsp_1kmn0aExample"],
          "return_resolution_ids": ["retres_1kmn0aExample"],
          "line_items": [...]
        },
        "return_receipts": [...],
        "return_inspections": [],
        "return_dispositions": [{
          "return_disposition_id": "retdsp_1kmn0aExample",
          "disposition_type": "sellable",
          "status": "succeeded",
          "quantity": 1,
          "inventory_location_id": "loc_1kmn0aExample"
        }],
        "return_resolutions": [{
          "return_resolution_id": "retres_1kmn0aExample",
          "resolution_type": "refund",
          "status": "pending",
          "returned_total_money": {"amount": 2400, "currency": "USD"},
          "buyer_refund_amount_money": {"amount": 2400, "currency": "USD"}
        }]
      },
      "request_id": "req_..."
    }
    

    What each part of the request does:

    • No decision. The preceding /decide call committed it. The receipt's Location must match the decision's receiving_location_id. A mismatch returns 409 ACTION_NOT_ALLOWED with reason field_locked and param: receipt.receiving_location_id. Missing receipt or receipt.receiving_location_id returns 400 INVALID_REQUEST with detail REQUIRED and the missing field as param.
    • receipt records when and where the item arrived. received_at can't be more than five minutes in the future. source_system is optional. Types pos, wms, erp, and other need an external_source_id; manual takes none.
    • received_quantity must be the line's whole handback quantity. For a partial arrival, record it with receipts instead.
    • No disposition. Under automatic disposition, Flint restocks a unit received without inspection as sellable at the receiving Location. For an accepted inspection, Flint uses the condition-to-disposition rules. A tracked item also gets an inventory receipt and movement. An untracked item, like this mug, moves no stock. Send a disposition on the line to choose where the item goes, or set receipt_disposition_mode: manual in the return policy to turn off automatic disposition.
    • resolution creates and confirms the refund for one unit. For an exchange, send resolution_type: exchange with replacement_line_items and pricing_basis, as Choose replacement merchandise shows.
    • No completion_mode. On a Return with no policy, it defaults to automatic, so Flint completes the Return as soon as its last blocker clears. Send manual on /decide to complete it yourself with POST /v1/returns/{return_id}/complete.

    The receipt, disposition, and resolution commit together or not at all. The earlier decision stays committed if processing fails. Process takes a line only while nothing has been received, inspected, dispositioned, or resolved on it; after that, process returns 409 ACTION_NOT_ALLOWED with reason unsupported_state, naming the line and param: line_items[i].return_line_item_id. Use the stepwise routes in Receiving and inspecting and Return resolutions.

  4. Wait for the refund#

    The refund runs after the response. The resolution is pending, and the Return's only blocker is resolution_pending. When the refund succeeds, the resolution becomes completed, its refund_ids lists the Refund, and Flint completes the Return and sends return.completed.

    Confirm it with one read:

    cURL
    curl "https://api.withflintpay.com/v1/returns/ret_1kmn0aExample?expand=return_resolutions" \
      -H "Authorization: Bearer YOUR_API_KEY"
    

    A completed Return has status: completed, an empty completion_blockers, and financial_summary.refunded_money of 2400. A pending refund isn't a reason to start another resolution. If the resolution ends failed, When a resolution fails explains each failure_code.

Customer will send items back#

When the item is still with the customer, approve the Return first so they know where to send it, then record the arrival.

  1. Create the Return#

    Send the same request as at the counter, with its own Idempotency-Key. The Return starts requested.

  2. Approve it#

    cURL
    curl -X POST https://api.withflintpay.com/v1/returns/ret_1kmn0aExample/decide \
      -H "Authorization: Bearer YOUR_API_KEY" \
      -H "Content-Type: application/json" \
      -H "Idempotency-Key: mail-return-0412-decide" \
      -d '{
        "line_items": [{
          "return_line_item_id": "retli_1kmn0aExample",
          "approved_quantity": 1,
          "receiving_location_id": "loc_1kmn0aExample"
        }]
      }'
    
    Response
    {
      "data": {
        "return_id": "ret_1kmn0aExample",
        "status": "open",
        "decision_status": "approved",
        "merchandise_status": "awaiting_handoff",
        "resolution_status": "not_selected",
        "completion_mode": "automatic",
        "completion_blockers": [
          {
            "code": "handoff_pending",
            "message": "Approved merchandise has not been handed off.",
            "return_line_item_id": "retli_1kmn0aExample"
          },
          {
            "code": "resolution_not_selected",
            "message": "No buyer-value resolution has been selected.",
            "return_line_item_id": "retli_1kmn0aExample"
          }
        ],
        "line_items": [{
          "return_line_item_id": "retli_1kmn0aExample",
          "status": "open",
          "approved_quantity": 1,
          "return_required_quantity": 1,
          "receiving_location_id": "loc_1kmn0aExample",
          "is_inspection_required": false,
          "release_timing": "after_receipt",
          "allowed_resolution_types": ["refund", "exchange", "replacement", "no_monetary_action", "store_credit"]
        }]
      },
      "request_id": "req_..."
    }
    

    The decision takes the same fields and defaults as at the counter. It must cover every line on the Return. To leave a line for later, decline it with approved_quantity: 0 and a decline_reason, then open a separate Return for it when you're ready.

    The customer sends the item to receiving_location_id. To give them a prepaid label and track the parcel, see Return labels and tracking.

  3. Process it when it arrives#

    The Return is open, so its decision and completion_mode are already committed. Leave both out:

    cURL
    curl -X POST https://api.withflintpay.com/v1/returns/ret_1kmn0aExample/process \
      -H "Authorization: Bearer YOUR_API_KEY" \
      -H "Content-Type: application/json" \
      -H "Idempotency-Key: mail-return-0412-process" \
      -d '{
        "receipt": {
          "receiving_location_id": "loc_1kmn0aExample",
          "received_at": "2026-10-31T16:05:00Z",
          "source_system": { "source_system_type": "manual" }
        },
        "line_items": [{
          "return_line_item_id": "retli_1kmn0aExample",
          "received_quantity": 1,
          "resolution": { "resolution_type": "refund", "quantity": 1 }
        }]
      }'
    

    Use the time the item arrived, not the time you process it. The response, the automatic restock, and the refund that follows are the same as at the counter.

    If the decision required inspection, add an inspection with acceptance_status: accepted to the line in the same request. An item you can't accept as received, such as one that arrives damaged, goes through inspection on the stepwise routes instead.

When a policy decides first#

Once you create return policies, a policy with automatic approval can open the Return on its own shortly after you create it, and Flint sends return.decision_recorded. Read the Return's status before you choose the process body:

  • requested. When every selected line is policy-eligible, you can send a decision for every line in /process. Otherwise, call /decide first as in the examples above. Fields you leave out default to the policy's proposal instead of Flint's no-policy defaults. A decision that differs from the proposal needs an override_reason.
  • open. Leave out decision and completion_mode. Sending either unchanged is accepted; a different value is refused with field_locked. If the line has an automatic_resolution_type, Flint already created that resolution, so leave out resolution and send only the receipt.

Errors to handle#

  • HTTP 409
    Reason status_not_reached: the Return is requested and a line has no decision. Process and decide need one for every line. param is line_items when a line is left out, or the line's decision when process sends the line without one. Reason field_locked: the Return is already open and the request changes its committed decision or completion_mode; param names the field. Leave it out, or send the committed value. Reason refund_unavailable: the original payment can't be refunded through its provider any more. On a decision, send automatic_resolution_type: null to resolve manually. On a resolution, choose another resolution_type, such as no_monetary_action, and reimburse the buyer another way. On confirm, cancel the resolution and create one with another resolution_type. On create, current_status: inactive means the return reason is inactive: reactivate it or pick another.
  • HTTP 400
    param names the input. With detail REQUIRED and param: line_items[0].fulfillment_id, the line shipped in more than one fulfillment; pick one of the IDs in selectable_resources. With param: completion_mode, the lines' policies set different completion modes: send manual or automatic.
  • HTTP 409
    The key was already used for a different request. See Replay, conflict, or in progress.
  • HTTP 409
    VERSION_CONFLICTRefresh, then retry
    You sent expected_version and the Return changed since that version. Read it again, check what changed, and retry against details[0].current_version.

Deciding and processing lists every refusal on these routes and what details[0] names in each.

Retry a lost response#

Create and process require an Idempotency-Key. If a response is lost, send the same request again with the same key and body: Flint returns the original result and its IDs without moving stock or money twice. Derive the keys from something your system still has when the response disappears, such as the register transaction ID, as the examples do with pos-1042-0087.

To find a Return whose create response was lost, list GET /v1/returns?idempotency_key=pos-1042-0087-return. Recovery reads covers the other routes.

To guard against a concurrent change from another register or the Dashboard, send the version from your last read as expected_version on process or decide.

Webhooks#

Follow these to know where a Return stands without polling:

Webhooks on Returns lists the rest.

API calls#

  • 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

    Find what an order can still send back.

  • POST/v1/return-reasonsRequired API key scope: commerce.returns.reasons.writeReference for POST /v1/return-reasons

    Create your own return reason.

  • POST/v1/returnsRequired API key scope: commerce.returns.writeReference for POST /v1/returns

    Create a requested Return.

  • POST/v1/returns/{return_id}/decideRequired API key scope: commerce.returns.writeReference for POST /v1/returns/{return_id}/decide

    Approve or decline every line and open the Return.

  • POST/v1/returns/{return_id}/processRequired API key scopes: commerce.returns.operations.write, commerce.returns.resolutions.write and commerce.returns.writeReference for POST /v1/returns/{return_id}/process

    Record the decision, receipt, disposition, and resolution in one request.

  • GET/v1/returns/{return_id}Required 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/returns/{return_id}

    Read the Return, with its receipts, dispositions, and resolutions expanded.

Next steps#

ReturnsThe model behind these calls: the three status tracks and completion blockers.Buyer-initiated returnsLet buyers start a return from their account or your storefront.Return policies and reasonsReturn windows, fees, and automatic approval.

Was this helpful?