Validate non-WFS inventory in dynamic sandbox
Use this recipe to simulate non-WFS inventory reservation, inventory decrement, and stockout behavior in sandbox.
This recipe starts with an existing test SKU and fulfillment center, then walks through adding inventory, creating a test order that reserves all available inventory, shipping the order to decrement inventory, and confirming that another order fails when the requested quantity exceeds available-to-sell inventory.
Workflow
This workflow validates inventory behavior across the order lifecycle, including inventory reservation, inventory decrement, and stockout conditions.
Before you begin
To complete this recipe, you need Marketplace sandbox API credentials and access to the Marketplace sandbox environment. Use your sandbox credentials to generate an OAuth access token before calling the APIs in this workflow.
For more information about sandbox setup and authentication, refer to the Walmart sandbox guide.
Prerequisites
To create the required test resources for this recipe, complete Validate order fulfillment in sandbox.
Before running this recipe, you must complete the following setup:
- Create a test SKU.
- Create a test fulfillment center.
Step 1: Authenticate
Generate an OAuth access token to authorize Marketplace sandbox API requests.
Endpoint
Requirements
- You must have valid Marketplace sandbox API credentials.
- The access token must be active when you call each API in this workflow.
Sample request
This sample request uses your Marketplace sandbox client credentials to generate an OAuth access token for subsequent API calls.
curl --location 'https://sandbox.walmartapis.com/v3/token' \ --header 'Accept: application/json' \ --header 'Authorization: Basic <base64(clientId:clientSecret)>' \ --header 'Content-Type: application/x-www-form-urlencoded' \ --header 'WM_MARKET: us' \ --header 'WM_QOS.CORRELATION_ID: <correlation_id>' \ --header 'WM_SVC.NAME: MP' \ --data-urlencode 'grant_type=client_credentials'import base64
import requests client_id = "clientId"
client_secret = "clientSecret" credentials = base64.b64encode(f"{client_id}:{client_secret}".encode()).decode() url = "https://sandbox.walmartapis.com/v3/token" headers = { "Accept": "application/json", "Authorization": f"Basic {credentials}", "Content-Type": "application/x-www-form-urlencoded", "WM_MARKET": "us", "WM_QOS.CORRELATION_ID": "<correlation_id>", "WM_SVC.NAME": "MP",
} data = { "grant_type": "client_credentials"
} response = requests.post(url, headers=headers, data=data)
response.raise_for_status() print(response.json())import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.charset.StandardCharsets;
import java.util.Base64; public class TokenRequest { public static void main(String[] args) throws Exception { String clientId = "clientId"; String clientSecret = "clientSecret"; String credentials = Base64.getEncoder().encodeToString( (clientId + ":" + clientSecret).getBytes(StandardCharsets.UTF_8) ); String formBody = "grant_type=client_credentials"; HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://sandbox.walmartapis.com/v3/token")) .header("Accept", "application/json") .header("Authorization", "Basic " + credentials) .header("Content-Type", "application/x-www-form-urlencoded") .header("WM_MARKET", "us") .header("WM_QOS.CORRELATION_ID", "<correlation_id>") .header("WM_SVC.NAME", "MP") .POST(HttpRequest.BodyPublishers.ofString(formBody)) .build(); HttpClient client = HttpClient.newHttpClient(); HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString()); System.out.println(response.statusCode()); System.out.println(response.body()); }
}What to expect
- The API returns an access token.
- Use the access token in subsequent API requests in this recipe.
Step 2: Add inventory
Add inventory for the test SKU at the fulfillment center so it can be used to create a test order.
Endpoint
Requirements
- The test SKU must already be created.
- The fulfillment center must already be created.
- The inventory quantity added in this step is used as the input quantity for the remaining validation steps.
Sample request
This sample request updates the inventory quantity for a specific SKU at a specific ship node in the Marketplace sandbox.
curl --location --request PUT 'https://sandbox.walmartapis.com/v3/inventories/{{sku}}' \ --header 'Accept: application/json' \ --header 'WM_SVC.NAME: MP' \ --header 'WM_SEC.ACCESS_TOKEN: {{token}}' \ --header 'WM_SANDBOX: v2' \ --header 'WM_QOS.CORRELATION_ID: <correlation_id>' \ --header 'Content-Type: application/json' \ --data-raw '{ "inventories": { "nodes": [ { "shipNode": "{{shipNode}}", "inputQty": { "unit": "EACH", "amount": 10 } } ] } }import requests sku = "TESTSKU123"
token = "YOUR_ACCESS_TOKEN"
ship_node = "YOUR_SHIP_NODE" url = f"https://sandbox.walmartapis.com/v3/inventories/{sku}" headers = { "Accept": "application/json", "WM_SVC.NAME": "MP", "WM_SEC.ACCESS_TOKEN": token, "WM_SANDBOX": "v2", "WM_QOS.CORRELATION_ID": "<correlation_id>", "Content-Type": "application/json",
} payload = { "inventories": { "nodes": [ { "shipNode": ship_node, "inputQty": { "unit": "EACH", "amount": 10 } } ] }
} response = requests.put(url, headers=headers, json=payload)
response.raise_for_status() print(response.status_code)
print(response.text)import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse; public class InventoryUpdate { public static void main(String[] args) throws Exception { String sku = "TESTSKU123"; String token = "YOUR_ACCESS_TOKEN"; String shipNode = "YOUR_SHIP_NODE"; String body = """ { "inventories": { "nodes": [ { "shipNode": "%s", "inputQty": { "unit": "EACH", "amount": 10 } } ] } } """.formatted(shipNode); HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://sandbox.walmartapis.com/v3/inventories/" + sku)) .header("Accept", "application/json") .header("WM_SVC.NAME", "MP") .header("WM_SEC.ACCESS_TOKEN", token) .header("WM_SANDBOX", "v2") .header("WM_QOS.CORRELATION_ID", "<correlation_id>") .header("Content-Type", "application/json") .PUT(HttpRequest.BodyPublishers.ofString(body)) .build(); HttpClient client = HttpClient.newHttpClient(); HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString()); System.out.println(response.statusCode()); System.out.println(response.body()); }
}What to expect
- Inventory is added successfully for the test SKU.
- The SKU has available inventory at the fulfillment center.
Step 3: Create a test order
Create a test order for the SKU using an order quantity equal to the inventory quantity added in the previous step.
Endpoint
Requirements
- The test SKU must have inventory available at the fulfillment center.
- The order quantity must equal the inventory quantity added in Step 2.
Sample request
This sample request creates a simulated test order in the Marketplace sandbox using the specified SKU and shipping details.
curl --location --request POST 'https://sandbox.walmartapis.com/v1/simulations/orders' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'WM_SEC.ACCESS_TOKEN: <access_token>' \ --header 'WM_SVC.NAME: MP' \ --header 'WM_SANDBOX: v2' \ --data-raw '{ "customerEmailId": "[email protected]", "shippingInfo": { "phone": "5558675309", "postalAddress": { "name": "Jane Smith", "address1": "123 Main St", "city": "Springfield", "state": "CA", "postalCode": "95035", "country": "US", "addressType": "RESIDENTIAL" } }, "orderLines": { "orderLine": [ { "item": { "sku": "{{sku}}" }, "orderLineQuantity": { "unitOfMeasurement": "EACH", "amount": 10 } } ] } }'import requests url = "https://sandbox.walmartapis.com/v1/simulations/orders" headers = { "Accept": "application/json", "Content-Type": "application/json", "WM_SEC.ACCESS_TOKEN": "<access_token>", "WM_SVC.NAME": "MP", "WM_SANDBOX": "v2",
} payload = { "customerEmailId": "[email protected]", "shippingInfo": { "phone": "5558675309", "postalAddress": { "name": "Jane Smith", "address1": "123 Main St", "city": "Springfield", "state": "CA", "postalCode": "95035", "country": "US", "addressType": "RESIDENTIAL", }, }, "orderLines": { "orderLine": [ { "item": { "sku": "{{sku}}", }, "orderLineQuantity": { "unitOfMeasurement": "EACH", "amount": 10, }, } ] },
} response = requests.post(url, headers=headers, json=payload)
response.raise_for_status() print(response.status_code)
print(response.json())import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse; public class CreateSimulatedOrder { public static void main(String[] args) throws Exception { String body = """ { "customerEmailId": "[email protected]", "shippingInfo": { "phone": "5558675309", "postalAddress": { "name": "Jane Smith", "address1": "123 Main St", "city": "Springfield", "state": "CA", "postalCode": "95035", "country": "US", "addressType": "RESIDENTIAL" } }, "orderLines": { "orderLine": [ { "item": { "sku": "{{sku}}" }, "orderLineQuantity": { "unitOfMeasurement": "EACH", "amount": 10 } } ] } } """; HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://sandbox.walmartapis.com/v1/simulations/orders")) .header("Accept", "application/json") .header("Content-Type", "application/json") .header("WM_SEC.ACCESS_TOKEN", "<access_token>") .header("WM_SVC.NAME", "MP") .header("WM_SANDBOX", "v2") .POST(HttpRequest.BodyPublishers.ofString(body)) .build(); HttpClient client = HttpClient.newHttpClient(); HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString()); System.out.println(response.statusCode()); System.out.println(response.body()); }
}What to expect
- A test order is created successfully.
- The full inventory quantity is reserved for the test order.
Step 4: Verify reserved inventory
Call the get single item inventory per ship node API to verify that the reserved inventory quantity equals the inventory quantity added in step 2.
Endpoint
Requirements
- The test order must already be created.
- Use the same SKU and fulfillment center used in the previous steps.
- The input quantity is the inventory quantity added in Step 2.
Sample request
This sample request retrieves the inventory details for a specific SKU in the Marketplace sandbox.
curl --location --request GET 'https://sandbox.walmartapis.com/v3/inventories/{{sku}}' \ --header 'cache-control: no-cache' \ --header 'Accept: application/json' \ --header 'WM_SEC.ACCESS_TOKEN: <access_token>' \ --header 'WM_SVC.NAME: MP' \ --header 'WM_SANDBOX: v2' \ --header 'WM_QOS.CORRELATION_ID: <correlation_id>'import requests sku = "YOUR_SKU"
token = "YOUR_ACCESS_TOKEN" url = f"https://sandbox.walmartapis.com/v3/inventories/{sku}" headers = { "cache-control": "no-cache", "Accept": "application/json", "WM_SEC.ACCESS_TOKEN": <access_token>, "WM_SVC.NAME": "MP", "WM_SANDBOX": "v2", "WM_QOS.CORRELATION_ID": "<correlation_id>",
} response = requests.get(url, headers=headers)
response.raise_for_status() print(response.status_code)
print(response.text)import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse; public class GetInventory { public static void main(String[] args) throws Exception { String sku = "YOUR_SKU"; String token = "<access_token>"; HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://sandbox.walmartapis.com/v3/inventories/" + sku)) .header("cache-control", "no-cache") .header("Accept", "application/json") .header("WM_SEC.ACCESS_TOKEN", token) .header("WM_SVC.NAME", "MP") .header("WM_SANDBOX", "v2") .header("WM_QOS.CORRELATION_ID", "<correlation_id>") .GET() .build(); HttpClient client = HttpClient.newHttpClient(); HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString()); System.out.println(response.statusCode()); System.out.println(response.body()); }
}What to expect
- The API returns inventory details for the SKU at the fulfillment center.
- The reserved inventory quantity equals the input quantity.
Step 5: Acknowledge the order
Acknowledge the test order before shipping it.
Endpoint
POST /v3/orders/{purchaseOrderId}/acknowledge
Requirements
- The test order must already be created.
- Use the purchase order ID returned when the test order was created.
- The access token must be active when you call this API.
Sample request
The sample request acknowledges a specific Marketplace sandbox order.
curl --location --request POST 'https://sandbox.walmartapis.com/v3/orders/{{purchaseOrderId}}/acknowledge' \ --header 'Accept: application/json' \ --header 'WM_SANDBOX: v2' \ --header 'WM_SEC.ACCESS_TOKEN: <access_token>' \ --header 'WM_SVC.NAME: MP' \ --header 'WM_QOS.CORRELATION_ID: <correlation_id>'import requests purchase_order_id = "2614941166890"
token = "YOUR_ACCESS_TOKEN" url = f"https://sandbox.walmartapis.com/v3/orders/{purchase_order_id}/acknowledge" headers = { "Accept": "application/json", "WM_SEC.ACCESS_TOKEN": <access_token>, "WM_SVC.NAME": "MP", "WM_SANDBOX": "v2", "WM_QOS.CORRELATION_ID": "<correlation_id>",
} response = requests.post(url, headers=headers)
response.raise_for_status() print(response.status_code)
print(response.text)import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse; public class AcknowledgeOrder { public static void main(String[] args) throws Exception { String purchaseOrderId = "2614941166890"; String token = "<access_token>"; HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://sandbox.walmartapis.com/v3/orders/" + purchaseOrderId + "/acknowledge")) .header("Accept", "application/json") .header("WM_SEC.ACCESS_TOKEN", token) .header("WM_SVC.NAME", "MP") .header("WM_SANDBOX", "v2") .header("WM_QOS.CORRELATION_ID", "<correlation_id>") .POST(HttpRequest.BodyPublishers.noBody()) .build(); HttpClient client = HttpClient.newHttpClient(); HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString()); System.out.println(response.statusCode()); System.out.println(response.body()); }
}What to expect
- The order is acknowledged successfully.
- The order is ready to be shipped.
Step 6: Ship the order
Ship the test order to complete the fulfillment action that decrements inventory.
Endpoint
POST /v3/orders/{purchaseOrderId}/shipping
Requirements
- The test order must already be acknowledged.
- Use the purchase order ID returned when the test order was created.
- The shipment quantity must match the test order quantity.
Sample request
This sample request submits shipment information for a specific order and marks the order lines as shipped in the Marketplace sandbox.
curl --location --request POST 'https://sandbox.walmartapis.com/v3/orders/<purchase_order_id>/shipping' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'WM_SANDBOX: v2' \
--header 'WM_SEC.ACCESS_TOKEN: <access_token>' \
--header 'WM_SVC.NAME: MP' \
--header 'WM_QOS.CORRELATION_ID: <correlation_id>' \
--data-raw '{ "orderShipment": { "orderLines": { "orderLine": [ { "lineNumber": "1", "intentToCancelOverride": false, "sellerOrderId": "456782346", "orderLineStatuses": { "orderLineStatus": [ { "status": "Shipped", "statusQuantity": { "unitOfMeasurement": "EACH", "amount": "10" }, "trackingInfo": { "shipDateTime": 1780697848000, "carrierName": { "carrier": "UPS" }, "methodCode": "Standard", "trackingNumber": "22344", "trackingURL": "https://example.com/tracking/ups?&type=MP&seller_id=12345&promise_date=03/02/2020&dzip=92840&tracking_numbers=92345" }, "returnCenterAddress": { "name": "walmart", "address1": "1 Customer Drive", "city": "Bentonville", "state": "AR", "postalCode": "72716", "country": "USA", "dayPhone": "5558675309", "emailId": "[email protected]" } } ] } } ] } }
}'import requests url = "https://sandbox.walmartapis.com/v3/orders/<purchase_order_id>/shipping" headers = { "Accept": "application/json", "Content-Type": "application/json", "WM_SANDBOX": "v2", "WM_SEC.ACCESS_TOKEN": "<access_token>", "WM_SVC.NAME": "MP", "WM_QOS.CORRELATION_ID": "<correlation_id>",
} payload = { "orderShipment": { "orderLines": { "orderLine": [ { "lineNumber": "1", "intentToCancelOverride": False, "sellerOrderId": "456782346", "orderLineStatuses": { "orderLineStatus": [ { "status": "Shipped", "statusQuantity": { "unitOfMeasurement": "EACH", "amount": "10", }, "trackingInfo": { "shipDateTime": 1780697848000, "carrierName": { "carrier": "UPS", }, "methodCode": "Standard", "trackingNumber": "22344", "trackingURL": "https://example.com/tracking/ups?&type=MP&seller_id=12345&promise_date=03/02/2020&dzip=92840&tracking_numbers=92345", }, "returnCenterAddress": { "name": "walmart", "address1": "1 Customer Drive", "city": "Bentonville", "state": "AR", "postalCode": "72716", "country": "USA", "dayPhone": "5558675309", "emailId": "[email protected]", }, } ] }, } ] } }
} response = requests.post(url, headers=headers, json=payload)
response.raise_for_status() print(response.status_code)
print(response.text)import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse; public class ShipOrder { public static void main(String[] args) throws Exception { String body = """ { "orderShipment": { "orderLines": { "orderLine": [ { "lineNumber": "1", "intentToCancelOverride": false, "sellerOrderId": "456782346", "orderLineStatuses": { "orderLineStatus": [ { "status": "Shipped", "statusQuantity": { "unitOfMeasurement": "EACH", "amount": "10" }, "trackingInfo": { "shipDateTime": 1780697848000, "carrierName": { "carrier": "UPS" }, "methodCode": "Standard", "trackingNumber": "22344", "trackingURL": "https://example.com/tracking/ups?&type=MP&seller_id=12345&promise_date=03/02/2020&dzip=92840&tracking_numbers=92345" }, "returnCenterAddress": { "name": "walmart", "address1": "1 Customer Drive", "city": "Bentonville", "state": "AR", "postalCode": "72716", "country": "USA", "dayPhone": "5558675309", "emailId": "[email protected]" } } ] } } ] } } } """; HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://sandbox.walmartapis.com/v3/orders/<purchase_order_id>/shipping")) .header("Accept", "application/json") .header("Content-Type", "application/json") .header("WM_SANDBOX", "v2") .header("WM_SEC.ACCESS_TOKEN", "<access_token>") .header("WM_SVC.NAME", "MP") .header("WM_QOS.CORRELATION_ID", "<correlation_id>") .POST(HttpRequest.BodyPublishers.ofString(body)) .build(); HttpClient client = HttpClient.newHttpClient(); HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString()); System.out.println(response.statusCode()); System.out.println(response.body()); }
}What to expect
- The test order is shipped successfully.
- Inventory is decremented after shipment.
Step 7: Verify inventory decrement
Call the get single item inventory per ship node API again to verify that the input quantity is 0 after the order is shipped.
Endpoint
Requirements
- The test order must already be shipped.
- Use the same SKU and fulfillment center used in the previous inventory check.
Sample request
This sample request retrieves the inventory details for a specific SKU in the Marketplace sandbox
curl --location --request GET 'https://sandbox.walmartapis.com/v3/inventories/{{sku}}' \ --header 'cache-control: no-cache' \ --header 'Accept: application/json' \ --header 'WM_SEC.ACCESS_TOKEN: <access_token>' \ --header 'WM_SVC.NAME: MP' \ --header 'WM_SANDBOX: v2' \ --header 'WM_QOS.CORRELATION_ID: <correlation_id>'import requests sku = "Seller-SKU-001"
token = "<access_token>" url = f"https://sandbox.walmartapis.com/v3/inventories/{sku}" headers = { "cache-control": "no-cache", "Accept": "application/json", "WM_SEC.ACCESS_TOKEN": <access_token>, "WM_SVC.NAME": "MP", "WM_SANDBOX": "v2", "WM_QOS.CORRELATION_ID": "<correlation_id>",
} response = requests.get(url, headers=headers)
response.raise_for_status() print(response.status_code)
print(response.text)import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse; public class GetInventory { public static void main(String[] args) throws Exception { String sku = "Seller-SKU-001"; String token = "<access_token>"; HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://sandbox.walmartapis.com/v3/inventories/" + sku)) .header("cache-control", "no-cache") .header("Accept", "application/json") .header("WM_SEC.ACCESS_TOKEN", token) .header("WM_SVC.NAME", "MP") .header("WM_SANDBOX", "v2") .header("WM_QOS.CORRELATION_ID", "<correlation_id>") .GET() .build(); HttpClient client = HttpClient.newHttpClient(); HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString()); System.out.println(response.statusCode()); System.out.println(response.body()); }
}What to expect
- The API returns updated inventory details for the SKU at the fulfillment center.
- The input quantity is
0.
Step 8: Verify stockout behavior
Create another test order for the same SKU to verify that the request fails when the order quantity is greater than available-to-sell inventory quantity.
Endpoint
Requirements
- The same SKU must be used from the previous steps.
- Available-to-sell inventory quantity must be
0. - The requested order quantity must be greater than the available-to-sell inventory quantity.
Sample request
This sample request creates a simulated test order in the Marketplace sandbox using the specified SKU and shipping details.
curl --location --request POST 'https://sandbox.walmartapis.com/v1/simulations/orders' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'WM_SEC.ACCESS_TOKEN: <access_token>' \
--header 'WM_SVC.NAME: MP' \
--header 'WM_SANDBOX: v2' \
--data-raw '{ "customerEmailId": "[email protected]", "shippingInfo": { "phone": "5558675309", "postalAddress": { "name": "Jane Smith", "address1": "123 Main St", "city": "Springfield", "state": "CA", "postalCode": "95035", "country": "US", "addressType": "RESIDENTIAL" } }, "orderLines": { "orderLine": [ { "item": { "sku": "<sku>" }, "orderLineQuantity": { "unitOfMeasurement": "EACH", "amount": "1" } } ] }
}'import requests url = "https://sandbox.walmartapis.com/v1/simulations/orders" headers = { "Accept": "application/json", "Content-Type": "application/json", "WM_SEC.ACCESS_TOKEN": "<access_token>", "WM_SVC.NAME": "MP", "WM_SANDBOX": "v2",
} payload = { "customerEmailId": "[email protected]", "shippingInfo": { "phone": "5558675309", "postalAddress": { "name": "Jane Smith", "address1": "123 Main St", "city": "Springfield", "state": "CA", "postalCode": "95035", "country": "US", "addressType": "RESIDENTIAL", }, }, "orderLines": { "orderLine": [ { "item": { "sku": "<sku>", }, "orderLineQuantity": { "unitOfMeasurement": "EACH", "amount": "1", }, } ] },
} response = requests.post(url, headers=headers, json=payload)
response.raise_for_status() print(response.status_code)
print(response.text)import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse; public class CreateSimulatedOrder { public static void main(String[] args) throws Exception { String body = """ { "customerEmailId": "[email protected]", "shippingInfo": { "phone": "5558675309", "postalAddress": { "name": "Jane Smith", "address1": "123 Main St", "city": "Springfield", "state": "CA", "postalCode": "95035", "country": "US", "addressType": "RESIDENTIAL" } }, "orderLines": { "orderLine": [ { "item": { "sku": "<sku>" }, "orderLineQuantity": { "unitOfMeasurement": "EACH", "amount": "1" } } ] } } """; HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://sandbox.walmartapis.com/v1/simulations/orders")) .header("Accept", "application/json") .header("Content-Type", "application/json") .header("WM_SEC.ACCESS_TOKEN", "<access_token>") .header("WM_SVC.NAME", "MP") .header("WM_SANDBOX", "v2") .POST(HttpRequest.BodyPublishers.ofString(body)) .build(); HttpClient client = HttpClient.newHttpClient(); HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString()); System.out.println(response.statusCode()); System.out.println(response.body()); }
}What to expect
- The test order is not created.
- The API returns an error because the order quantity is greater than the available-to-sell inventory quantity.
Verify the results
After completing this recipe, verify that:
- Reserved inventory matches the inventory quantity added in Step 2.
- Inventory is decremented after shipment.
- Additional orders fail when the requested quantity exceeds available inventory.
Next steps
Now that you have validated inventory reservation, decrement, and stockout behavior, you can continue testing additional sandbox workflows:
Related resources
- Simulations API Reference
- Sandbox Guide
- Inventory API Guide
- Inventory API Reference
- Orders API Guide
- Orders API Reference
Updated 17 days ago

