You can set up real-time inventory for your store to provide shoppers with accurate inventory of items that will update in real-time when an order is submitted.
When you are using this version of the Inventory feature, the "Call Script URL" field must contain the URL of your inventory script. Such scripts must accept and return information in the formats described below (here's a sample script.) Inventory will be checked first when a new item is added to the cart and subsequently when the user confirms an order.
All requests will be sent as POST requests with item information sent in <key>=<value> format as described below:
.catalog=<catalog name>Note the "." preceding each of the keys above. Also, each key-value pair will be separated by the ampersand (&) symbol. This list is followed by the item attribute list, if any.
.quantity=<item quantity requested>
.price=<price of item>
When options are defined and selected for an item in the order, the key will take the name of the option (such as size or color) and the value is the option. For example:
The script should respond with the following header information:
Available: <item quantity available>where <quantity> is the number of items available.
Use 0 (zero) to indicate non-availability. Use a negative number to indicate unknown availability.
Inventory-Message: <message>where <message> is the text that a customer will see when they try to place an order for an item that isn't available.
To enable real-time inventory:
Note: If you require firewall restrictions on access to your web server, add the IP ranges for real-time integrations.
Validating Your ScriptWhen you enter the URL for your script in your Store Manager, we will verify it by sending the following request:
.catalog=<your catalog name>&The script should respond with the following header information:
Available: <any integer value>
Please note, that the "Database Inventory" version of the Inventory feature does check your inventory levels in real time at the time the ordered items are placed into the Shopping Cart for your Store, so for most people, the "Database Inventory" version of the Inventory feature works fairly well. Learn more.