Merchant API: returns
About this article
This article explains how to manage returns via the Merchant API v2 endpoints: retrieve returns, create returns, acknowledge returns, and mark them as received.
Table of contents
Return fields, statuses, and reasons
Retrieve the returns of one order
Introduction
/v2/returns endpoints. Do not use the /v2.1/returns or /v2.1/refundsendpoints unless you were accepted into the beta testing program.
When a customer sends a product back to your warehouse, both you and the marketplace need to know about it to process the return in the back-end systems and issue the appropriate refund to the customer.
The Merchant API returns endpoints allow your system to fetch returns registered on the marketplace, confirm that a return is received in your system, and create returns that you handle directly with the customer.
The Merchant API v2 endpoints handle three types of returns:
- Marketplace returns: the customer registers the return on the marketplace, e.g.: via the marketplace's customer service or website. ChannelEngine imports the return into your tenant. You fetch it, acknowledge it, and report what you accepted or rejected.
- Merchant returns: the customer sends the order back to you directly, e.g.: via your customer service. You handle the return in your own system and register it on ChannelEngine. ChannelEngine exports the return to the marketplace.
- Marketplace-fulfilled returns: the marketplace registers and handles the return of an order it also fulfilled. You usually retrieve these for reporting and reconciliation purposes.
/v2/returns endpoints. With these endpoints, a physical return is always required to issue a refund, and the refund is based on the product quantities in the related order. The /v2.1/returns endpoints treat returns and refunds as two separate processes, which gives you more flexibility, e.g.: to refund without a return. The /v2.1/returns endpoints are in closed beta. To join the beta program, contact your customer success manager or ChannelEngine's Support team. See Merchant API: returns and refunds v2.1 [beta].
Overview
Refer to the flowchart below to visualize how a return travels between the marketplace, ChannelEngine, and your system.
Requirements
- Your tenant URL. The base URL is
https://{tenant}.channelengine.net/api. - A Merchant API key. Send it in the
X-CE-KEYheader. Find your Merchant API key at Settings, Merchant API keys on ChannelEngine. - Shipped orders on ChannelEngine. A return always belongs to an order that was already shipped.
- To create a merchant return, you need the
MerchantOrderNo(your own unique order reference).
Available API endpoints
Which endpoints you use depends on who handles the return. For marketplace returns, use the retrieve, acknowledge, and mark-as-received endpoints.
For merchant returns, use the create endpoint.
-
Create a merchant return:
POST /v2/returns/merchant
Use this endpoint to tell ChannelEngine that a customer returned an order to you, in full or in part. -
Retrieve all returns:
GET /v2/returns
Use this endpoint to retrieve every type of return (merchant, marketplace, mixed, and marketplace-fulfilled), filtered by channel, status, reason, date, or order number. -
Retrieve marketplace returns:
GET /v2/returns/merchant
Use this endpoint to retrieve only the returns a marketplace created, including returns for marketplace-fulfilled orders. -
Retrieve unhandled returns:
GET /v2/returns/merchant/new
Use this endpoint to retrieve marketplace returns with the statusIN_PROGRESSthat you have not handled yet. -
Retrieve the returns of one order:
GET /v2/returns/merchant/{merchantOrderNo}
Use this endpoint to check whether one specific order has been returned. -
Acknowledge a return:
POST /v2/returns/merchant/acknowledge
Use this endpoint to confirm that a return is registered in your system and to link it to your own return number. -
Mark a return as received:
PUT /v2/returns
Use this endpoint to report how many items of a marketplace return you accepted and rejected. Accepted items are refunded. -
Report a failed export:
POST /v2/returns/mark-export-as-failed
Use this endpoint to trigger a notification in ChannelEngine's notification center, alerting all users in your tenant that a given return could not be exported to your merchant system.
Return fields, statuses, and reasons
Return fields
These are the main fields you see when you retrieve returns.
Top-level fields in the response to GET /v2/returns
| Field | Type | Description |
Id |
integer | The unique return reference used by ChannelEngine. You need it to acknowledge a return, mark it as received, or report a failed export. |
MerchantOrderNo |
string | Your unique order reference. |
ChannelOrderNo |
string | The unique order reference used by the marketplace. |
MerchantReturnNo |
string | Your unique return reference. Empty for a marketplace return that you have not acknowledged yet. |
ChannelReturnNo |
string | The unique return reference used by the marketplace. Empty for a merchant return. |
ChannelId, ChannelName
|
integer, string | The marketplace the return belongs to. GlobalChannelId and GlobalChannelName identify the global channel. |
Status |
string | The status of the return. See Statuses. |
Reason |
string | The reason code of the return. See Reasons. |
CustomerComment, MerchantComment
|
string | Optional comments from the customer and from you. Maximum 4001 characters each. |
RefundInclVat, RefundExclVat
|
decimal | The refund amount including and excluding VAT. For information only. ChannelEngine does not use these values to calculate the refund. |
TrackTraceNo |
string | The tracking number of the return. |
AcknowledgedDate |
date-time | When you acknowledged the return. |
ReturnDate |
date-time | When the return was created in the source system, if available. |
CreatedAt, UpdatedAt
|
date-time | When the return was created and last updated on ChannelEngine. |
ExtraData |
object | Extra key-value pairs on the return. Each key must be unique. |
Lines |
array | The returned products. See Return line fields. |
Return line fields
The following fields appear in the response with each return line.
Return line response fields
| Field | Type | Description |
MerchantProductNo |
string | Your unique product reference (SKU). |
Quantity |
integer | The number of units of this product in the return. |
AcceptedQuantity |
integer | The number of returned units you marked as accepted. |
RejectedQuantity |
integer | The number of returned units you marked as rejected. |
OrderLine |
object | The order line the returned product belongs to. |
ShipmentStatus |
string | The shipment status of the product: SHIPPED, IN_BACKORDER, or MANCO. |
StockLocation |
object | The stock location of the return line (Id and Name). |
ExtraData |
object | Extra key-value pairs on the return line. Each key must be unique. |
Statuses
A return has one of the below statuses. Use them in the Statuses filter.
Return status parameters
| Status | Meaning |
IN_PROGRESS |
A marketplace return that you still need to process. GET /v2/returns/merchant/new returns exactly these. |
RECEIVED |
The return has been processed: each line has an accepted or rejected quantity. Merchant returns you create with POST /v2/returns/merchant get this status right away. |
CANCELLED |
The marketplace cancelled the return before it was received. |
A return moves from IN_PROGRESS to RECEIVED when you mark it as received. A received or cancelled return cannot be changed anymore.
Reasons
Use these values for Reason when you create a return, and in the Reasons filter when you retrieve returns.
Return reason parameters
| Reason | Meaning |
PRODUCT_DEFECT |
The product is defective. |
PRODUCT_UNSATISFACTORY |
The customer is not satisfied with the product. |
WRONG_PRODUCT |
The customer received the wrong product. |
TOO_MANY_PRODUCTS |
The customer received too many products. |
REFUSED |
The customer refused the delivery. |
REFUSED_DAMAGED |
The customer refused the delivery because the product was damaged. |
WRONG_ADDRESS |
The parcel could not be delivered because the address was incorrect. |
NOT_COLLECTED |
The customer did not collect the parcel. |
WRONG_SIZE |
The product has the wrong size. |
OTHER |
Any other reason. |
Create a merchant return
Use POST /v2/returns/merchant for merchant returns, i.e.: when a customer reports the return directly with you and you handle the return yourself.
Registering a return on ChannelEngine marks the order as fully or partially returned. The endpoint responds with HTTP 201 when it creates the return with the status RECEIVED. Once ChannelEngine exports the return to the marketplace, the marketplace calculates the refund, typically based on the quantity and price of returned products.
Request fields
Top-level request fields
| Field | Type | Description |
MerchantOrderNo (required) |
string | Your unique order reference. Maximum 50 characters. |
MerchantReturnNo (required) |
string | Your unique return reference. Maximum 50 characters. |
Lines (required) |
array | The returned products. See the line fields below. |
Reason |
string | The reason for the return. See Reasons. |
TrackTraceNo |
string | The tracking number of the return. Maximum 50 characters. |
CustomerComment, MerchantComment
|
string | Optional comments. Maximum 4001 characters each. |
RefundInclVat, RefundExclVat
|
decimal | Optional. The refund amount including and excluding VAT. For information only. ChannelEngine does not use these values to calculate the refund. |
ReturnDate |
date-time | When the customer created the return, if you know it. |
ExtraData |
object | Extra key-value pairs. Each key must be unique. |
Line-level request fields
| Line field | Type | Description |
MerchantProductNo (required) |
string | Your unique product reference (SKU). Maximum 64 characters. |
Quantity (required) |
integer | The number of items of this product that were returned. |
OrderLineId |
integer | The order line the product belongs to. Useful when the same product appears on more than one line of the order. |
ExtraData |
object | Extra key-value pairs on the line. |
Partial returns
If the marketplace supports it, you can return part of an order and create several returns for the same order.
Creating a partial return on a marketplace that only supports full returns results in a full return.
How to create a merchant return
- Collect the order number, a unique return number from your own system, and the SKU and quantity of each returned product.
- Send the request to
POST /v2/returns/merchantwith a JSON body and your key in theX-CE-KEYheader. - You receive HTTP 201 with
Success: true. - Optionally, check the result with
GET /v2/returns/merchant/{merchantOrderNo}. The return appears on the order.
curl -X POST "https://{tenant}.channelengine.net/api/v2/returns/merchant" \
-H "Content-Type: application/json" \
-H "X-CE-KEY: your-merchant-api-key" \
-d '{
"MerchantOrderNo": "ORDER-10001",
"MerchantReturnNo": "RMA-5001",
"Reason": "PRODUCT_DEFECT",
"TrackTraceNo": "3SABCD123456789",
"MerchantComment": "Zipper broken",
"Lines": [
{ "MerchantProductNo": "SKU-001", "Quantity": 1 }
]
}'You receive HTTP 404 if the order does not exist, and HTTP 409 if the return cannot be created, e.g.: because it conflicts with an existing return. Check Message in the response for details.
Retrieve all returns
GET /v2/returns is the one endpoint that returns every type of return: merchant, marketplace, mixed, and marketplace-fulfilled. Use it for reporting, for reconciling your system with ChannelEngine, or to look up returns by order number. The endpoint responds with HTTP 200 and a list of returns.
Filters
All filters are optional and go in the query string. Combine them to narrow the results.
Filters for GET /v2/returns
| Parameter | Description |
CreatorType |
Who created the return: ONLY_FROM_MERCHANT, ONLY_FROM_CHANNEL, or MIXED. The default is MIXED. |
ChannelIds |
One or more channel IDs. |
MerchantOrderNos |
One or more of your order numbers. |
ChannelOrderNos |
One or more marketplace order numbers. |
FulfillmentType |
Who fulfilled the order: ALL, ONLY_MERCHANT, ONLY_CHANNEL, MIXED, INCLUDES_MERCHANT, or INCLUDES_CHANNEL. |
Statuses |
One or more return statuses. See Statuses. |
Reasons |
One or more return reasons. See Reasons. |
FromDate, ToDate
|
Only returns created in this period. |
FromUpdateDate, ToUpdateDate
|
Only returns last updated in this period. |
IsAcknowledged |
true for acknowledged returns, false for returns you have not acknowledged yet. |
Page |
The page number, when the result has more than one page. |
How to retrieve returns with filters
- Send the request to
GET /v2/returnswith your key in theX-CE-KEYheader. Add the filters you need to the query string. - You receive HTTP 200 with
Success: true. - Read the returns in
Content. IfTotalCountis higher thanCount, request the next page withPage. If nothing matches your filters,Contentis empty.
curl -X GET "https://{tenant}.channelengine.net/api/v2/returns?CreatorType=ONLY_FROM_CHANNEL&IsAcknowledged=false&Page=1" \
-H "Accept: application/json" \
-H "X-CE-KEY: your-merchant-api-key"Example response:
{
"Content": [
{
"Id": 1042,
"MerchantOrderNo": "ORDER-10001",
"ChannelOrderNo": "303-1234567-7654321",
"ChannelName": "Amazon NL",
"ChannelId": 12,
"ChannelReturnNo": "RET-998877",
"MerchantReturnNo": null,
"Status": "IN_PROGRESS",
"Reason": "WRONG_SIZE",
"RefundInclVat": 49.95,
"RefundExclVat": 41.28,
"Lines": [
{
"MerchantProductNo": "SKU-001",
"Quantity": 1,
"AcceptedQuantity": 0,
"RejectedQuantity": 0
}
]
}
],
"Count": 1,
"TotalCount": 1,
"ItemsPerPage": 100,
"StatusCode": 200,
"Success": true
}Retrieve marketplace returns
Use GET /v2/returns/merchant when you only want the returns that a marketplace created, not the ones you registered yourself. This also includes returns for marketplace-fulfilled orders. To include the returns you created yourself, use GET /v2/returns instead.
The endpoint accepts the same filters as GET /v2/returns, except CreatorType. To retrieve only marketplace-fulfilled returns, e.g.: for reconciliation, filter on FulfillmentType=ONLY_CHANNEL.
curl -X GET "https://{tenant}.channelengine.net/api/v2/returns/merchant?Statuses=IN_PROGRESS&ChannelIds=12" \
-H "Accept: application/json" \
-H "X-CE-KEY: your-merchant-api-key"Retrieve unhandled returns
GET /v2/returns/merchant/new returns all marketplace returns with the status IN_PROGRESS, so your system can pick up new returns without any filtering of its own. Run it on a schedule. Filter on ChannelIds and use Page to move through the results.
- Send the request to
GET /v2/returns/merchant/new. - You receive HTTP 200 with the returns that still need handling.
- Import each return into your system and save its
Id. - Acknowledge each return with
POST /v2/returns/merchant/acknowledge, or report a problem withPOST /v2/returns/mark-export-as-failed.
curl -X GET "https://{tenant}.channelengine.net/api/v2/returns/merchant/new?Page=1" \
-H "Accept: application/json" \
-H "X-CE-KEY: your-merchant-api-key"Retrieve the returns of one order
Use GET /v2/returns/merchant/{merchantOrderNo} when a customer asks about an order, or when your system needs to check an order before it refunds or restocks. Pass your order reference in the path and you get every return for that order. Each item also contains Method and TrackTraceUrl next to the fields in Return fields. If the order has no returns, Content is empty.
curl -X GET "https://{tenant}.channelengine.net/api/v2/returns/merchant/ORDER-10001" \
-H "Accept: application/json" \
-H "X-CE-KEY: your-merchant-api-key"Acknowledge a return
Use POST /v2/returns/merchant/acknowledge to tell ChannelEngine that you registered a marketplace return in your system. Acknowledging links the ChannelEngine return to your own MerchantReturnNo, so you can reference the same return in later API calls and in your internal processes (refund, repair, exchange). Afterwards, you can filter on IsAcknowledged to see which returns you have not processed yet. This stops your integration from importing the same return twice.
Fields required to acknowledge a return
| Field | Type | Description |
ReturnId (required) |
integer | The ChannelEngine Id of the return. |
MerchantReturnNo (required) |
string | Your own return reference for this return. |
How to acknowledge a return
- Retrieve unacknowledged returns, e.g.: with
GET /v2/returns/merchant?Statuses=IN_PROGRESS&IsAcknowledged=false&FromDate=.... For marketplace-fulfilled returns, filter onFulfillmentType=ONLY_CHANNEL&IsAcknowledged=false. - Import the return into your system and note the return number your system gives it.
- Send the request to
POST /v2/returns/merchant/acknowledgewith theReturnIdand yourMerchantReturnNo. - You receive HTTP 200 with
Success: true. - Check the result with
GET /v2/returns?IsAcknowledged=true. The return shows anAcknowledgedDateand yourMerchantReturnNo.
curl -X POST "https://{tenant}.channelengine.net/api/v2/returns/merchant/acknowledge" \
-H "Content-Type: application/json" \
-H "X-CE-KEY: your-merchant-api-key" \
-d '{
"ReturnId": 1042,
"MerchantReturnNo": "RMA-5001"
}'You receive HTTP 200 if the return is successfully acknowledged, HTTP 404 if the return does not exist, and HTTP 409 if the return cannot be acknowledged.
Mark a return as received
Once a marketplace return arrives at your warehouse and you have checked it, use PUT /v2/returns to report, per product, how many returned items you accept and how many you reject. This marks the return as fully or partially received. The customer gets a refund based on the accepted quantity.
| Field | Type | Description |
ReturnId (required) |
integer | The ChannelEngine Id of the return. |
Lines (required) |
array | One item per returned product. |
Lines[].MerchantProductNo (required) |
string | Your unique product reference (SKU). Maximum 64 characters. |
Lines[].AcceptedQuantity (required) |
integer | The number of items you accept. A refund is triggered for these items. |
Lines[].RejectedQuantity (required) |
integer | The number of items you reject. No refund is triggered for these items. |
- Inspect the returned items and decide, per product, how many you accept and how many you reject.
- Send the request to
PUT /v2/returnswith theReturnIdand one line per product. - You receive HTTP 200 with
Success: true. - Check the result with
GET /v2/returns. The lines show yourAcceptedQuantityandRejectedQuantity.
curl -X PUT "https://{tenant}.channelengine.net/api/v2/returns" \
-H "Content-Type: application/json" \
-H "X-CE-KEY: your-merchant-api-key" \
-d '{
"ReturnId": 1042,
"Lines": [
{ "MerchantProductNo": "SKU-001", "AcceptedQuantity": 1, "RejectedQuantity": 0 },
{ "MerchantProductNo": "SKU-002", "AcceptedQuantity": 1, "RejectedQuantity": 1 }
]
}'You receive HTTP 404 if the return does not exist, and HTTP 409 if the return was already received or cancelled.
Report a failed export
Use POST /v2/returns/mark-export-as-failed to trigger a notification in ChannelEngine's notification center, alerting all users in your tenant that a given return could not be exported to your merchant system, e.g.: because the order is unknown in your system or a product no longer exists. Provide a clear message. You can report several returns in one request. The endpoint responds with HTTP 201.
| Field | Type | Description |
IdentifierType |
string | The type of identifier you use. The only accepted value is RETURN_ID. |
Models |
array | One item for each failed return. |
Models[].Identifier (required) |
string | The identifier of the return. |
Models[].FailExportMessage (required) |
string | A message that explains why the export failed. Write a message your own team can act on, such as the order number and the cause. |
curl -X POST "https://{tenant}.channelengine.net/api/v2/returns/mark-export-as-failed" \
-H "Content-Type: application/json" \
-H "X-CE-KEY: your-merchant-api-key" \
-d '{
"IdentifierType": "RETURN_ID",
"Models": [
{ "Identifier": "1042", "FailExportMessage": "Order ORDER-10001 not found in our ERP" }
]
}'You receive HTTP 400 if a return cannot be found. Check the Id with GET /v2/returns.
Common workflows
Process marketplace returns
- Fetch the returns that need handling with
GET /v2/returns/merchant?Statuses=IN_PROGRESS&IsAcknowledged=false. - Import each return into your system.
- Acknowledge each with
POST /v2/returns/merchant/acknowledge, or report that the export failed withPOST /v2/returns/mark-export-as-failed. - Inspect the parcel when it arrives.
- Report the accepted (refunded) and rejected quantities with
PUT /v2/returns.
Register a return that you handle yourself
- The customer sends the order back to you, and you register the return in your own system.
- Send
POST /v2/returns/merchantwith the order number, your return number, and the returned lines. - Optionally, confirm the result with
GET /v2/returns/merchant/{merchantOrderNo}.
Find returns that you have not processed
Send GET /v2/returns?IsAcknowledged=false. Use this as a safety net next to your regular job, to catch any return that was missed. Use FromUpdateDate to ask only for returns that changed since your last run: store the time of each successful run and use it as the start of the next one.
Test returns
Test in your development environment before you go live. You can create test returns on the ChannelEngine web interface or via the Merchant API. For guidance, see ChannelEngine: how to create a test marketplace return and Merchant API: testing your integration.
Common issues
| What you see | Likely cause and fix |
HTTP 401 or Success: false
|
The API key is missing, wrong, or a Channel API key. Use a Merchant API key in the X-CE-KEY header. |
HTTP 400 with ValidationErrors
|
A field is missing or not valid. Check the required fields, the maximum lengths, and that Reason matches a value in Reasons. |
| HTTP 404 when creating a return | The order does not exist. Check MerchantOrderNo. |
| HTTP 404 when acknowledging, updating, or reporting | No return with this Id exists. Look it up with GET /v2/returns. |
| HTTP 409 when creating, acknowledging, or updating | The request conflicts with the current state of the return, e.g.: because the return was already received or cancelled. Read Message in the response and check the return with GET /v2/returns. |
GET /v2/returns/merchant/new returns nothing |
There are no marketplace returns with the status IN_PROGRESS. Use GET /v2/returns with a date filter to look further back. |
| The same return is imported twice | The return was not acknowledged. Acknowledge each return after you import it, and filter with IsAcknowledged=false. |
A return is missing from GET /v2/returns/merchant
|
Check your filters, especially Statuses and the date range. Merchant returns that you created yourself do not appear here. Use GET /v2/returns for all types. |
| A partial return was created as a full return | The marketplace does not support partial returns. |
Next steps
- Merchant API: orders: fetch, acknowledge, and ship the orders your returns belong to.
- Merchant API: notifications: see what happened when something fails.
- Merchant API: marketplace and merchant returns (flowchart): a visual overview of both return flows.
Comments
0 comments
Article is closed for comments.