FBA Inventory Dynamic Sandbox Guide

Test your FBA Inventory API v1 integration code.

Use the Fulfillment by Amazon (FBA) Inventory API v1 dynamic sandbox to test integration code in a safe, isolated developer environment without affecting production data or initiating real-world events. The dynamic sandbox routes requests to a sandbox backend that can return realistic responses based on the request parameters. By sending requests to the sandbox endpoints instead of the SP-API endpoints, you can test standard workflows without impacting production data.

This guide introduces the available dynamic sandbox operations for the FBA Inventory sandbox environment. For more information about the Selling Partner API sandbox environments, refer to the Selling Partner API sandbox.

Dynamic sandbox support in the FBA Inventory API

The dynamic sandbox is supported in the FBA Inventory API v1. Making calls to the dynamic sandbox is identical to making production API calls except you must direct your requests to a dynamic sandbox endpoint for your region instead of the production endpoint. Refer to Selling Partner API sandbox endpoints for the supported sandbox endpoints.

The following FBA Inventory operations return a dynamic response:

The getInventorySummaries response includes the following dynamic fields; all other fields have a static null (0) value:

  • ASIN
  • fnSku
  • sellerSku
  • fulfillableQuantity
  • totalReservedQuantity
  • pendingCustomerOrderQuantity
  • totalQuantity

To dynamically change the response fields for fulfillableQuantity, totalReservedQuantity, and pendingCustomerOrderQuantity, you must create and manage virtual fulfillment orders using the Fulfillment Outbound dynamic sandbox.

Testing using the FBA Inventory dynamic sandbox

To use FBA Inventory dynamic sandbox, you must create a virtual inventory item and add it to the sandbox environment using the following control APIs:

  1. Create an inventory item using createInventoryItem.
  2. Add your inventory item to your sandbox environment using addInventory.
  3. Repeat step 1 and step 2 until you have enough items in your sandbox to conduct your tests.
  4. View your sandbox catalog items and associated inventory by calling getInventorySummaries.

Tutorial: Create, modify, and review virtual inventory

This tutorial shows you how to use the FBA Inventory API v1 dynamic sandbox (along with the Fulfillment Outbound dynamic sandbox) to create, modify, and review inventory in your virtual sandbox environment.

Prerequisites

To complete this tutorial, you must have:

Step 1: Create a virtual product or item

Call the createInventoryItem operation with the sandbox endpoint, as shown in the following example request. This operation creates one inventory item at a time.

Request example

POST https://sandbox.sellingpartnerapi-na.amazon.com/fba/inventory/v1/items
{
  "sellerSku": "PermanentMarker-Red",
  "marketplaceIds": "ATVPDKIKX0DER",
  "productName": "Red Permanent Marker"
}

Step 2. Add virtual inventory for items

Add inventory to the item you created in step 1 by calling the addInventory operation with the sandbox endpoint, as shown in the following example request. To create additional virtual items and inventory, repeat step 1 and step 2.

Request example

POST https://sandbox.sellingpartnerapi-na.amazon.com/v1/items/inventory
{
  "inventoryItems": [
    {
      "sellerSku": "PermanentMarker-Red",
      "marketplaceIds": "ATVPDKIKX0DER",
      "quantity": 5
    },
    {
      "sellerSku": "PermanentMarker-Blue",
      "marketplaceIds": "ATVPDKIKX0DER",
      "quantity": 5
    }
  ]
}

Step 3. Validate inventory summaries

Review the inventory details for the items you created in step 1 and step 2 by calling the getInventorySummaries operation with the sandbox endpoint.

Request example

GET https://sandbox.sellingpartnerapi-na.amazon.com/fba/inventory/v1/summaries?details=true&granularityType=Marketplace&granularityId=ATVPDKIKX0DER&sellerSkus=PermanentMarker-Red&marketplaceIds=ATVPDKIKX0DER

📘

Note

The FBA Inventory API v1 dynamic sandbox automatically creates a virtual Amazon Standard Identification Number (ASIN) and fulfillment network stock keeping unit (FNSKU). These values are fictitious and do not appear in Amazon production.

Step 4. Deplete your virtual inventory

To complete this step, use the Fulfillment Outbound dynamic sandbox to virtually create and fulfill an off-Amazon fulfillment order that depletes the inventory items you created in step 1 and step 2.

Step 5. Review your updated inventory levels

Call the getInventorySummaries operation with the sandbox endpoint to review your updated inventory levels based upon the orders that you completed in the Fulfillment Outbound dynamic sandbox.

Request example

GET https://sandbox.sellingpartnerapi-na.amazon.com/fba/inventory/v1/summaries?details=true&granularityType=Marketplace&granularityId=ATVPDKIKX0DER&sellerSkus=PermanentMarker-Red&marketplaceIds=ATVPDKIKX0DER

Step 6. Delete inventory items from your sandbox

To delete an inventory item from your sandbox environment, call the deleteInventoryItem operation with the sandbox endpoint.

🚧

Important

You can only delete an inventory item if values for fulfillableQuantity, totalReservedQuantity, and pendingCustomerOrderQuantity are 0. To deplete all of your inventory, use the Fulfillment Outbound dynamic sandbox to complete orders.

Request example

DELETE https://sellingpartnerapi-na.amazon.com/fba/inventory/v1/items/deleteInventoryItem
{
  "marketplaceIds": "ATVPDKIKX0DE",
  "sellerSku": "PermanentMarker-Red"
}

OSZAR »