Cancel order lines

Market availability: Global

Call this endpoint to cancel one or more order lines for a specific order. Use this action when you are unable to fulfill certain items or need to cancel an order partially or entirely. This endpoint updates the order line status to Cancelled and returns the updated order details.

Note:

  • Make sure you only cancel order lines that have not been shipped.
  • Orders fulfilled by Walmart Fulfillment Services (WFS) can't be cancelled using this endpoint. Use the Cancel customer order for WFS item endpoint instead.

Endpoint

POST https://marketplace.walmartapis.com/v3/orders/{purchaseOrderId}/cancel

Sample request

curl --request POST \ --url https://marketplace.walmartapis.com/v3/orders/purchaseOrderId/cancel \ --header 'WM_GLOBAL_VERSION: 3.1' \ --header 'WM_MARKET: us' \ --header 'accept: application/json' \ --header 'content-type: application/json' \ --data '
{ "orderCancellation": { "orderLines": { "orderLine": [ { "lineNumber": "string", "orderLineStatuses": { "orderLineStatus": [ { "status": "Cancelled", "statusCode": "CREATED", "cancellationReason": "string", "statusQuantity": { "unitOfMeasurement": "EACH", "amount": "string" } } ] }, "miscAttributes": { "miscAttribute": [ { "name": "PET_DETAILS", "details": { "detail": [ { "key": "PET_FIRST_NAME", "value": "string" } ] } } ] } } ] } }
}
'

Note: You can cancel specific order lines by specifying their orderLine. For a full order cancellation, include all order lines in the request.

Modify your code

  • Replace {purchaseOrderId} in the endpoint URL with the actual order ID you want to cancel.
  • Substitute <Base64EncodedClientID:ClientSecret> with your Base64-encoded credentials.
  • Update WM_QOS.CORRELATION_ID with a unique value for tracking your request.
  • Adjust the orderCancellation payload if you need to cancel additional order lines or specify a different cancellation reason.

Cancellation reason codes

To cancel an order line, you must include a valid cancellationReason value. The reason you choose helps Walmart understand why the item cannot be fulfilled and may affect future item visibility or fraud evaluation.

Refer to the Cancel order lines API reference for the full list.

cancellationReasonWhen to use it
CUSTOMER_REQUESTED_SELLER_TO_CANCELThe customer asked to cancel the item.
SELLER_CANCEL_OUT_OF_STOCKThe item is out of stock. Walmart may hide the item from listings until inventory is replenished.
SELLER_CANCEL_PRICING_ERRORThere’s a pricing error, such as a mismatch between the listed price and what was intended.
SELLER_CANCEL_ADDRESS_NOT_SERVICEABLEYou or your carrier can’t deliver to the customer’s address.
SELLER_CANCEL_FRAUD_STOP_SHIPMENTYou’ve confirmed the order is fraudulent. If you're unsure, contact the Walmart Risk Prevention team (refer to the API Reference).

Note: If the cancellation reason does not match the situation, Walmart may restrict or flag your listings.

Sample responses

application/json

200 - Sample 1-US

{ "order": { "purchaseOrderId": "109006246065915", "customerOrderId": "100000688573669", "customerEmailId": "[email protected]", "orderDate": 1740919275952, "shippingInfo": { "phone": "0000000000", "estimatedDeliveryDate": 1741219140000, "estimatedShipDate": 1740985200000, "methodCode": "Standard", "postalAddress": { "name": "Astro Teflon", "address1": "2476 Barlow Ave", "address2": null, "city": "San Jose", "state": "CA", "postalCode": "95122", "country": "USA", "addressType": "RESIDENTIAL" }, "carrierMethodName": null }, "orderLines": { "orderLine": [ { "lineNumber": "1", "item": { "productName": "Pre-Owned Gateway GWNC31514-BL 15.6\" FHD i3-1115G4 3GHz Intel UHD Graphics 4GB RAM 128GB SSD Win 11 Home", "sku": "test-single-item-condition-diffseller8", "condition": "Pre-Owned: Like New" }, "charges": { "charge": [ { "chargeType": "PRODUCT", "discountType": null, "isDiscount": null, "chargeName": "ItemPrice", "chargeAmount": { "currency": "USD", "amount": 310 }, "tax": null } ] }, "orderLineQuantity": { "unitOfMeasurement": "EACH", "amount": "1" }, "statusDate": 1740952475104, "orderLineStatuses": { "orderLineStatus": [ { "status": "Cancelled", "subSellerId": null, "statusQuantity": { "unitOfMeasurement": "EACH", "amount": "1" }, "cancellationReason": null, "trackingInfo": { "carrierName": { "otherCarrier": null, "carrier": null }, "methodCode": "Standard", "actualDeliveryDateTime": null, "carrierMethodCode": null, "packageStatus": null, "trackingURL": null }, "returnCenterAddress": null, "sellerOrderId": null, "shipmentPackages": null } ] }, "refund": null, "fulfillment": { "fulfillmentOption": "DELIVERY", "shipMethod": "STANDARD", "storeId": null, "pickUpDateTime": 1741219140000, "pickUpBy": null, "shippingProgramType": "THREE_TO_FIVE_DAY", "shippingSLA": "3", "shippingConfigSource": "SELLER", "predictedShipNodeName": null } } ] }, "shipNode": { "type": "SellerFulfilled", "name": "Shoes.com - 10900015173 - MP", "id": "10900015173" } }
}

200 - Sample 2-MX

{ "order": { "purchaseOrderId": "609102965703912", "customerOrderId": "900000028441948", "customerEmailId": "[email protected]", "kycDetails": { "kycIdType": "RFC", "kycIdValue": "VECJ880326XYZ" }, "orderDate": 1769615503844, "shippingInfo": { "phone": "4085872353", "estimatedDeliveryDate": 1770926400000, "estimatedShipDate": 1770916400000, "postalAddress": { "name": "Address One", "address1": "Blvd Manuel Avila Camacho", "address2": "641", "address3": "PERIODISTA", "address4": "MIGUEL HIDALGO", "city": "Ciudad de México", "state": "CDMX", "postalCode": "11220", "country": "MX", "addressType": null }, "carrierMethodName": null }, "totalLines": "1", "totalQuantity": "1", "orderLines": { "orderLine": [ { "primeLineNumber": "1", "coLineNumber": "1", "item": { "upc": "08114616386489", "offerId": "6FCB799631923664872132DA81F64DD2", "productName": "Product Test", "sku": "SKU-AUTO-81146163864891", "condition": "New", "imageUrl": "https://example.com/images/mock-product-image.jpg", "unitPrice": { "currency": "MXN", "amount": 120 }, "unitPriceWithoutTax": { "currency": "MXN", "amount": 103.45 } }, "charges": { "charge": [ { "chargeType": "PRODUCT", "chargeAmount": { "currency": "MXN", "amount": 103.45 }, "tax": { "taxName": "TOTAL_TAX", "taxAmount": { "currency": "MXN", "amount": 16.55 } }, "taxDetails": [ { "taxName": "TOTAL_TAX", "taxAmount": { "currency": "MXN", "amount": 16.55 } } ], "isDiscount": null, "discountType": null } ] }, "orderLineQuantity": { "unitOfMeasurement": "EACH", "amount": "1" }, "orderLineStatuses": { "orderLineStatus": [ { "status": "Cancelled", "subSellerId": null, "statusQuantity": { "unitOfMeasurement": "EACH", "amount": "1" }, "cancellationReason": "REJECT", "trackingInfo": null, "returnCenterAddress": null, "sellerOrderId": null, "shipmentPackages": null } ] }, "refund": null, "shippingMethod": "STANDARD", "soPrimeLineSubLineNo": "900000028441948-3", "promiseDeliveryDate": "2026-02-06T20:00:00.000+0000", "isMSIEnabled": "Y", "seller": { "id": "10900030838", "name": "CBT test 1122", "shipNodeType": "SellerFulfilled" }, "isWFSEnabled": "N", "fulfillmentType": "S2H" } ] }, "shipments": [ { "shipmentLines": [ { "primeLineNo": "1", "shipmentLineNo": "1", "quantity": { "unitOfMeasurement": "EACH", "amount": "1" } } ], "shipmentNo": "699001087_1", "status": "Shipment Canceled", "packageNo": "699001087_1", "isSellerOwnedShipment": "Y", "carrier": "Seller_Owned", "shipmentAdditionalDate": { "expectedShipmentShippedDate": "2026-02-05T05:00:00.000+0000" } } ], "orderTotal": { "currency": "MXN", "amount": 0 } }
}

200 - Sample 3-CA

{ "order": { "purchaseOrderId": "309102965701491", "customerOrderId": "701769585462705", "customerEmailId": "[email protected]", "orderDate": 1769585463706, "shippingInfo": { "phone": "6657555657", "estimatedDeliveryDate": 1769889600000, "estimatedShipDate": 1769670000000, "methodCode": "Express", "postalAddress": { "name": "geetha kunchepu", "address1": "Manitoba Public Insurance", "address2": null, "city": "Winnipeg", "state": "MB", "postalCode": "R2W 3T3", "country": "CA", "addressType": "RESIDENTIAL" }, "carrierMethodName": null }, "orderLines": { "orderLine": [ { "lineNumber": "1", "item": { "productName": "ANIMALPEDIGREEtwo", "sku": "EDF07661449630550" }, "charges": { "charge": [ { "chargeType": "PRODUCT", "chargeName": "ItemPrice", "chargeAmount": { "currency": "CAD", "amount": 200 }, "tax": { "taxName": "PST", "taxAmount": { "currency": "CAD", "amount": 24 } }, "isDiscount": false, "discountType": null }, { "chargeType": "SHIPPING", "chargeName": "SHIPPING", "chargeAmount": { "currency": "CAD", "amount": 16 }, "tax": { "taxName": "PST", "taxAmount": { "currency": "CAD", "amount": 1.92 } }, "isDiscount": false, "discountType": null }, { "chargeType": "PRODUCT", "chargeName": "ITEM_PRICE_AFTER_DISCOUNT", "chargeAmount": { "currency": "CAD", "amount": 200 }, "tax": { "taxAmount": { "currency": "CAD", "amount": 0 } }, "isDiscount": null, "discountType": null }, { "chargeType": "TAX", "chargeName": "TAX", "chargeAmount": { "currency": "CAD", "amount": 25.92 }, "tax": { "taxAmount": { "currency": "CAD", "amount": 0 } }, "isDiscount": false, "discountType": null } ] }, "orderLineQuantity": { "unitOfMeasurement": "EACH", "amount": "1" }, "orderLineStatuses": { "orderLineStatus": [ { "status": "Cancelled", "subSellerId": null, "statusQuantity": { "unitOfMeasurement": "EACH", "amount": "1" }, "cancellationReason": "Cancelled", "trackingInfo": null, "returnCenterAddress": null, "sellerOrderId": null, "shipmentPackages": null } ] }, "refund": null, "fulfillment": { "fulfillmentOption": "S2H", "shipMethod": "EXPEDITED", "storeId": null, "offerId": "46067EC8F029354ABC1668C9AFCCD106", "pickUpDateTime": null, "pickUpBy": null, "shippingProgramType": null, "predictedShipNodeId": "10011361291", "predictedShipNodeName": null } } ] } }
}

200 - Sample 4-CL

{ "order": { "purchaseOrderId": "P100644649", "customerOrderId": "2152525021491", "isWCPOrder": true, "orderDate": 1737634602000, "shippingInfo": { "phone": "+56567657687", "estimatedDeliveryDate": 1738191600000, "estimatedShipDate": 1737698400000, "methodCode": "STANDARD", "postalAddress": { "name": "Test Pickup", "address1": "Pedro de Valdivia", "address2": "1885", "city": "Providencia", "state": "Región Metropolitana", "country": "CL", "addressType": null }, "carrierMethodName": null }, "orderSummary": { "totalAmount": { "amount": 327174.5, "currency": "CLP" }, "orderSubTotals": [ { "subTotalType": "SHIPPING", "fundingType": null, "totalAmount": { "amount": 2504, "currency": "CLP" } }, { "subTotalType": "TAX", "fundingType": null, "totalAmount": { "amount": 10389.5, "currency": "CLP" } }, { "subTotalType": "PRODUCT", "fundingType": null, "totalAmount": { "amount": 314281, "currency": "CLP" } }, { "subTotalType": "DISCOUNT", "fundingType": null, "totalAmount": { "amount": 0, "currency": "CLP" } } ] }, "orderLines": { "orderLine": [ { "lineNumber": "1", "item": { "productName": "Run Shoe VVKK02", "sku": "FootCONV701" }, "charges": { "charge": [ { "chargeType": "PRODUCT", "chargeName": "ItemPrice", "chargeAmount": { "currency": "CLP", "amount": 142855 }, "tax": { "taxName": "IVA_TAX", "taxAmount": { "currency": "CLP", "amount": 22620.85 } }, "isDiscount": null, "discountType": null }, { "chargeType": "COMMISSION", "chargeName": "Commission", "chargeAmount": { "currency": "CLP", "amount": 0 }, "tax": { "taxAmount": { "currency": "CLP", "amount": 0 } }, "isDiscount": null, "discountType": null }, { "chargeType": "SHIPPING", "chargeName": "Shipping", "chargeAmount": { "currency": "CLP", "amount": 6260 }, "tax": { "taxName": "SHIP_IVA_TAX", "taxAmount": { "currency": "CLP", "amount": 991.65 } }, "isDiscount": null, "discountType": null }, { "chargeType": "TAX", "chargeName": "TAX", "chargeAmount": { "currency": "CLP", "amount": 23612.5 }, "tax": { "taxAmount": { "currency": "CLP", "amount": 0 } }, "isDiscount": null, "discountType": null }, { "chargeType": "DISCOUNT", "chargeName": "DISCOUNT", "chargeAmount": { "currency": "CLP", "amount": 0 }, "tax": { "taxAmount": { "currency": "CLP", "amount": 0 } }, "isDiscount": null, "discountType": null } ] }, "orderLineQuantity": { "unitOfMeasurement": "EACH", "amount": "3" }, "statusDate": 1738191600000, "orderLineStatuses": { "orderLineStatus": [ { "status": "Created", "subSellerId": null, "statusQuantity": { "unitOfMeasurement": "EACH", "amount": "3" }, "cancellationReason": null, "trackingInfo": { "carrierName": { "otherCarrier": null, "carrier": null }, "methodCode": "STANDARD", "carrierMethodCode": null, "trackingURL": null, "packageStatus": null, "shipmentNo": null, "actualDeliveryDateTime": null }, "returnCenterAddress": null, "sellerOrderId": null, "shipmentPackages": null }, { "status": "Cancelled", "subSellerId": null, "statusQuantity": { "unitOfMeasurement": "EACH", "amount": "3" }, "cancellationReason": "PRICE_ERROR", "trackingInfo": { "carrierName": { "otherCarrier": null, "carrier": null }, "methodCode": "STANDARD", "carrierMethodCode": null, "trackingURL": null, "packageStatus": null, "shipmentNo": null, "actualDeliveryDateTime": null }, "returnCenterAddress": null, "sellerOrderId": null, "shipmentPackages": null } ] }, "refund": null, "fulfillment": { "fulfillmentOption": "Seller", "shipMethod": "STANDARD", "storeId": "10900042217", "offerId": "D72F2988997E33A48619FBDBD836634E", "pickUpDateTime": null, "pickUpBy": null, "shippingProgramType": null, "predictedShipNodeId": "10900042217", "predictedShipNodeName": "LABORATORIO BALLERINA LTDAjj" } }, { "lineNumber": "2", "item": { "productName": "Baby Clothing Test 072", "sku": "BabyCloth72" }, "charges": { "charge": [ { "chargeType": "PRODUCT", "chargeName": "ItemPrice", "chargeAmount": { "currency": "CLP", "amount": 171426 }, "tax": { "taxName": "IVA_TAX", "taxAmount": { "currency": "CLP", "amount": 32574 } }, "isDiscount": null, "discountType": null }, { "chargeType": "COMMISSION", "chargeName": "Commission", "chargeAmount": { "currency": "CLP", "amount": 0 }, "tax": { "taxAmount": { "currency": "CLP", "amount": 0 } }, "isDiscount": null, "discountType": null }, { "chargeType": "SHIPPING", "chargeName": "Shipping", "chargeAmount": { "currency": "CLP", "amount": 7512 }, "tax": { "taxName": "SHIP_IVA_TAX", "taxAmount": { "currency": "CLP", "amount": 1428 } }, "isDiscount": null, "discountType": null }, { "chargeType": "TAX", "chargeName": "TAX", "chargeAmount": { "currency": "CLP", "amount": 34002 }, "tax": { "taxAmount": { "currency": "CLP", "amount": 0 } }, "isDiscount": null, "discountType": null }, { "chargeType": "DISCOUNT", "chargeName": "DISCOUNT", "chargeAmount": { "currency": "CLP", "amount": 0 }, "tax": { "taxAmount": { "currency": "CLP", "amount": 0 } }, "isDiscount": null, "discountType": null } ] }, "orderLineQuantity": { "unitOfMeasurement": "EACH", "amount": "4" }, "statusDate": 1738191600000, "orderLineStatuses": { "orderLineStatus": [ { "status": "Acknowledged", "statusQuantity": { "unitOfMeasurement": "EACH", "amount": "4" }, "cancellationReason": null, "trackingInfo": { "carrierName": { "otherCarrier": null, "carrier": null }, "methodCode": "STANDARD", "carrierMethodCode": null, "trackingURL": null, "packageStatus": null, "shipmentNo": null, "actualDeliveryDateTime": null }, "returnCenterAddress": null, "sellerOrderId": null, "shipmentPackages": null }, { "status": "Cancelled", "subSellerId": null, "statusQuantity": { "unitOfMeasurement": "EACH", "amount": "3" }, "cancellationReason": "PRICE_ERROR", "trackingInfo": { "carrierName": { "otherCarrier": null, "carrier": null }, "methodCode": "STANDARD", "carrierMethodCode": null, "trackingURL": null, "packageStatus": null, "shipmentNo": null, "actualDeliveryDateTime": null }, "returnCenterAddress": null, "sellerOrderId": null, "shipmentPackages": null } ] }, "refund": null, "fulfillment": { "fulfillmentOption": "Seller", "shipMethod": "STANDARD", "storeId": "10900042217", "offerId": "44E214E8361E3A0281C9678CAD27DBBF", "pickUpDateTime": null, "pickUpBy": null, "shippingProgramType": null, "predictedShipNodeId": "10900042217", "predictedShipNodeName": "LABORATORIO BALLERINA LTDAjj" } } ] } }
}

400

{ "errors": [ { "code": "INVALID_REQUEST_CONTENT.GMP_ORDER_API", "description": "Invalid request content.", "info": "Request content is not valid.", "severity": "ERROR", "category": "DATA" } ]
}

401

{ "errors": [ { "code": "UNAUTHORIZED.GMP_ORDER_API", "description": "Unauthorized request.", "info": "Authentication failed. Verify your credentials.", "severity": "ERROR", "category": "APPLICATION" } ]
}

403

{ "errors": [ { "code": "FORBIDDEN.GMP_ORDER_API", "description": "Access denied.", "info": "You do not have permission to perform this action.", "severity": "ERROR", "category": "APPLICATION" } ]
}

404

{ "errors": [ { "code": "NOT_FOUND.GMP_ORDER_API", "description": "Resource not found.", "info": "The requested purchase order was not found.", "severity": "ERROR", "category": "DATA" } ]
}

429

{ "code": "REQUEST_THRESHOLD_VIOLATED", "description": "Too many requests in a given amount of time.", "info": "You have exceeded the rate limit for this API. Retry after the time indicated in the Retry-After header.", "severity": "ERROR", "category": "SYSTEM", "causes": [], "errorIdentifiers": {}, "field": "RateLimitExceeded"
}

500

{ "errors": [ { "code": "INTERNAL_SERVER_ERROR.GMP_ORDER_API", "description": "An internal server error occurred.", "info": "Retry the request. If the issue persists, contact support.", "severity": "ERROR", "category": "SYSTEM" } ]
}

Result

If successful, the API returns an HTTP status: 200 OK along with a JSON object showing the updated order details. The specified order lines will now have a Cancelled status, indicating that those items will no longer be fulfilled.


Did this page help you?