Return policies and reasons
A return policy lets Flint judge return requests the way you would: what can come back, for how long, what the buyer may get instead, whether the merchandise has to arrive first, and what you deduct. Flint evaluates every request against your active policies. It approves and resolves automatically where a policy allows that, and sends the rest to you with the policy's proposal attached.
A policy has a stable ID, a name, and a status. Its rules live on revisions, and each revision is immutable. Each Return line pins the revision it was judged against, so a Return decided last March still shows the rules it was decided under after you have changed them twice.
Write a policy#
This policy accepts any item for 30 days from delivery, lets the buyer choose a refund or an exchange, approves automatically, has the buyer pay return shipping, keeps a 10 percent restocking fee, and releases the money once the goods arrive:
curl -X POST https://api.withflintpay.com/v1/return-policies \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: policy-standard-001" \
-d '{
"name": "Standard returns",
"revision": {
"priority": 100,
"scope": { "match_type": "all" },
"eligibility_result": "eligible",
"return_window": { "duration_seconds": 2592000, "starts_at_event": "delivered" },
"allowed_resolution_types": ["refund", "exchange"],
"approval_mode": "automatic",
"resolution_mode": "manual",
"completion_mode": "automatic",
"release_timing": "after_receipt",
"is_merchandise_return_required": true,
"is_inspection_required": false,
"receiving_location_id": "loc_1kmn0aExample",
"receipt_disposition_mode": "automatic",
"return_shipping": { "payer": "buyer" },
"restocking_fee": { "calculation_type": "percent", "percent": 10 }
}
}'
The response's data is the policy, with status: "inactive" and version: 1. Nothing is evaluated against it until you turn it on. Its first revision's ID is in current_return_policy_revision_id.
resolution_mode: "manual" means Flint approves the request but leaves the outcome to you, because an exchange needs someone to pick the replacement merchandise. receipt_disposition_mode: "automatic" creates a sellable disposition when no inspection is required. When inspection is required, an accepted inspection chooses sellable, quality_control, or damaged from its condition, as described in Receipt and disposition.
The decisions in a revision#
Every field answers one question. priority, scope, eligibility_result, approval_mode, and is_merchandise_return_required are required on every revision.
| Question | Fields |
|---|---|
| Which items does it cover, and does it beat other policies? | scope, priority. See Which policy wins. |
| Can they come back at all? | eligibility_result: eligible, review_required (returnable, but you decide every request), or ineligible. An ineligible revision also needs ineligibility_reason. |
| Until when? | return_window. Leave it out for no deadline. See Windows. |
| What may the buyer get? | allowed_resolution_types: any of refund, store_credit, exchange, replacement, and no_monetary_action. |
| Who approves and who picks the outcome? | approval_mode, resolution_mode, resolution_selection_mode, automatic_resolution_type, completion_mode. See What automatic decides. |
| When does the buyer get the value? | release_timing: after_approval, after_handoff, after_receipt, after_inspection, or manual. It gates exchanges and replacements as well as refunds. manual waits for POST /v1/return-resolutions/{return_resolution_id}/release. |
| Does the merchandise come back, and where? | is_merchandise_return_required, is_inspection_required, receiving_location_id. |
| What happens to it when it arrives? | receipt_disposition_mode. See Receipt and disposition. |
| What do you charge? | return_shipping, restocking_fee. See Fees and who pays shipping. |
Rules Flint checks when you write a revision#
Create and publish both reject a revision that breaks one of these rules, with 400 INVALID_REQUEST and param naming the field, such as revision.scope.match_type.
- An ineligible revision commits no resolution behavior. With
eligibility_result: "ineligible", sendineligibility_reasonand omitallowed_resolution_types,resolution_mode,release_timing, andcompletion_mode. The other rules below apply only toeligibleandreview_requiredrevisions. - Eligible and review-required revisions need
allowed_resolution_types,resolution_mode, andcompletion_mode, and must not setineligibility_reason.allowed_resolution_typescan't repeat a value. release_timingis required whenrefundorstore_creditis allowed.after_handoffandafter_receiptneedis_merchandise_return_required: true.after_inspectionalso needsis_inspection_required: true. When neither money outcome is allowed and you omit it, Flint uses the latest point the line can reach:after_inspection,after_receipt, orafter_approvalwhen nothing comes back.- Merchandise that comes back needs a destination.
is_merchandise_return_required: truerequiresreceiving_location_id. When it isfalse, omitreceiving_location_idand either omitis_inspection_requiredor set it tofalse. Validation errors identify the conflicting field inparam, such asrevision.is_inspection_requiredorrevision.receiving_location_id. - Automatic resolution needs a selection mode.
resolution_mode: "automatic"requiresresolution_selection_mode. Withpolicy_default,automatic_resolution_typeis required and must be inallowed_resolution_types. Withbuyer_requested, omitautomatic_resolution_type, and allow onlyrefund,store_credit, andno_monetary_action.resolution_mode: "manual"sets neither field. return_window.duration_secondsis above 0 and at most 158,112,000 (1,830 days).priorityis 0 or higher.restocking_feeisflatwith onlyflat_money, orpercentwith onlypercent, from 1 to 100 with up to four decimal places.scopefollows the rules in Which policy wins.
Whether the receiving Location is usable is checked later, when the policy is active. See the next section.
Turn a policy on#
Set status to active. Send the version from your last read as expected_version:
curl -X PATCH https://api.withflintpay.com/v1/return-policies/rpol_1kmn0aExample \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: policy-standard-activate-001" \
-d '{
"status": "active",
"expected_version": 1
}'
The response shows status: "active" and version: 2. Before activating, Flint checks the current revision against your other active policies:
- The receiving Location must exist, be active, and have a postal address, since buyers ship to it. Otherwise the request fails with
409 ACTION_NOT_ALLOWED, and the message says why the location can't be used. - Two active policies can't tie. When another active policy has the same
priorityand a scope that could cover the same item, the request fails with409 ACTION_NOT_ALLOWEDandreason: configuration_required. Give one of them a different priority, or scopes that can't overlap.
Change the rules#
Revisions can't be edited. To change a window, fee, scope, or mode, publish a new revision with the complete rules. Fields you leave out don't carry over from the previous revision. This one extends the window to 60 days:
curl -X POST https://api.withflintpay.com/v1/return-policies/rpol_1kmn0aExample/revisions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: policy-standard-rev-002" \
-d '{
"expected_return_policy_version": 2,
"revision": {
"priority": 100,
"scope": { "match_type": "all" },
"eligibility_result": "eligible",
"return_window": { "duration_seconds": 5184000, "starts_at_event": "delivered" },
"allowed_resolution_types": ["refund", "exchange"],
"approval_mode": "automatic",
"resolution_mode": "manual",
"completion_mode": "automatic",
"release_timing": "after_receipt",
"is_merchandise_return_required": true,
"is_inspection_required": false,
"receiving_location_id": "loc_1kmn0aExample",
"receipt_disposition_mode": "automatic",
"return_shipping": { "payer": "buyer" },
"restocking_fee": { "calculation_type": "percent", "percent": 10 }
}
}'
expected_return_policy_version is required. Without it, the request returns 400 INVALID_REQUEST with detail code REQUIRED and param: "expected_return_policy_version". Publishing raises the policy's version and points current_return_policy_revision_id at the new revision. New requests are judged by it from then on; Returns already created keep the revision they pinned. When the policy is active, the new revision has to pass the same location and priority checks as activation.
PATCH changes only identity fields: name, external_reference_id, metadata, and status. It never changes rules.
Read policies and revisions#
Policy responses include current_return_policy_revision_id. Create, update, publish, and archive responses omit current_revision. Reads leave the revision out unless you ask for it. Add expand=current_revision to read the rules with the policy, or to list every policy with its rules in one request:
curl -G https://api.withflintpay.com/v1/return-policies \
-H "Authorization: Bearer YOUR_API_KEY" \
--data-urlencode "status=active" \
--data-urlencode "expand=current_revision"
A revision’s effective_at records when it became current on an active policy, or when its policy was first activated. It is absent if the revision was never current while the policy was active.
Each policy then carries current_revision, the same object GET /v1/return-policies/{return_policy_id}/revisions/{return_policy_revision_id} returns. Without a status filter, lists return active and inactive policies and leave archived ones out. Page tokens stay valid when you add or drop expand. See Read the current revision.
GET /v1/return-policies/{return_policy_id}/revisions lists a policy's revisions, newest first, which is how you show what a Return was judged against after the rules changed.
Turn a policy off or retire it#
Only active policies are evaluated.
- inactive moves to active on PATCH status active
- active moves to inactive on PATCH status inactive
- inactive moves to archived on DELETE
- active moves to archived on DELETE
status on return policyPolicies don't publish supported_actions: the status above tells you what is allowed. Returns that already pinned a revision keep it whatever you do to the policy.
Which policy wins#
For each line in a request, Flint finds the active policies whose scope covers the item and uses the one with the highest priority. Layer a general policy under specific ones.
Every scope needs a match_type:
allcovers every item. Every other list in the scope must be empty or absent. Use it for your catch-all.includecovers only what its lists name, and needs at least one nonempty list. When you fill several lists, an item must match every one of them; within a list, any value matches.
| List | Matches |
|---|---|
product_ids | The order line's product |
variant_ids | The order line's variant |
category_handles | Any of the line's catalog categories, by handle from GET /v1/categories |
location_ids | The Location the item was fulfilled from |
channel_types | Supported order channels only; unknown values are rejected. Where the order came from: checkout, payment_link, virtual_terminal, api, or subscription |
Each list holds up to 100 distinct values. A scope without match_type returns 400 INVALID_REQUEST with param: revision.scope.match_type; leaving it out never means all items.
When you create a policy or publish a revision, the receiving location and each product, variant, and location ID in the scope must exist in your merchant and environment. An unavailable ID returns 404 RESOURCE_NOT_FOUND with the field or list entry in param.
When no active policy covers a line, its eligibility is review_required with reason: no_matching_policy. You and your integrations can still create a Return for it, and you decide it by hand with no override reason, because there is no policy to override. A buyer can't request it through a customer session: an active policy that covers the item is what opts it into self-service.
Final sale#
Express final sale as a higher-priority ineligible policy over your catch-all. This one excludes everything in the clearance category:
curl -X POST https://api.withflintpay.com/v1/return-policies \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: policy-final-sale-001" \
-d '{
"name": "Final sale",
"revision": {
"priority": 200,
"scope": { "match_type": "include", "category_handles": ["clearance"] },
"eligibility_result": "ineligible",
"ineligibility_reason": "final_sale",
"approval_mode": "manual",
"is_merchandise_return_required": false
}
}'
Don't copy the resolution fields across from your eligible policy: an ineligible revision that sets allowed_resolution_types, resolution_mode, release_timing, or completion_mode is rejected. Activate it like any other policy.
An eligibility preview then reports a clearance item like this, with a reason_message you can show the buyer:
{
"status": "ineligible",
"reason": "policy_ineligible",
"ineligibility_reason": "final_sale",
"reason_message": "This item was sold as final sale.",
"eligible_quantity": 0,
"return_policy_id": "rpol_1kmn0aFinalSale"
}
Flint checks an ineligible policy before the return window, so a final-sale item reports final_sale even when its window has also passed. The other ineligibility_reason values are product_excluded, category_excluded, market_restricted, channel_restricted, outside_return_window, and other; each has its own message. Show what can come back covers every eligibility reason a buyer can see.
Windows#
A window is duration_seconds plus the event it counts from. Each fulfillment gets its own deadline, reported as expires_at on the line's eligibility. After it, the line is ineligible with reason: return_window_expired.
starts_at_event | Counts from |
|---|---|
fulfilled | The fulfillment completing: the delivery, pickup, or service completion that finished it, or your complete call |
delivered | The carrier delivering a shipment, or a local or digital delivery |
picked_up | The buyer collecting in person |
service_completed | The work being finished |
delivered is usually what a buyer thinks "30 days" means. A shipment with packages completes when its last package is delivered, so fulfilled and delivered start together. When you complete a shipment yourself, send occurred_at with the delivery time: it becomes the delivery date that delivered counts from. If you omit it, Flint uses the time you mark the shipment complete.
When the start event hasn't been recorded for a fulfillment, such as a delivered window on an in-store pickup, Flint can't compute a deadline. The line becomes review_required with reason: manual_review_required, and you decide it.
Fees and who pays shipping#
return_shipping.payer is merchant or buyer. It is a statement of policy, not a charge: Flint doesn't buy labels, so the policy holds no amount. When you charge the buyer for a label, add a return_shipping_fee adjustment to the resolution.
restocking_fee is proposed for each eligible line in the line's policy_adjustment_proposals, with the amount in calculated_amount_money:
flatproposesflat_moneyfor the line.percentproposes that percent of what the buyer paid for the returned units, after discounts and including their allocated tax, before the fee.10means 10 percent. For two $18.00 units discounted by 10%, returning one unit with a 10% fee deducts $1.62 from its $16.20 refundable value.
Both fees are capped at the units' refundable value. Percentage fees use the same unit allocation as the refund; the last units take any remaining paid value. For each return, apply the pinned policy percentage to what the buyer paid for those units, then round down to the smallest currency unit. See Refund rounding.
Rounding each percentage fee down means fees across several returns under the same percentage never add up to more than that percentage of what was paid. At 50%, units allocated $14.37, $14.37, and $14.36 incur fees of $7.18 each, totaling $21.54, below the $21.55 policy cap. Earlier fees, waivers, failures, and policy revisions do not change a new return's fee. The same calculation applies to refunds, exchanges, and store credit.
The fee lands on the resolution as a restocking_fee adjustment, a deduction in the same arithmetic as the refund, and appears in the Return's financial_summary as deduction_money. It is never netted invisibly into the refund.
Receipt and disposition#
receipt_disposition_mode decides what happens to verified merchandise when it arrives. Omit it to use automatic.
automaticcreates dispositions withreason: inspection_result. Without inspection, it creates asellabledisposition at the receipt's receiving location. When inspection is required, an accepted inspection mapsnewandunopenedtosellable;opened,used,incomplete, andundeterminedtoquality_control; anddamagedanddefectivetodamaged. A successful tracked disposition also creates an inventory receipt and movement; untracked merchandise has no inventory effect. If an inventory mapping is missing, the observation is still recorded and the generated disposition isfailedwithfailure_code: inventory_item_unmapped. Cancel it or create a replacement; retry is unavailable.manualleaves inventory unchanged. The received quantity waits for you to create a disposition, and the Return stays blocked bydisposition_requireduntil you do.
What automatic decides#
Two modes work together. approval_mode decides whether Flint approves the Return itself. resolution_mode decides whether it also creates and confirms the buyer's outcome.
Automatic approval runs when a Return is created, whoever creates it, and again when its lines change while it is requested. It approves only when every line qualifies:
- Its policy is
eligible(notreview_required) and hasapproval_mode: "automatic". - The full requested quantity is eligible.
- The policies on the Return don't set different
completion_modevalues. - Under automatic
buyer_requestedresolution, the buyer has chosen an allowed outcome.
If any line falls short, the whole Return stays requested with each line's proposal, and you decide it. Flint never approves part of a Return on its own.
Automatic resolution creates refund, store_credit, and no_monetary_action outcomes. An exchange or replacement means picking merchandise, which Flint leaves to a person. resolution_selection_mode decides who picks the outcome:
policy_defaultusesautomatic_resolution_typewithout asking.buyer_requesteduses the outcome the buyer chose fromallowed_resolution_types. Until they choose, the Return staysrequested, and resolution previews show them what each option is worth.
The resolution still waits for its release_timing before value moves. completion_mode closes the loop: under automatic, Flint completes the Return when the last completion blocker clears. Under manual, you call POST /v1/returns/{return_id}/complete once completion_blockers is empty.
Decide a request by hand#
When no automatic policy decides a Return, or you want to overrule one, decide it with POST /v1/returns/{return_id}/decide. The decision covers every line at once. Each line needs approved_quantity, and when you approve less than the buyer asked for, a decline_reason: not_eligible, quantity_unavailable, evidence_missing, suspected_abuse, merchant_discretion, or other. Every other field is optional. Flint starts from a default for each one, and anything you send replaces it.
Accept the proposal
A line your policy covers
The defaults are the line's eligibility.decision_proposal, recalculated for the quantity you approve. Send approved_quantity alone to accept it.
{
"line_items": [
{
"return_line_item_id": "retli_1kmn0aExample",
"approved_quantity": 1
}
]
}
State the outcome
A line no policy covers
Merchandise comes back by default, so tell Flint where it goes.
{
"line_items": [
{
"return_line_item_id": "retli_1kmn0aExample",
"approved_quantity": 1,
"receiving_location_id": "loc_1kmn0aExample"
}
]
}
When no policy covers a line, or its policy can't build a proposal, the defaults are:
| Field | Default |
|---|---|
return_required_quantity | approved_quantity: every approved unit comes back |
allowed_resolution_types | refund, exchange, replacement, no_monetary_action, and store_credit. Whether the payment can fund a refund or store credit is checked when you resolve the line |
automatic_resolution_type | None, so you choose the outcome when you resolve the line |
is_inspection_required | false |
receiving_location_id | None. Required when any merchandise comes back |
release_timing | The latest point the line can reach, as below |
When neither you nor the proposal sets release_timing, Flint uses:
after_inspectionwhen merchandise comes back and must be inspectedafter_receiptwhen merchandise comes back without inspectionafter_approvalwhen nothing comes back
A decided line always has a release_timing, and it gates exchanges and replacements as well as refunds. Set after_approval yourself when you mean to send a replacement before the original arrives.
automatic_resolution_type asks Flint to create and confirm the outcome itself, as an automatic policy would. It accepts refund, store_credit, and no_monetary_action, and must be in the line's allowed_resolution_types. Omit it to keep the proposal's value, or send null to resolve the line yourself. A buyer_requested policy proposes an automatic outcome only once the buyer has chosen one, so a line you decide before that, such as a Return you created at a register, has no automatic_resolution_type and you resolve it yourself.
When the original payment can no longer fund the automatic outcome, deciding fails with 409 ACTION_NOT_ALLOWED and reason: refund_unavailable or store_credit_unavailable. details[0] names the order in resource_type and resource_id, and param names the line's field, such as line_items[0].automatic_resolution_type. Send null or no_monetary_action instead.
Omit completion_mode to use the mode every pinned policy sets, or automatic when none sets one. When the policies disagree, the request returns 400 INVALID_REQUEST naming completion_mode, so send it.
Some combinations could never finish, and Flint rejects them:
- Any
return_required_quantityabove 0 needs areceiving_location_id. release_timing: "after_inspection"needsis_inspection_required: true; otherwise the gate never opens.- With
return_required_quantity: 0,is_inspection_requiredcan't betrue, andrelease_timingcan only beafter_approvalormanual. Flint fillsafter_approvalwhen you leave it unset.
Overriding a policy#
A line whose decision differs from its policy's proposal needs an override_reason: customer_service_exception, policy_correction, risk_review, merchant_discretion, or other, with an optional override_reason_message. So does approving more than eligibility.eligible_quantity on any line a policy matched, including one the policy made ineligible. Sending automatic_resolution_type: null where the proposal has a value is a difference too. The release timing Flint fills in never counts as one. A line no policy matched rejects override_reason, because there is nothing to override.
Note: Returnless refunds
Approve a quantity with return_required_quantity: 0 and the buyer keeps the merchandise. The Return still settles the money and records why, so it reconciles like any other. Use it when return shipping costs more than the item is worth.
Return reasons#
Every Return line needs a return_reason_id: why the buyer says it is coming back. Flint provides nine reasons in every environment, such as too_small, defective, and changed_mind; the Return reasons reference lists their IDs. Add your own for anything specific to what you sell:
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-runs-small-001" \
-d '{
"handle": "runs_small",
"name": "Runs small",
"category_handles": ["footwear"],
"is_note_required": false
}'
handleis the stable identifier you match on. It starts with a lowercase letter, uses only lowercase letters, digits, and underscores, and is at most 100 characters. It can't match one of Flint's handles or any of your reasons, archived ones included: that returns409 ALREADY_EXISTSwithparam: "handle", naming the existing reason. Find a reason by handle withGET /v1/return-reasons?handle=runs_small.nameis what the buyer reads.is_note_required: truemakes the buyer add a note when they choose it.category_handleslimits where the reason applies, by catalog category handle. A buyer sees and can choose it only for items in those categories. You and your integrations can choose any active reason for any line, because staff correct a buyer's pick. Leave it out to apply the reason everywhere.- Availability. Set a reason
inactivewithPATCHto stop offering it, andactiveto offer it again. This works on Flint's reasons too, for your store only; it is the only change Flint's reasons accept. A line sent with an inactive reason returns409 ACTION_NOT_ALLOWEDwithcurrent_status: inactive.DELETEarchives one of your own reasons for good.
A store that doesn't track reasons can create one, such as in_store with is_note_required: false, and use it for counter returns. Returns that recorded a reason keep its name and handle, so tidying the list never changes what an old Return means. Availability has the full rules.
Return reasons are one of several vocabularies that use the word "reason", and they aren't interchangeable:
| Vocabulary | Who supplies it | Where it lives |
|---|---|---|
| Return reason | The buyer | return_reason_id on the Return line |
| Inspection finding | The warehouse | finding_codes on an inspection line |
| Decline reason | You | decline_reason on a decision |
| Override reason | You | override_reason on a decision that departs from its policy |
| Refund reason | Flint | reason on the Refund, mapped from the buyer's return reason |
A buyer saying "damaged" and a warehouse finding damaged are different claims about the same parcel, and the difference is what you want when one of them is wrong. Keep them separate.
Errors#
Next steps#
Buyer-initiated returnsReturn resolutionsReturn policies API referenceWrite the buyer-facing policy text with the return policy generator, which also gives you the matching POST /v1/return-policies request.