API Recipes

Inventory Reservation and Decrement Validation

This recipe was an interactive walkthrough in the previous portal. Each step below names the API call it makes; open it in the API Reference to try it.

Overview

Step 1: Get Orders

Search your order history to find an order to work with. The response's orderLines[] includes the

API call: getOrders

Step 2: Set Inventory

Set a starting inventory quantity for the seller SKU found in Step 2. This is the baseline you will

API call: updateInventoryForSku

Example arguments:

{
            path: { sku },
            body: {
              quantity: 50,
            },
          }

Step 3: Verify Inventory

Confirm the inventory quantity you just set is now reflected for this SKU.

API call: getInventoryForSku

Example arguments:

{
            path: { sku },
          }

Step 4: Acknowledge Order

Acknowledge the order found in Step 2 to confirm you have accepted it for fulfillment — required

API call: acknowledgeOrder

Example arguments:

{
            path: { purchaseOrderId },
            body: {
              orderLines: [
                {
                  lineNumber: lineNumber ?? "1",
                  statusCode: "Acknowledged",
                },
              ],
            },
          }

Step 5: Ship Order

Ship the order's line with tracking information. Shipping the line is what triggers the inventory

API call: shipOrderLines

Example arguments:

{
            path: { purchaseOrderId },
            body: {
              orderLines: [
                {
                  lineNumber: lineNumber ?? "1",
                  trackingInfo: {
                    carrier: "UPS",
                    trackingNumber: "1Z999AA10123456784",
                    shippedDate: new Date().toISOString(),
                  },
                },
              ],
            },
          }

Step 6: Verify Inventory Decremented

Re-check the same SKU's inventory. The inventoryDetails.fulfillableQuantity should now be lower

API call: getInventoryForSku

Example arguments:

{
            path: { sku },
          }

Step 7: Bulk Update Inventory

Update inventory for multiple SKUs in a single request — useful when restocking many items at once

API call: bulkUpdateInventory

Example arguments:

{
            body: {
              items: [
                { sellerSku: sku ?? "SKU-0001", quantity: 75 },
                { sellerSku: "SKU-0002", quantity: 30 },
              ],
            },
          }

On this page