Cancel return order
Call this endpoint to cancel a Walmart Multichannel Solutions (MCS) customer return order that hasn't been received or finalized yet and to cancel previously placed return orders. You can use this API when a return was created in error of if the customer keeps the item.
This page describes an example using only the required parameters and inputs to cancel a return order. For a full list of customization options and additional capabilities, refer to the Marketplace WFS Multichannel solutions API Reference.
Endpoint
POST https://marketplace.walmartapis.com/v3/fulfillment/return-orders/{orderId}/cancel
Sample request
curl --request POST \ --url 'https://marketplace.walmartapis.com/v3/fulfillment/return-orders/330044524157165704/cancel' \ --header 'accept: application/json' \ --header 'content-type: application/json' \ --header 'WM_SEC.ACCESS_TOKEN: <your_oauth_access_token>' \ --header 'WM_SVC.NAME: Walmart Marketplace' \ --header 'WM_QOS.CORRELATION_ID: <uuid-for-this-call>' \ --data '{ "header": { "headerAttributes": { "buId": "0", "martId": "202" } }, "payload": {} }'
import requests url = "https://marketplace.walmartapis.com/v3/fulfillment/return-orders/330044524157165704/cancel" headers = { "Accept": "application/json", "Content-Type": "application/json", "WM_SEC.ACCESS_TOKEN": "<your_oauth_access_token>", "WM_SVC.NAME": "Walmart Marketplace", "WM_QOS.CORRELATION_ID": "<uuid-for-this-call>",
} json_data = { "header": { "headerAttributes": { "buId": "0", "martId": "202" } }, "payload": {}
} response = requests.post(url, headers=headers, json=json_data)
print(response.status_code)
print(response.text)
Modify your code
- Use a unique
WM_QOS.CORRELATION_ID
for each request. - Replace
WM_SEC.ACCESS_TOKEN
with your valid access token obtained through authentication. - Replace 330044524157165704 with the
returnOrderId
you want to cancel.
Sample response
The API returns a successful response on the successful cancellation of a return order.
{ "status": "CANCELLED", "headers": { "headerAttributes": { "buId": "0", "martId": "0" } } }
Result
On success, the return is cancelled and the response includes the updated status (CANCELLED).
Updated 15 days ago