Cancel customer order for WFS item
Market availability: US only
Call this endpoint to cancel a previously created Walmart Fulfillment Services (WFS) fulfilled customer order for your Walmart Multichannel solutions (MCS) channels. Use this API before fulfillment progresses, for instance before a line ships. If a line is already shipped or is in a non-reversible state it cannot be cancelled.
This page describes an example using only the required parameters and inputs to cancel a customer order for WFS item. 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/orders-fulfillments/cancelSample request
Use this sample to request cancellation of one or more unshipped lines on a previously created WFS fulfilled MCS order.
curl --request POST \ --url https://marketplace.walmartapis.com/v3/fulfillment/orders-fulfillments/cancel \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'WM_SEC.ACCESS_TOKEN: <access_token>' \ --header 'WM_QOS.CORRELATION_ID: <uuid>' \ --header 'WM_SVC.NAME: Walmart Marketplace' \ --data '
{ "header": { "headerAttributes": { "buId": "0", "martId": "202" } }, "payload": { "customerOrderNo": "sellername001ABC123", "orderItems": [ { "sellerLineId": "1232456", "qty": { "unitOfMeasure": "EACH", "measurementValue": 2 } } ] }
}
'import requests url = "https://marketplace.walmartapis.com/v3/fulfillment/orders-fulfillments/cancel" headers = { "Accept": "application/json", "Content-Type": "application/json", "WM_SEC.ACCESS_TOKEN": "<access_token>", "WM_QOS.CORRELATION_ID": "<uuid>", "WM_SVC.NAME": "Walmart Marketplace",
} json_data = { "header": { "headerAttributes": { "buId": "0", "martId": "202" } }, "payload": { "customerOrderNo": "sellername001ABC123", "orderItems": [ { "sellerLineId": "1232456", "qty": { "unitOfMeasure": "EACH", "measurementValue": 2 } } ] }
} 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_IDfor each request. - Replace
WM_SEC.ACCESS_TOKENwith your valid access token obtained through authentication. - Supply your
customerOrderNoand theorderItemsto cancel; lines already shipped or locked cannot be canceled.
Sample response
The API returns a successful response when the order is successfully cancelled.
{ "status": "ACCEPTED", "header": { "headerAttributes": { "buId": "0", "martId": "202" } }, "payload": { "requestId": "594ef12e-0d0f-402d-aab9-3f7ca06b0ed7" }
}If the request fails, the API responds as follows.
{ “status”: “FAIL”, “errors”: [ { “code”: “404.WSAAS.100", “description”: “Data not found in WSAAS”, “info”: “requested order not found”, “severity”: “ERROR”, “category”: “REQUEST” } ] }Result
The specified eligible lines are cancelled and any reserved inventory is released back to WFS. Partial cancellations are possible, cancellable lines are cancelled and in-flight or shipped lines remain the same. For the cancelled lines, now new shipments are created and existing shipments that are already in progress are unaffected.
The Walmart Multichannel Solution is an extension of Walmart Fulfillment Services (WFS), uniquely placed to ensure quality, scale, and efficiency for a seller to grow a successful business. Walmart centralizes and manages the entire assortment of inventory, supply chain management, and fulfillment capabilities, while sellers can list and sell their items on multiple online platforms and storefronts.
Sellers specifically onboarded on Walmart Multichannel Solution can use this API to cancel customer orders that were earlier placed.
The following is a sample successful response provided by the API on the successful creation of an order.
{ “status”: “ACCEPTED”, “payload”: { “requestId”: “1c1804ca-37d0-4084-8668-734f4369e3e3” } }The following is a sample response provided by the API on Failures.
{ “status”: “FAIL”, “errors”: [ { “code”: “404.WSAAS.100", “description”: “Data not found in WSAAS”, “info”: “requested order not found”, “severity”: “ERROR”, “category”: “REQUEST” } ] }Updated 3 months ago

