Comment on page
Managing inventory items
Learn how to manage inventory items
In the distributed model, you must define an inventory item and then create the resource. Once created, you can then update or delete the resource. In this model, you must also ensure that the shared attributes of SKU-inventory item pairs remain synchronized.
In both the distributed and the orchestrated models, you use an inventory item's unique identifier to check inventory levels, request shipping quotes, and reserve products during checkout.
In the distributed model, you must use an inventory item's unique identifier when creating a fulfillment order.
The following are some of an inventory item's key definable attributes. For comprehensive specifications, refer to the Inventory Items API reference documentation.
An inventory item's unique identifier is represented by
id
.However, the product identifier in your system should match the inventory item's
id
in our system. As a result, we recommend that you specify your own inventory id
and that it matches your product's designated universally unique identifier.An inventory item's
countryOfOrigin
is a two-letter Alpha-2 country code described in the ISO 3166 international standard. Invalid country codes return a 400 Bad Request
:{
"type": "bad_request",
"errors": [
{
"code": "invalid_parameter",
"parameter": "countryOfOrigin",
"message": "'KP' is not a valid Country of Origin."
}
]
}
An inventory item's
eccn
represents an Export Control Classification Number (ECCN). This value determines whether:- A product requires a US export/re-export license
- A product contains any other license requirements/restrictions
- A product has an end use which is prohibited by applicable export control laws
Digital River's legal documentation lists ECCNs pre-approved for use in the Digital River APIs. In the table's description field, you may find additional requirements and restrictions that further limit the use of the ECCN.
Digital River can only resell products with these listed ECCNs. If you have a product with an ECCN that you'd like to be considered for addition to the list, please contact [email protected]
The format of the code is
####.##.####
, where #
represents a numeric digit between 0 and 9. The first six digits are mandatory. Any code longer than six digits but less than ten digits is optional and based on the country's preference. The period is not included in the character count.Digital River only validates that the format of a Harmonized System code you provide is correct. We don't determine whether the code accurately classifies your product.
For example, the full ten-digit code for Jasmine rice in the United States is 1006.20.40.25. If that's the value you specify, we don't check to ensure your product fits into that category.
Incorrectly formatted
hsCode
values return a 400 Bad Request
:JSON
{
"type": "bad_request",
"errors": [
{
"code": "invalid_parameter",
"parameter": "hsCode",
"message": "'1234.56.YW' is not a valid HS code."
}
]
}
An inventory item contains
manufacturerId
and partNumber
fields.The
manufacturerId
signifies the unique identifier of a part/product's manufacturer.A manufacturer part number (MPN) is a unique code issued by manufacturers to identify a part/product. It is represented by
partNumber
.MPNs are meant to be static identifiers of a part/product, universal to all distributors, wholesalers, and resellers. They allow customers to identify exact parts and protect themselves from counterfeits accurately.
If two parts/products originate from two manufacturers, each must have its own MPN. These identifiers are especially relevant for automotive and consumer electronics due to the numerous parts in these complex products.
You may decide to build your integration such that customers can reserve out-of-stock items or pre-order items not yet in stock. To do this, you can use an inventory item's
allowOversell
flag.If you set the flag to
true
, customers can reserve the item even when inventory is not available. When set to false
, customers won't be able to place a hold on an item when its inventory levels are insufficient.You can use the Inventory Items API to create and update, retrieve, search for, and delete inventory items.
The methods to create and update inventory items are similar, with one major difference. In create requests, you're allowed to specify a unique identifier. When updating items, you must send that identifier as a path parameter.
Create an inventory item
Update an inventory item
curl --location --request POST 'http://api.digitalriver.com/inventory-items' \
--header 'Authorization: Bearer <API_key>' \
--header 'Content-Type: application/json' \
--data-raw '{
"id": "8d7b212f-2a19-4530-84b9-aa76e8dad4eb",
"manufacturerId": "20013",
"partNumber": "DEMOPARTNUMBER2",
"eccn": "EAR99",
"hsCode": "6404.20",
"countryOfOrigin": "DK",
"allowOversell": false
}'
curl --location --request POST 'http://dispatch-test.digitalriver.com/inventory-items/8d7b212f-2a19-4530-84b9-aa76e8dad4eb' \
--header 'Authorization: Bearer <API_key>' \
--header 'Content-Type: application/json' \
--data-raw '{
"countryOfOrigin": "CA",
"allowOversell": true
}'
For both
POST/inventory-items
and POST/inventory-items/{id}
requests, however, you can specify a part number, Export Control Classification Number, Harmonized System code, and country of origin. You can also tell us whether you want to allow overselling of that item.The Inventory Items API lets you permanently delete an inventory item by supplying its unique identifier.
In Digital River coordinated fulfillments that use the orchestrated model, you should not directly delete inventory items.