The Returns API models the complete RMA lifecycle: a return is created on an order, it's approved or rejected, the customer ships the merchandise back, the merchant receives it, and finally the refund (or exchange) is processed. Each step is a separate endpoint, with its own permission.
The real catalog of return states has 12 values: return-requested, return-approved, return-rejected, return-shipped, return-received, inspecting, refund-pending, refunded, exchange-pending, exchange-shipped, exchange-completed, closed. Besides the refund flow there is also an exchange flow (exchange-*) — the return type (type) can be refund, exchange, or store-credit. Every response follows the standard Orders envelope.
Returns the paginated list of orders with at least one return, wrapped in data.orders (each order with the detail of its returns[]), together with data.total, data.page, and data.limit. There is no meta.pagination — the handler doesn't pass a third argument to createSuccessResponse.
Returns the count of returns grouped by status, wrapped in data, with the keys open, inProgress, awaitingAction, completed, rejected, and total.
Required permission:returns:read
The groups map as follows (RETURN_STATUS_GROUPS): open = return-requested, return-approved; inProgress = return-shipped, return-received, inspecting; awaitingAction = refund-pending, exchange-pending; completed = refunded, exchange-completed, closed; rejected = return-rejected. total sums every return matched by the base filter, in any status.
Returnsdata.orderId and data.orderHandle, the order's returns array in data.returns, and its count in data.totalReturns. The returns array is NOT data directly.
Order items to return, identified by sku (not by index). Minimum 1 element.
items.skustringrequired
SKU of the item within the original order. The service looks up this SKU in order.items; if it doesn't exist, it fails with OrderValidationError (items.sku).
items.quantitynumberrequired
Quantity to return for that SKU. Cannot exceed the quantity originally purchased on the order; if it does, it fails with OrderValidationError (items.quantity).
items.reasonenum
Return reason specific to this item. Same catalog as the root-level reason. If omitted, inherits the body's reason.
reasonenumrequired
Reason for the return. One of: defective, wrong-item, size-fit, quality-issue, not-as-described, changed-mind, arrived-late, damaged-shipping, duplicate-order, other. Hyphenated — wrong_item (underscore) fails validation.
typestring
Return type: refund, exchange, or store-credit. Not enforced at runtime (see note below).
requestedBystring
Who requests the return: customer, seller, platform, or marketplace. Default: seller.
initialStatusstring
Initial status of the return (for manual returns already created in an advanced state, e.g. return-received).
overallConditionstring
Overall condition of the merchandise, if already known when creating (see catalog in the receive section).
shipmentInfoobject
Return shipping information, if already known when creating (manual returns). The transport validator doesn't declare this field — createReturnSchema only validates items and reason, with .passthrough() — so Zod never checks it; the shape below is what the service (CreateReturnInput.shipmentInfo) consumes when it's sent.
shipmentInfo.trackingNumberstring
Tracking number of the return shipment.
shipmentInfo.carrierstring
Carrier code. Accepted values: fedex, dhl, ups, estafeta, redpack, 99minutos, other. If your carrier is not on the list, send `other` and put its name in `carrierName`. Do not send `manual`, `automatic`, `automatica` or similar: those are capture modes —how the label was obtained—, not carriers, and the API rejects them.
shipmentInfo.customCarrierNamestring
Carrier name when carrier is a generic value like 'other'.
shipmentInfo.trackingUrlstring
Tracking URL, for carriers without a direct integration.
shipmentInfo.waybillIdstring
Waybill ID.
shipmentInfo.labelUrlstring
URL of the PDF label.
shipmentInfo.shippedAtstring
Shipment date (ISO 8601). If sent, it also sets the return's shippedAt.
shipmentInfo.receivedAtstring
Receipt date (ISO 8601). If sent, it also sets the return's receivedAt.
shipmentInfo.costobject
Cost of the return shipment.
shipmentInfo.cost.labelCostnumberrequired
Cost of the label (≥ 0).
shipmentInfo.cost.feniciaFeenumber
Fenicia's fee on the shipment, if applicable.
shipmentInfo.cost.paidByenumrequired
Who pays for the shipment. One of: customer, seller, platform.
shipmentInfo.cost.currencystringrequired
3-letter currency (e.g. MXN).
items is identified by sku, not by itemIndex
Unlike POST /orders/{orderId}/prepare (which identifies items by itemIndex), creating a return identifies each item by sku: the service looks up that SKU inside order.items and fails with OrderValidationError if it isn't found, or if quantity exceeds the order's original quantity.ts`), as described above.
type isn't enforced at runtime despite the TypeScript type marking it required
The transport validator (createReturnSchema) only requires items and reason — it doesn't validate type at all. And at the library level, createReturn() assigns newReturn.type = input.type directly, with no check whatsoever: if you omit type, the field stays undefined in the saved document, with no error. The CreateReturnInput TypeScript interface marks type as non-optional, but that does NOT translate into an actual validation in any layer — it's a type promise the code doesn't keep. If your integration depends on every return having a type, send it explicitly; don't assume a default.
Overall condition of the merchandise (see catalog in the receive section).
inspectionNotesstring
Notes from the merchandise inspection.
rejectionReasonstring
Rejection reason, if applicable.
skipMerchandiseReturnboolean
Whether the physical return of the merchandise is skipped (e.g. refund without return).
inventoryDispositionobject
What to do with the returned inventory.
inventoryDisposition.locationIdstringrequired
Location where the returned merchandise is placed.
inventoryDisposition.locationNamestring
Location name, for display.
inventoryDisposition.placeTypeenumrequired
Destination of the merchandise. One of: available, reconditioning, damaged, shrinkage.
inventoryDisposition.placeCodestring
Internal code of the destination location, if applicable.
inventoryDisposition.costImpactnumber
Cost impact of this disposition (e.g. shrinkage value), if known.
inventoryDisposition.currencystring
3-letter currency for costImpact (e.g. MXN).
refundobject
Associated refund data.
refund.amountnumberrequired
Amount refunded (> 0).
refund.currencystringrequired
3-letter currency (e.g. MXN).
refund.methodenumrequired
Refund method. One of: original-payment, store-credit, bank-transfer.
refund.statusenumrequired
Refund status. One of: pending, processing, completed, failed.
refund.transactionIdstring
Transaction ID of the payment method, if applicable.
shipmentInfoobject
Return shipment information.
shipmentInfo.trackingNumberstring
Tracking number of the return shipment.
shipmentInfo.carrierstring
Carrier code. Accepted values: fedex, dhl, ups, estafeta, redpack, 99minutos, other. If your carrier is not on the list, send `other` and put its name in `carrierName`. Do not send `manual`, `automatic`, `automatica` or similar: those are capture modes —how the label was obtained—, not carriers, and the API rejects them.
shipmentInfo.customCarrierNamestring
Carrier name when carrier is a generic value like 'other'.
shipmentInfo.trackingUrlstring
Tracking URL, for carriers without a direct integration.
shipmentInfo.waybillIdstring
Waybill ID.
shipmentInfo.labelUrlstring
URL of the PDF label.
shipmentInfo.shippedAtstring
Shipment date (ISO 8601).
shipmentInfo.receivedAtstring
Receipt date (ISO 8601).
shipmentInfo.costobject
Cost of the return shipment.
shipmentInfo.cost.labelCostnumberrequired
Cost of the label (≥ 0).
shipmentInfo.cost.feniciaFeenumber
Fenicia's fee on the shipment, if applicable.
shipmentInfo.cost.paidByenumrequired
Who pays for the shipment. One of: customer, seller, platform.
Returns the full return exactly as it was before the approval, with status updated to return-approved and approvedAt added — not just the ID and status — wrapped in data.
curl -X POST https://api.fenicia.io/orders/65f3a1b2c4d5e6f7a8b9c0d1/returns/65f3a1b2c4d5e6f7a8b9c0e0/reject \ -H "Authorization: Bearer fkapi_your_api_key" \ -H "Content-Type: application/json" \ -d '{"reason":"Fuera de la ventana de devoluciones"}'
Returns the full return exactly as it was before the rejection, with status updated to return-rejected, plus rejectedAt and rejectionReason — not just the ID and status — wrapped in data.
Returns the full return exactly as it was before the shipment, with status updated to return-shipped, plus shippedAt and shipmentInfo (merged with whatever already existed) — not just those loose fields — wrapped in data.
Carrier code. Accepted values: fedex, dhl, ups, estafeta, redpack, 99minutos, other. If your carrier is not on the list, send `other` and put its name in `carrierName`. Do not send `manual`, `automatic`, `automatica` or similar: those are capture modes —how the label was obtained—, not carriers, and the API rejects them.
waybillIdstring
Waybill ID.
labelUrlstring
URL of the PDF label.
costobject
Cost of the return shipment.
cost.labelCostnumberrequired
Cost of the label (≥ 0).
cost.feniciaFeenumber
Fenicia's fee on the shipment, if applicable (≥ 0).
cost.paidByenumrequired
Who pays for the shipment. One of: customer, seller — unlike PUT /orders/{orderId}/returns/{returnId}, the platform value does NOT exist here.
cost.currencystringrequired
3-letter currency (e.g. MXN).
originobject
Origin address of the return shipment. All fields are optional (normalization happens downstream); the schema is strict — an unknown key is rejected.
origin._idstring
ID of the saved address, if applicable.
origin.streetstring
Street.
origin.exteriorNumberstring
Exterior number.
origin.interiorNumberstring
Interior number.
origin.neighborhoodstring
Neighborhood.
origin.addressLine1string
Address line 1, for addresses that don't use the street/number breakdown.
origin.addressLine2string
Address line 2.
origin.citystring
City.
origin.statestring
State.
origin.provincestring
Province, for addresses outside Mexico.
origin.provinceCodestring
Province code.
origin.zipCodestring
ZIP/postal code.
origin.countryCodestring
Country code (ISO).
origin.countryNamestring
Country name.
origin.countrystring
Country, free-form (alternative to countryCode/countryName).
origin.referencesstring
References to locate the address.
origin.namestring
Contact name at this address.
origin.companyNamestring
Company name, if applicable.
origin.phonestring
Contact phone.
origin.emailstring
Contact email.
destinationobject
Destination address of the return shipment. Same fields as origin — all optional, strict schema.
destination._idstring
ID of the saved address, if applicable.
destination.streetstring
Street.
destination.exteriorNumberstring
Exterior number.
destination.interiorNumberstring
Interior number.
destination.neighborhoodstring
Neighborhood.
destination.addressLine1string
Address line 1, for addresses that don't use the street/number breakdown.
destination.addressLine2string
Address line 2.
destination.citystring
City.
destination.statestring
State.
destination.provincestring
Province, for addresses outside Mexico.
destination.provinceCodestring
Province code.
destination.zipCodestring
ZIP/postal code.
destination.countryCodestring
Country code (ISO).
destination.countryNamestring
Country name.
destination.countrystring
Country, free-form (alternative to countryCode/countryName).
Returns the return's ID, its new status, and the registered overall condition (overallCondition), wrapped in data. The status is NOT always inspecting: receiveReturn only produces inspecting when condition is exactly pending-inspection; with any other catalog value (like-new, used-acceptable, damaged, etc.) the return moves straight to refund-pending, because the condition was already assessed in this same call.
The status depends on condition
receiveReturn (Lib/Services/Orders/src/returns/shipment-return.ts) computes newStatus = condition === "pending-inspection" ? "inspecting" : "refund-pending". Send condition: "pending-inspection" if you haven't assessed the merchandise yet and want it queued for inspection; send any other catalog value if you already assessed it on receipt, and the return will skip straight to awaiting refund.
Condition of the merchandise received. One of: unopened, like-new, used-acceptable, used-poor, damaged, defective, pending-inspection. Hyphenated. Note: new, used, and unusable do NOT exist in this catalog.
Returns the return with the processed refund data in data.refund (amount, currency, method, status: "processing", transactionId if sent), wrapped in data. data.status does NOT change to refunded — it stays exactly as it was before the call (see the notice below).
This endpoint never leaves the return at refunded
The body is .strict() (refundInputSchema: only accepts amount, currency, method, transactionId — no status). The handler (process-refund.ts) always builds the refund with status: "processing" before calling the library, and processRefund (refund.ts) only moves the return to refunded when it receives refundData.status === "completed" — a condition this endpoint never meets. In practice: the refund gets recorded (amount, currency, method, transactionId), but the return's status stays exactly as it was before the call.
We did not find, in this audit, a dedicated endpoint that automatically closes the return to refunded. The only verified path in the code is PUT /orders/{orderId}/returns/{returnId} with {"status": "refunded"} in the body — that validator does accept an explicit status — but that's a manual update, not an automatic consequence of processing the refund.
Refund method. Exactly one of: original-payment, store-credit, bank-transfer. Hyphenated — there is no generic fourth value; original_payment (underscore) fails validation.
transactionIdstring
Transaction ID of the payment method, if applicable.