Create or update customers
curl --request POST \
--url https://api.brandgate.dev/v1/customers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"items": [
{
"external_id": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customer_number": "<string>",
"company_name": "<string>",
"contact_name": "<string>",
"email": "jsmith@example.com",
"phone": "<string>",
"vat_number": "<string>",
"billing_address": {
"line1": "<string>",
"city": "<string>",
"postal_code": "<string>",
"country": "<string>"
},
"shipping_address": {
"line1": "<string>",
"city": "<string>",
"postal_code": "<string>",
"country": "<string>"
},
"payment_terms_days": 182,
"preferred_currency": "<string>",
"price_list": "<string>",
"source_updated_at": "2023-11-07T05:31:56Z"
}
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
items: [
{
external_id: '<string>',
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
customer_number: '<string>',
company_name: '<string>',
contact_name: '<string>',
email: 'jsmith@example.com',
phone: '<string>',
vat_number: '<string>',
billing_address: {
line1: '<string>',
city: '<string>',
postal_code: '<string>',
country: '<string>'
},
shipping_address: {
line1: '<string>',
city: '<string>',
postal_code: '<string>',
country: '<string>'
},
payment_terms_days: 182,
preferred_currency: '<string>',
price_list: '<string>',
source_updated_at: '2023-11-07T05:31:56Z'
}
]
})
};
fetch('https://api.brandgate.dev/v1/customers', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.brandgate.dev/v1/customers"
payload = { "items": [
{
"external_id": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customer_number": "<string>",
"company_name": "<string>",
"contact_name": "<string>",
"email": "jsmith@example.com",
"phone": "<string>",
"vat_number": "<string>",
"billing_address": {
"line1": "<string>",
"city": "<string>",
"postal_code": "<string>",
"country": "<string>"
},
"shipping_address": {
"line1": "<string>",
"city": "<string>",
"postal_code": "<string>",
"country": "<string>"
},
"payment_terms_days": 182,
"preferred_currency": "<string>",
"price_list": "<string>",
"source_updated_at": "2023-11-07T05:31:56Z"
}
] }
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/customers");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{\n \"items\": [\n {\n \"external_id\": \"<string>\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"customer_number\": \"<string>\",\n \"company_name\": \"<string>\",\n \"contact_name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\",\n \"vat_number\": \"<string>\",\n \"billing_address\": {\n \"line1\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"country\": \"<string>\"\n },\n \"shipping_address\": {\n \"line1\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"country\": \"<string>\"\n },\n \"payment_terms_days\": 182,\n \"preferred_currency\": \"<string>\",\n \"price_list\": \"<string>\",\n \"source_updated_at\": \"2023-11-07T05:31:56Z\"\n }\n ]\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
{
"object": "batch_result",
"results": [
{
"external_id": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"result": "created",
"error": {
"code": "stale_write",
"message": "<string>",
"existing_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}
],
"counts": {
"created": 123,
"updated": 123,
"unchanged": 123,
"errors": 123
}
}{
"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>"
}
}Create or update customers
Up to 100 customers per request, matched by your external_id. To link a customer that already exists in BrandGate, send its id on the first sync. A customer is never merged by email: a clash is returned as customer_exists with existing_id. Assign a price list with price_list (its external_id). Fields you leave out are not changed.
Requires the customers:write scope.
POST
/
v1
/
customers
Create or update customers
curl --request POST \
--url https://api.brandgate.dev/v1/customers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"items": [
{
"external_id": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customer_number": "<string>",
"company_name": "<string>",
"contact_name": "<string>",
"email": "jsmith@example.com",
"phone": "<string>",
"vat_number": "<string>",
"billing_address": {
"line1": "<string>",
"city": "<string>",
"postal_code": "<string>",
"country": "<string>"
},
"shipping_address": {
"line1": "<string>",
"city": "<string>",
"postal_code": "<string>",
"country": "<string>"
},
"payment_terms_days": 182,
"preferred_currency": "<string>",
"price_list": "<string>",
"source_updated_at": "2023-11-07T05:31:56Z"
}
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
items: [
{
external_id: '<string>',
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
customer_number: '<string>',
company_name: '<string>',
contact_name: '<string>',
email: 'jsmith@example.com',
phone: '<string>',
vat_number: '<string>',
billing_address: {
line1: '<string>',
city: '<string>',
postal_code: '<string>',
country: '<string>'
},
shipping_address: {
line1: '<string>',
city: '<string>',
postal_code: '<string>',
country: '<string>'
},
payment_terms_days: 182,
preferred_currency: '<string>',
price_list: '<string>',
source_updated_at: '2023-11-07T05:31:56Z'
}
]
})
};
fetch('https://api.brandgate.dev/v1/customers', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.brandgate.dev/v1/customers"
payload = { "items": [
{
"external_id": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customer_number": "<string>",
"company_name": "<string>",
"contact_name": "<string>",
"email": "jsmith@example.com",
"phone": "<string>",
"vat_number": "<string>",
"billing_address": {
"line1": "<string>",
"city": "<string>",
"postal_code": "<string>",
"country": "<string>"
},
"shipping_address": {
"line1": "<string>",
"city": "<string>",
"postal_code": "<string>",
"country": "<string>"
},
"payment_terms_days": 182,
"preferred_currency": "<string>",
"price_list": "<string>",
"source_updated_at": "2023-11-07T05:31:56Z"
}
] }
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/customers");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{\n \"items\": [\n {\n \"external_id\": \"<string>\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"customer_number\": \"<string>\",\n \"company_name\": \"<string>\",\n \"contact_name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\",\n \"vat_number\": \"<string>\",\n \"billing_address\": {\n \"line1\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"country\": \"<string>\"\n },\n \"shipping_address\": {\n \"line1\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"country\": \"<string>\"\n },\n \"payment_terms_days\": 182,\n \"preferred_currency\": \"<string>\",\n \"price_list\": \"<string>\",\n \"source_updated_at\": \"2023-11-07T05:31:56Z\"\n }\n ]\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
{
"object": "batch_result",
"results": [
{
"external_id": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"result": "created",
"error": {
"code": "stale_write",
"message": "<string>",
"existing_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}
],
"counts": {
"created": 123,
"updated": 123,
"unchanged": 123,
"errors": 123
}
}{
"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 → API & MCP.
Body
application/json
Required array length:
1 - 100 elementsShow child attributes
Show child attributes