curl --request POST \
--url https://api.jtl-cloud.com/erp/customers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-tenant-id: <x-tenant-id>' \
--data '
{
"CustomerGroupId": 123,
"BillingAddress": {
"City": "Example City",
"CountryIso": "DE",
"Company": "Sportbedarf Sommer",
"Company2": "Innovation Division",
"FormOfAddress": "Mr.",
"Title": "Dr.",
"FirstName": "John",
"LastName": "Doe",
"Street": "Main St. 123",
"Address2": "Floor 5, Apt 302",
"PostalCode": "12345",
"State": "Example State",
"VatID": "DE123456789",
"PhoneNumber": "+49 1234 445556661",
"MobilePhoneNumber": "+49 160 123 4567",
"EmailAddress": "example@email.com",
"Fax": "+49 1234 4455566615"
},
"LanguageIso": "DE",
"InternalCompanyId": 123,
"Number": "C1005486",
"OtherAddresses": {
"OtherBillingAddresses": [
{
"City": "Example City",
"CountryIso": "DE",
"Company": "Sportbedarf Sommer",
"Company2": "Innovation Division",
"FormOfAddress": "Mr.",
"Title": "Dr.",
"FirstName": "John",
"LastName": "Doe",
"Street": "Main St. 123",
"Address2": "Floor 5, Apt 302",
"PostalCode": "12345",
"State": "Example State",
"VatID": "DE123456789",
"PhoneNumber": "+49 1234 445556661",
"MobilePhoneNumber": "+49 160 123 4567",
"EmailAddress": "example@email.com",
"Fax": "+49 1234 4455566615"
}
],
"OtherShippingAddresses": [
{
"City": "Example City",
"CountryIso": "DE",
"Company": "Sportbedarf Sommer",
"Company2": "Innovation Division",
"FormOfAddress": "Mr.",
"Title": "Dr.",
"FirstName": "John",
"LastName": "Doe",
"Street": "Main St. 123",
"Address2": "Floor 5, Apt 302",
"PostalCode": "12345",
"State": "Example State",
"VatID": "DE123456789",
"PhoneNumber": "+49 1234 445556661",
"MobilePhoneNumber": "+49 160 123 4567",
"EmailAddress": "example@email.com",
"Fax": "+49 1234 4455566615"
}
],
"OtherCustomerAddresses": [
{
"City": "Example City",
"CountryIso": "DE",
"Company": "Sportbedarf Sommer",
"Company2": "Innovation Division",
"FormOfAddress": "Mr.",
"Title": "Dr.",
"FirstName": "John",
"LastName": "Doe",
"Street": "Main St. 123",
"Address2": "Floor 5, Apt 302",
"PostalCode": "12345",
"State": "Example State",
"VatID": "DE123456789",
"PhoneNumber": "+49 1234 445556661",
"MobilePhoneNumber": "+49 160 123 4567",
"EmailAddress": "example@email.com",
"Fax": "+49 1234 4455566615"
}
]
},
"PaymentSettings": {
"PaymentMethodId": 123,
"Discount": 5,
"PaymentTarget": 3,
"CreditLimit": 100,
"StopPaymentRequest": false
},
"CustomerSince": "2023-02-01T13:30:00.0000000+00:00",
"LastChange": "2023-02-01T13:30:00.0000000+00:00",
"CustomerCategoryId": 123,
"TaxIdentificationNumber": "123/123/12345",
"AccountsReceivableNumber": 10000,
"CommercialRegisterNumber": "HRB 1234",
"Website": "https://mywebsite.com",
"InitialContact": "Amazon",
"EbayUsername": "eBaybuyer123",
"Birthday": "1985-01-01T",
"IsLocked": false,
"IsCashRegisterBased": false
}
'import requests
url = "https://api.jtl-cloud.com/erp/customers"
payload = {
"CustomerGroupId": 123,
"BillingAddress": {
"City": "Example City",
"CountryIso": "DE",
"Company": "Sportbedarf Sommer",
"Company2": "Innovation Division",
"FormOfAddress": "Mr.",
"Title": "Dr.",
"FirstName": "John",
"LastName": "Doe",
"Street": "Main St. 123",
"Address2": "Floor 5, Apt 302",
"PostalCode": "12345",
"State": "Example State",
"VatID": "DE123456789",
"PhoneNumber": "+49 1234 445556661",
"MobilePhoneNumber": "+49 160 123 4567",
"EmailAddress": "example@email.com",
"Fax": "+49 1234 4455566615"
},
"LanguageIso": "DE",
"InternalCompanyId": 123,
"Number": "C1005486",
"OtherAddresses": {
"OtherBillingAddresses": [
{
"City": "Example City",
"CountryIso": "DE",
"Company": "Sportbedarf Sommer",
"Company2": "Innovation Division",
"FormOfAddress": "Mr.",
"Title": "Dr.",
"FirstName": "John",
"LastName": "Doe",
"Street": "Main St. 123",
"Address2": "Floor 5, Apt 302",
"PostalCode": "12345",
"State": "Example State",
"VatID": "DE123456789",
"PhoneNumber": "+49 1234 445556661",
"MobilePhoneNumber": "+49 160 123 4567",
"EmailAddress": "example@email.com",
"Fax": "+49 1234 4455566615"
}
],
"OtherShippingAddresses": [
{
"City": "Example City",
"CountryIso": "DE",
"Company": "Sportbedarf Sommer",
"Company2": "Innovation Division",
"FormOfAddress": "Mr.",
"Title": "Dr.",
"FirstName": "John",
"LastName": "Doe",
"Street": "Main St. 123",
"Address2": "Floor 5, Apt 302",
"PostalCode": "12345",
"State": "Example State",
"VatID": "DE123456789",
"PhoneNumber": "+49 1234 445556661",
"MobilePhoneNumber": "+49 160 123 4567",
"EmailAddress": "example@email.com",
"Fax": "+49 1234 4455566615"
}
],
"OtherCustomerAddresses": [
{
"City": "Example City",
"CountryIso": "DE",
"Company": "Sportbedarf Sommer",
"Company2": "Innovation Division",
"FormOfAddress": "Mr.",
"Title": "Dr.",
"FirstName": "John",
"LastName": "Doe",
"Street": "Main St. 123",
"Address2": "Floor 5, Apt 302",
"PostalCode": "12345",
"State": "Example State",
"VatID": "DE123456789",
"PhoneNumber": "+49 1234 445556661",
"MobilePhoneNumber": "+49 160 123 4567",
"EmailAddress": "example@email.com",
"Fax": "+49 1234 4455566615"
}
]
},
"PaymentSettings": {
"PaymentMethodId": 123,
"Discount": 5,
"PaymentTarget": 3,
"CreditLimit": 100,
"StopPaymentRequest": False
},
"CustomerSince": "2023-02-01T13:30:00.0000000+00:00",
"LastChange": "2023-02-01T13:30:00.0000000+00:00",
"CustomerCategoryId": 123,
"TaxIdentificationNumber": "123/123/12345",
"AccountsReceivableNumber": 10000,
"CommercialRegisterNumber": "HRB 1234",
"Website": "https://mywebsite.com",
"InitialContact": "Amazon",
"EbayUsername": "eBaybuyer123",
"Birthday": "1985-01-01T",
"IsLocked": False,
"IsCashRegisterBased": False
}
headers = {
"x-tenant-id": "<x-tenant-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-tenant-id': '<x-tenant-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
CustomerGroupId: 123,
BillingAddress: {
City: 'Example City',
CountryIso: 'DE',
Company: 'Sportbedarf Sommer',
Company2: 'Innovation Division',
FormOfAddress: 'Mr.',
Title: 'Dr.',
FirstName: 'John',
LastName: 'Doe',
Street: 'Main St. 123',
Address2: 'Floor 5, Apt 302',
PostalCode: '12345',
State: 'Example State',
VatID: 'DE123456789',
PhoneNumber: '+49 1234 445556661',
MobilePhoneNumber: '+49 160 123 4567',
EmailAddress: 'example@email.com',
Fax: '+49 1234 4455566615'
},
LanguageIso: 'DE',
InternalCompanyId: 123,
Number: 'C1005486',
OtherAddresses: {
OtherBillingAddresses: [
{
City: 'Example City',
CountryIso: 'DE',
Company: 'Sportbedarf Sommer',
Company2: 'Innovation Division',
FormOfAddress: 'Mr.',
Title: 'Dr.',
FirstName: 'John',
LastName: 'Doe',
Street: 'Main St. 123',
Address2: 'Floor 5, Apt 302',
PostalCode: '12345',
State: 'Example State',
VatID: 'DE123456789',
PhoneNumber: '+49 1234 445556661',
MobilePhoneNumber: '+49 160 123 4567',
EmailAddress: 'example@email.com',
Fax: '+49 1234 4455566615'
}
],
OtherShippingAddresses: [
{
City: 'Example City',
CountryIso: 'DE',
Company: 'Sportbedarf Sommer',
Company2: 'Innovation Division',
FormOfAddress: 'Mr.',
Title: 'Dr.',
FirstName: 'John',
LastName: 'Doe',
Street: 'Main St. 123',
Address2: 'Floor 5, Apt 302',
PostalCode: '12345',
State: 'Example State',
VatID: 'DE123456789',
PhoneNumber: '+49 1234 445556661',
MobilePhoneNumber: '+49 160 123 4567',
EmailAddress: 'example@email.com',
Fax: '+49 1234 4455566615'
}
],
OtherCustomerAddresses: [
{
City: 'Example City',
CountryIso: 'DE',
Company: 'Sportbedarf Sommer',
Company2: 'Innovation Division',
FormOfAddress: 'Mr.',
Title: 'Dr.',
FirstName: 'John',
LastName: 'Doe',
Street: 'Main St. 123',
Address2: 'Floor 5, Apt 302',
PostalCode: '12345',
State: 'Example State',
VatID: 'DE123456789',
PhoneNumber: '+49 1234 445556661',
MobilePhoneNumber: '+49 160 123 4567',
EmailAddress: 'example@email.com',
Fax: '+49 1234 4455566615'
}
]
},
PaymentSettings: {
PaymentMethodId: 123,
Discount: 5,
PaymentTarget: 3,
CreditLimit: 100,
StopPaymentRequest: false
},
CustomerSince: '2023-02-01T13:30:00.0000000+00:00',
LastChange: '2023-02-01T13:30:00.0000000+00:00',
CustomerCategoryId: 123,
TaxIdentificationNumber: '123/123/12345',
AccountsReceivableNumber: 10000,
CommercialRegisterNumber: 'HRB 1234',
Website: 'https://mywebsite.com',
InitialContact: 'Amazon',
EbayUsername: 'eBaybuyer123',
Birthday: '1985-01-01T',
IsLocked: false,
IsCashRegisterBased: false
})
};
fetch('https://api.jtl-cloud.com/erp/customers', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.jtl-cloud.com/erp/customers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'CustomerGroupId' => 123,
'BillingAddress' => [
'City' => 'Example City',
'CountryIso' => 'DE',
'Company' => 'Sportbedarf Sommer',
'Company2' => 'Innovation Division',
'FormOfAddress' => 'Mr.',
'Title' => 'Dr.',
'FirstName' => 'John',
'LastName' => 'Doe',
'Street' => 'Main St. 123',
'Address2' => 'Floor 5, Apt 302',
'PostalCode' => '12345',
'State' => 'Example State',
'VatID' => 'DE123456789',
'PhoneNumber' => '+49 1234 445556661',
'MobilePhoneNumber' => '+49 160 123 4567',
'EmailAddress' => 'example@email.com',
'Fax' => '+49 1234 4455566615'
],
'LanguageIso' => 'DE',
'InternalCompanyId' => 123,
'Number' => 'C1005486',
'OtherAddresses' => [
'OtherBillingAddresses' => [
[
'City' => 'Example City',
'CountryIso' => 'DE',
'Company' => 'Sportbedarf Sommer',
'Company2' => 'Innovation Division',
'FormOfAddress' => 'Mr.',
'Title' => 'Dr.',
'FirstName' => 'John',
'LastName' => 'Doe',
'Street' => 'Main St. 123',
'Address2' => 'Floor 5, Apt 302',
'PostalCode' => '12345',
'State' => 'Example State',
'VatID' => 'DE123456789',
'PhoneNumber' => '+49 1234 445556661',
'MobilePhoneNumber' => '+49 160 123 4567',
'EmailAddress' => 'example@email.com',
'Fax' => '+49 1234 4455566615'
]
],
'OtherShippingAddresses' => [
[
'City' => 'Example City',
'CountryIso' => 'DE',
'Company' => 'Sportbedarf Sommer',
'Company2' => 'Innovation Division',
'FormOfAddress' => 'Mr.',
'Title' => 'Dr.',
'FirstName' => 'John',
'LastName' => 'Doe',
'Street' => 'Main St. 123',
'Address2' => 'Floor 5, Apt 302',
'PostalCode' => '12345',
'State' => 'Example State',
'VatID' => 'DE123456789',
'PhoneNumber' => '+49 1234 445556661',
'MobilePhoneNumber' => '+49 160 123 4567',
'EmailAddress' => 'example@email.com',
'Fax' => '+49 1234 4455566615'
]
],
'OtherCustomerAddresses' => [
[
'City' => 'Example City',
'CountryIso' => 'DE',
'Company' => 'Sportbedarf Sommer',
'Company2' => 'Innovation Division',
'FormOfAddress' => 'Mr.',
'Title' => 'Dr.',
'FirstName' => 'John',
'LastName' => 'Doe',
'Street' => 'Main St. 123',
'Address2' => 'Floor 5, Apt 302',
'PostalCode' => '12345',
'State' => 'Example State',
'VatID' => 'DE123456789',
'PhoneNumber' => '+49 1234 445556661',
'MobilePhoneNumber' => '+49 160 123 4567',
'EmailAddress' => 'example@email.com',
'Fax' => '+49 1234 4455566615'
]
]
],
'PaymentSettings' => [
'PaymentMethodId' => 123,
'Discount' => 5,
'PaymentTarget' => 3,
'CreditLimit' => 100,
'StopPaymentRequest' => false
],
'CustomerSince' => '2023-02-01T13:30:00.0000000+00:00',
'LastChange' => '2023-02-01T13:30:00.0000000+00:00',
'CustomerCategoryId' => 123,
'TaxIdentificationNumber' => '123/123/12345',
'AccountsReceivableNumber' => 10000,
'CommercialRegisterNumber' => 'HRB 1234',
'Website' => 'https://mywebsite.com',
'InitialContact' => 'Amazon',
'EbayUsername' => 'eBaybuyer123',
'Birthday' => '1985-01-01T',
'IsLocked' => false,
'IsCashRegisterBased' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-tenant-id: <x-tenant-id>"
],
]);
$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 := "https://api.jtl-cloud.com/erp/customers"
payload := strings.NewReader("{\n \"CustomerGroupId\": 123,\n \"BillingAddress\": {\n \"City\": \"Example City\",\n \"CountryIso\": \"DE\",\n \"Company\": \"Sportbedarf Sommer\",\n \"Company2\": \"Innovation Division\",\n \"FormOfAddress\": \"Mr.\",\n \"Title\": \"Dr.\",\n \"FirstName\": \"John\",\n \"LastName\": \"Doe\",\n \"Street\": \"Main St. 123\",\n \"Address2\": \"Floor 5, Apt 302\",\n \"PostalCode\": \"12345\",\n \"State\": \"Example State\",\n \"VatID\": \"DE123456789\",\n \"PhoneNumber\": \"+49 1234 445556661\",\n \"MobilePhoneNumber\": \"+49 160 123 4567\",\n \"EmailAddress\": \"example@email.com\",\n \"Fax\": \"+49 1234 4455566615\"\n },\n \"LanguageIso\": \"DE\",\n \"InternalCompanyId\": 123,\n \"Number\": \"C1005486\",\n \"OtherAddresses\": {\n \"OtherBillingAddresses\": [\n {\n \"City\": \"Example City\",\n \"CountryIso\": \"DE\",\n \"Company\": \"Sportbedarf Sommer\",\n \"Company2\": \"Innovation Division\",\n \"FormOfAddress\": \"Mr.\",\n \"Title\": \"Dr.\",\n \"FirstName\": \"John\",\n \"LastName\": \"Doe\",\n \"Street\": \"Main St. 123\",\n \"Address2\": \"Floor 5, Apt 302\",\n \"PostalCode\": \"12345\",\n \"State\": \"Example State\",\n \"VatID\": \"DE123456789\",\n \"PhoneNumber\": \"+49 1234 445556661\",\n \"MobilePhoneNumber\": \"+49 160 123 4567\",\n \"EmailAddress\": \"example@email.com\",\n \"Fax\": \"+49 1234 4455566615\"\n }\n ],\n \"OtherShippingAddresses\": [\n {\n \"City\": \"Example City\",\n \"CountryIso\": \"DE\",\n \"Company\": \"Sportbedarf Sommer\",\n \"Company2\": \"Innovation Division\",\n \"FormOfAddress\": \"Mr.\",\n \"Title\": \"Dr.\",\n \"FirstName\": \"John\",\n \"LastName\": \"Doe\",\n \"Street\": \"Main St. 123\",\n \"Address2\": \"Floor 5, Apt 302\",\n \"PostalCode\": \"12345\",\n \"State\": \"Example State\",\n \"VatID\": \"DE123456789\",\n \"PhoneNumber\": \"+49 1234 445556661\",\n \"MobilePhoneNumber\": \"+49 160 123 4567\",\n \"EmailAddress\": \"example@email.com\",\n \"Fax\": \"+49 1234 4455566615\"\n }\n ],\n \"OtherCustomerAddresses\": [\n {\n \"City\": \"Example City\",\n \"CountryIso\": \"DE\",\n \"Company\": \"Sportbedarf Sommer\",\n \"Company2\": \"Innovation Division\",\n \"FormOfAddress\": \"Mr.\",\n \"Title\": \"Dr.\",\n \"FirstName\": \"John\",\n \"LastName\": \"Doe\",\n \"Street\": \"Main St. 123\",\n \"Address2\": \"Floor 5, Apt 302\",\n \"PostalCode\": \"12345\",\n \"State\": \"Example State\",\n \"VatID\": \"DE123456789\",\n \"PhoneNumber\": \"+49 1234 445556661\",\n \"MobilePhoneNumber\": \"+49 160 123 4567\",\n \"EmailAddress\": \"example@email.com\",\n \"Fax\": \"+49 1234 4455566615\"\n }\n ]\n },\n \"PaymentSettings\": {\n \"PaymentMethodId\": 123,\n \"Discount\": 5,\n \"PaymentTarget\": 3,\n \"CreditLimit\": 100,\n \"StopPaymentRequest\": false\n },\n \"CustomerSince\": \"2023-02-01T13:30:00.0000000+00:00\",\n \"LastChange\": \"2023-02-01T13:30:00.0000000+00:00\",\n \"CustomerCategoryId\": 123,\n \"TaxIdentificationNumber\": \"123/123/12345\",\n \"AccountsReceivableNumber\": 10000,\n \"CommercialRegisterNumber\": \"HRB 1234\",\n \"Website\": \"https://mywebsite.com\",\n \"InitialContact\": \"Amazon\",\n \"EbayUsername\": \"eBaybuyer123\",\n \"Birthday\": \"1985-01-01T\",\n \"IsLocked\": false,\n \"IsCashRegisterBased\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-tenant-id", "<x-tenant-id>")
req.Header.Add("Authorization", "Bearer <token>")
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.post("https://api.jtl-cloud.com/erp/customers")
.header("x-tenant-id", "<x-tenant-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"CustomerGroupId\": 123,\n \"BillingAddress\": {\n \"City\": \"Example City\",\n \"CountryIso\": \"DE\",\n \"Company\": \"Sportbedarf Sommer\",\n \"Company2\": \"Innovation Division\",\n \"FormOfAddress\": \"Mr.\",\n \"Title\": \"Dr.\",\n \"FirstName\": \"John\",\n \"LastName\": \"Doe\",\n \"Street\": \"Main St. 123\",\n \"Address2\": \"Floor 5, Apt 302\",\n \"PostalCode\": \"12345\",\n \"State\": \"Example State\",\n \"VatID\": \"DE123456789\",\n \"PhoneNumber\": \"+49 1234 445556661\",\n \"MobilePhoneNumber\": \"+49 160 123 4567\",\n \"EmailAddress\": \"example@email.com\",\n \"Fax\": \"+49 1234 4455566615\"\n },\n \"LanguageIso\": \"DE\",\n \"InternalCompanyId\": 123,\n \"Number\": \"C1005486\",\n \"OtherAddresses\": {\n \"OtherBillingAddresses\": [\n {\n \"City\": \"Example City\",\n \"CountryIso\": \"DE\",\n \"Company\": \"Sportbedarf Sommer\",\n \"Company2\": \"Innovation Division\",\n \"FormOfAddress\": \"Mr.\",\n \"Title\": \"Dr.\",\n \"FirstName\": \"John\",\n \"LastName\": \"Doe\",\n \"Street\": \"Main St. 123\",\n \"Address2\": \"Floor 5, Apt 302\",\n \"PostalCode\": \"12345\",\n \"State\": \"Example State\",\n \"VatID\": \"DE123456789\",\n \"PhoneNumber\": \"+49 1234 445556661\",\n \"MobilePhoneNumber\": \"+49 160 123 4567\",\n \"EmailAddress\": \"example@email.com\",\n \"Fax\": \"+49 1234 4455566615\"\n }\n ],\n \"OtherShippingAddresses\": [\n {\n \"City\": \"Example City\",\n \"CountryIso\": \"DE\",\n \"Company\": \"Sportbedarf Sommer\",\n \"Company2\": \"Innovation Division\",\n \"FormOfAddress\": \"Mr.\",\n \"Title\": \"Dr.\",\n \"FirstName\": \"John\",\n \"LastName\": \"Doe\",\n \"Street\": \"Main St. 123\",\n \"Address2\": \"Floor 5, Apt 302\",\n \"PostalCode\": \"12345\",\n \"State\": \"Example State\",\n \"VatID\": \"DE123456789\",\n \"PhoneNumber\": \"+49 1234 445556661\",\n \"MobilePhoneNumber\": \"+49 160 123 4567\",\n \"EmailAddress\": \"example@email.com\",\n \"Fax\": \"+49 1234 4455566615\"\n }\n ],\n \"OtherCustomerAddresses\": [\n {\n \"City\": \"Example City\",\n \"CountryIso\": \"DE\",\n \"Company\": \"Sportbedarf Sommer\",\n \"Company2\": \"Innovation Division\",\n \"FormOfAddress\": \"Mr.\",\n \"Title\": \"Dr.\",\n \"FirstName\": \"John\",\n \"LastName\": \"Doe\",\n \"Street\": \"Main St. 123\",\n \"Address2\": \"Floor 5, Apt 302\",\n \"PostalCode\": \"12345\",\n \"State\": \"Example State\",\n \"VatID\": \"DE123456789\",\n \"PhoneNumber\": \"+49 1234 445556661\",\n \"MobilePhoneNumber\": \"+49 160 123 4567\",\n \"EmailAddress\": \"example@email.com\",\n \"Fax\": \"+49 1234 4455566615\"\n }\n ]\n },\n \"PaymentSettings\": {\n \"PaymentMethodId\": 123,\n \"Discount\": 5,\n \"PaymentTarget\": 3,\n \"CreditLimit\": 100,\n \"StopPaymentRequest\": false\n },\n \"CustomerSince\": \"2023-02-01T13:30:00.0000000+00:00\",\n \"LastChange\": \"2023-02-01T13:30:00.0000000+00:00\",\n \"CustomerCategoryId\": 123,\n \"TaxIdentificationNumber\": \"123/123/12345\",\n \"AccountsReceivableNumber\": 10000,\n \"CommercialRegisterNumber\": \"HRB 1234\",\n \"Website\": \"https://mywebsite.com\",\n \"InitialContact\": \"Amazon\",\n \"EbayUsername\": \"eBaybuyer123\",\n \"Birthday\": \"1985-01-01T\",\n \"IsLocked\": false,\n \"IsCashRegisterBased\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.jtl-cloud.com/erp/customers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-tenant-id"] = '<x-tenant-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"CustomerGroupId\": 123,\n \"BillingAddress\": {\n \"City\": \"Example City\",\n \"CountryIso\": \"DE\",\n \"Company\": \"Sportbedarf Sommer\",\n \"Company2\": \"Innovation Division\",\n \"FormOfAddress\": \"Mr.\",\n \"Title\": \"Dr.\",\n \"FirstName\": \"John\",\n \"LastName\": \"Doe\",\n \"Street\": \"Main St. 123\",\n \"Address2\": \"Floor 5, Apt 302\",\n \"PostalCode\": \"12345\",\n \"State\": \"Example State\",\n \"VatID\": \"DE123456789\",\n \"PhoneNumber\": \"+49 1234 445556661\",\n \"MobilePhoneNumber\": \"+49 160 123 4567\",\n \"EmailAddress\": \"example@email.com\",\n \"Fax\": \"+49 1234 4455566615\"\n },\n \"LanguageIso\": \"DE\",\n \"InternalCompanyId\": 123,\n \"Number\": \"C1005486\",\n \"OtherAddresses\": {\n \"OtherBillingAddresses\": [\n {\n \"City\": \"Example City\",\n \"CountryIso\": \"DE\",\n \"Company\": \"Sportbedarf Sommer\",\n \"Company2\": \"Innovation Division\",\n \"FormOfAddress\": \"Mr.\",\n \"Title\": \"Dr.\",\n \"FirstName\": \"John\",\n \"LastName\": \"Doe\",\n \"Street\": \"Main St. 123\",\n \"Address2\": \"Floor 5, Apt 302\",\n \"PostalCode\": \"12345\",\n \"State\": \"Example State\",\n \"VatID\": \"DE123456789\",\n \"PhoneNumber\": \"+49 1234 445556661\",\n \"MobilePhoneNumber\": \"+49 160 123 4567\",\n \"EmailAddress\": \"example@email.com\",\n \"Fax\": \"+49 1234 4455566615\"\n }\n ],\n \"OtherShippingAddresses\": [\n {\n \"City\": \"Example City\",\n \"CountryIso\": \"DE\",\n \"Company\": \"Sportbedarf Sommer\",\n \"Company2\": \"Innovation Division\",\n \"FormOfAddress\": \"Mr.\",\n \"Title\": \"Dr.\",\n \"FirstName\": \"John\",\n \"LastName\": \"Doe\",\n \"Street\": \"Main St. 123\",\n \"Address2\": \"Floor 5, Apt 302\",\n \"PostalCode\": \"12345\",\n \"State\": \"Example State\",\n \"VatID\": \"DE123456789\",\n \"PhoneNumber\": \"+49 1234 445556661\",\n \"MobilePhoneNumber\": \"+49 160 123 4567\",\n \"EmailAddress\": \"example@email.com\",\n \"Fax\": \"+49 1234 4455566615\"\n }\n ],\n \"OtherCustomerAddresses\": [\n {\n \"City\": \"Example City\",\n \"CountryIso\": \"DE\",\n \"Company\": \"Sportbedarf Sommer\",\n \"Company2\": \"Innovation Division\",\n \"FormOfAddress\": \"Mr.\",\n \"Title\": \"Dr.\",\n \"FirstName\": \"John\",\n \"LastName\": \"Doe\",\n \"Street\": \"Main St. 123\",\n \"Address2\": \"Floor 5, Apt 302\",\n \"PostalCode\": \"12345\",\n \"State\": \"Example State\",\n \"VatID\": \"DE123456789\",\n \"PhoneNumber\": \"+49 1234 445556661\",\n \"MobilePhoneNumber\": \"+49 160 123 4567\",\n \"EmailAddress\": \"example@email.com\",\n \"Fax\": \"+49 1234 4455566615\"\n }\n ]\n },\n \"PaymentSettings\": {\n \"PaymentMethodId\": 123,\n \"Discount\": 5,\n \"PaymentTarget\": 3,\n \"CreditLimit\": 100,\n \"StopPaymentRequest\": false\n },\n \"CustomerSince\": \"2023-02-01T13:30:00.0000000+00:00\",\n \"LastChange\": \"2023-02-01T13:30:00.0000000+00:00\",\n \"CustomerCategoryId\": 123,\n \"TaxIdentificationNumber\": \"123/123/12345\",\n \"AccountsReceivableNumber\": 10000,\n \"CommercialRegisterNumber\": \"HRB 1234\",\n \"Website\": \"https://mywebsite.com\",\n \"InitialContact\": \"Amazon\",\n \"EbayUsername\": \"eBaybuyer123\",\n \"Birthday\": \"1985-01-01T\",\n \"IsLocked\": false,\n \"IsCashRegisterBased\": false\n}"
response = http.request(request)
puts response.read_body{
"Id": 123,
"Number": "C1005486",
"CustomerGroupId": 123,
"BillingAddress": {
"Id": 123,
"Company": "Sportbedarf Sommer",
"Company2": "Innovation Division",
"FormOfAddress": "Mr.",
"Title": "Dr.",
"FirstName": "John",
"LastName": "Doe",
"Street": "Main St. 123",
"Address2": "Floor 5, Apt 302",
"PostalCode": "12345",
"City": "Example City",
"State": "Example State",
"CountryIso": "DE",
"VatID": "DE123456789",
"PhoneNumber": "+49 1234 445556661",
"MobilePhoneNumber": "+49 160 123 4567",
"EmailAddress": "example@email.com",
"Fax": "+49 1234 4455566615"
},
"Shipmentaddress": {
"Id": 123,
"Company": "Sportbedarf Sommer",
"Company2": "Innovation Division",
"FormOfAddress": "Mr.",
"Title": "Dr.",
"FirstName": "John",
"LastName": "Doe",
"Street": "Main St. 123",
"Address2": "Floor 5, Apt 302",
"PostalCode": "12345",
"City": "Example City",
"State": "Example State",
"CountryIso": "DE",
"VatID": "DE123456789",
"PhoneNumber": "+49 1234 445556661",
"MobilePhoneNumber": "+49 160 123 4567",
"EmailAddress": "example@email.com",
"Fax": "+49 1234 4455566615"
},
"CustomAddress": {
"Id": 123,
"Company": "Sportbedarf Sommer",
"Company2": "Innovation Division",
"FormOfAddress": "Mr.",
"Title": "Dr.",
"FirstName": "John",
"LastName": "Doe",
"Street": "Main St. 123",
"Address2": "Floor 5, Apt 302",
"PostalCode": "12345",
"City": "Example City",
"State": "Example State",
"CountryIso": "DE",
"VatID": "DE123456789",
"PhoneNumber": "+49 1234 445556661",
"MobilePhoneNumber": "+49 160 123 4567",
"EmailAddress": "example@email.com",
"Fax": "+49 1234 4455566615"
},
"OtherAddresses": {
"OtherBillingAddresses": [
{
"Id": 123,
"Company": "Sportbedarf Sommer",
"Company2": "Innovation Division",
"FormOfAddress": "Mr.",
"Title": "Dr.",
"FirstName": "John",
"LastName": "Doe",
"Street": "Main St. 123",
"Address2": "Floor 5, Apt 302",
"PostalCode": "12345",
"City": "Example City",
"State": "Example State",
"CountryIso": "DE",
"VatID": "DE123456789",
"PhoneNumber": "+49 1234 445556661",
"MobilePhoneNumber": "+49 160 123 4567",
"EmailAddress": "example@email.com",
"Fax": "+49 1234 4455566615"
}
],
"OtherShippingAddresses": [
{
"Id": 123,
"Company": "Sportbedarf Sommer",
"Company2": "Innovation Division",
"FormOfAddress": "Mr.",
"Title": "Dr.",
"FirstName": "John",
"LastName": "Doe",
"Street": "Main St. 123",
"Address2": "Floor 5, Apt 302",
"PostalCode": "12345",
"City": "Example City",
"State": "Example State",
"CountryIso": "DE",
"VatID": "DE123456789",
"PhoneNumber": "+49 1234 445556661",
"MobilePhoneNumber": "+49 160 123 4567",
"EmailAddress": "example@email.com",
"Fax": "+49 1234 4455566615"
}
],
"OtherCustomerAddresses": [
{
"Id": 123,
"Company": "Sportbedarf Sommer",
"Company2": "Innovation Division",
"FormOfAddress": "Mr.",
"Title": "Dr.",
"FirstName": "John",
"LastName": "Doe",
"Street": "Main St. 123",
"Address2": "Floor 5, Apt 302",
"PostalCode": "12345",
"City": "Example City",
"State": "Example State",
"CountryIso": "DE",
"VatID": "DE123456789",
"PhoneNumber": "+49 1234 445556661",
"MobilePhoneNumber": "+49 160 123 4567",
"EmailAddress": "example@email.com",
"Fax": "+49 1234 4455566615"
}
]
},
"PaymentSettings": {
"PaymentMethodId": 123,
"Discount": 5,
"PaymentTarget": 3,
"CreditLimit": 100,
"StopPaymentRequest": false
},
"CustomerSince": "2023-02-01T13:30:00.0000000+00:00",
"LastChange": "2023-02-01T13:30:00.0000000+00:00",
"LanguageIso": "DE",
"InternalCompanyId": 123,
"CustomerCategoryId": 123,
"TaxIdentificationNumber": "123/123/12345",
"AccountsReceivableNumber": 10000,
"CommercialRegisterNumber": "HRB 1234",
"Website": "https://mywebsite.com",
"InitialContact": "Amazon",
"EbayUsername": "eBaybuyer123",
"Birthday": "1985-01-01T",
"IsLocked": false,
"IsCashRegisterBased": false
}{
"ErrorCode": "<string>",
"ValidationErrors": {},
"Errors": {},
"ErrorMessage": "<string>",
"Stacktrace": "<string>"
}Create Customer
Create a new customer
curl --request POST \
--url https://api.jtl-cloud.com/erp/customers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-tenant-id: <x-tenant-id>' \
--data '
{
"CustomerGroupId": 123,
"BillingAddress": {
"City": "Example City",
"CountryIso": "DE",
"Company": "Sportbedarf Sommer",
"Company2": "Innovation Division",
"FormOfAddress": "Mr.",
"Title": "Dr.",
"FirstName": "John",
"LastName": "Doe",
"Street": "Main St. 123",
"Address2": "Floor 5, Apt 302",
"PostalCode": "12345",
"State": "Example State",
"VatID": "DE123456789",
"PhoneNumber": "+49 1234 445556661",
"MobilePhoneNumber": "+49 160 123 4567",
"EmailAddress": "example@email.com",
"Fax": "+49 1234 4455566615"
},
"LanguageIso": "DE",
"InternalCompanyId": 123,
"Number": "C1005486",
"OtherAddresses": {
"OtherBillingAddresses": [
{
"City": "Example City",
"CountryIso": "DE",
"Company": "Sportbedarf Sommer",
"Company2": "Innovation Division",
"FormOfAddress": "Mr.",
"Title": "Dr.",
"FirstName": "John",
"LastName": "Doe",
"Street": "Main St. 123",
"Address2": "Floor 5, Apt 302",
"PostalCode": "12345",
"State": "Example State",
"VatID": "DE123456789",
"PhoneNumber": "+49 1234 445556661",
"MobilePhoneNumber": "+49 160 123 4567",
"EmailAddress": "example@email.com",
"Fax": "+49 1234 4455566615"
}
],
"OtherShippingAddresses": [
{
"City": "Example City",
"CountryIso": "DE",
"Company": "Sportbedarf Sommer",
"Company2": "Innovation Division",
"FormOfAddress": "Mr.",
"Title": "Dr.",
"FirstName": "John",
"LastName": "Doe",
"Street": "Main St. 123",
"Address2": "Floor 5, Apt 302",
"PostalCode": "12345",
"State": "Example State",
"VatID": "DE123456789",
"PhoneNumber": "+49 1234 445556661",
"MobilePhoneNumber": "+49 160 123 4567",
"EmailAddress": "example@email.com",
"Fax": "+49 1234 4455566615"
}
],
"OtherCustomerAddresses": [
{
"City": "Example City",
"CountryIso": "DE",
"Company": "Sportbedarf Sommer",
"Company2": "Innovation Division",
"FormOfAddress": "Mr.",
"Title": "Dr.",
"FirstName": "John",
"LastName": "Doe",
"Street": "Main St. 123",
"Address2": "Floor 5, Apt 302",
"PostalCode": "12345",
"State": "Example State",
"VatID": "DE123456789",
"PhoneNumber": "+49 1234 445556661",
"MobilePhoneNumber": "+49 160 123 4567",
"EmailAddress": "example@email.com",
"Fax": "+49 1234 4455566615"
}
]
},
"PaymentSettings": {
"PaymentMethodId": 123,
"Discount": 5,
"PaymentTarget": 3,
"CreditLimit": 100,
"StopPaymentRequest": false
},
"CustomerSince": "2023-02-01T13:30:00.0000000+00:00",
"LastChange": "2023-02-01T13:30:00.0000000+00:00",
"CustomerCategoryId": 123,
"TaxIdentificationNumber": "123/123/12345",
"AccountsReceivableNumber": 10000,
"CommercialRegisterNumber": "HRB 1234",
"Website": "https://mywebsite.com",
"InitialContact": "Amazon",
"EbayUsername": "eBaybuyer123",
"Birthday": "1985-01-01T",
"IsLocked": false,
"IsCashRegisterBased": false
}
'import requests
url = "https://api.jtl-cloud.com/erp/customers"
payload = {
"CustomerGroupId": 123,
"BillingAddress": {
"City": "Example City",
"CountryIso": "DE",
"Company": "Sportbedarf Sommer",
"Company2": "Innovation Division",
"FormOfAddress": "Mr.",
"Title": "Dr.",
"FirstName": "John",
"LastName": "Doe",
"Street": "Main St. 123",
"Address2": "Floor 5, Apt 302",
"PostalCode": "12345",
"State": "Example State",
"VatID": "DE123456789",
"PhoneNumber": "+49 1234 445556661",
"MobilePhoneNumber": "+49 160 123 4567",
"EmailAddress": "example@email.com",
"Fax": "+49 1234 4455566615"
},
"LanguageIso": "DE",
"InternalCompanyId": 123,
"Number": "C1005486",
"OtherAddresses": {
"OtherBillingAddresses": [
{
"City": "Example City",
"CountryIso": "DE",
"Company": "Sportbedarf Sommer",
"Company2": "Innovation Division",
"FormOfAddress": "Mr.",
"Title": "Dr.",
"FirstName": "John",
"LastName": "Doe",
"Street": "Main St. 123",
"Address2": "Floor 5, Apt 302",
"PostalCode": "12345",
"State": "Example State",
"VatID": "DE123456789",
"PhoneNumber": "+49 1234 445556661",
"MobilePhoneNumber": "+49 160 123 4567",
"EmailAddress": "example@email.com",
"Fax": "+49 1234 4455566615"
}
],
"OtherShippingAddresses": [
{
"City": "Example City",
"CountryIso": "DE",
"Company": "Sportbedarf Sommer",
"Company2": "Innovation Division",
"FormOfAddress": "Mr.",
"Title": "Dr.",
"FirstName": "John",
"LastName": "Doe",
"Street": "Main St. 123",
"Address2": "Floor 5, Apt 302",
"PostalCode": "12345",
"State": "Example State",
"VatID": "DE123456789",
"PhoneNumber": "+49 1234 445556661",
"MobilePhoneNumber": "+49 160 123 4567",
"EmailAddress": "example@email.com",
"Fax": "+49 1234 4455566615"
}
],
"OtherCustomerAddresses": [
{
"City": "Example City",
"CountryIso": "DE",
"Company": "Sportbedarf Sommer",
"Company2": "Innovation Division",
"FormOfAddress": "Mr.",
"Title": "Dr.",
"FirstName": "John",
"LastName": "Doe",
"Street": "Main St. 123",
"Address2": "Floor 5, Apt 302",
"PostalCode": "12345",
"State": "Example State",
"VatID": "DE123456789",
"PhoneNumber": "+49 1234 445556661",
"MobilePhoneNumber": "+49 160 123 4567",
"EmailAddress": "example@email.com",
"Fax": "+49 1234 4455566615"
}
]
},
"PaymentSettings": {
"PaymentMethodId": 123,
"Discount": 5,
"PaymentTarget": 3,
"CreditLimit": 100,
"StopPaymentRequest": False
},
"CustomerSince": "2023-02-01T13:30:00.0000000+00:00",
"LastChange": "2023-02-01T13:30:00.0000000+00:00",
"CustomerCategoryId": 123,
"TaxIdentificationNumber": "123/123/12345",
"AccountsReceivableNumber": 10000,
"CommercialRegisterNumber": "HRB 1234",
"Website": "https://mywebsite.com",
"InitialContact": "Amazon",
"EbayUsername": "eBaybuyer123",
"Birthday": "1985-01-01T",
"IsLocked": False,
"IsCashRegisterBased": False
}
headers = {
"x-tenant-id": "<x-tenant-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-tenant-id': '<x-tenant-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
CustomerGroupId: 123,
BillingAddress: {
City: 'Example City',
CountryIso: 'DE',
Company: 'Sportbedarf Sommer',
Company2: 'Innovation Division',
FormOfAddress: 'Mr.',
Title: 'Dr.',
FirstName: 'John',
LastName: 'Doe',
Street: 'Main St. 123',
Address2: 'Floor 5, Apt 302',
PostalCode: '12345',
State: 'Example State',
VatID: 'DE123456789',
PhoneNumber: '+49 1234 445556661',
MobilePhoneNumber: '+49 160 123 4567',
EmailAddress: 'example@email.com',
Fax: '+49 1234 4455566615'
},
LanguageIso: 'DE',
InternalCompanyId: 123,
Number: 'C1005486',
OtherAddresses: {
OtherBillingAddresses: [
{
City: 'Example City',
CountryIso: 'DE',
Company: 'Sportbedarf Sommer',
Company2: 'Innovation Division',
FormOfAddress: 'Mr.',
Title: 'Dr.',
FirstName: 'John',
LastName: 'Doe',
Street: 'Main St. 123',
Address2: 'Floor 5, Apt 302',
PostalCode: '12345',
State: 'Example State',
VatID: 'DE123456789',
PhoneNumber: '+49 1234 445556661',
MobilePhoneNumber: '+49 160 123 4567',
EmailAddress: 'example@email.com',
Fax: '+49 1234 4455566615'
}
],
OtherShippingAddresses: [
{
City: 'Example City',
CountryIso: 'DE',
Company: 'Sportbedarf Sommer',
Company2: 'Innovation Division',
FormOfAddress: 'Mr.',
Title: 'Dr.',
FirstName: 'John',
LastName: 'Doe',
Street: 'Main St. 123',
Address2: 'Floor 5, Apt 302',
PostalCode: '12345',
State: 'Example State',
VatID: 'DE123456789',
PhoneNumber: '+49 1234 445556661',
MobilePhoneNumber: '+49 160 123 4567',
EmailAddress: 'example@email.com',
Fax: '+49 1234 4455566615'
}
],
OtherCustomerAddresses: [
{
City: 'Example City',
CountryIso: 'DE',
Company: 'Sportbedarf Sommer',
Company2: 'Innovation Division',
FormOfAddress: 'Mr.',
Title: 'Dr.',
FirstName: 'John',
LastName: 'Doe',
Street: 'Main St. 123',
Address2: 'Floor 5, Apt 302',
PostalCode: '12345',
State: 'Example State',
VatID: 'DE123456789',
PhoneNumber: '+49 1234 445556661',
MobilePhoneNumber: '+49 160 123 4567',
EmailAddress: 'example@email.com',
Fax: '+49 1234 4455566615'
}
]
},
PaymentSettings: {
PaymentMethodId: 123,
Discount: 5,
PaymentTarget: 3,
CreditLimit: 100,
StopPaymentRequest: false
},
CustomerSince: '2023-02-01T13:30:00.0000000+00:00',
LastChange: '2023-02-01T13:30:00.0000000+00:00',
CustomerCategoryId: 123,
TaxIdentificationNumber: '123/123/12345',
AccountsReceivableNumber: 10000,
CommercialRegisterNumber: 'HRB 1234',
Website: 'https://mywebsite.com',
InitialContact: 'Amazon',
EbayUsername: 'eBaybuyer123',
Birthday: '1985-01-01T',
IsLocked: false,
IsCashRegisterBased: false
})
};
fetch('https://api.jtl-cloud.com/erp/customers', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.jtl-cloud.com/erp/customers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'CustomerGroupId' => 123,
'BillingAddress' => [
'City' => 'Example City',
'CountryIso' => 'DE',
'Company' => 'Sportbedarf Sommer',
'Company2' => 'Innovation Division',
'FormOfAddress' => 'Mr.',
'Title' => 'Dr.',
'FirstName' => 'John',
'LastName' => 'Doe',
'Street' => 'Main St. 123',
'Address2' => 'Floor 5, Apt 302',
'PostalCode' => '12345',
'State' => 'Example State',
'VatID' => 'DE123456789',
'PhoneNumber' => '+49 1234 445556661',
'MobilePhoneNumber' => '+49 160 123 4567',
'EmailAddress' => 'example@email.com',
'Fax' => '+49 1234 4455566615'
],
'LanguageIso' => 'DE',
'InternalCompanyId' => 123,
'Number' => 'C1005486',
'OtherAddresses' => [
'OtherBillingAddresses' => [
[
'City' => 'Example City',
'CountryIso' => 'DE',
'Company' => 'Sportbedarf Sommer',
'Company2' => 'Innovation Division',
'FormOfAddress' => 'Mr.',
'Title' => 'Dr.',
'FirstName' => 'John',
'LastName' => 'Doe',
'Street' => 'Main St. 123',
'Address2' => 'Floor 5, Apt 302',
'PostalCode' => '12345',
'State' => 'Example State',
'VatID' => 'DE123456789',
'PhoneNumber' => '+49 1234 445556661',
'MobilePhoneNumber' => '+49 160 123 4567',
'EmailAddress' => 'example@email.com',
'Fax' => '+49 1234 4455566615'
]
],
'OtherShippingAddresses' => [
[
'City' => 'Example City',
'CountryIso' => 'DE',
'Company' => 'Sportbedarf Sommer',
'Company2' => 'Innovation Division',
'FormOfAddress' => 'Mr.',
'Title' => 'Dr.',
'FirstName' => 'John',
'LastName' => 'Doe',
'Street' => 'Main St. 123',
'Address2' => 'Floor 5, Apt 302',
'PostalCode' => '12345',
'State' => 'Example State',
'VatID' => 'DE123456789',
'PhoneNumber' => '+49 1234 445556661',
'MobilePhoneNumber' => '+49 160 123 4567',
'EmailAddress' => 'example@email.com',
'Fax' => '+49 1234 4455566615'
]
],
'OtherCustomerAddresses' => [
[
'City' => 'Example City',
'CountryIso' => 'DE',
'Company' => 'Sportbedarf Sommer',
'Company2' => 'Innovation Division',
'FormOfAddress' => 'Mr.',
'Title' => 'Dr.',
'FirstName' => 'John',
'LastName' => 'Doe',
'Street' => 'Main St. 123',
'Address2' => 'Floor 5, Apt 302',
'PostalCode' => '12345',
'State' => 'Example State',
'VatID' => 'DE123456789',
'PhoneNumber' => '+49 1234 445556661',
'MobilePhoneNumber' => '+49 160 123 4567',
'EmailAddress' => 'example@email.com',
'Fax' => '+49 1234 4455566615'
]
]
],
'PaymentSettings' => [
'PaymentMethodId' => 123,
'Discount' => 5,
'PaymentTarget' => 3,
'CreditLimit' => 100,
'StopPaymentRequest' => false
],
'CustomerSince' => '2023-02-01T13:30:00.0000000+00:00',
'LastChange' => '2023-02-01T13:30:00.0000000+00:00',
'CustomerCategoryId' => 123,
'TaxIdentificationNumber' => '123/123/12345',
'AccountsReceivableNumber' => 10000,
'CommercialRegisterNumber' => 'HRB 1234',
'Website' => 'https://mywebsite.com',
'InitialContact' => 'Amazon',
'EbayUsername' => 'eBaybuyer123',
'Birthday' => '1985-01-01T',
'IsLocked' => false,
'IsCashRegisterBased' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-tenant-id: <x-tenant-id>"
],
]);
$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 := "https://api.jtl-cloud.com/erp/customers"
payload := strings.NewReader("{\n \"CustomerGroupId\": 123,\n \"BillingAddress\": {\n \"City\": \"Example City\",\n \"CountryIso\": \"DE\",\n \"Company\": \"Sportbedarf Sommer\",\n \"Company2\": \"Innovation Division\",\n \"FormOfAddress\": \"Mr.\",\n \"Title\": \"Dr.\",\n \"FirstName\": \"John\",\n \"LastName\": \"Doe\",\n \"Street\": \"Main St. 123\",\n \"Address2\": \"Floor 5, Apt 302\",\n \"PostalCode\": \"12345\",\n \"State\": \"Example State\",\n \"VatID\": \"DE123456789\",\n \"PhoneNumber\": \"+49 1234 445556661\",\n \"MobilePhoneNumber\": \"+49 160 123 4567\",\n \"EmailAddress\": \"example@email.com\",\n \"Fax\": \"+49 1234 4455566615\"\n },\n \"LanguageIso\": \"DE\",\n \"InternalCompanyId\": 123,\n \"Number\": \"C1005486\",\n \"OtherAddresses\": {\n \"OtherBillingAddresses\": [\n {\n \"City\": \"Example City\",\n \"CountryIso\": \"DE\",\n \"Company\": \"Sportbedarf Sommer\",\n \"Company2\": \"Innovation Division\",\n \"FormOfAddress\": \"Mr.\",\n \"Title\": \"Dr.\",\n \"FirstName\": \"John\",\n \"LastName\": \"Doe\",\n \"Street\": \"Main St. 123\",\n \"Address2\": \"Floor 5, Apt 302\",\n \"PostalCode\": \"12345\",\n \"State\": \"Example State\",\n \"VatID\": \"DE123456789\",\n \"PhoneNumber\": \"+49 1234 445556661\",\n \"MobilePhoneNumber\": \"+49 160 123 4567\",\n \"EmailAddress\": \"example@email.com\",\n \"Fax\": \"+49 1234 4455566615\"\n }\n ],\n \"OtherShippingAddresses\": [\n {\n \"City\": \"Example City\",\n \"CountryIso\": \"DE\",\n \"Company\": \"Sportbedarf Sommer\",\n \"Company2\": \"Innovation Division\",\n \"FormOfAddress\": \"Mr.\",\n \"Title\": \"Dr.\",\n \"FirstName\": \"John\",\n \"LastName\": \"Doe\",\n \"Street\": \"Main St. 123\",\n \"Address2\": \"Floor 5, Apt 302\",\n \"PostalCode\": \"12345\",\n \"State\": \"Example State\",\n \"VatID\": \"DE123456789\",\n \"PhoneNumber\": \"+49 1234 445556661\",\n \"MobilePhoneNumber\": \"+49 160 123 4567\",\n \"EmailAddress\": \"example@email.com\",\n \"Fax\": \"+49 1234 4455566615\"\n }\n ],\n \"OtherCustomerAddresses\": [\n {\n \"City\": \"Example City\",\n \"CountryIso\": \"DE\",\n \"Company\": \"Sportbedarf Sommer\",\n \"Company2\": \"Innovation Division\",\n \"FormOfAddress\": \"Mr.\",\n \"Title\": \"Dr.\",\n \"FirstName\": \"John\",\n \"LastName\": \"Doe\",\n \"Street\": \"Main St. 123\",\n \"Address2\": \"Floor 5, Apt 302\",\n \"PostalCode\": \"12345\",\n \"State\": \"Example State\",\n \"VatID\": \"DE123456789\",\n \"PhoneNumber\": \"+49 1234 445556661\",\n \"MobilePhoneNumber\": \"+49 160 123 4567\",\n \"EmailAddress\": \"example@email.com\",\n \"Fax\": \"+49 1234 4455566615\"\n }\n ]\n },\n \"PaymentSettings\": {\n \"PaymentMethodId\": 123,\n \"Discount\": 5,\n \"PaymentTarget\": 3,\n \"CreditLimit\": 100,\n \"StopPaymentRequest\": false\n },\n \"CustomerSince\": \"2023-02-01T13:30:00.0000000+00:00\",\n \"LastChange\": \"2023-02-01T13:30:00.0000000+00:00\",\n \"CustomerCategoryId\": 123,\n \"TaxIdentificationNumber\": \"123/123/12345\",\n \"AccountsReceivableNumber\": 10000,\n \"CommercialRegisterNumber\": \"HRB 1234\",\n \"Website\": \"https://mywebsite.com\",\n \"InitialContact\": \"Amazon\",\n \"EbayUsername\": \"eBaybuyer123\",\n \"Birthday\": \"1985-01-01T\",\n \"IsLocked\": false,\n \"IsCashRegisterBased\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-tenant-id", "<x-tenant-id>")
req.Header.Add("Authorization", "Bearer <token>")
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.post("https://api.jtl-cloud.com/erp/customers")
.header("x-tenant-id", "<x-tenant-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"CustomerGroupId\": 123,\n \"BillingAddress\": {\n \"City\": \"Example City\",\n \"CountryIso\": \"DE\",\n \"Company\": \"Sportbedarf Sommer\",\n \"Company2\": \"Innovation Division\",\n \"FormOfAddress\": \"Mr.\",\n \"Title\": \"Dr.\",\n \"FirstName\": \"John\",\n \"LastName\": \"Doe\",\n \"Street\": \"Main St. 123\",\n \"Address2\": \"Floor 5, Apt 302\",\n \"PostalCode\": \"12345\",\n \"State\": \"Example State\",\n \"VatID\": \"DE123456789\",\n \"PhoneNumber\": \"+49 1234 445556661\",\n \"MobilePhoneNumber\": \"+49 160 123 4567\",\n \"EmailAddress\": \"example@email.com\",\n \"Fax\": \"+49 1234 4455566615\"\n },\n \"LanguageIso\": \"DE\",\n \"InternalCompanyId\": 123,\n \"Number\": \"C1005486\",\n \"OtherAddresses\": {\n \"OtherBillingAddresses\": [\n {\n \"City\": \"Example City\",\n \"CountryIso\": \"DE\",\n \"Company\": \"Sportbedarf Sommer\",\n \"Company2\": \"Innovation Division\",\n \"FormOfAddress\": \"Mr.\",\n \"Title\": \"Dr.\",\n \"FirstName\": \"John\",\n \"LastName\": \"Doe\",\n \"Street\": \"Main St. 123\",\n \"Address2\": \"Floor 5, Apt 302\",\n \"PostalCode\": \"12345\",\n \"State\": \"Example State\",\n \"VatID\": \"DE123456789\",\n \"PhoneNumber\": \"+49 1234 445556661\",\n \"MobilePhoneNumber\": \"+49 160 123 4567\",\n \"EmailAddress\": \"example@email.com\",\n \"Fax\": \"+49 1234 4455566615\"\n }\n ],\n \"OtherShippingAddresses\": [\n {\n \"City\": \"Example City\",\n \"CountryIso\": \"DE\",\n \"Company\": \"Sportbedarf Sommer\",\n \"Company2\": \"Innovation Division\",\n \"FormOfAddress\": \"Mr.\",\n \"Title\": \"Dr.\",\n \"FirstName\": \"John\",\n \"LastName\": \"Doe\",\n \"Street\": \"Main St. 123\",\n \"Address2\": \"Floor 5, Apt 302\",\n \"PostalCode\": \"12345\",\n \"State\": \"Example State\",\n \"VatID\": \"DE123456789\",\n \"PhoneNumber\": \"+49 1234 445556661\",\n \"MobilePhoneNumber\": \"+49 160 123 4567\",\n \"EmailAddress\": \"example@email.com\",\n \"Fax\": \"+49 1234 4455566615\"\n }\n ],\n \"OtherCustomerAddresses\": [\n {\n \"City\": \"Example City\",\n \"CountryIso\": \"DE\",\n \"Company\": \"Sportbedarf Sommer\",\n \"Company2\": \"Innovation Division\",\n \"FormOfAddress\": \"Mr.\",\n \"Title\": \"Dr.\",\n \"FirstName\": \"John\",\n \"LastName\": \"Doe\",\n \"Street\": \"Main St. 123\",\n \"Address2\": \"Floor 5, Apt 302\",\n \"PostalCode\": \"12345\",\n \"State\": \"Example State\",\n \"VatID\": \"DE123456789\",\n \"PhoneNumber\": \"+49 1234 445556661\",\n \"MobilePhoneNumber\": \"+49 160 123 4567\",\n \"EmailAddress\": \"example@email.com\",\n \"Fax\": \"+49 1234 4455566615\"\n }\n ]\n },\n \"PaymentSettings\": {\n \"PaymentMethodId\": 123,\n \"Discount\": 5,\n \"PaymentTarget\": 3,\n \"CreditLimit\": 100,\n \"StopPaymentRequest\": false\n },\n \"CustomerSince\": \"2023-02-01T13:30:00.0000000+00:00\",\n \"LastChange\": \"2023-02-01T13:30:00.0000000+00:00\",\n \"CustomerCategoryId\": 123,\n \"TaxIdentificationNumber\": \"123/123/12345\",\n \"AccountsReceivableNumber\": 10000,\n \"CommercialRegisterNumber\": \"HRB 1234\",\n \"Website\": \"https://mywebsite.com\",\n \"InitialContact\": \"Amazon\",\n \"EbayUsername\": \"eBaybuyer123\",\n \"Birthday\": \"1985-01-01T\",\n \"IsLocked\": false,\n \"IsCashRegisterBased\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.jtl-cloud.com/erp/customers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-tenant-id"] = '<x-tenant-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"CustomerGroupId\": 123,\n \"BillingAddress\": {\n \"City\": \"Example City\",\n \"CountryIso\": \"DE\",\n \"Company\": \"Sportbedarf Sommer\",\n \"Company2\": \"Innovation Division\",\n \"FormOfAddress\": \"Mr.\",\n \"Title\": \"Dr.\",\n \"FirstName\": \"John\",\n \"LastName\": \"Doe\",\n \"Street\": \"Main St. 123\",\n \"Address2\": \"Floor 5, Apt 302\",\n \"PostalCode\": \"12345\",\n \"State\": \"Example State\",\n \"VatID\": \"DE123456789\",\n \"PhoneNumber\": \"+49 1234 445556661\",\n \"MobilePhoneNumber\": \"+49 160 123 4567\",\n \"EmailAddress\": \"example@email.com\",\n \"Fax\": \"+49 1234 4455566615\"\n },\n \"LanguageIso\": \"DE\",\n \"InternalCompanyId\": 123,\n \"Number\": \"C1005486\",\n \"OtherAddresses\": {\n \"OtherBillingAddresses\": [\n {\n \"City\": \"Example City\",\n \"CountryIso\": \"DE\",\n \"Company\": \"Sportbedarf Sommer\",\n \"Company2\": \"Innovation Division\",\n \"FormOfAddress\": \"Mr.\",\n \"Title\": \"Dr.\",\n \"FirstName\": \"John\",\n \"LastName\": \"Doe\",\n \"Street\": \"Main St. 123\",\n \"Address2\": \"Floor 5, Apt 302\",\n \"PostalCode\": \"12345\",\n \"State\": \"Example State\",\n \"VatID\": \"DE123456789\",\n \"PhoneNumber\": \"+49 1234 445556661\",\n \"MobilePhoneNumber\": \"+49 160 123 4567\",\n \"EmailAddress\": \"example@email.com\",\n \"Fax\": \"+49 1234 4455566615\"\n }\n ],\n \"OtherShippingAddresses\": [\n {\n \"City\": \"Example City\",\n \"CountryIso\": \"DE\",\n \"Company\": \"Sportbedarf Sommer\",\n \"Company2\": \"Innovation Division\",\n \"FormOfAddress\": \"Mr.\",\n \"Title\": \"Dr.\",\n \"FirstName\": \"John\",\n \"LastName\": \"Doe\",\n \"Street\": \"Main St. 123\",\n \"Address2\": \"Floor 5, Apt 302\",\n \"PostalCode\": \"12345\",\n \"State\": \"Example State\",\n \"VatID\": \"DE123456789\",\n \"PhoneNumber\": \"+49 1234 445556661\",\n \"MobilePhoneNumber\": \"+49 160 123 4567\",\n \"EmailAddress\": \"example@email.com\",\n \"Fax\": \"+49 1234 4455566615\"\n }\n ],\n \"OtherCustomerAddresses\": [\n {\n \"City\": \"Example City\",\n \"CountryIso\": \"DE\",\n \"Company\": \"Sportbedarf Sommer\",\n \"Company2\": \"Innovation Division\",\n \"FormOfAddress\": \"Mr.\",\n \"Title\": \"Dr.\",\n \"FirstName\": \"John\",\n \"LastName\": \"Doe\",\n \"Street\": \"Main St. 123\",\n \"Address2\": \"Floor 5, Apt 302\",\n \"PostalCode\": \"12345\",\n \"State\": \"Example State\",\n \"VatID\": \"DE123456789\",\n \"PhoneNumber\": \"+49 1234 445556661\",\n \"MobilePhoneNumber\": \"+49 160 123 4567\",\n \"EmailAddress\": \"example@email.com\",\n \"Fax\": \"+49 1234 4455566615\"\n }\n ]\n },\n \"PaymentSettings\": {\n \"PaymentMethodId\": 123,\n \"Discount\": 5,\n \"PaymentTarget\": 3,\n \"CreditLimit\": 100,\n \"StopPaymentRequest\": false\n },\n \"CustomerSince\": \"2023-02-01T13:30:00.0000000+00:00\",\n \"LastChange\": \"2023-02-01T13:30:00.0000000+00:00\",\n \"CustomerCategoryId\": 123,\n \"TaxIdentificationNumber\": \"123/123/12345\",\n \"AccountsReceivableNumber\": 10000,\n \"CommercialRegisterNumber\": \"HRB 1234\",\n \"Website\": \"https://mywebsite.com\",\n \"InitialContact\": \"Amazon\",\n \"EbayUsername\": \"eBaybuyer123\",\n \"Birthday\": \"1985-01-01T\",\n \"IsLocked\": false,\n \"IsCashRegisterBased\": false\n}"
response = http.request(request)
puts response.read_body{
"Id": 123,
"Number": "C1005486",
"CustomerGroupId": 123,
"BillingAddress": {
"Id": 123,
"Company": "Sportbedarf Sommer",
"Company2": "Innovation Division",
"FormOfAddress": "Mr.",
"Title": "Dr.",
"FirstName": "John",
"LastName": "Doe",
"Street": "Main St. 123",
"Address2": "Floor 5, Apt 302",
"PostalCode": "12345",
"City": "Example City",
"State": "Example State",
"CountryIso": "DE",
"VatID": "DE123456789",
"PhoneNumber": "+49 1234 445556661",
"MobilePhoneNumber": "+49 160 123 4567",
"EmailAddress": "example@email.com",
"Fax": "+49 1234 4455566615"
},
"Shipmentaddress": {
"Id": 123,
"Company": "Sportbedarf Sommer",
"Company2": "Innovation Division",
"FormOfAddress": "Mr.",
"Title": "Dr.",
"FirstName": "John",
"LastName": "Doe",
"Street": "Main St. 123",
"Address2": "Floor 5, Apt 302",
"PostalCode": "12345",
"City": "Example City",
"State": "Example State",
"CountryIso": "DE",
"VatID": "DE123456789",
"PhoneNumber": "+49 1234 445556661",
"MobilePhoneNumber": "+49 160 123 4567",
"EmailAddress": "example@email.com",
"Fax": "+49 1234 4455566615"
},
"CustomAddress": {
"Id": 123,
"Company": "Sportbedarf Sommer",
"Company2": "Innovation Division",
"FormOfAddress": "Mr.",
"Title": "Dr.",
"FirstName": "John",
"LastName": "Doe",
"Street": "Main St. 123",
"Address2": "Floor 5, Apt 302",
"PostalCode": "12345",
"City": "Example City",
"State": "Example State",
"CountryIso": "DE",
"VatID": "DE123456789",
"PhoneNumber": "+49 1234 445556661",
"MobilePhoneNumber": "+49 160 123 4567",
"EmailAddress": "example@email.com",
"Fax": "+49 1234 4455566615"
},
"OtherAddresses": {
"OtherBillingAddresses": [
{
"Id": 123,
"Company": "Sportbedarf Sommer",
"Company2": "Innovation Division",
"FormOfAddress": "Mr.",
"Title": "Dr.",
"FirstName": "John",
"LastName": "Doe",
"Street": "Main St. 123",
"Address2": "Floor 5, Apt 302",
"PostalCode": "12345",
"City": "Example City",
"State": "Example State",
"CountryIso": "DE",
"VatID": "DE123456789",
"PhoneNumber": "+49 1234 445556661",
"MobilePhoneNumber": "+49 160 123 4567",
"EmailAddress": "example@email.com",
"Fax": "+49 1234 4455566615"
}
],
"OtherShippingAddresses": [
{
"Id": 123,
"Company": "Sportbedarf Sommer",
"Company2": "Innovation Division",
"FormOfAddress": "Mr.",
"Title": "Dr.",
"FirstName": "John",
"LastName": "Doe",
"Street": "Main St. 123",
"Address2": "Floor 5, Apt 302",
"PostalCode": "12345",
"City": "Example City",
"State": "Example State",
"CountryIso": "DE",
"VatID": "DE123456789",
"PhoneNumber": "+49 1234 445556661",
"MobilePhoneNumber": "+49 160 123 4567",
"EmailAddress": "example@email.com",
"Fax": "+49 1234 4455566615"
}
],
"OtherCustomerAddresses": [
{
"Id": 123,
"Company": "Sportbedarf Sommer",
"Company2": "Innovation Division",
"FormOfAddress": "Mr.",
"Title": "Dr.",
"FirstName": "John",
"LastName": "Doe",
"Street": "Main St. 123",
"Address2": "Floor 5, Apt 302",
"PostalCode": "12345",
"City": "Example City",
"State": "Example State",
"CountryIso": "DE",
"VatID": "DE123456789",
"PhoneNumber": "+49 1234 445556661",
"MobilePhoneNumber": "+49 160 123 4567",
"EmailAddress": "example@email.com",
"Fax": "+49 1234 4455566615"
}
]
},
"PaymentSettings": {
"PaymentMethodId": 123,
"Discount": 5,
"PaymentTarget": 3,
"CreditLimit": 100,
"StopPaymentRequest": false
},
"CustomerSince": "2023-02-01T13:30:00.0000000+00:00",
"LastChange": "2023-02-01T13:30:00.0000000+00:00",
"LanguageIso": "DE",
"InternalCompanyId": 123,
"CustomerCategoryId": 123,
"TaxIdentificationNumber": "123/123/12345",
"AccountsReceivableNumber": 10000,
"CommercialRegisterNumber": "HRB 1234",
"Website": "https://mywebsite.com",
"InitialContact": "Amazon",
"EbayUsername": "eBaybuyer123",
"Birthday": "1985-01-01T",
"IsLocked": false,
"IsCashRegisterBased": false
}{
"ErrorCode": "<string>",
"ValidationErrors": {},
"Errors": {},
"ErrorMessage": "<string>",
"Stacktrace": "<string>"
}Authorizations
The access token received from the authorization server in the OAuth 2.0 flow.
Headers
The User-Id (int or uuid) on whose behalf the request is executed. Requires scope 'Application.RunAs'.
The tenant ID for the target ERP instance.
Query Parameters
If true, the workflows do not trigger automatic.
Body
The customer to create.
Model Class: CreateCustomer
Model Class: CreateAddress
Show child attributes
Show child attributes
The customer's language.
"DE"
"C1005486"
Model Class: CreateAddress
Show child attributes
Show child attributes
Model Class: CreateAddress
Show child attributes
Show child attributes
Model Class: CreateOtherAddresses
Show child attributes
Show child attributes
Model Class: CreatePaymentSettings
Show child attributes
Show child attributes
"2023-02-01T13:30:00.0000000+00:00"
"2023-02-01T13:30:00.0000000+00:00"
"123/123/12345"
10000
"HRB 1234"
"https://mywebsite.com"
"Amazon"
"eBaybuyer123"
"1985-01-01T"
false
false
Response
The created customer.
Model Class: Customer
The customer's number.
"C1005486"
Model Class: Address
Show child attributes
Show child attributes
Model Class: Address
Show child attributes
Show child attributes
Model Class: Address
Show child attributes
Show child attributes
Model Class: OtherAddresses
Show child attributes
Show child attributes
Model Class: PaymentSettings
Show child attributes
Show child attributes
Date since they have been a customer.
"2023-02-01T13:30:00.0000000+00:00"
Date of the last customer's data change.
"2023-02-01T13:30:00.0000000+00:00"
The customer's language.
"DE"
The customer's tax identification number.
"123/123/12345"
The customer's accounts receivable number.
10000
The customer's commercial register number.
"HRB 1234"
The customer's website.
"https://mywebsite.com"
The source of initial contact. This could be for example a specific sales channel, a convention or a marketing campaign.
"Amazon"
The customer's eBay username.
"eBaybuyer123"
The customer's date of birth.
"1985-01-01T"
The customer's locked status for online shop sales channels.
false
States if a customer is from a cash-register or point of sale and if their data should be synchronized with JTL-POS, for example.
false
Was this page helpful?