Inventory Set Bulk

POST{{api_url}}/shop/inventory/bulk_update

Set inventory for a sku

Authorization

Bearer token, sent in the Authorization header. Inherited from the collection.

Headers

KeyValueDescription
Content-Typeapplication/json

Body

[
    {
        "sku": "DTR5511",
        "warehouse_id": 13,
        "quantity_to_set": 27
    },
    {
        "sku": "1705145",
        "warehouse_id": 13,
        "quantity_to_set": 3
    },
    {
        "sku": "1702325",
        "warehouse_id": 13,
        "quantity_to_set": 1
    },
    {
        "sku": "3012431",
        "warehouse_id": 13,
        "quantity_to_set": 1
    },
    {
        "sku": "SMR15SF10",
        "warehouse_id": 13,
        "quantity_to_set": 0
    },
    {
        "sku": "8895554",
        "warehouse_id": 13,
        "quantity_to_set": 12
    },
    {
        "sku": "1703305",
        "warehouse_id": 13,
        "quantity_to_set": 14
    },
    {
        "sku": "1307005",
        "warehouse_id": 13,
        "quantity_to_set": 38
    },
    {
        "sku": "5531020",
        "warehouse_id": 13,
        "quantity_to_set": 19
    },
    {
        "sku": "16071160",
        "warehouse_id": 13,
        "quantity_to_set": 4
    },
    {
        "sku": "16021510",
        "warehouse_id": 13,
        "quantity_to_set": 5
    }
]

Example Request

curl --location --request POST '{{api_url}}/shop/inventory/bulk_update' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {{auth_token}}' \
--data '[
    {
        "sku": "DTR5511",
        "warehouse_id": 13,
        "quantity_to_set": 27
    },
    {
        "sku": "1705145",
        "warehouse_id": 13,
        "quantity_to_set": 3
    },
    {
        "sku": "1702325",
        "warehouse_id": 13,
        "quantity_to_set": 1
    },
    {
        "sku": "3012431",
        "warehouse_id": 13,
        "quantity_to_set": 1
    },
    {
        "sku": "SMR15SF10",
        "warehouse_id": 13,
        "quantity_to_set": 0
    },
    {
        "sku": "8895554",
        "warehouse_id": 13,
        "quantity_to_set": 12
    },
    {
        "sku": "1703305",
        "warehouse_id": 13,
        "quantity_to_set": 14
    },
    {
        "sku": "1307005",
        "warehouse_id": 13,
        "quantity_to_set": 38
    },
    {
        "sku": "5531020",
        "warehouse_id": 13,
        "quantity_to_set": 19
    },
    {
        "sku": "16071160",
        "warehouse_id": 13,
        "quantity_to_set": 4
    },
    {
        "sku": "16021510",
        "warehouse_id": 13,
        "quantity_to_set": 5
    }
]'

Example Responses

Inventory Set Bulk

Request

curl --location --request POST '{{api_url}}/shop/inventory/bulk_update' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--data '[
    {
        "sku": "ABC123",
        "warehouse_id": 7,
        "quantity_to_add": 5
    },
    {
        "sku": "DEF456",
        "warehouse_id": 7,
        "quantity_to_set": 100
    },
    {
        "sku": "GHI789",
        "warehouse_id": 17,
        "quantity_to_set": 250
    }
]'

Response 200 OK

[
    {
        "sku": "ABC123",
        "warehouse_inventory": "50"
    },
    {
        "sku": "DEF456",
        "warehouse_inventory": null
    },
    {
        "sku": "GHI789",
        "warehouse_inventory": null
    }
]