Developer Guide
Order Return
An order or portion of an order is eligible for return only if it has been fulfilled and the items to be returned have not previously been returned. Even if it meets these conditions, the order may not be returnable, or individual items may not be returnable if an item’s eligible
property is set to false
in check order return eligibility API response, or if fabric OMS determines an item cannot be returned.
General Rules:
- Return for an item is identified by the
exchange
boolean (exchange
is set tofalse
) field on the return payload. - Return for an order is validated for eligibility based on the orderId and lineItemId.
- Charged amount in the payments object of the order document should not be null to process the refund.
- Use
POST/api/v2/order/return
endpoint to initiate order-return. - Order status should be one of:
ORDER_DELIVERED
,ORDER_SHIPPED
,ORDER_PARTIALLY_SHIPPED
,ORDER_PARTIALLY_DELIVERED
,ORDER_PARTIALLY_RETURNED
,
ORDER_PARTIALLY_CANCELLED
,PICKUP_COMPLETE
. - lineOrderStatus should be one of:
PENDING_EXCHANGE
,RETURN_PROCESSING
,PARTIALLY_CANCELLED
,PARTIALLY_REFUNDED
,PARTIALLY_CANCELLED_REFUNDED
,VALID
,PENDING_RETURN
,ORDER_LINE_VALID
,SHIPPED
,PARTIALLY_SHIPPED
,PARTIALLY_ALLOCATED
,DELIVERED
,PARTIALLY_DELIVERED
,PARTIAL_RETURN
.
Return Workflow
Create return when an item is pending to be received at the distribution center
- When a shopper or a customer service agent creates a return request, but the item is not received at the distribution center: Set
returnType
toPENDING
in the request payload while calling POST/api/v2/order/return to create a return. lineOrderStatus
will be updated toRETURN_PENDING
for the line item of an order ID. You can get the order details, along with the order status, by calling the GET/api/v2/order endpoint.RETURN_PENDING
webhook event is triggered if the merchant has subscribed to the event. The target URL of the subscription payload is notified.
sample curl
Item reaches distribution center and is processed for return or reject
- When an item reaches the distribution center, use POST/api/v2/order/return endpoint to set
returnType
toPROCESSING
in the request payload. lineOrderStatus
will be updated toRETURN_PROCESSING
for the line item of the order ID. You can get the order details, along with the order status, by calling the GET/api/v2/order endpoint.- At this stage, the customer service agent at the warehouse or the distribution center does the quality checks such as, if the item is in good condition to return if the item matches the original order, etc. After a thorough inspection, the CSR can accept or reject the return request.
RETURN_PROCESSING
webhook event is triggered if the merchant has subscribed to the event. The target URL of the subscription payload is notified about the event.
sample curl:
- If customer service agents reject the return request for any reason, they must use POST/api/v2/order/return endpoint to set
returnType
toREJECTED
. - Provide proper reason and sub-reasons for rejecting the return request.
lineOrderStatus
is updated toRETURN_REJECTED
for the line item of the order ID. You can get the order details, along with the order status, by calling the GET/api/v2/order endpoint.RETURN_REJECTED
webhook event is triggered if the merchant has subscribed to the event. The target URL will be notified of the event.
sample curl:
Create a return when an item is received or accepted for return
- Use POST/api/v2/order/return endpoint, and set
returnType
toreceived
. - The amount received for return will be validated based on the invoiced amount for the item. If validation fails for any reason, an error message will be returned.
- If a refund for returned item is successful, the response for the order return endpoint (POST/api/v2/order/return) will display
refundStatus
asSUCCESSFUL
. - If all the quantity of line items are returned:
lineOrderStatus
(return status at item level) will be updated toRETURNED
.statusCode
(return status at order level) will be updated toORDER_RETURNED
.
- If some of the quantities of line items are returned:
lineOrderStatus
(return status at item level) will be updated toPARTIALLY_RETURNED
.statusCode
(return status at order level) will be updated toORDER_PARTIALLY_RETURNED
.
- If the refund failed for any reason, the response for the order return endpoint (POST/api/v2/order/return) will display
refundStatus
asREFUND_FAILED
. RETURN_NOTIFICATION_EMAIL
andREFUND_NOTIFICATION_EMAIL
webhook events are triggered if the merchant has subscribed to the events, and details are sent to the merchant.
sample curl:
Was this page helpful?