Batch update customers
curl --request PATCH \
--url http://localhost:3000/v2/customers/many \
--header 'Content-Type: application/json' \
--header 'x-API-Key: <api-key>' \
--data '
{
"ids": [
"<string>"
],
"data": {
"number": 1001,
"name": "ABC Cleaning Services GmbH",
"_id": "<string>",
"companyId": "<string>",
"status": {
"status": 123,
"createdAt": "2023-11-07T05:31:56Z",
"createdBy": "<string>",
"lastModifiedAt": "2023-11-07T05:31:56Z",
"lastModifiedBy": "<string>"
},
"chatId": "<string>",
"contactPerson": "John Doe",
"address": {
"street": "<string>",
"zip": "<string>",
"city": "<string>",
"country": "<string>",
"co": "<string>",
"state": "<string>"
},
"contact": {
"telephone": "+1-555-123-4567",
"mobile": "+1-555-987-6543",
"email": "contact@company.com",
"sms": "+1-555-111-2222",
"smsCount": 5,
"smsChatCount": 12,
"smsSendDate": "2024-01-15T10:30:00Z",
"smsSendBy": "user123",
"website": "https://www.company.com",
"lastSMSStatus": "delivered",
"secondSmsSendDate": "2024-01-16T14:45:00Z"
},
"contract": {},
"invoiceRecipientId": "<string>",
"invoiceCCRecipientIds": [
"<string>"
],
"hideRecipientOnDocuments": false,
"buyerReference": "04011000-1234512345-12",
"orderReferenceId": "SUP-12345",
"vatNumber": "DE123456789",
"debitorNumber": "DEB-001",
"paymentTermId": "<string>"
}
}
'import requests
url = "http://localhost:3000/v2/customers/many"
payload = {
"ids": ["<string>"],
"data": {
"number": 1001,
"name": "ABC Cleaning Services GmbH",
"_id": "<string>",
"companyId": "<string>",
"status": {
"status": 123,
"createdAt": "2023-11-07T05:31:56Z",
"createdBy": "<string>",
"lastModifiedAt": "2023-11-07T05:31:56Z",
"lastModifiedBy": "<string>"
},
"chatId": "<string>",
"contactPerson": "John Doe",
"address": {
"street": "<string>",
"zip": "<string>",
"city": "<string>",
"country": "<string>",
"co": "<string>",
"state": "<string>"
},
"contact": {
"telephone": "+1-555-123-4567",
"mobile": "+1-555-987-6543",
"email": "contact@company.com",
"sms": "+1-555-111-2222",
"smsCount": 5,
"smsChatCount": 12,
"smsSendDate": "2024-01-15T10:30:00Z",
"smsSendBy": "user123",
"website": "https://www.company.com",
"lastSMSStatus": "delivered",
"secondSmsSendDate": "2024-01-16T14:45:00Z"
},
"contract": {},
"invoiceRecipientId": "<string>",
"invoiceCCRecipientIds": ["<string>"],
"hideRecipientOnDocuments": False,
"buyerReference": "04011000-1234512345-12",
"orderReferenceId": "SUP-12345",
"vatNumber": "DE123456789",
"debitorNumber": "DEB-001",
"paymentTermId": "<string>"
}
}
headers = {
"x-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'x-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
ids: ['<string>'],
data: {
number: 1001,
name: 'ABC Cleaning Services GmbH',
_id: '<string>',
companyId: '<string>',
status: {
status: 123,
createdAt: '2023-11-07T05:31:56Z',
createdBy: '<string>',
lastModifiedAt: '2023-11-07T05:31:56Z',
lastModifiedBy: '<string>'
},
chatId: '<string>',
contactPerson: 'John Doe',
address: {
street: '<string>',
zip: '<string>',
city: '<string>',
country: '<string>',
co: '<string>',
state: '<string>'
},
contact: {
telephone: '+1-555-123-4567',
mobile: '+1-555-987-6543',
email: 'contact@company.com',
sms: '+1-555-111-2222',
smsCount: 5,
smsChatCount: 12,
smsSendDate: '2024-01-15T10:30:00Z',
smsSendBy: 'user123',
website: 'https://www.company.com',
lastSMSStatus: 'delivered',
secondSmsSendDate: '2024-01-16T14:45:00Z'
},
contract: {},
invoiceRecipientId: '<string>',
invoiceCCRecipientIds: ['<string>'],
hideRecipientOnDocuments: false,
buyerReference: '04011000-1234512345-12',
orderReferenceId: 'SUP-12345',
vatNumber: 'DE123456789',
debitorNumber: 'DEB-001',
paymentTermId: '<string>'
}
})
};
fetch('http://localhost:3000/v2/customers/many', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3000",
CURLOPT_URL => "http://localhost:3000/v2/customers/many",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'ids' => [
'<string>'
],
'data' => [
'number' => 1001,
'name' => 'ABC Cleaning Services GmbH',
'_id' => '<string>',
'companyId' => '<string>',
'status' => [
'status' => 123,
'createdAt' => '2023-11-07T05:31:56Z',
'createdBy' => '<string>',
'lastModifiedAt' => '2023-11-07T05:31:56Z',
'lastModifiedBy' => '<string>'
],
'chatId' => '<string>',
'contactPerson' => 'John Doe',
'address' => [
'street' => '<string>',
'zip' => '<string>',
'city' => '<string>',
'country' => '<string>',
'co' => '<string>',
'state' => '<string>'
],
'contact' => [
'telephone' => '+1-555-123-4567',
'mobile' => '+1-555-987-6543',
'email' => 'contact@company.com',
'sms' => '+1-555-111-2222',
'smsCount' => 5,
'smsChatCount' => 12,
'smsSendDate' => '2024-01-15T10:30:00Z',
'smsSendBy' => 'user123',
'website' => 'https://www.company.com',
'lastSMSStatus' => 'delivered',
'secondSmsSendDate' => '2024-01-16T14:45:00Z'
],
'contract' => [
],
'invoiceRecipientId' => '<string>',
'invoiceCCRecipientIds' => [
'<string>'
],
'hideRecipientOnDocuments' => false,
'buyerReference' => '04011000-1234512345-12',
'orderReferenceId' => 'SUP-12345',
'vatNumber' => 'DE123456789',
'debitorNumber' => 'DEB-001',
'paymentTermId' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://localhost:3000/v2/customers/many"
payload := strings.NewReader("{\n \"ids\": [\n \"<string>\"\n ],\n \"data\": {\n \"number\": 1001,\n \"name\": \"ABC Cleaning Services GmbH\",\n \"_id\": \"<string>\",\n \"companyId\": \"<string>\",\n \"status\": {\n \"status\": 123,\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"createdBy\": \"<string>\",\n \"lastModifiedAt\": \"2023-11-07T05:31:56Z\",\n \"lastModifiedBy\": \"<string>\"\n },\n \"chatId\": \"<string>\",\n \"contactPerson\": \"John Doe\",\n \"address\": {\n \"street\": \"<string>\",\n \"zip\": \"<string>\",\n \"city\": \"<string>\",\n \"country\": \"<string>\",\n \"co\": \"<string>\",\n \"state\": \"<string>\"\n },\n \"contact\": {\n \"telephone\": \"+1-555-123-4567\",\n \"mobile\": \"+1-555-987-6543\",\n \"email\": \"contact@company.com\",\n \"sms\": \"+1-555-111-2222\",\n \"smsCount\": 5,\n \"smsChatCount\": 12,\n \"smsSendDate\": \"2024-01-15T10:30:00Z\",\n \"smsSendBy\": \"user123\",\n \"website\": \"https://www.company.com\",\n \"lastSMSStatus\": \"delivered\",\n \"secondSmsSendDate\": \"2024-01-16T14:45:00Z\"\n },\n \"contract\": {},\n \"invoiceRecipientId\": \"<string>\",\n \"invoiceCCRecipientIds\": [\n \"<string>\"\n ],\n \"hideRecipientOnDocuments\": false,\n \"buyerReference\": \"04011000-1234512345-12\",\n \"orderReferenceId\": \"SUP-12345\",\n \"vatNumber\": \"DE123456789\",\n \"debitorNumber\": \"DEB-001\",\n \"paymentTermId\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("http://localhost:3000/v2/customers/many")
.header("x-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"ids\": [\n \"<string>\"\n ],\n \"data\": {\n \"number\": 1001,\n \"name\": \"ABC Cleaning Services GmbH\",\n \"_id\": \"<string>\",\n \"companyId\": \"<string>\",\n \"status\": {\n \"status\": 123,\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"createdBy\": \"<string>\",\n \"lastModifiedAt\": \"2023-11-07T05:31:56Z\",\n \"lastModifiedBy\": \"<string>\"\n },\n \"chatId\": \"<string>\",\n \"contactPerson\": \"John Doe\",\n \"address\": {\n \"street\": \"<string>\",\n \"zip\": \"<string>\",\n \"city\": \"<string>\",\n \"country\": \"<string>\",\n \"co\": \"<string>\",\n \"state\": \"<string>\"\n },\n \"contact\": {\n \"telephone\": \"+1-555-123-4567\",\n \"mobile\": \"+1-555-987-6543\",\n \"email\": \"contact@company.com\",\n \"sms\": \"+1-555-111-2222\",\n \"smsCount\": 5,\n \"smsChatCount\": 12,\n \"smsSendDate\": \"2024-01-15T10:30:00Z\",\n \"smsSendBy\": \"user123\",\n \"website\": \"https://www.company.com\",\n \"lastSMSStatus\": \"delivered\",\n \"secondSmsSendDate\": \"2024-01-16T14:45:00Z\"\n },\n \"contract\": {},\n \"invoiceRecipientId\": \"<string>\",\n \"invoiceCCRecipientIds\": [\n \"<string>\"\n ],\n \"hideRecipientOnDocuments\": false,\n \"buyerReference\": \"04011000-1234512345-12\",\n \"orderReferenceId\": \"SUP-12345\",\n \"vatNumber\": \"DE123456789\",\n \"debitorNumber\": \"DEB-001\",\n \"paymentTermId\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3000/v2/customers/many")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Patch.new(url)
request["x-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"ids\": [\n \"<string>\"\n ],\n \"data\": {\n \"number\": 1001,\n \"name\": \"ABC Cleaning Services GmbH\",\n \"_id\": \"<string>\",\n \"companyId\": \"<string>\",\n \"status\": {\n \"status\": 123,\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"createdBy\": \"<string>\",\n \"lastModifiedAt\": \"2023-11-07T05:31:56Z\",\n \"lastModifiedBy\": \"<string>\"\n },\n \"chatId\": \"<string>\",\n \"contactPerson\": \"John Doe\",\n \"address\": {\n \"street\": \"<string>\",\n \"zip\": \"<string>\",\n \"city\": \"<string>\",\n \"country\": \"<string>\",\n \"co\": \"<string>\",\n \"state\": \"<string>\"\n },\n \"contact\": {\n \"telephone\": \"+1-555-123-4567\",\n \"mobile\": \"+1-555-987-6543\",\n \"email\": \"contact@company.com\",\n \"sms\": \"+1-555-111-2222\",\n \"smsCount\": 5,\n \"smsChatCount\": 12,\n \"smsSendDate\": \"2024-01-15T10:30:00Z\",\n \"smsSendBy\": \"user123\",\n \"website\": \"https://www.company.com\",\n \"lastSMSStatus\": \"delivered\",\n \"secondSmsSendDate\": \"2024-01-16T14:45:00Z\"\n },\n \"contract\": {},\n \"invoiceRecipientId\": \"<string>\",\n \"invoiceCCRecipientIds\": [\n \"<string>\"\n ],\n \"hideRecipientOnDocuments\": false,\n \"buyerReference\": \"04011000-1234512345-12\",\n \"orderReferenceId\": \"SUP-12345\",\n \"vatNumber\": \"DE123456789\",\n \"debitorNumber\": \"DEB-001\",\n \"paymentTermId\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"modifiedCount": 123
}Customers
Batch Update Customers
Update multiple customers at once. Useful for bulk operations like status changes.
PATCH
/
customers
/
many
Batch update customers
curl --request PATCH \
--url http://localhost:3000/v2/customers/many \
--header 'Content-Type: application/json' \
--header 'x-API-Key: <api-key>' \
--data '
{
"ids": [
"<string>"
],
"data": {
"number": 1001,
"name": "ABC Cleaning Services GmbH",
"_id": "<string>",
"companyId": "<string>",
"status": {
"status": 123,
"createdAt": "2023-11-07T05:31:56Z",
"createdBy": "<string>",
"lastModifiedAt": "2023-11-07T05:31:56Z",
"lastModifiedBy": "<string>"
},
"chatId": "<string>",
"contactPerson": "John Doe",
"address": {
"street": "<string>",
"zip": "<string>",
"city": "<string>",
"country": "<string>",
"co": "<string>",
"state": "<string>"
},
"contact": {
"telephone": "+1-555-123-4567",
"mobile": "+1-555-987-6543",
"email": "contact@company.com",
"sms": "+1-555-111-2222",
"smsCount": 5,
"smsChatCount": 12,
"smsSendDate": "2024-01-15T10:30:00Z",
"smsSendBy": "user123",
"website": "https://www.company.com",
"lastSMSStatus": "delivered",
"secondSmsSendDate": "2024-01-16T14:45:00Z"
},
"contract": {},
"invoiceRecipientId": "<string>",
"invoiceCCRecipientIds": [
"<string>"
],
"hideRecipientOnDocuments": false,
"buyerReference": "04011000-1234512345-12",
"orderReferenceId": "SUP-12345",
"vatNumber": "DE123456789",
"debitorNumber": "DEB-001",
"paymentTermId": "<string>"
}
}
'import requests
url = "http://localhost:3000/v2/customers/many"
payload = {
"ids": ["<string>"],
"data": {
"number": 1001,
"name": "ABC Cleaning Services GmbH",
"_id": "<string>",
"companyId": "<string>",
"status": {
"status": 123,
"createdAt": "2023-11-07T05:31:56Z",
"createdBy": "<string>",
"lastModifiedAt": "2023-11-07T05:31:56Z",
"lastModifiedBy": "<string>"
},
"chatId": "<string>",
"contactPerson": "John Doe",
"address": {
"street": "<string>",
"zip": "<string>",
"city": "<string>",
"country": "<string>",
"co": "<string>",
"state": "<string>"
},
"contact": {
"telephone": "+1-555-123-4567",
"mobile": "+1-555-987-6543",
"email": "contact@company.com",
"sms": "+1-555-111-2222",
"smsCount": 5,
"smsChatCount": 12,
"smsSendDate": "2024-01-15T10:30:00Z",
"smsSendBy": "user123",
"website": "https://www.company.com",
"lastSMSStatus": "delivered",
"secondSmsSendDate": "2024-01-16T14:45:00Z"
},
"contract": {},
"invoiceRecipientId": "<string>",
"invoiceCCRecipientIds": ["<string>"],
"hideRecipientOnDocuments": False,
"buyerReference": "04011000-1234512345-12",
"orderReferenceId": "SUP-12345",
"vatNumber": "DE123456789",
"debitorNumber": "DEB-001",
"paymentTermId": "<string>"
}
}
headers = {
"x-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'x-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
ids: ['<string>'],
data: {
number: 1001,
name: 'ABC Cleaning Services GmbH',
_id: '<string>',
companyId: '<string>',
status: {
status: 123,
createdAt: '2023-11-07T05:31:56Z',
createdBy: '<string>',
lastModifiedAt: '2023-11-07T05:31:56Z',
lastModifiedBy: '<string>'
},
chatId: '<string>',
contactPerson: 'John Doe',
address: {
street: '<string>',
zip: '<string>',
city: '<string>',
country: '<string>',
co: '<string>',
state: '<string>'
},
contact: {
telephone: '+1-555-123-4567',
mobile: '+1-555-987-6543',
email: 'contact@company.com',
sms: '+1-555-111-2222',
smsCount: 5,
smsChatCount: 12,
smsSendDate: '2024-01-15T10:30:00Z',
smsSendBy: 'user123',
website: 'https://www.company.com',
lastSMSStatus: 'delivered',
secondSmsSendDate: '2024-01-16T14:45:00Z'
},
contract: {},
invoiceRecipientId: '<string>',
invoiceCCRecipientIds: ['<string>'],
hideRecipientOnDocuments: false,
buyerReference: '04011000-1234512345-12',
orderReferenceId: 'SUP-12345',
vatNumber: 'DE123456789',
debitorNumber: 'DEB-001',
paymentTermId: '<string>'
}
})
};
fetch('http://localhost:3000/v2/customers/many', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3000",
CURLOPT_URL => "http://localhost:3000/v2/customers/many",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'ids' => [
'<string>'
],
'data' => [
'number' => 1001,
'name' => 'ABC Cleaning Services GmbH',
'_id' => '<string>',
'companyId' => '<string>',
'status' => [
'status' => 123,
'createdAt' => '2023-11-07T05:31:56Z',
'createdBy' => '<string>',
'lastModifiedAt' => '2023-11-07T05:31:56Z',
'lastModifiedBy' => '<string>'
],
'chatId' => '<string>',
'contactPerson' => 'John Doe',
'address' => [
'street' => '<string>',
'zip' => '<string>',
'city' => '<string>',
'country' => '<string>',
'co' => '<string>',
'state' => '<string>'
],
'contact' => [
'telephone' => '+1-555-123-4567',
'mobile' => '+1-555-987-6543',
'email' => 'contact@company.com',
'sms' => '+1-555-111-2222',
'smsCount' => 5,
'smsChatCount' => 12,
'smsSendDate' => '2024-01-15T10:30:00Z',
'smsSendBy' => 'user123',
'website' => 'https://www.company.com',
'lastSMSStatus' => 'delivered',
'secondSmsSendDate' => '2024-01-16T14:45:00Z'
],
'contract' => [
],
'invoiceRecipientId' => '<string>',
'invoiceCCRecipientIds' => [
'<string>'
],
'hideRecipientOnDocuments' => false,
'buyerReference' => '04011000-1234512345-12',
'orderReferenceId' => 'SUP-12345',
'vatNumber' => 'DE123456789',
'debitorNumber' => 'DEB-001',
'paymentTermId' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://localhost:3000/v2/customers/many"
payload := strings.NewReader("{\n \"ids\": [\n \"<string>\"\n ],\n \"data\": {\n \"number\": 1001,\n \"name\": \"ABC Cleaning Services GmbH\",\n \"_id\": \"<string>\",\n \"companyId\": \"<string>\",\n \"status\": {\n \"status\": 123,\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"createdBy\": \"<string>\",\n \"lastModifiedAt\": \"2023-11-07T05:31:56Z\",\n \"lastModifiedBy\": \"<string>\"\n },\n \"chatId\": \"<string>\",\n \"contactPerson\": \"John Doe\",\n \"address\": {\n \"street\": \"<string>\",\n \"zip\": \"<string>\",\n \"city\": \"<string>\",\n \"country\": \"<string>\",\n \"co\": \"<string>\",\n \"state\": \"<string>\"\n },\n \"contact\": {\n \"telephone\": \"+1-555-123-4567\",\n \"mobile\": \"+1-555-987-6543\",\n \"email\": \"contact@company.com\",\n \"sms\": \"+1-555-111-2222\",\n \"smsCount\": 5,\n \"smsChatCount\": 12,\n \"smsSendDate\": \"2024-01-15T10:30:00Z\",\n \"smsSendBy\": \"user123\",\n \"website\": \"https://www.company.com\",\n \"lastSMSStatus\": \"delivered\",\n \"secondSmsSendDate\": \"2024-01-16T14:45:00Z\"\n },\n \"contract\": {},\n \"invoiceRecipientId\": \"<string>\",\n \"invoiceCCRecipientIds\": [\n \"<string>\"\n ],\n \"hideRecipientOnDocuments\": false,\n \"buyerReference\": \"04011000-1234512345-12\",\n \"orderReferenceId\": \"SUP-12345\",\n \"vatNumber\": \"DE123456789\",\n \"debitorNumber\": \"DEB-001\",\n \"paymentTermId\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("http://localhost:3000/v2/customers/many")
.header("x-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"ids\": [\n \"<string>\"\n ],\n \"data\": {\n \"number\": 1001,\n \"name\": \"ABC Cleaning Services GmbH\",\n \"_id\": \"<string>\",\n \"companyId\": \"<string>\",\n \"status\": {\n \"status\": 123,\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"createdBy\": \"<string>\",\n \"lastModifiedAt\": \"2023-11-07T05:31:56Z\",\n \"lastModifiedBy\": \"<string>\"\n },\n \"chatId\": \"<string>\",\n \"contactPerson\": \"John Doe\",\n \"address\": {\n \"street\": \"<string>\",\n \"zip\": \"<string>\",\n \"city\": \"<string>\",\n \"country\": \"<string>\",\n \"co\": \"<string>\",\n \"state\": \"<string>\"\n },\n \"contact\": {\n \"telephone\": \"+1-555-123-4567\",\n \"mobile\": \"+1-555-987-6543\",\n \"email\": \"contact@company.com\",\n \"sms\": \"+1-555-111-2222\",\n \"smsCount\": 5,\n \"smsChatCount\": 12,\n \"smsSendDate\": \"2024-01-15T10:30:00Z\",\n \"smsSendBy\": \"user123\",\n \"website\": \"https://www.company.com\",\n \"lastSMSStatus\": \"delivered\",\n \"secondSmsSendDate\": \"2024-01-16T14:45:00Z\"\n },\n \"contract\": {},\n \"invoiceRecipientId\": \"<string>\",\n \"invoiceCCRecipientIds\": [\n \"<string>\"\n ],\n \"hideRecipientOnDocuments\": false,\n \"buyerReference\": \"04011000-1234512345-12\",\n \"orderReferenceId\": \"SUP-12345\",\n \"vatNumber\": \"DE123456789\",\n \"debitorNumber\": \"DEB-001\",\n \"paymentTermId\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3000/v2/customers/many")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Patch.new(url)
request["x-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"ids\": [\n \"<string>\"\n ],\n \"data\": {\n \"number\": 1001,\n \"name\": \"ABC Cleaning Services GmbH\",\n \"_id\": \"<string>\",\n \"companyId\": \"<string>\",\n \"status\": {\n \"status\": 123,\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"createdBy\": \"<string>\",\n \"lastModifiedAt\": \"2023-11-07T05:31:56Z\",\n \"lastModifiedBy\": \"<string>\"\n },\n \"chatId\": \"<string>\",\n \"contactPerson\": \"John Doe\",\n \"address\": {\n \"street\": \"<string>\",\n \"zip\": \"<string>\",\n \"city\": \"<string>\",\n \"country\": \"<string>\",\n \"co\": \"<string>\",\n \"state\": \"<string>\"\n },\n \"contact\": {\n \"telephone\": \"+1-555-123-4567\",\n \"mobile\": \"+1-555-987-6543\",\n \"email\": \"contact@company.com\",\n \"sms\": \"+1-555-111-2222\",\n \"smsCount\": 5,\n \"smsChatCount\": 12,\n \"smsSendDate\": \"2024-01-15T10:30:00Z\",\n \"smsSendBy\": \"user123\",\n \"website\": \"https://www.company.com\",\n \"lastSMSStatus\": \"delivered\",\n \"secondSmsSendDate\": \"2024-01-16T14:45:00Z\"\n },\n \"contract\": {},\n \"invoiceRecipientId\": \"<string>\",\n \"invoiceCCRecipientIds\": [\n \"<string>\"\n ],\n \"hideRecipientOnDocuments\": false,\n \"buyerReference\": \"04011000-1234512345-12\",\n \"orderReferenceId\": \"SUP-12345\",\n \"vatNumber\": \"DE123456789\",\n \"debitorNumber\": \"DEB-001\",\n \"paymentTermId\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"modifiedCount": 123
}Authorizations
API-KeyBearer-Auth
Body
application/json
Batch update data
Response
Customers updated successfully
Number of customers modified
Was this page helpful?
⌘I

