Set stock levels
curl --request POST \
--url https://api.brandgate.dev/v1/inventory \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"items": [
{
"sku": "<string>",
"quantity": 50000000
}
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({items: [{sku: '<string>', quantity: 50000000}]})
};
fetch('https://api.brandgate.dev/v1/inventory', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.brandgate.dev/v1/inventory"
payload = { "items": [
{
"sku": "<string>",
"quantity": 50000000
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)using RestSharp;
var options = new RestClientOptions("https://api.brandgate.dev/v1/inventory");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{\n \"items\": [\n {\n \"sku\": \"<string>\",\n \"quantity\": 50000000\n }\n ]\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
{
"object": "inventory_update",
"updated": 1,
"unmatched_skus": [
"<string>"
]
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}inventory
Set stock levels
Set absolute stock per SKU (up to 500 per request). The ERP is the source of truth: BrandGate stock is overwritten, not added to. Answers 409 inventory_managed_by_erp when the company already imports stock from an ERP connected in BrandGate.
Requires the inventory:write scope.
POST
/
v1
/
inventory
Set stock levels
curl --request POST \
--url https://api.brandgate.dev/v1/inventory \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"items": [
{
"sku": "<string>",
"quantity": 50000000
}
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({items: [{sku: '<string>', quantity: 50000000}]})
};
fetch('https://api.brandgate.dev/v1/inventory', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.brandgate.dev/v1/inventory"
payload = { "items": [
{
"sku": "<string>",
"quantity": 50000000
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)using RestSharp;
var options = new RestClientOptions("https://api.brandgate.dev/v1/inventory");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{\n \"items\": [\n {\n \"sku\": \"<string>\",\n \"quantity\": 50000000\n }\n ]\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
{
"object": "inventory_update",
"updated": 1,
"unmatched_skus": [
"<string>"
]
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}Authorizations
apiKeyoauth2
An organization API key (bg_live_…), created in BrandGate under Settings → Developers.
Body
application/json
Required array length:
1 - 500 elementsShow child attributes
Show child attributes