Returns

Returns coordinate authorization, merchandise, and buyer value without treating a refund as proof that goods came back. A Return contains frozen order-line identity, policy evaluation, line-level quantities, handoff requirements, progress summaries, completion blockers, and links to its operational and financial effects.

Use an eligibility check to discover returnable fulfilled allocations, then create a requested Return or use the composite processing command for an in-store flow. The instance processing command applies the same facts to an existing Return. Use the child collections when you need detailed receipt, inspection, disposition, or resolution history.

New to this surface? The Returns guide explains the model and points at the right integration; Your first return walks one item from a paid order to a settled refund.

The four statuses#

A Return carries four status fields because the things they describe genuinely come apart. Read the one that answers your question rather than inferring from a neighbour.

FieldQuestion it answersValues
decision_statusDid we say yes?pending, approved, partially_approved, declined
merchandise_statusDid the goods come back?not_required, awaiting_handoff, in_transit, partially_received, received, inspection_required, partially_inspected, inspection_review_required, disposition_required, resolved, exception
resolution_statusDid the buyer get their value?not_selected, pending, partially_fulfilled, requires_action, fulfilled, failed
statusIs the whole thing finished?requested, open, declined, canceled, completed

pending appears in three of these and fulfilled in two, so a bare status value is ambiguous without its field name. merchandise_status is not_required for a returnless refund, where the buyer keeps the goods, and exception when merchandise arrived that Flint cannot attribute to a line.

A Return moves requested to open on decision and open to completed when the last obligation clears. completed is not terminal: /reopen returns it to open so late compensating facts can be recorded.

Completion blockers#

completion_blockers is the authoritative list of what is still owed. Each entry names the Return line it belongs to and, where one exists, the receipt, inspection, disposition, or resolution holding it up. An empty array means nothing is outstanding.

CodeCleared by
decision_pendingDeciding the line
handoff_pendingThe buyer handing merchandise to a carrier
receipt_pendingThe warehouse recording arrival
inspection_pendingAn inspection observation
inspection_review_requiredAn acceptance decision on an inspection line
disposition_pendingA successful disposition
resolution_not_selectedChoosing what the buyer gets
resolution_pendingThe resolution's effects settling
resolution_requires_actionWhatever the resolution is waiting on, usually a buyer payment
resolution_failedRetrying or replacing the failed resolution
merchandise_exceptionVerifying or dispositioning merchandise that arrived unidentified or in excess

Under completion_mode: "automatic" Flint completes the Return when the final blocker clears. Under manual you call /complete, and the call fails while any blocker remains.

Gate downstream work on return.completed or on an empty blocker list, never on a refund succeeding. A resolution can reach a terminal state while merchandise work is still open.

Line quantities#

A Return line carries twelve counters. Three of them answer questions you will actually ask; the rest are telemetry that explains how they got there.

QuestionRead
How much can I still approve?requested_quantity minus approved_quantity, declined_quantity, and canceled_quantity
How much is still expected back?return_required_quantity minus received_quantity
How much can I still put on a resolution?available_resolution_quantity

available_resolution_quantity is derived, and its subtlety is worth stating: proposed, pending, action-required, failed, and fulfilled resolutions all reserve capacity. A failed resolution does not release its quantity until it is canceled or corrected, which is what stops a retry and a replacement from both paying out.

return_required_quantity is the returnless-refund control. Set it to 0 while approving quantity and the buyer keeps the merchandise; the Return still settles the money and still records why.

The remaining counters (handed_off_quantity, inspected_quantity, accepted_quantity, rejected_quantity, dispositioned_quantity, resolved_quantity, review_required_quantity) track progress through the physical steps. Disposition capacity is received_quantity when no inspection is required, and accepted_quantity plus rejected_quantity when one is.

Writes#

Return PATCH routes preserve omitted fields. Send null to clear a nullable scalar that the route exposes, including external_reference_id, buyer_note, and requested_resolution_type.

Child mutations on /line-items return the parent Return rather than the mutated line, because a line change can move the Return's aggregate statuses and blockers. GET on the same path returns the line itself.

Writes that change meaning take expected_return_revision from the resource you last read. On a conflict, 409 RETURN_REVISION_CONFLICT carries the current revision in its error detail, so you can re-read and retry rather than searching for what changed.

Idempotency-Key is required on both processing commands and optional elsewhere. Because the create form mints an ID you have not seen, recover a lost response with GET /v1/returns?idempotency_key=... rather than creating a second Return.

Buyer portal sessions#

A Return read with a portal session is narrower than the same Return read with a merchant key. supported_actions is trimmed to at most ["cancel"], completion_blockers is filtered to the four a buyer can personally clear (handoff_pending, resolution_not_selected, resolution_requires_action, resolution_failed), and merchant-private fields are removed. The difference is deliberate, not a permissions error.

Create return eligibility check#

POST/v1/return-eligibility-checksRequires scope: commerce.return_policies.write or commerce.return_reasons.write or commerce.returns.decisions.write or commerce.returns.operations.write or commerce.returns.process.write or commerce.returns.read or commerce.returns.resolutions.write or commerce.returns.write

Evaluate every remaining fulfilled allocation or an explicit selection without creating a Return or reserving quantity. The result is advisory and may become stale immediately.

Request body
order_idstringrequired
selectionone ofrequired
Response · 200
dataobjectrequired
metaobject
request_idstring

Error codes

AUTH_REQUIREDINSUFFICIENT_SCOPEINVALID_REQUESTRATE_LIMIT_EXCEEDEDRESOURCE_NOT_FOUND
Bash
curl -X POST https://api.withflintpay.com/v1/return-eligibility-checks \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "order_id": "",
    "selection": {
      "selection_type": "all_remaining_fulfilled"
    }
  }'

List returns#

GET/v1/returnsRequires scope: commerce.return_policies.write or commerce.return_reasons.write or commerce.returns.decisions.write or commerce.returns.operations.write or commerce.returns.process.write or commerce.returns.read or commerce.returns.resolutions.write or commerce.returns.write

List Returns for the merchant, filtered by order, customer, status, decision, merchandise, resolution, or creation window. Filter by idempotency_key to recover a create whose response never arrived.

Query parameters
created_afterstring

RFC3339 created after filter.

created_beforestring

RFC3339 created before filter.

customer_idstring

Filter by customer id.

decision_statusarray of enum

Filter by decision status.

pendingapprovedpartially_approveddeclined
external_reference_idstring

Filter by external reference id.

idempotency_keystring

Filter by idempotency key.

merchandise_statusarray of enum

Filter by merchandise status.

not_requiredawaiting_handoffin_transitpartially_receivedreceivedinspection_requiredpartially_inspectedinspection_review_requireddisposition_requiredresolvedexception
order_idstring

Filter by order id.

page_sizeinteger

Page size. Defaults to 20 and is capped at 100.

page_tokenstring

Opaque cursor returned by the previous page.

receiving_location_idstring

Filter by receiving location id.

resolution_statusarray of enum

Filter by resolution status.

not_selectedpendingpartially_fulfilledrequires_actionfulfilledfailed
resolution_typearray of enum

Filter by resolution type.

refundexchangereplacementno_monetary_actioncorrection
return_numberstring

Filter by return number.

return_reason_idstring

Filter by return reason id.

statusarray of enum

Filter by status.

requestedopencompleteddeclinedcanceled
updated_afterstring

RFC3339 updated after filter.

updated_beforestring

RFC3339 updated before filter.

work_typearray of enum

Filter by work type.

decisionhandoffreceiptinspectiondispositionresolutionexception
Response · 200
dataarray of objectrequired
metaobject
next_page_tokenstring
request_idstring

Error codes

AUTH_REQUIREDINSUFFICIENT_SCOPEINVALID_REQUESTRATE_LIMIT_EXCEEDED
Bash
curl https://api.withflintpay.com/v1/returns \
  -H "Authorization: Bearer YOUR_API_KEY"

Create return#

POST/v1/returnsIdempotentRequires scope: commerce.returns.write

Create a requested Return. When no policy matches, the Return remains available for merchant review rather than failing creation.

Request body
external_reference_idstring
line_itemsarray of objectrequired
metadatamap of string
order_idstringrequired
Response · 201
dataobjectrequired
metaobject
request_idstring

Error codes

AUTH_REQUIREDINSUFFICIENT_SCOPEINVALID_REQUESTRATE_LIMIT_EXCEEDEDRESOURCE_NOT_FOUND
Bash
curl -X POST https://api.withflintpay.com/v1/returns \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: a-unique-key" \
  -d '{
    "line_items": [
      {
        "order_line_item_id": "",
        "requested_quantity": 0,
        "return_reason_id": ""
      }
    ],
    "order_id": ""
  }'

Get return#

GET/v1/returns/{return_id}Requires scope: commerce.return_policies.write or commerce.return_reasons.write or commerce.returns.decisions.write or commerce.returns.operations.write or commerce.returns.process.write or commerce.returns.read or commerce.returns.resolutions.write or commerce.returns.write

Retrieve a Return with its line items, policy evaluation, financial summary, and completion blockers. Supports expand for the order, the customer, and each line item's reason and fulfillment.

Path parameters
return_idstringrequired

Flint return id.

Query parameters
expandarray of enum

Supported expansions: customer, line_items.fulfillment, line_items.return_reason, order. Expanded relationships are returned only when explicitly requested and authorized. 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. Send repeated expand parameters as the canonical form, for example expand=customer&expand=line_items.fulfillment. Comma-separated values, expand[]=customer, and numeric expand[0]=customer are accepted for common client compatibility.

customerline_items.fulfillmentline_items.return_reasonorder
Response · 200
dataobjectrequired
metaobject
request_idstring

Error codes

AUTH_REQUIREDDANGLING_EXPANSION_REFERENCEEXPANSION_DEPENDENCY_UNAVAILABLEEXPANSION_RESOLUTION_FAILEDINSUFFICIENT_SCOPEINTERNAL_ERRORINVALID_REQUESTRATE_LIMIT_EXCEEDEDRESOURCE_NOT_FOUNDSERVICE_UNAVAILABLE
Bash
curl https://api.withflintpay.com/v1/returns/ret_01K0P7W6A4N9F3J2T8Q5R1C6XM \
  -H "Authorization: Bearer YOUR_API_KEY"

Update return#

PATCH/v1/returns/{return_id}IdempotentRequires scope: commerce.returns.write

Update caller-owned fields on a Return. Only external_reference_id and metadata are writable; every other change goes through a decision, operation, or resolution command.

Path parameters
return_idstringrequired

Flint return id.

Request body
external_reference_idstring
metadatamap of string
Response · 200
dataobjectrequired
metaobject
request_idstring

Error codes

AUTH_REQUIREDINSUFFICIENT_SCOPEINVALID_REQUESTRATE_LIMIT_EXCEEDEDRESOURCE_NOT_FOUND
Bash
curl -X PATCH https://api.withflintpay.com/v1/returns/ret_01K0P7W6A4N9F3J2T8Q5R1C6XM \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: a-unique-key" \
  -d '{
    "external_reference_id": "",
    "metadata": {}
  }'

Cancel return#

POST/v1/returns/{return_id}/cancelIdempotentRequires scope: commerce.returns.write

Cancel a Return before any merchandise or value work commits. Cancellation is refused once a receipt, inspection, disposition, or resolution exists.

Path parameters
return_idstringrequired

Flint return id.

Request body
expected_return_revisionintegerrequired
reasonenumrequired
buyer_requestmerchant_requestduplicateexpiredcreated_in_errorother
reason_messagestring
Response · 200
dataobjectrequired
metaobject
request_idstring

Error codes

AUTH_REQUIREDINSUFFICIENT_SCOPEINVALID_REQUESTRATE_LIMIT_EXCEEDEDRESOURCE_NOT_FOUND
Bash
curl -X POST https://api.withflintpay.com/v1/returns/ret_01K0P7W6A4N9F3J2T8Q5R1C6XM/cancel \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: a-unique-key" \
  -d '{
    "expected_return_revision": 0,
    "reason": "buyer_request"
  }'

Complete return#

POST/v1/returns/{return_id}/completeIdempotentRequires scope: commerce.returns.write

Complete a Return whose completion_mode is manual. The call fails while completion_blockers is non-empty. Automatic Returns complete themselves when the final blocker clears.

Path parameters
return_idstringrequired

Flint return id.

Request body
expected_return_revisionintegerrequired
reasonenum
manual_completionexception_waivedother
reason_messagestring
Response · 200
dataobjectrequired
metaobject
request_idstring

Error codes

AUTH_REQUIREDINSUFFICIENT_SCOPEINVALID_REQUESTRATE_LIMIT_EXCEEDEDRESOURCE_NOT_FOUND
Bash
curl -X POST https://api.withflintpay.com/v1/returns/ret_01K0P7W6A4N9F3J2T8Q5R1C6XM/complete \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: a-unique-key" \
  -d '{
    "expected_return_revision": 0
  }'

Decide return#

POST/v1/returns/{return_id}/decideIdempotentRequires scope: commerce.returns.decisions.write

Record per-line Return decisions atomically. Each line selects policy_evaluation or explicit decision semantics.

Path parameters
return_idstringrequired

Flint return id.

Request body
completion_modeenumrequired
manualautomatic
expected_return_revisionintegerrequired
line_itemsarray of one ofrequired
Response · 200
dataobjectrequired
metaobject
request_idstring

Error codes

AUTH_REQUIREDINSUFFICIENT_SCOPEINVALID_REQUESTRATE_LIMIT_EXCEEDEDRESOURCE_NOT_FOUND
Bash
curl -X POST https://api.withflintpay.com/v1/returns/ret_01K0P7W6A4N9F3J2T8Q5R1C6XM/decide \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: a-unique-key" \
  -d '{
    "completion_mode": "manual",
    "expected_return_revision": 0,
    "line_items": [
      {
        "approved_quantity": 0,
        "decision_basis": "policy_evaluation",
        "return_line_item_id": ""
      }
    ]
  }'

List return line items#

GET/v1/returns/{return_id}/line-itemsRequires scope: commerce.return_policies.write or commerce.return_reasons.write or commerce.returns.decisions.write or commerce.returns.operations.write or commerce.returns.process.write or commerce.returns.read or commerce.returns.resolutions.write or commerce.returns.write

List the line items on a Return with their quantity counters, eligibility, frozen display identity, and return value.

Path parameters
return_idstringrequired

Flint return id.

Query parameters
fulfillment_idstring

Filter by fulfillment id.

merchandise_statusarray of enum

Filter by merchandise status.

not_requiredawaiting_handoffin_transitpartially_receivedreceivedinspection_requiredpartially_inspectedinspection_review_requireddisposition_requiredresolvedexception
order_line_item_idstring

Filter by order line item id.

page_sizeinteger

Page size. Defaults to 20 and is capped at 100.

page_tokenstring

Opaque cursor returned by the previous page.

resolution_statusarray of enum

Filter by resolution status.

not_selectedpendingpartially_fulfilledrequires_actionfulfilledfailed
return_reason_idstring

Filter by return reason id.

statusarray of enum

Filter by status.

requestedopencompleteddeclinedcanceled
Response · 200
dataarray of objectrequired
metaobject
next_page_tokenstring
request_idstring

Error codes

AUTH_REQUIREDINSUFFICIENT_SCOPEINVALID_REQUESTRATE_LIMIT_EXCEEDEDRESOURCE_NOT_FOUND
Bash
curl https://api.withflintpay.com/v1/returns/ret_01K0P7W6A4N9F3J2T8Q5R1C6XM/line-items \
  -H "Authorization: Bearer YOUR_API_KEY"

Add return line item#

POST/v1/returns/{return_id}/line-itemsIdempotentRequires scope: commerce.returns.write

Add a line item to a requested Return. The response is the updated Return, not the new line.

Path parameters
return_idstringrequired

Flint return id.

Request body
expected_return_revisionintegerrequired
line_itemobjectrequired
Response · 200
dataobjectrequired
metaobject
request_idstring

Error codes

AUTH_REQUIREDINSUFFICIENT_SCOPEINVALID_REQUESTRATE_LIMIT_EXCEEDEDRESOURCE_NOT_FOUND
Bash
curl -X POST https://api.withflintpay.com/v1/returns/ret_01K0P7W6A4N9F3J2T8Q5R1C6XM/line-items \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: a-unique-key" \
  -d '{
    "expected_return_revision": 0,
    "line_item": {
      "order_line_item_id": "",
      "requested_quantity": 0,
      "return_reason_id": ""
    }
  }'

Get return line item#

GET/v1/returns/{return_id}/line-items/{return_line_item_id}Requires scope: commerce.return_policies.write or commerce.return_reasons.write or commerce.returns.decisions.write or commerce.returns.operations.write or commerce.returns.process.write or commerce.returns.read or commerce.returns.resolutions.write or commerce.returns.write

Retrieve one Return line item, including its quantity counters and the reason the buyer selected.

Path parameters
return_idstringrequired

Flint return id.

return_line_item_idstringrequired

Flint return line item id.

Response · 200
dataobjectrequired
metaobject
request_idstring

Error codes

AUTH_REQUIREDINSUFFICIENT_SCOPEINVALID_REQUESTRATE_LIMIT_EXCEEDEDRESOURCE_NOT_FOUND
Bash
curl https://api.withflintpay.com/v1/returns/ret_01K0P7W6A4N9F3J2T8Q5R1C6XM/line-items/retli_01K0P7W6A4N9F3J2T8Q5R1C6XM \
  -H "Authorization: Bearer YOUR_API_KEY"

Update return line item#

PATCH/v1/returns/{return_id}/line-items/{return_line_item_id}IdempotentRequires scope: commerce.returns.write

Update a requested Return line item. Send null to clear buyer_note or requested_resolution_type. The response is the updated Return.

Path parameters
return_idstringrequired

Flint return id.

return_line_item_idstringrequired

Flint return line item id.

Request body
buyer_notestring
expected_return_revisionintegerrequired
requested_quantityinteger

Whole-number quantity; fractional quantities are not supported.

requested_resolution_typeenum
refundexchangereplacementno_monetary_action
return_reason_idstring
Response · 200
dataobjectrequired
metaobject
request_idstring

Error codes

AUTH_REQUIREDINSUFFICIENT_SCOPEINVALID_REQUESTRATE_LIMIT_EXCEEDEDRESOURCE_NOT_FOUND
Bash
curl -X PATCH https://api.withflintpay.com/v1/returns/ret_01K0P7W6A4N9F3J2T8Q5R1C6XM/line-items/retli_01K0P7W6A4N9F3J2T8Q5R1C6XM \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: a-unique-key" \
  -d '{
    "expected_return_revision": 0
  }'

Delete return line item#

DELETE/v1/returns/{return_id}/line-items/{return_line_item_id}IdempotentRequires scope: commerce.returns.write

Remove a line item from a requested Return. The response is the updated Return.

Path parameters
return_idstringrequired

Flint return id.

return_line_item_idstringrequired

Flint return line item id.

Response · 200
dataobjectrequired
metaobject
request_idstring

Error codes

AUTH_REQUIREDINSUFFICIENT_SCOPEINVALID_REQUESTRATE_LIMIT_EXCEEDEDRESOURCE_NOT_FOUND
Bash
curl -X DELETE https://api.withflintpay.com/v1/returns/ret_01K0P7W6A4N9F3J2T8Q5R1C6XM/line-items/retli_01K0P7W6A4N9F3J2T8Q5R1C6XM \
  -H "Authorization: Bearer YOUR_API_KEY"

Cancel return line item#

POST/v1/returns/{return_id}/line-items/{return_line_item_id}/cancelIdempotentRequires scope: commerce.returns.decisions.write

Cancel approved quantity on a Return line item. Quantity already received, inspected, dispositioned, or reserved by a resolution cannot be canceled, and the conflict response names what is blocking it.

Path parameters
return_idstringrequired

Flint return id.

return_line_item_idstringrequired

Flint return line item id.

Request body
expected_return_revisionintegerrequired
handback_quantityintegerrequired

Whole-number quantity; fractional quantities are not supported.

quantityintegerrequired

Whole-number quantity; fractional quantities are not supported.

reasonenumrequired
buyer_requestmerchant_requestexpiredcreated_in_errorother
reason_messagestring
Response · 200
dataobjectrequired
metaobject
request_idstring

Error codes

AUTH_REQUIREDINSUFFICIENT_SCOPEINVALID_REQUESTRATE_LIMIT_EXCEEDEDRESOURCE_NOT_FOUND
Bash
curl -X POST https://api.withflintpay.com/v1/returns/ret_01K0P7W6A4N9F3J2T8Q5R1C6XM/line-items/retli_01K0P7W6A4N9F3J2T8Q5R1C6XM/cancel \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: a-unique-key" \
  -d '{
    "expected_return_revision": 0,
    "handback_quantity": 0,
    "quantity": 0,
    "reason": "buyer_request"
  }'

Waive return line inspection#

POST/v1/returns/{return_id}/line-items/{return_line_item_id}/waive-inspectionIdempotentRequires scope: commerce.returns.decisions.write

Waive the inspection requirement on a Return line item so received quantity can be dispositioned and resolved without an inspection observation.

Path parameters
return_idstringrequired

Flint return id.

return_line_item_idstringrequired

Flint return line item id.

Request body
expected_return_revisionintegerrequired
reasonenumrequired
policy_overridetrusted_in_store_handoffmerchant_reviewother
reason_messagestring
Response · 200
dataobjectrequired
metaobject
request_idstring

Error codes

AUTH_REQUIREDINSUFFICIENT_SCOPEINVALID_REQUESTRATE_LIMIT_EXCEEDEDRESOURCE_NOT_FOUND
Bash
curl -X POST https://api.withflintpay.com/v1/returns/ret_01K0P7W6A4N9F3J2T8Q5R1C6XM/line-items/retli_01K0P7W6A4N9F3J2T8Q5R1C6XM/waive-inspection \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: a-unique-key" \
  -d '{
    "expected_return_revision": 0,
    "reason": "policy_override"
  }'

Process existing return#

POST/v1/returns/{return_id}/processIdempotentRequires scope: commerce.returns.process.write

Process an existing requested Return atomically at the Flint facts layer. Requires the current Return revision and Idempotency-Key. Linked effects remain asynchronous.

Path parameters
return_idstringrequired

Flint return id.

Request body
completion_behaviorenum
complete_when_readyleave_open
expected_return_revisionintegerrequired
line_itemsarray of objectrequired
receiptobject
Response · 200
dataobjectrequired
metaobject
request_idstring

Error codes

AUTH_REQUIREDINSUFFICIENT_SCOPEINVALID_REQUESTRATE_LIMIT_EXCEEDEDRESOURCE_NOT_FOUND
Bash
curl -X POST https://api.withflintpay.com/v1/returns/ret_01K0P7W6A4N9F3J2T8Q5R1C6XM/process \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: a-unique-key" \
  -d '{
    "expected_return_revision": 0,
    "line_items": [
      {
        "return_line_item_id": ""
      }
    ]
  }'

Reopen return#

POST/v1/returns/{return_id}/reopenIdempotentRequires scope: commerce.returns.decisions.write

Reopen a completed Return to record late compensating facts. Confirmed money movements are never edited backward, so a monetary fix is a new correction resolution.

Path parameters
return_idstringrequired

Flint return id.

Request body
expected_return_revisionintegerrequired
reasonenumrequired
linked_effect_changedcorrection_requiredadditional_merchandise_receivedmerchant_requestother
reason_messagestring
Response · 200
dataobjectrequired
metaobject
request_idstring

Error codes

AUTH_REQUIREDINSUFFICIENT_SCOPEINVALID_REQUESTRATE_LIMIT_EXCEEDEDRESOURCE_NOT_FOUND
Bash
curl -X POST https://api.withflintpay.com/v1/returns/ret_01K0P7W6A4N9F3J2T8Q5R1C6XM/reopen \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: a-unique-key" \
  -d '{
    "expected_return_revision": 0,
    "reason": "linked_effect_changed"
  }'

Process return#

POST/v1/returns/processIdempotentRequires scope: commerce.returns.process.write

Create and process a bounded Return resource graph atomically at the Flint facts layer. Linked refunds, payments, replacement orders, and inventory effects remain asynchronous. Idempotency-Key is required.

Request body
completion_behaviorenumrequired
complete_when_readyleave_open
external_reference_idstring
line_itemsarray of objectrequired
metadatamap of string
order_idstringrequired
receiptobject
Response · 201
dataobjectrequired
metaobject
request_idstring

Error codes

AUTH_REQUIREDINSUFFICIENT_SCOPEINVALID_REQUESTRATE_LIMIT_EXCEEDEDRESOURCE_NOT_FOUND
Bash
curl -X POST https://api.withflintpay.com/v1/returns/process \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: a-unique-key" \
  -d '{
    "completion_behavior": "complete_when_ready",
    "line_items": [
      {
        "decision": {
          "approved_quantity": {},
          "decision_basis": {}
        },
        "order_line_item_id": "",
        "requested_quantity": 0,
        "return_reason_id": ""
      }
    ],
    "order_id": ""
  }'
Rate this doc