Create/Update and Delete Stock Table

Instructions

When creating a stock table, our API will create a unique "ID" for that table, so you can update or delete it whenever you want.

Request object has the following properties:

AttributeTypeDescription
codestringPrice table name
typestringown or supplier
prioritystringTable priority
0 is the high priority
quantityintegerquantity of stock available
handling_timestringhandling time

Example of Stock Table creation

{
    "stock_table": [
        {
            "code": "YOUR_CODE",
            "type": "own",
            "priority": 0, 
            "quantity": 10,
            "price": 2.22,
            "special_price": 1.22,
            "handling_time": 10
        },
        {
            "code": "YOUR_CODE_2",
            "type": "supplier",
            "priority": 1,
            "quantity": 3,
            "price": 2.22,
            "special_price": 1.22,
            "handling_time": 10
        }
    ]
}

Example of Stock Table return

Return example after creating the stock table, see that when creating it generated an "id".

{
    "stock_table": [
        {
            "price_history": [],
            "specialprice_history": [],
            "stock_history": [],
            "code": "YOUR_CODE",
            "type": "own",
            "priority": 0,
            "reserved": 0,
            "quantity": 10,
            "price": 2.22,
            "special_price": 1.22,
            "handling_time": 10,
            "id": "60ca141bf2170c5e36d31f77"
        },
        {
            "price_history": [],
            "specialprice_history": [],
            "stock_history": [],
            "code": "YOUR_CODE_2",
            "type": "supplier",
            "priority": 1,
            "reserved": 0,
            "quantity": 3,
            "price": 2.22,
            "special_price": 1.22,
            "handling_time": 10,
            "id": "60ca141bf2170c5e36d31f7b"
        }
    ]
}

Update Example

In this example update, change the inventory of the YOUR_CODE table.

I will use the "code" to make this inventory change.

{
    "stock_table": [
        {
            "code": "YOUR_CODE",
            "quantity": 20
        }
    ]
}

Example of Stock Table return

{
    "stock_table": [
        {
            "price_history": [],
            "specialprice_history": [],
            "stock_history": [],
            "code": "YOUR_CODE",
            "type": "own",
            "priority": 0,
            "reserved": 0,
            "quantity": 20,
            "price": 2.22,
            "special_price": 1.22,
            "handling_time": 10,
            "id": "60ca141bf2170c5e36d31f77"
        },
        {
            "price_history": [],
            "specialprice_history": [],
            "stock_history": [],
            "code": "YOUR_CODE_2",
            "type": "supplier",
            "priority": 1,
            "reserved": 0,
            "quantity": 3,
            "price": 2.22,
            "special_price": 1.22,
            "handling_time": 10,
            "id": "60ca141bf2170c5e36d31f7b"
        }
    ]
}

Deleting Stock Table

To delete an stock table, just enter the corresponding "code" and send "remove" with "true" value.

{
    "stock_table": [
        {
            "code": "YOUR_CODE",
            "remove": true
        }
    ]
}
Language
Click Try It! to start a request and see the response here!