# 1. Update Stocks

Bulk Inventory Update — Asynchronous batch update by sku, id or externalId. Supports global stock (omit warehouses) or per‑warehouse stock (list of clientIds or {clientId, stock}). Emits stock.update.requested events; track with requestId/batchId. Response includes acceptedRows, errors, and summary.

Overview

HMACASYNC
Auth
HMAC Partner
Method
PATCH

# Path

https://partners-api.tocobagus.net/api/v1 /partner/stores/inventory

# Request

Query parameters: None.

# Required Headers

Header Example Description
x-signature bdbb8833fe43671e058b56dace75763a78a2edf8de7365afb6f534d750056e80 HMAC signature of the request, computed with the partner secret and x-timestamp (auth integrity).
x-partner-client-id 2025112512510620439726 Partner identifier issued by Omni; used to locate the partner secret.
x-store-client-id 638765489981529612495 Target store identifier under the partner account.
x-store-token stkn_Dd26kxQ7obYAdAvo Store access token for store-level authorization.
x-timestamp 1758100350458 UNIX epoch timestamp used when computing x-signature (replay protection).

# Request Payload

Content-Type: application/json

# Example Body Payload

{
  "items": [
    {
      "sku": "SKU-MRON-L",
      "stock": 55,
      "warehouses": [
        "2026012714314318226016"
      ]
    },
    {
      "id": "c16785c6-f55a-4b1d-943c-621db1296357",
      "stock": 99,
      "warehouses": [
        "2026012714314318226016"
      ]
    },
    {
      "sku": "SKU-BLK-XL",
      "warehouses": [
        {
          "stock": 8,
          "clientId": "wh_wh8-HpRcn3ZH"
        },
        {
          "stock": 12,
          "clientId": "wh_Xv53JrfSpHh7"
        },
        {
          "stock": 2,
          "clientId": "wh_Xv53JrfSp37s"
        }
      ]
    },
    {
      "sku": "SKU-GRY-XL",
      "stock": 200
    },
    {
      "id": "d4a8b8bc-de1d-40cb-98de-6783b3fdeab3",
      "stock": 18
    },
    {
      "externalId": "bee2f8e5-ed8c-4b8e-97dc-208e45521909",
      "stock": 32
    }
  ]
}

# Example Request

curl -X PATCH "http:///partner/stores/inventory" \
  -H "Content-Type: application/json" \
  -H "x-signature: bdbb8833fe43671e058b56dace75763a78a2edf8de7365afb6f534d750056e80" \
  -H "x-partner-client-id: 2025112512510620439726" \
  -H "x-store-client-id: 638765489981529612495" \
  -H "x-store-token: stkn_Dd26kxQ7obYAdAvo" \
  -H "x-timestamp: 1758100350458" \
  --data '{"items":[{"sku":"SKU-MRON-L","stock":55,"warehouses":["2026012714314318226016"]},{"id":"c16785c6-f55a-4b1d-943c-621db1296357","stock":99,"warehouses":["2026012714314318226016"]},{"sku":"SKU-BLK-XL","warehouses":[{"stock":8,"clientId":"wh_wh8-HpRcn3ZH"},{"stock":12,"clientId":"wh_Xv53JrfSpHh7"},{"stock":2,"clientId":"wh_Xv53JrfSp37s"}]},{"sku":"SKU-GRY-XL","stock":200},{"id":"d4a8b8bc-de1d-40cb-98de-6783b3fdeab3","stock":18}]}'
const qs = new URLSearchParams({});
const url = "http:///partner/stores/inventory" + (qs.toString() ? "?" + qs.toString() : "");
const res = await fetch(url, {
  method: "PATCH",
  headers: {
  "x-signature": "bdbb8833fe43671e058b56dace75763a78a2edf8de7365afb6f534d750056e80",
  "x-partner-client-id": "2025112512510620439726",
  "x-store-client-id": "638765489981529612495",
  "x-store-token": "stkn_Dd26kxQ7obYAdAvo",
  "x-timestamp": "1758100350458"
},
  body: JSON.stringify({"items":[{"sku":"SKU-MRON-L","stock":55,"warehouses":["2026012714314318226016"]},{"id":"c16785c6-f55a-4b1d-943c-621db1296357","stock":99,"warehouses":["2026012714314318226016"]},{"sku":"SKU-BLK-XL","warehouses":[{"stock":8,"clientId":"wh_wh8-HpRcn3ZH"},{"stock":12,"clientId":"wh_Xv53JrfSpHh7"},{"stock":2,"clientId":"wh_Xv53JrfSp37s"}]},{"sku":"SKU-GRY-XL","stock":200},{"id":"d4a8b8bc-de1d-40cb-98de-6783b3fdeab3","stock":18}]})
});
const json = await res.json();
console.log(json);
qs := url.Values{}

u := "http:///partner/stores/inventory"
if q := qs.Encode(); q != "" { u = u + "?" + q }
req, _ := http.NewRequest("PATCH", u, bytes.NewBufferString("{\"items\":[{\"sku\":\"SKU-MRON-L\",\"stock\":55,\"warehouses\":[\"2026012714314318226016\"]},{\"id\":\"c16785c6-f55a-4b1d-943c-621db1296357\",\"stock\":99,\"warehouses\":[\"2026012714314318226016\"]},{\"sku\":\"SKU-BLK-XL\",\"warehouses\":[{\"stock\":8,\"clientId\":\"wh_wh8-HpRcn3ZH\"},{\"stock\":12,\"clientId\":\"wh_Xv53JrfSpHh7\"},{\"stock\":2,\"clientId\":\"wh_Xv53JrfSp37s\"}]},{\"sku\":\"SKU-GRY-XL\",\"stock\":200},{\"id\":\"d4a8b8bc-de1d-40cb-98de-6783b3fdeab3\",\"stock\":18}]}"))
req.Header.Set("x-signature", "bdbb8833fe43671e058b56dace75763a78a2edf8de7365afb6f534d750056e80")
req.Header.Set("x-partner-client-id", "2025112512510620439726")
req.Header.Set("x-store-client-id", "638765489981529612495")
req.Header.Set("x-store-token", "stkn_Dd26kxQ7obYAdAvo")
req.Header.Set("x-timestamp", "1758100350458")
req.Header.Set("Content-Type", "application/json")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
b, _ := io.ReadAll(resp.Body)
fmt.Println(string(b))
var client = java.net.http.HttpClient.newHttpClient();
var req = java.net.http.HttpRequest.newBuilder()
    .uri(java.net.URI.create("http:///partner/stores/inventory"))
    .header("Content-Type","application/json")
    .header("x-signature", "bdbb8833fe43671e058b56dace75763a78a2edf8de7365afb6f534d750056e80")
    .header("x-partner-client-id", "2025112512510620439726")
    .header("x-store-client-id", "638765489981529612495")
    .header("x-store-token", "stkn_Dd26kxQ7obYAdAvo")
    .header("x-timestamp", "1758100350458")
    .method("PATCH", java.net.http.HttpRequest.BodyPublishers.ofString("{\"items\":[{\"sku\":\"SKU-MRON-L\",\"stock\":55,\"warehouses\":[\"2026012714314318226016\"]},{\"id\":\"c16785c6-f55a-4b1d-943c-621db1296357\",\"stock\":99,\"warehouses\":[\"2026012714314318226016\"]},{\"sku\":\"SKU-BLK-XL\",\"warehouses\":[{\"stock\":8,\"clientId\":\"wh_wh8-HpRcn3ZH\"},{\"stock\":12,\"clientId\":\"wh_Xv53JrfSpHh7\"},{\"stock\":2,\"clientId\":\"wh_Xv53JrfSp37s\"}]},{\"sku\":\"SKU-GRY-XL\",\"stock\":200},{\"id\":\"d4a8b8bc-de1d-40cb-98de-6783b3fdeab3\",\"stock\":18}]}"))
    .build();
var res = client.send(req, java.net.http.HttpResponse.BodyHandlers.ofString());
System.out.println(res.body());

# Responses

# Example Responses

{
  "success": true,
  "message": "Stock update completed successfully",
  "requestId": "b9ac96d2-7ce7-4473-bb86-0ed2e8c7846a",
  "meta": {
    "timestamp": "2026-02-04T20:01:39.898Z",
    "durationMs": 967,
    "dispatch": true
  },
  "data": {
    "summary": {
      "total": 5,
      "failed": 2,
      "pending": 3
    },
    "acceptedRows": [
      {
        "rowIndex": 0,
        "target": "variant",
        "id": "8ae500ea-9b4d-4edb-a18f-b99f1d4aa955",
        "externalId": "946b3ffa-5f9e-412e-acf4-eea306736e63",
        "sku": "SKU-MRON-L"
      },
      {
        "rowIndex": 1,
        "target": "product",
        "id": "015c28c3-b48c-4e1f-a8a1-9a1cc07022c5",
        "externalId": "bee2f8e5-ed8c-4b8e-97dc-208e45521909"
      },
      {
        "rowIndex": 3,
        "target": "variant",
        "id": "8ae500ea-9b4d-4edb-a18f-b99f1d4aa955",
        "externalId": "946b3ffa-5f9e-412e-acf4-eea306736e63",
        "sku": "SKU-GRY-XL"
      }
    ],
    "errors": [
      {
        "code": "INV_001",
        "message": "Invalid SKU",
        "rowIndex": 2,
        "sku": "SKU-BLK-XL",
        "details": {
          "context": {
            "reason": "Product SKU not found"
          }
        }
      },
      {
        "code": "INV_002",
        "message": "Invalid Product ID",
        "rowIndex": 4,
        "id": "d4a8b8bc-de1d-40cb-98de-6783b3fdeab3",
        "details": {
          "context": {
            "reason": "Product ID not found"
          }
        }
      }
    ],
    "batchId": "05c66098-f4b1-4274-81ef-84a1a2916511"
  }
}
{
  "success": false,
  "error": {
    "code": "AUTH_003",
    "message": "Expired or invalid timestamp",
    "details": {
      "timestamp": "2026-02-04T19:26:36.936Z",
      "hint": "Request timestamp must be within 300 seconds",
      "context": {
        "providedTimestamp": 1770230415283,
        "currentTime": 1770233196936,
        "ageSeconds": 2781
      }
    }
  },
  "requestId": "6f805723-2f81-463e-b065-630c51d0e682"
}
{
  "success": false,
  "error": {
    "code": "AUTH_010",
    "message": "Invalid signature",
    "details": {
      "timestamp": "2026-02-04T19:27:33.550Z",
      "hint": "Invalid HMAC signature",
      "context": {
        "partnerClientId": "2025112512510620439726"
      }
    }
  },
  "requestId": "9aeea2c8-0c6e-4ecd-a042-abd768c2e410"
}

# Dictionary

None for this endpoint.

# Notes

None for this endpoint.