Refund order lines

Call this endpoint to issue a refund for one or more order lines in a specific order. Use this action when you need to refund items, partially or entirely, due to situations such as billing errors or customer returns.

Endpoint

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

Sample request

curl -X 'POST' 'https://sandbox.walmartapis.com/v3/orders/qweq/refund' -H 'accept: application/json' -H 'WM_SEC.ACCESS_TOKEN: eyJraWQiOiIzZjVhYTFmNS1hYWE5LTQzM.....' -H 'WM_QOS.CORRELATION_ID: b3261d2d-028a-4ef7-8602-633c23200af6' -H 'WM_SVC.NAME: Walmart Service Name' -H 'Content-Type: application/json' -d'{"orderRefund":{"purchaseOrderId":"2577453162650","orderLines":{"orderLine":[{"lineNumber":"4","isFullRefund":false,"refunds":{"refund":[{"refundComments":"testtest","refundCharges":{"refundCharge":[{"refundReason":"Merchandisenotreceived","charge":{"chargeType":"PRODUCT","chargeName":"ItemPrice","chargeAmount":{"currency":"USD","amount":-0.1},"tax":{"taxName":"ItemPriceTax","taxAmount":{"currency":"USD","amount":-0.1}}}}]}}]}}]}}}'
curl-X'POST' 'https://sandbox.walmartapis.com/v3/orders/qweq/refund' -H'accept:application/json' -H'WM_SEC.ACCESS_TOKEN:eyJraWQiOiIzZjVhYTFmNS1hYWE5LTQzM.....' -H'WM_QOS.CORRELATION_ID:b3261d2d-028a-4ef7-8602-633nc23200af6' -H'WM_SVC.NAME:WalmartServiceName' -H'Content-Type:application/xml' -d'<?xmlversion="1.0"encoding="UTF-8"?>
<orderRefundxmlns="http://walmart.com/mp/v3/orders">
<purchaseOrderId>2575193093772</purchaseOrderId>
<orderLines>
<orderLine>
<lineNumber>1</lineNumber>
<isFullRefund>false</isFullRefund>
<refunds>
<refund>
<refundComments>testtest</refundComments>
<refundCharges>
<refundCharge>
<refundReason>DamagedItem</refundReason>
<charge>
<chargeType>PRODUCT</chargeType>
<chargeName>ItemPrice</chargeName>
<chargeAmount>
<currency>USD</currency>
<amount>-10.02</amount>
</chargeAmount>
<tax>
<taxName>ItemPriceTax</taxName>
<taxAmount>
<currency>USD</currency>
<amount>-5.03</amount>
</taxAmount>
</tax>
</charge>
</refundCharge>
<refundCharge>
<refundReason>TaxExemptCustomer</refundReason>
<charge>
<chargeType>SHIPPING</chargeType>
<chargeName>ShippingPrice</chargeName>
<chargeAmount>
<currency>USD</currency>
<amount>-1.02</amount>
</chargeAmount>
<tax>
<taxName>ShippingTax</taxName>
<taxAmount>
<currency>USD</currency>
<amount>-0.05</amount>
</taxAmount>
</tax>
</charge>
</refundCharge>
</refundCharges>
</refund>
</refunds>
</orderLine>
</orderLines>
</orderRefund>'

Modify your code

  • Replace {purchaseOrderId} in the endpoint URL with the actual order ID.
  • Substitute <Base64EncodedClientID:ClientSecret> with your Base64-encoded credentials.
  • Update WM_QOS.CORRELATION_ID with a unique value for tracking your request.
  • Adjust the orderRefund payload as needed, including the isFullRefund flag, refund reasons, and charge details.

Sample responses

application/json

200

{ "order": { "purchaseOrderId": "2577573191435", "customerOrderId": "5571600820146", "customerEmailId": "[email protected]", "orderDate": 1476392223000, "orderType": "PREORDER", "shippingInfo": { "phone": "6502248603", "estimatedDeliveryDate": 1479798000000, "estimatedShipDate": 1476424800000, "methodCode": "Standard", "postalAddress": { "name": "Madhukara PGOMS", "address1": "860 W Cal Ave", "address2": "Seat # 860C.2.176", "city": "Sunnyvale", "state": "CA", "postalCode": "94086", "country": "USA", "addressType": "RESIDENTIAL" } }, "orderLines": { "orderLine": [ { "lineNumber": "1", "item": { "productName": "Ozark Trail 4-Person Dome Tent", "sku": "NJ_WITHOUT_RCA_003" }, "charges": { "charge": [ { "chargeType": "PRODUCT", "chargeName": "ItemPrice", "chargeAmount": { "currency": "USD", "amount": 19.99 }, "tax": { "taxName": "Tax1", "taxAmount": { "currency": "USD", "amount": 0 } }, "taxAndOtherFees": { "taxName": "Tax1", "taxAmount": { "currency": "USD", "amount": 0 } } }, { "chargeType": "SHIPPING", "chargeName": "Shipping", "chargeAmount": { "currency": "USD", "amount": 2 }, "tax": { "taxName": "Tax2", "taxAmount": { "currency": "USD", "amount": 0 } }, "taxAndOtherFees": { "taxName": "Tax2", "taxAmount": { "currency": "USD", "amount": 0 } } } ] }, "orderLineQuantity": { "unitOfMeasurement": "EACH", "amount": "1" }, "statusDate": 1476470187000, "orderLineStatuses": { "orderLineStatus": [ { "status": "Shipped", "statusQuantity": { "unitOfMeasurement": "EACH", "amount": "1" }, "trackingInfo": { "shipDateTime": 1475008215000, "carrierName": { "carrier": "FedEx" }, "methodCode": "Standard", "trackingNumber": "3445435443441221", "trackingURL": "http://www.fedex.com" } } ] }, "refund": { "refundCharges": { "refundCharge": [ { "refundReason": "BillingError", "charge": { "chargeType": "PRODUCT", "chargeName": "Billing Error", "chargeAmount": { "currency": "USD", "amount": -19.99 } } }, { "refundReason": "BillingError", "charge": { "chargeType": "SHIPPING", "chargeName": "Billing Error", "chargeAmount": { "currency": "USD", "amount": -2 } } } ] } } } ] } }
}

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

{ "errors": [ { "code": "RATE_LIMIT_EXCEEDED.GMP_ORDER_API", "description": "Too many requests.", "info": "Rate limit exceeded. Retry after the specified time.", "severity": "ERROR", "category": "APPLICATION" } ]
}

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" } ]
}

application/xml

200

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns3:order xmlns:ns2="http://walmart.com/mp/orders" xmlns:ns3="http://walmart.com/mp/v3/orders" xmlns:ns4="http://walmart.com/"> <ns3:purchaseOrderId> 2575193093772 </ns3:purchaseOrderId> <ns3:customerOrderId> 4021603841173 </ns3:customerOrderId> <ns3:customerEmailId> [email protected] </ns3:customerEmailId> <ns3:orderType> PREORDER </ns3:orderType> <ns3:orderDate> 2016-05-11T22:55:28.000Z </ns3:orderDate> <ns3:shippingInfo> <ns3:phone> 6502248603 </ns3:phone> <ns3:estimatedDeliveryDate> 2016-05-20T17:00:00.000Z </ns3:estimatedDeliveryDate> <ns3:estimatedShipDate> 2016-05-16T17:00:00.000Z </ns3:estimatedShipDate> <ns3:methodCode> Standard </ns3:methodCode> <ns3:postalAddress> <ns3:name> Joe Doe PGOMS </ns3:name> <ns3:address1> 860 W Cal Ave </ns3:address1> <ns3:address2> Seat # 860C.2.176 </ns3:address2> <ns3:city> Sunnyvale </ns3:city> <ns3:state> CA </ns3:state> <ns3:postalCode> 94086 </ns3:postalCode> <ns3:country> USA </ns3:country> <ns3:addressType> RESIDENTIAL </ns3:addressType> </ns3:postalAddress> </ns3:shippingInfo> <ns3:orderLines> <ns3:orderLine> <ns3:lineNumber> 2 </ns3:lineNumber> <ns3:item> <ns3:productName> Garmin Refurbished nuvi 2595LMT 5 GPS w Lifetime Maps and Traffic </ns3:productName> <ns3:sku> GRMN100201 </ns3:sku> </ns3:item> <ns3:charges> <ns3:charge> <ns3:chargeType> PRODUCT </ns3:chargeType> <ns3:chargeName> ItemPrice </ns3:chargeName> <ns3:chargeAmount> <ns3:currency> USD </ns3:currency> <ns3:amount> 124.98 </ns3:amount> </ns3:chargeAmount> <ns3:tax> <ns3:taxName> Tax1 </ns3:taxName> <ns3:taxAmount> <ns3:currency> USD </ns3:currency> <ns3:amount> 10.93 </ns3:amount> </ns3:taxAmount> </ns3:tax> </ns3:charge> <ns3:charge> <ns3:chargeType> SHIPPING </ns3:chargeType> <ns3:chargeName> Shipping </ns3:chargeName> <ns3:chargeAmount> <ns3:currency> USD </ns3:currency> <ns3:amount> 2.00 </ns3:amount> </ns3:chargeAmount> <ns3:tax> <ns3:taxName> Tax2 </ns3:taxName> <ns3:taxAmount> <ns3:currency> USD </ns3:currency> <ns3:amount> 0.19 </ns3:amount> </ns3:taxAmount> </ns3:tax> </ns3:charge> </ns3:charges> <ns3:orderLineQuantity> <ns3:unitOfMeasurement> EACH </ns3:unitOfMeasurement> <ns3:amount> 1 </ns3:amount> </ns3:orderLineQuantity> <ns3:statusDate> 2016-06-03T23:48:00.000Z </ns3:statusDate> <ns3:orderLineStatuses> <ns3:orderLineStatus> <ns3:status> Shipped </ns3:status> <ns3:statusQuantity> <ns3:unitOfMeasurement> EACH </ns3:unitOfMeasurement> <ns3:amount> 1 </ns3:amount> </ns3:statusQuantity> <ns3:trackingInfo> <ns3:shipDateTime> 2016-06-27T05:30:15.000Z </ns3:shipDateTime> <ns3:carrierName> <ns3:carrier> FedEx </ns3:carrier> </ns3:carrierName> <ns3:methodCode> Standard </ns3:methodCode> <ns3:trackingNumber> 12333634122 </ns3:trackingNumber> <ns3:trackingURL> http://www.fedex.com </ns3:trackingURL> </ns3:trackingInfo> </ns3:orderLineStatus> </ns3:orderLineStatuses> <ns3:refund> <ns3:refundCharges> <ns3:refundCharge> <ns3:refundReason> DamagedItem </ns3:refundReason> <ns3:charge> <ns3:chargeType> PRODUCT </ns3:chargeType> <ns3:chargeName> Damaged </ns3:chargeName> <ns3:chargeAmount> <ns3:currency> USD </ns3:currency> <ns3:amount> -10.02 </ns3:amount> </ns3:chargeAmount> <ns3:tax> <ns3:taxName> Product </ns3:taxName> <ns3:taxAmount> <ns3:currency> USD </ns3:currency> <ns3:amount> -5.03 </ns3:amount> </ns3:taxAmount> </ns3:tax> </ns3:charge> </ns3:refundCharge> <ns3:refundCharge> <ns3:refundReason> TaxExemptCustomer </ns3:refundReason> <ns3:charge> <ns3:chargeType> SHIPPING </ns3:chargeType> <ns3:chargeName> Tax Exempt </ns3:chargeName> <ns3:chargeAmount> <ns3:currency> USD </ns3:currency> <ns3:amount> -1.02 </ns3:amount> </ns3:chargeAmount> <ns3:tax> <ns3:taxName> Shipping </ns3:taxName> <ns3:taxAmount> <ns3:currency> USD </ns3:currency> <ns3:amount> -0.05 </ns3:amount> </ns3:taxAmount> </ns3:tax> </ns3:charge> </ns3:refundCharge> </ns3:refundCharges> </ns3:refund> </ns3:orderLine> </ns3:orderLines>
</ns3:order>

application/problem+json

400

{ "type": "string", "title": "string", "status": 0, "detail": "string", "instance": "string"
}

401

{ "type": "string", "title": "string", "status": 0, "detail": "string", "instance": "string"
}

403

{ "type": "string", "title": "string", "status": 0, "detail": "string", "instance": "string"
}

404

{ "type": "string", "title": "string", "status": 0, "detail": "string", "instance": "string"
}

429

{ "type": "string", "title": "string", "status": 0, "detail": "string", "instance": "string"
}

500

{ "type": "string", "title": "string", "status": 0, "detail": "string", "instance": "string"
}

An order response can include multiple miscAttribute groups when an item belongs to more than one program. For example, a virtual pack can include a VIRTUAL_PACK group alongside any other applicable metadata groups.

Result

If successful, the API returns an HTTP status: 200 OK along with a JSON object showing the updated order details, including the refund information for the specified order lines.


Did this page help you?