Inventory
Get inventory items
GET /inventory/items[/name/{#name}][/kind/#{kind}][/unit_price_operator/#{unit_price_operator}][/unit_price/#{unit_price}][/qty_operator/#{qty_operator}][/qty/#{qty}][/stock_operator/#{stock_operator}][/stock/#{stock}]
URI arguments
Argument | Type | Required | Value/Description |
---|---|---|---|
name | string | A name or code. | |
kind | integer | Item kind. See the possible values of kind. |
|
unit_price_operator | string | See the possible values of operator. | |
unit_price | double | A unit price. | |
qty_operator | string | See the possible values of operator. | |
qty | double | A quantity. | |
stock_operator | string | See the possible values of operator. | |
stock | double | A stock quantity. |
cURL request example
curl -u #:#{password}'\ -H 'User-Agent: #{user_agent}'\ -X GET https://#{subdomain}.iscriba.com/api/inventory/items/unit_price_operator/gteq/unit_price/100
XML response example
HTTP Status: 200 OK
<?xml version="1.0" encoding="utf-8"?> <xml> <items> <item> ... </item> <item> ... </item> </items> </xml>
Get an item
GET /inventory/item/id/#{item_id}
URI arguments
Argument | Type | Required | Value |
---|---|---|---|
id | integer | yes | The #{item_id} of the item you wish to get. |
cURL request example
curl -u #:#{password}'\ -H 'User-Agent: #{user_agent}'\ -X GET https://#{subdomain}.iscriba.com/api/inventory/item/id/1
XML response example
HTTP Status: 200 OK
<?xml version="1.0" encoding="utf-8"?> <xml> <item> <item_id>1</item_id> <name>Article</name> <kind>1</kind> <description>Description Article</description> <unit_price>100</unit_price> <qty>1</qty> <manage_stock>0</manage_stock> <stock>0</stock> </item> </xml>
Create an item
POST /inventory/item
Request fields
Field | Type | Required | Description |
---|---|---|---|
name | string | yes | A name or code. |
kind | integer | yes | Item kind. See the possible values of kind. |
description | string | yes | A description. |
unit_price | double | yes | A unit price. |
qty | double | yes | A quantity. |
manage_stock | boolean | yes | Stock management. |
stock | double | yes (if manage_stock = 1) | A stock quantity. |
cURL request example
curl -u #:#{password}'\ -H 'User-Agent: #{user_agent}'\ -d "name=Article&kind=1&description=Description Article&unit_price=10.50&qty=1&manage_stock=1&stock=10"\ https://#{subdomain}.iscriba.com/api/inventory/item
XML response example
HTTP Status: 201 Created
<?xml version="1.0" encoding="utf-8"?> <xml> <item_id>1</item_id> </xml>
Modify an item
PUT /inventory/item/id/#{item_id}
URI arguments
Argument | Type | Required | Value |
---|---|---|---|
id | integer | yes | The #{item_id} of the item you wish to modify. |
Request fields
Same as create an item except that no field is required.
cURL request example
curl -u #:#{password}'\ -H 'User-Agent: #{user_agent}'\ -X PUT\ -d "kind=2&unit_price=12.50&stock=5"\ https://#{subdomain}.iscriba.com/api/inventory/item/id/1
XML response example
HTTP Response: 200 OK
<?xml version="1.0" encoding="utf-8"?> <xml> <item_id>1</item_id> </xml>
Delete an item
DELETE /inventory/item/id/#{item_id}
URI arguments
Argument | Type | Required | Value |
---|---|---|---|
id | integer | yes | The #{item_id} of the item you wish to delete. |
cURL request example
curl -u #:#{password}'\ -H 'User-Agent: #{user_agent}'\ -X DELETE https://#{subdomain}.iscriba.com/api/inventory/item/id/1
XML response example
HTTP Response: 200 OK
<?xml version="1.0" encoding="utf-8"?> <xml> <item_id>1</item_id> </xml>