An example JSON payload containing 2 products.

Save the content as products.json and use this curl command to upload the products using the bulk update api:


curl -H "X-OMNIVORE-CLIENT-ID: ***" -H "X-OMNIVORE-CLIENT-SECRET: ***" --request POST -T inventory.json "https://m1.omnivore.com.au/v2/retailer/example/inventory/bulkUpdate"


foo bar

{
  "products": [
    {
      "sku": "TEST1",
      "variants": [
        {
          "sku": "TEST1",
          "quantity": 1
        }
      ]
    },
    {
      "sku": "TEST2",
      "variants": [
        {
          "sku": "TEST2-RED",
          "quantity": 2
        },
        {
          "sku": "TEST2-BLUE",
          "quantity": 3
        }
      ]
    }
  ]
}

In the example above, only the quantities (inventory) for the products will be updated. No other properties are changed.


Optionally, one can also provide an updated price, for one or all product variants, eg:

{
  "products": [
    {
      "sku": "TEST1",
      "variants": [
        {
          "sku": "TEST1",
          "quantity": 1
        }
      ]
    },
    {
      "sku": "TEST2",
      "variants": [
        {
          "sku": "TEST2-RED",
          "sell_price": {
            "with_tax": "22.00",
            "without_tax": "20.00",
            "tax": "2.00",
            "currency": "AUD"
          },
          "quantity": 2
        },
        {
          "sku": "TEST2-BLUE",
          "quantity": 3
        }
      ]
    }
  ]
}

The price for the red variant ie sku "TEST2-RED" of the product "TEST2" will be updated, along with the quantities of all products and variants specified in the upload file.