Skip to content

Raise a Return

Raise a new return (RMA) request for one item of one of the customer's orders. The item must be return-eligible — check it with GET /api/shop/returnable-items first. The requested quantity (rma_qty) is capped server-side by the quantity the customer is actually allowed to return. The return starts in a Pending status.

Endpoint

POST /api/shop/returns

Authentication

This endpoint requires an authenticated customer — send the storefront key and a customer Bearer token. See the Authentication page.

Request Headers

HeaderRequiredDescription
Content-TypeYesapplication/json
X-STOREFRONT-KEYYesYour storefront API key
AuthorizationYesBearer token (customer login required)

Request Body

json
{
  "order_id": 45,
  "order_item_id": 78,
  "rma_qty": 1,
  "resolution_type": "return",
  "rma_reason_id": 2,
  "information": "Item arrived damaged.",
  "package_condition": "opened",
  "agreement": true
}

Request Parameters

ParameterTypeRequiredDescription
order_idintegerYesId of the order the item belongs to.
order_item_idintegerYesId of the order item being returned — from returnable-items.
rma_qtyintegerYesQuantity to return. Capped server-side by the returnable quantity.
resolution_typestringYesreturn or cancel_items.
rma_reason_idintegerYesId of the chosen return reason — from return-reasons.
informationstringNoFree-text note about the return.
package_conditionstringNoReported package condition, e.g. opened.
agreementbooleanYesMust be true to confirm the return terms.

Image attachments

Optional image files can be attached to the return by sending the request as multipart/form-data with an images[] field alongside the fields above.

Response Fields (201 Created)

FieldTypeDescription
idintegerReturn ID.
orderIdintegerId of the order the item belongs to.
orderIncrementIdstringHuman-readable order number.
statusIdintegerNumeric status id — 1 (Pending) for a fresh return.
statusTitlestringStatus label.
statusColorstringHex color for the status badge.
packageConditionstringReported package condition.
informationstringThe note supplied when raising the return.
canClosebooleanWhether the return can be closed.
canReopenbooleanWhether the return can be reopened.
isExpiredbooleanWhether the return is past its action window.
itemobjectThe returned item — id, order_item_id, sku, name, quantity, resolution, reason_id, reason, variant_id.
imagesarrayAttached images (id, path, url). Empty when no files were sent.
messagesCountintegerNumber of conversation messages — 0 for a fresh return.
createdAtstringISO 8601 creation timestamp.
updatedAtstringISO 8601 last update timestamp.

Status Codes

StatusMeaning
201 CreatedReturn raised; status is Pending.
400 Bad RequestItem not eligible, invalid quantity, or agreement not true.
401 UnauthorizedMissing or invalid customer Bearer token.
403 ForbiddenMissing or invalid storefront key.
404 Not FoundThe order does not exist or is not the customer's.

Released under the MIT License.