data-src=/_includes/saas-only.md
Inventory source nomination
The inventory source nomination endpoints are the admin equivalent of the storefront source-level inventory reservations GraphQL features in Adobe Commerce as a Cloud Service. Use these endpoints to read and set the inventory source that fulfills each cart item, and to check source-level and stock-level availability before you place an order.
These endpoints are designed for:
- Custom order creation applications that customer service representatives use
- Integrations that select a fulfillment source, such as a store or warehouse, before order placement
Availability reads and nomination-time checks are advisory and do not reserve inventory. Commerce runs the authoritative availability check when the order is placed. To learn how a nomination is copied to the order and reserved at the source, see Order lifecycle.
Authentication
All endpoints require an admin or integration bearer token. The admin user role or integration must have the role resource listed for each endpoint in the REST API reference.
Differences from the GraphQL features
The admin endpoints are built for operational use, so they do not apply the storefront restrictions of the sourceAvailability and stockAvailability GraphQL queries:
- Exact quantities - Quantities are always exact. The Only X left Threshold setting does not mask them.
- All enabled sources - Source availability reports every enabled source that is assigned to the stock of the store's sales channel. The storefront visibility setting of a source, the per-source disclosure setting, and catalog visibility rules do not apply.
- Numeric cart item IDs - Nominations use the numeric
item_idof the cart item instead of the GraphQLcart_item_uid.
REST API reference
/V1/carts/:cartId/nominated-sourcesMagento_Cart::manage/V1/carts/:cartId/nominated-sourcesMagento_Cart::manage/V1/inventory/source-availabilityMagento_InventoryApi::source/V1/inventory/stock-availabilityMagento_InventoryApi::stockdata-variant=info
data-slots=text
null, so an omitted field is distinguishable from a value of 0.Retrieve nominated sources
GET /V1/carts/:cartId/nominated-sources returns the current nomination state of every visible item in an active cart.
Response (200):
[
{
"item_id": 42,
"sku": "24-MB01",
"source_code": "warehouse_a",
"nominated_source": {
"source_code": "warehouse_a",
"sku": "24-MB01",
"available_qty": 25,
"is_in_stock": true
},
"errors": []
},
{
"item_id": 45,
"sku": "24-MB02",
"source_code": "warehouse_b",
"errors": [
{
"code": "SOURCE_DISABLED",
"message": "The inventory source \"warehouse_b\" is disabled."
}
]
}
]
item_idskusource_codenominated_sourcenominated_source.source_codenominated_source.skunominated_source.available_qtynominated_source.is_in_stockerrorscode and message. The code is UNKNOWN_SOURCE, SOURCE_DISABLED, or NOT_ENOUGH_QTY. Empty when the nomination is valid.Set or clear nominated sources
PUT /V1/carts/:cartId/nominated-sources sets or clears the nominated source on one or more items in an active cart. Use GET /V1/carts/:cartId/items to find the item_id of each cart item.
Request body:
Wrap the list of items in a nominations object.
{
"nominations": {
"items": [
{
"item_id": 42,
"source_code": "warehouse_a"
},
{
"item_id": 43,
"source_code": null
},
{
"item_id": 44,
"source_code": "store_nyc_001"
}
]
}
}
nominations.itemsnominations.items[].item_idnominations.items[].source_codenull or an empty string.Commerce validates that every item_id belongs to the cart before it writes anything. If any item is not in the cart, the request fails with a 404 response and no nominations change.
The endpoint supports partial success. Commerce saves each valid nomination and returns each invalid nomination in rejected_items with a 200 response. A cart supports one nominated source for each SKU.
Response (200):
The items array contains the nomination state of every cart item after the update, in the same format as Retrieve nominated sources.
{
"items": [ <...> ],
"rejected_items": [
{
"item_id": 44,
"code": "NOT_ENOUGH_QTY",
"message": "Not enough quantity available at the inventory source \"store_nyc_001\".",
"requested_qty": 5,
"available_qty": 2
}
]
}
Each object in rejected_items contains the following fields:
item_idcodemessagerequested_qtyNOT_ENOUGH_QTY.available_qtyNOT_ENOUGH_QTY.The code field returns one of the following values:
UNKNOWN_SOURCESOURCE_DISABLEDNOT_ENOUGH_QTYSKU_SOURCE_CONFLICTRetrieve source availability
GET /V1/inventory/source-availability returns the source-level availability of each requested SKU at the store's sources.
Source-level availability is the physical quantity net of source-level reservations. It does not account for stock-level reservations that cannot be attributed to a source, so it is not the purchasable quantity. Use stock availability to determine whether a SKU can be purchased.
Query parameters:
storeIdskus[]sourceCodes[]onlyInStocktrue, omits sources where the SKU is not in stock. Defaults to false.The following example returns the availability of one SKU at two sources:
GET /V1/inventory/source-availability?storeId=1&skus[]=24-MB01&sourceCodes[]=warehouse_a&sourceCodes[]=store_nyc_001
Response (200):
The response contains one entry for each requested SKU, in request order.
[
{
"sku": "24-MB01",
"sources": [
{
"source_code": "warehouse_a",
"name": "Warehouse A",
"is_pickup_location_active": false,
"available_qty": 25,
"is_in_stock": true
},
{
"source_code": "store_nyc_001",
"name": "NYC Flagship Store",
"is_pickup_location_active": true,
"available_qty": 0,
"is_in_stock": false
}
]
}
]
skusources[].source_codesources[].namesources[].is_pickup_location_activesources[].available_qtysources[].is_in_stockRetrieve stock availability
GET /V1/inventory/stock-availability returns the stock-level salable quantity and purchase eligibility of each requested SKU for the store's sales channel. It uses the same calculation that the cart enforces, including reservations, backorders, minimum and increment quantity rules, and composite products.
Query parameters:
storeIdskus[]The following example returns the stock availability of two SKUs:
GET /V1/inventory/stock-availability?storeId=1&skus[]=24-MB01&skus[]=24-MB04
Response (200):
The response contains one entry for each requested SKU, in request order.
[
{
"sku": "24-MB01",
"salable_qty": 12,
"is_in_stock": true,
"is_salable": true
},
{
"sku": "24-MB04",
"salable_qty": 0,
"is_in_stock": false,
"is_salable": false
}
]
skusalable_qtyis_in_stockis_salablebackorder_messageError handling
400nominations.items list is emptyRequired parameter "items" is missing or empty.400nominations.items list contains more than 100 itemsParameter "items" may contain at most 100 entries.400item_id is not a positive integerEach entry of "items" requires a positive "item_id".404item_id is not a visible item in the cartCould not find cart item with id "<item_id>".400storeId is 0 or negativeParameter "storeId" must identify a store view.400storeId does not existStore with id "<storeId>" does not exist.400skus[] list is emptyRequired parameter "skus" is missing or empty.400skus[] list contains more than 100 valuesParameter "skus" may contain at most 100 entries.400sourceCodes[] list contains more than 100 valuesParameter "sourceCodes" may contain at most 100 entries.REST input validation also rejects a request that omits the required storeId or skus[] parameter with a 400 response.