Receiving and inspecting returns
When a returned parcel reaches your warehouse, your integration records up to three facts on the Return:
- A receipt: what arrived, and where.
- An inspection: what condition it was in, when the decision asked for one.
- A disposition: where the units went. Dispositions are what put stock back into inventory.
Receipts and inspections can release a refund that was waiting on them, but the warehouse never issues one. You build this in the system that does the receiving work: a WMS, a 3PL integration, or a tool on the returns dock. The Return must already exist and be open. Returns explains how it got there.
Give the warehouse its own key#
Create a key with only the commerce.returns.operations.write scope (see scope keys to the job). That scope covers receipts, inspections, and dispositions, and can read Returns, receipts, inspections, and dispositions. It can't decide a Return, waive an inspection, or create or confirm a resolution, so the warehouse integration can't move buyer money.
Two things the key doesn't give the warehouse:
- Location IDs. A receipt names the Flint Location (
loc_...) where the parcel arrived. Keep your building's Location ID in configuration, or addmerchants.locations.readto look it up withGET /v1/locations. - Merchant decisions. Waiving an inspection needs
commerce.returns.write.POST /v1/returns/{return_id}/process, which records a decision, merchandise, and resolutions in one call for a counter return, needscommerce.returns.write,commerce.returns.operations.write, andcommerce.returns.resolutions.write. Leave both to the merchant's systems.
Find the work#
GET /v1/returns with work_type lists Returns that are still requested or open and need that kind of work. Add receiving_location_id to see only your building.
curl "https://api.withflintpay.com/v1/returns?work_type=receipt,inspection,disposition,exception&receiving_location_id=loc_1kmn0aExample" \
-H "Authorization: Bearer YOUR_API_KEY"
work_type | The Return has |
|---|---|
receipt | Merchandise the buyer handed off that hasn't been received |
inspection | Received merchandise that needs an inspection or an acceptance decision |
disposition | Received merchandise without a successful disposition |
exception | Unidentified or excess merchandise, or a failed resolution |
On each Return, completion_blockers names the line still owed and, where one exists, the receipt, inspection, or disposition holding it up. GET /v1/returns/{return_id}?expand=return_receipts,return_inspections,return_dispositions returns the Return with its receipts, inspections, and dispositions.
Choose what happens after a receipt#
Two settings decide how many of the steps below you call. Both are fixed before the parcel arrives:
is_inspection_requiredon each Return line, set by the decision.receipt_disposition_modeon the Return policy revision pinned to the line:automatic, which is also used when no revision is pinned, ormanual.
automatic | manual | |
|---|---|---|
| No inspection required | The receipt creates a successful sellable disposition at the receiving location for each matched line and returns it in generated_dispositions. Nothing else to call. | The receipt records custody only. The line waits in disposition_required until you create a disposition. |
| Inspection required | An accepted inspection creates the sellable disposition and returns it in the inspection's generated_dispositions. | An accepted inspection makes the units available to disposition. You create the disposition. |
For tracked merchandise, an automatic disposition also creates an inventory receipt and movement. Untracked merchandise gets the disposition with no inventory effect.
Choose manual when the warehouse decides where each unit goes, or when it needs time to correct a receipt. An automatic disposition consumes the receipt as soon as Flint records it, and a consumed receipt can't be corrected.
The examples below assume manual with inspection required, so every step appears.
1. Record what arrived#
Create one receipt per parcel or receiving event:
curl -X POST https://api.withflintpay.com/v1/returns/ret_1kmn0aExample/receipts \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: wms-event-88412" \
-d '{
"receiving_location_id": "loc_1kmn0aExample",
"received_at": "2026-10-27T15:04:00Z",
"source_system": { "source_system_type": "wms", "external_source_id": "east-dc-wms" },
"external_reference_id": "RCV-1042",
"line_items": [
{ "type": "matched", "return_line_item_id": "retli_1kmn0aExample", "quantity": 1 }
]
}'
{
"data": {
"return_receipt_id": "retrc_1kmn0aExample",
"return_id": "ret_1kmn0aExample",
"status": "current",
"version": 1,
"receiving_location_id": "loc_1kmn0aExample",
"received_at": "2026-10-27T15:04:00Z",
"source_system": { "source_system_type": "wms", "external_source_id": "east-dc-wms" },
"external_reference_id": "RCV-1042",
"line_items": [
{
"return_receipt_line_item_id": "retrcli_1kmn0aExample",
"return_receipt_id": "retrc_1kmn0aExample",
"return_line_item_id": "retli_1kmn0aExample",
"verification_status": "matched",
"quantity": 1,
"available_disposition_quantity": 0,
"supported_actions": []
}
],
"generated_dispositions": [],
"created_at": "2026-10-27T15:04:02Z",
"updated_at": "2026-10-27T15:04:02Z"
}
}
available_disposition_quantity is what you can still disposition straight from this receipt line. It's 0 here because the line waits on inspection.
What the request takes:
receiving_location_idstringRequiredThe Location where the parcel arrived. When the Return line already has a receiving_location_id, such as the destination on its return label, the receipt must name the same Location.
received_atstringRequiredWhen the parcel arrived, at most five minutes in the future. Use the time your scanner recorded, not the time you sync.
line_itemsarrayRequired1 to 500 lines, each with a whole-number quantity and a type (below).
Idempotency-KeyheaderRequiredRequired on every receipt, inspection, and disposition you create (idempotency). Use your WMS event ID, so a redelivered event returns the first receipt instead of recording a second one. After a timeout, GET /v1/return-receipts?idempotency_key=wms-event-88412 shows whether the receipt exists.
source_systemobjectWhere the record came from. source_system_type is wms, pos, erp, other, or manual. external_source_id identifies your system; it's required for every type except manual, which rejects it. Don't put secrets in it.
external_reference_id, external_actor_idstringYour own receipt number, which GET /v1/return-receipts can filter by, and the operator who recorded it.
shipment_idstringThe Flint return Shipment the parcel came on. Flint then also caps each matched line at what that Shipment carried.
Receipt line types#
Each line's type says what you know about the units, and decides which fields the line takes:
type | Send | What it does |
|---|---|---|
matched | return_line_item_id | The expected item. Counts toward the line's received_quantity and satisfies after_receipt release timing. |
unverified | unverified_item with a name, and optionally sku and description | Something arrived and you can't tell which line it is. Counts toward no line. |
excess | return_line_item_id | More of that item than the line expects. Doesn't count toward received_quantity. |
A matched line can take at most the line's outstanding handback quantity: its return_required_quantity less what current receipts already matched. Record anything beyond that as a separate excess line. Unverified and excess units put the Return's merchandise_status in exception and add a merchandise_exception completion blocker until someone verifies the unverified units or dispositions them.
A line without type returns 400 INVALID_REQUEST with param naming it, such as line_items[0].type. A field that belongs to another type, such as unverified_item on a matched line, returns 400 INVALID_REQUEST with a NOT_ALLOWED detail. Receipt line responses report verification_status, but requests don't accept it.
When you can't tell what arrived#
Don't guess a line to make a parcel fit. Record what you saw:
curl -X POST https://api.withflintpay.com/v1/returns/ret_1kmn0aExample/receipts \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: wms-event-88413" \
-d '{
"receiving_location_id": "loc_1kmn0aExample",
"received_at": "2026-10-27T15:10:00Z",
"source_system": { "source_system_type": "wms", "external_source_id": "east-dc-wms" },
"line_items": [
{
"type": "unverified",
"quantity": 1,
"unverified_item": { "name": "Blue hoodie", "sku": "HOODIE-BLUE-M" }
}
]
}'
An unverified receipt line lists verify in its supported_actions. Once an operator identifies it, verify it against a Return line:
curl -X POST https://api.withflintpay.com/v1/return-receipts/retrc_1kmn0aExample/line-items/retrcli_1kmn0aExample/verify \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: wms-verify-88413" \
-d '{
"expected_version": 1,
"return_line_item_id": "retli_1kmn0aExample",
"verification_reason": "sku_match_confirmed"
}'
verification_reason is one of order_match_confirmed, sku_match_confirmed, inspection_confirmed, merchant_review, or other, with an optional verification_reason_message. The line becomes matched and from then on behaves like any matched line, including an automatic disposition when the policy uses automatic. Verify before anything dispositions the line, and only up to the Return line's outstanding handback quantity. You can also verify a line while inspecting it (below).
expected_version is optional and compares against the receipt's version, not the Return's. If another system verified a line on this receipt first, you get 409 VERSION_CONFLICT with param expected_version, and the detail names resource_type return_receipt, the receipt's ID, and its current_version. Read the receipt again, and retry if the line is still unverified.
Correct a receipt#
Receipts are observations: Flint never edits or deletes one. To fix a wrong receipt, record a replacement that names it:
curl -X POST https://api.withflintpay.com/v1/returns/ret_1kmn0aExample/receipts \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: wms-event-88420" \
-d '{
"supersedes_return_receipt_id": "retrc_1kmn0aExample",
"correction_reason": "entry_error",
"correction_reason_message": "Scanned twice; one unit was in the box.",
"receiving_location_id": "loc_1kmn0aExample",
"received_at": "2026-10-27T15:04:00Z",
"line_items": [
{ "type": "matched", "return_line_item_id": "retli_1kmn0aExample", "quantity": 1 }
]
}'
The replacement is a complete receipt, so send every field again. correction_reason is one of entry_error, duplicate_observation, source_correction, reconciliation_correction, or other, and is required with supersedes_return_receipt_id. The original stays readable with status superseded and superseded_by_return_receipt_id, so a reconciliation months later still sees what the floor reported at the time.
You can supersede only a current receipt, and only before a current inspection or an active disposition uses it. Under automatic mode, matched units on a line without required inspection are dispositioned as soon as the receipt is recorded, so there is no correction window.
2. Inspect it, when the decision asked you to#
When a line's is_inspection_required is true, its received units wait for an inspection before they can be dispositioned. Record one against the receipt:
curl -X POST https://api.withflintpay.com/v1/returns/ret_1kmn0aExample/inspections \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: wms-inspection-1042" \
-d '{
"return_receipt_id": "retrc_1kmn0aExample",
"inspection_location_id": "loc_1kmn0aExample",
"inspected_at": "2026-10-27T16:20:00Z",
"source_system": { "source_system_type": "wms", "external_source_id": "east-dc-wms" },
"line_items": [
{
"return_receipt_line_item_id": "retrcli_1kmn0aExample",
"quantity": 1,
"condition": "opened",
"acceptance_status": "accepted",
"finding_codes": ["matches_expected_item"]
}
]
}'
An inspection names a current receipt in return_receipt_id, and inspection_location_id must be that receipt's receiving_location_id. Each receipt line appears at most once per inspection, and inspections of one receipt line can't add up to more than its quantity, so you can inspect part of a line now and the rest later.
Each inspection line answers three separate questions:
condition(required) grades the item:new,unopened,opened,used,damaged,defective,incomplete, orundeterminedwhen it couldn't be assessed.finding_codes(optional, up to 50, no repeats) says what you discovered:matches_expected_item,wrong_item,damaged,defective,used,missing_parts,empty_package,counterfeit_suspected, orother.acceptance_status(required) is the call:accepted,rejected, orreview_required.
damaged, defective, and used appear in both condition and finding_codes. As a condition, the word grades the item. As a finding, it records what the inspector concluded, so read the field name with the value. Add internal_note, up to 5,000 characters, for anything the codes don't capture.
What each call does:
acceptedsatisfiesafter_inspectionrelease timing. Undermanualmode the units become available to disposition from the inspection line. Underautomaticmode Flint creates thesellabledisposition and returns it ingenerated_dispositions.rejectedreleases nothing. The units can still be dispositioned from the inspection line, for example asdamagedorreturn_to_buyer.review_requiredholds the line for someone else to decide (below).
Two kinds of receipt line need care:
- Unverified lines can be identified during inspection. Send
return_line_item_idand averification_reason, such asinspection_confirmed, on the inspection line, and Flint verifies the receipt line in the same call. Without them, an unverified line can't be inspected. - Excess lines can't be inspected. Disposition them from the receipt line.
When the inspector can't make the call#
review_required is for a line the floor shouldn't decide alone, such as a suspected counterfeit or a high-value item. It raises an inspection_review_required completion blocker, and the inspection line lists decide in its supported_actions. Whoever reviews it settles the line:
curl -X POST https://api.withflintpay.com/v1/return-inspections/retins_1kmn0aExample/line-items/retinli_1kmn0aExample/decide \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: review-retinli-1042" \
-d '{
"expected_version": 1,
"acceptance_status": "accepted",
"acceptance_decision_reason": "manual_review"
}'
acceptance_status here is accepted or rejected. acceptance_decision_reason is one of inspection_result, return_policy, manual_review, or other, with an optional acceptance_decision_reason_message. /decide settles only a review_required line. To change an accepted or rejected call, supersede the inspection.
expected_version is optional and compares against the inspection's version. A stale value returns 409 VERSION_CONFLICT with param expected_version, resource_type return_inspection, the inspection's ID, and its current_version. Changes to the Return don't make it stale, though the Return must still be open.
Correct an inspection#
Like receipts, inspections are never edited. Create a new inspection with supersedes_return_inspection_id and a correction_reason from the same list as receipts. The replacement must name the same receipt, and the original must be current with no active disposition from any of its lines. The original becomes superseded.
Waiving an inspection#
The merchant can drop the requirement for a line with POST /v1/returns/{return_id}/line-items/{return_line_item_id}/waive-inspection, which needs commerce.returns.write, so the warehouse key can't call it. After a waiver, received units on that line satisfy after_inspection release timing and can be dispositioned from the receipt line. Under automatic mode, Flint creates their sellable dispositions at once.
3. Say where the units went#
A disposition records the outcome for received units, and it's the step that moves stock. It takes exactly one source: return_receipt_line_item_id or return_inspection_line_item_id.
curl -X POST https://api.withflintpay.com/v1/returns/ret_1kmn0aExample/dispositions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: wms-disposition-1042" \
-d '{
"return_inspection_line_item_id": "retinli_1kmn0aExample",
"quantity": 1,
"disposition_type": "sellable",
"inventory_location_id": "loc_1kmn0aExample",
"reason": "inspection_result",
"occurred_at": "2026-10-27T16:30:00Z"
}'
{
"data": {
"return_disposition_id": "retdsp_1kmn0aExample",
"return_id": "ret_1kmn0aExample",
"return_line_item_id": "retli_1kmn0aExample",
"return_inspection_line_item_id": "retinli_1kmn0aExample",
"disposition_type": "sellable",
"status": "pending",
"quantity": 1,
"inventory_location_id": "loc_1kmn0aExample",
"inventory_movement_ids": [],
"reason": "inspection_result",
"occurred_at": "2026-10-27T16:30:00Z",
"metadata": {},
"created_by": { "actor_type": "integration", "actor_id": "key_1kmn0aExample" },
"supported_actions": ["cancel"],
"version": 1,
"created_at": "2026-10-27T16:30:01Z",
"updated_at": "2026-10-27T16:30:01Z"
}
}
reason is required: inspection_result, return_policy, warehouse_override, safety_requirement, or other, with an optional reason_message. You can also attach external_reference_id and metadata.
Where to disposition from#
| The units are | Disposition from |
|---|---|
| Matched, on a line without required inspection (or with it waived) | The receipt line |
| Matched, on a line that requires inspection | The inspection line, once it's accepted or rejected |
| Excess | The receipt line |
| Unverified | The receipt line, with a type that doesn't take a location. To restock them, verify them first. |
Flint won't guess which inventory item unidentified units should increase, which is why unverified units can only leave through repair, refurbish, liquidate, donate, discard, or return_to_buyer. Dispositions on a line can't add up to more than its quantity, counting pending and succeeded ones.
Disposition types#
Five types name an inventory_location_id, and four of those add units to an inventory quantity bucket at that Location:
disposition_type | Stock effect | inventory_location_id |
|---|---|---|
sellable | Adds to sellable stock | Required |
quality_control | Adds on-hand stock that isn't sellable | Required |
damaged | Adds on-hand stock that isn't sellable | Required |
quarantined | Adds on-hand stock that isn't sellable | Required |
lost | None. Records the units as lost at that Location | Required |
repair, refurbish, liquidate, donate, discard, return_to_buyer | None. The merchandise leaves without becoming stock | Rejected |
Flint doesn't default the Location for the first five, because it won't guess which building gained or lost the units. The last row rejects inventory_location_id instead of ignoring it, so a donate that carries one fails.
Follow the stock change#
- pending moves to succeeded on applied
- pending moves to failed on fails
- pending moves to canceled on cancel
- failed moves to pending on retry
- failed moves to canceled on cancel, replace
status on return dispositionDon't treat a pending disposition as restocked. Wait for return_disposition.updated, or read the disposition again.
When a disposition fails#
Choose by whether the intent still holds.
Same intent: retry. When the cause was temporary, retry the failed disposition. Retry keeps the disposition and its inventory effect, so the stock can't move twice:
curl -X POST https://api.withflintpay.com/v1/return-dispositions/retdsp_1kmn0aExample/retry \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: retry-retdsp-1042-1" \
-d '{
"reason": "dependency_recovered"
}'
Only a failed disposition can be retried. reason is one of dependency_recovered, mapping_corrected, operator_retry, or other. The disposition goes back to pending, and Flint checks the line's capacity again first.
Different intent: replace. When the type, Location, quantity, or source must change, such as after inventory_item_unmapped, where Flint has no inventory item to put the units into, create a new disposition that names the one it replaces:
curl -X POST https://api.withflintpay.com/v1/returns/ret_1kmn0aExample/dispositions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: wms-disposition-1042-replace" \
-d '{
"return_inspection_line_item_id": "retinli_1kmn0aExample",
"quantity": 1,
"disposition_type": "return_to_buyer",
"replaces_return_disposition_id": "retdsp_1kmn0aExample",
"reason": "warehouse_override",
"reason_message": "No inventory item for this product, so the item goes back to the buyer.",
"occurred_at": "2026-10-27T17:05:00Z"
}'
You can replace a failed or canceled disposition that no other disposition has replaced and whose stock change never applied. A failed original becomes canceled with replaced_by_return_disposition_id, so the two stay linked.
No longer wanted: cancel. POST /v1/return-dispositions/{return_disposition_id}/cancel with a reason of created_in_error, changed_disposition, duplicate, or other cancels a pending disposition before its stock change starts, or a failed one. A succeeded disposition can't be canceled.
Retry and cancel accept an optional expected_version, compared against the disposition's version. A stale value returns 409 VERSION_CONFLICT.
Keep your system in sync#
Flint sends these events as each record changes. Every payload carries the full record.
To reconcile on a schedule instead, poll GET /v1/return-receipts, GET /v1/return-inspections, and GET /v1/return-dispositions with updated_after (inclusive) and updated_before (exclusive). Each record keeps its own version and updated_at, separate from the Return's. A receipt or inspection starts at version 1 and advances when one of its lines is verified or decided, or when a replacement supersedes it. Changes to the Return alone don't change them.
All of these writes need the Return to be open. Once a Return is completed, the merchant has to reopen it before the warehouse can record late facts, such as a correction.
What the warehouse never touches#
Recording that a parcel arrived satisfies after_receipt release timing, and an accepted inspection or a waiver satisfies after_inspection. Neither issues a refund. The merchant's resolution does that, and it can be waiting on things the warehouse can't see. If a refund hasn't gone out after you've recorded everything, read completion_blockers on the Return: each entry says what is still owed. Return resolutions covers the money side.
