Amazon SP API Stock
Version | Date | Created / Updated | Notes |
---|---|---|---|
v1.0 | 11.05.2022 | Bogomil Pavlov | First publish |
v1.1 | 20.06.2023 | Bogomil Pavlov | Introduce Suffix/Prefix Update |
Update Stock
We will use the inventory feed to manage stock levels on Amazon. The xml structure and flows are described here but the actual feed flow and response reader is available here - Amazon SP-API Orders and Products Feeds Flow
Docs: Feed Type Values (amazon.com)
API Call: POST_INVENTORY_AVAILABILITY_DATA
XSD Schema:
<?xml version="1.0"?>
<!-- Revision="$Revision: #3 $" -->
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<!--
$Date: 2006/11/21 $
AMAZON.COM CONFIDENTIAL. This document and the information contained in it are
confidential and proprietary information of Amazon.com and may not be reproduced,
distributed or used, in whole or in part, for any purpose other than as necessary
to list products for sale on the www.amazon.com web site pursuant to an agreement
with Amazon.com.
-->
<xsd:include schemaLocation="amzn-base.xsd"/>
<xsd:element name="Inventory">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="SKU"/>
<xsd:element ref="FulfillmentCenterID" minOccurs="0"/>
<xsd:choice>
<xsd:element name="Available" type="xsd:boolean"/>
<xsd:element name="Quantity" type="xsd:nonNegativeInteger"/>
<xsd:element name="Lookup">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="FulfillmentNetwork"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
</xsd:choice>
<xsd:element name="RestockDate" type="xsd:date" minOccurs="0"/>
<xsd:element name="FulfillmentLatency" type="xsd:positiveInteger" minOccurs="0"/>
<xsd:element name="SwitchFulfillmentTo" minOccurs="0">
<!-- Use this element if you are switching the
fulfillment method for your item.
If you are switching from AFN to MFN, use "MFN"
If you are switching from MFN to AFN, use "AFN"
-->
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="MFN"/>
<xsd:enumeration value="AFN"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
NodeName
Mapping:
Integration Field | Integration Notes | Integration required | Hemi Mapping | Hemi Notes | ||
---|---|---|---|---|---|---|
Inventory |
||||||
SKU |
Yes | Product Details> SKU | (v1.1)Based on the setup in Account Amazon > Suffix/Prefix Value we want to add the suffix/prefix when we are sending updates to Amazon in the SKU. | |||
FulfillmentCenterID |
No | N/A | ||||
Available |
No | N/A | ||||
Quantity |
Yes | Product Accounts > Quantity | ||||
Lookup |
No | N/A | ||||
RestockDate |
No | N/A | ||||
FulfillmentLatency |
No | Product Accounts > Dispatch Time Max | ||||
Shipping Template > Dispatch Time Max | The priority of selecting the Dispatch time is if we have Product Accounts > Dispatch Time Max we pick it from Product Accounts. |
If there is no value in Product Accounts > Dispatch Time Max we pick it from the selected Product Accounts > Shipping Template if there is also nothing selected there we use the default Shipping Template > Dispatch Time Max
Else we do not include the FulfillmentLatency
in the payload. |
| | SwitchFulfillmentTo
| | MFN
AFN | No | N/A | |
Sample Request:
<Message>
<MessageID><![CDATA[1]]></MessageID><Inventory>
<SKU><![CDATA[14001438300]]></SKU>
<Quantity><![CDATA[10]]></Quantity>
<FulfillmentLatency><![CDATA[5]]></FulfillmentLatency>
</Inventory>
</Message>
The trigger for the stock update will be our standard flag Product Accounts > Update Quantity. Since we wont have listing flow yet, when we select listing for quantity update we need to ignore the internal Product and Listing status and rely only on:
Product Accounts > Update Quantity **= Pending Product Accounts > Closed = 0 Product Accounts > Protect Quantity = 0**
If update was successfully sent, we will have following statuses:
Product Accounts > Update Quantity = Sent
If we receive an error, we will have:
Product Accounts > Update Quantity = Error Product Accounts > Error Updating Quantity = {Store the relevant error message}
If the update is successful:
Product Accounts > Update Quantity = Not Needed
End Item
End item is used to stop a product from being “available” to the end buyer but without removing the product from the Marketplace. It is generally used to send 0 stock to the Channel to ensure the product is not being sold anymore.
Docs: Feed Type Values (amazon.com)
API Call: POST_INVENTORY_AVAILABILITY_DATA
XSD schema:
<?xml version="1.0"?>
<!-- Revision="$Revision: #3 $" -->
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<!--
$Date: 2006/11/21 $
AMAZON.COM CONFIDENTIAL. This document and the information contained in it are
confidential and proprietary information of Amazon.com and may not be reproduced,
distributed or used, in whole or in part, for any purpose other than as necessary
to list products for sale on the www.amazon.com web site pursuant to an agreement
with Amazon.com.
-->
<xsd:include schemaLocation="amzn-base.xsd"/>
<xsd:element name="Inventory">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="SKU"/>
<xsd:element ref="FulfillmentCenterID" minOccurs="0"/>
<xsd:choice>
<xsd:element name="Available" type="xsd:boolean"/>
<xsd:element name="Quantity" type="xsd:nonNegativeInteger"/>
<xsd:element name="Lookup">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="FulfillmentNetwork"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
</xsd:choice>
<xsd:element name="RestockDate" type="xsd:date" minOccurs="0"/>
<xsd:element name="FulfillmentLatency" type="xsd:positiveInteger" minOccurs="0"/>
<xsd:element name="SwitchFulfillmentTo" minOccurs="0">
<!-- Use this element if you are switching the
fulfillment method for your item.
If you are switching from AFN to MFN, use "MFN"
If you are switching from MFN to AFN, use "AFN"
-->
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="MFN"/>
<xsd:enumeration value="AFN"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
Sample Request:
<Inventory>
<SKU><![CDATA[14001438300]]></SKU>
<Quantity><![CDATA[0]]></Quantity>
<FulfillmentLatency><![CDATA[5]]></FulfillmentLatency>
</Inventory>
Mapping:
Integration Field | Integration Notes | Integration required | Hemi Mapping | Hemi Notes | ||
---|---|---|---|---|---|---|
Inventory |
||||||
SKU |
Yes | Product Details > SKU | ||||
FulfillmentCenterID |
No | N/A | ||||
Available |
No | N/A | ||||
Quantity |
Yes | “0“ | Hardcoded as “0“ | |||
Lookup |
No | N/A | ||||
RestockDate |
No | N/A | ||||
FulfillmentLatency |
No | N/A | ||||
SwitchFulfillmentTo |
MFN | |||||
AFN | No | N/A |
The trigger for the zero stock update will be our standard flag Product Accounts > End Item
If we would like to end the item (0 stock update):
Product Accounts > End Item **= Pending**
If update was successfully sent, we will have following statuses:
Product Accounts > End Item **= Sent**
If we receive an error, we will have:
Product Accounts > End Item = Error
Product Accounts > End Error = {Store the relevant error message}
If the update is successful: Product Accounts > End Item **= Not Needed**