This API is to be used by you to provide updates to stock availability for any of the products
that are sold by you. You are expected to provide an array of products, even if the array
contains only one entry.
You are also expected to have made a request to the authenticate API beforehand to have
successfully logged in, and to provide the session cookie given in the authenticate response
in the request to this API.
Parameters
| Name | Notes |
| supplier_id | (required) your id, passed to you from the authenticate api, to confirm who you are. |
| availability | (required) array of products, where each entry in the array contains keys for the product code and quantity. The format of these entries are: { "code": "123456", "qty": 2 } |
| availability[]['code'] | (required) product code used by you to identify a product. |
| availability[]['qty'] | (required) quantity of stock on hand, including awaiting despatch. |
Example Request
https://supplier.rstore.com/rest/stock_availability.api?supplier_id=1
With JSON Content:
{
"availability": [
{
"code": "123456",
"qty": 2
},
{
"code": "654321",
"qty": 1
}
]
}
With Cookie Header:
Cookie: "ksi=abcdefghijklmnopqrstuvwxyz123"
Responses
On Success:
{
"result":[
{
"label": "stock_availability",
"product_codes":"123456,654321"
}
]
}
On Missing Cookie, or Not Logged In
HTTP/1.0 401 Not Authenticated
User not authenticated
On Invalid Json Provided:
HTTP/1.0 400 Invalid Request
Invalid json provided
On Invalid Supplier Parameter
HTTP/1.0 400 Invalid Request
User not authorised to load this supplier's services
On Invalid/No Data Provided
HTTP/1.0 400 Invalid Request
No stock availability data provided
On Missing Product Code
HTTP/1.0 400 Invalid Request
The product's code is a required parameter
On Missing Quantity
HTTP/1.0 400 Invalid Request
Stock available is a required parameter
On Invalid Product Code
HTTP/1.0 400 Invalid Request
No record found for product code "123456"
Comments
0 comments
Article is closed for comments.