curl -X POST \
/tenants \
--header "Content-Type: application/json" \
--header "Authorization: Bearer <token>" \
--data '{
"name": "ACME Inc.",
"legalCompanyName": "ACME Inc.",
"username": "acme-inc"
}'import requests
url = "https://coreapi.io/tenants"
payload = {
"name": "ACME Inc.",
"legalCompanyName": "ACME Inc.",
"username": "acme-inc"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'ACME Inc.', legalCompanyName: 'ACME Inc.', username: 'acme-inc'})
};
fetch('https://coreapi.io/tenants', 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://coreapi.io/tenants",
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([
'name' => 'ACME Inc.',
'legalCompanyName' => 'ACME Inc.',
'username' => 'acme-inc'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"name": "ACME",
"legalCompanyName": "Acme Inc.",
"commercialRegister": "Berlin Charlottenburg",
"commercialRegisterNumber": "HRB 123456",
"id": "01F9Z3ZJXZQZJZJZJZJZJZJZJZ",
"username": "acme",
"vatNumber": "DE123456789",
"owner": "<unknown>",
"city": "Cologne",
"zip": "50667",
"street": "Domstraße",
"housenumber": "1",
"countryCode": "DE",
"website": "https://acme.com",
"phone": "+49 123 456 789",
"email": "info@acme.de",
"ceo": "Max Mustermann",
"iban": "DE89370400440532013000",
"environment": "sandbox",
"appearance": {
"primaryColor": "#000000",
"id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
"logoUrl": "https://example.com/logo.png",
"secondaryColor": "#000000",
"privacyUrl": "https://example.com/privacy",
"conditionsUrl": "https://example.com/terms-and-conditions",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
},
"documentSettings": {
"logoPosition": "left",
"id": "<string>",
"footer": {
"translations": {},
"id": "<string>"
}
},
"timeZone": "Europe/Berlin",
"readOnlyCustomers": true,
"createdAt": "2021-01-01T00:00:00+00:00",
"updatedAt": "2021-01-01T00:00:00+00:00"
}Create a new tenant
Creates a Tenant resource.
curl -X POST \
/tenants \
--header "Content-Type: application/json" \
--header "Authorization: Bearer <token>" \
--data '{
"name": "ACME Inc.",
"legalCompanyName": "ACME Inc.",
"username": "acme-inc"
}'import requests
url = "https://coreapi.io/tenants"
payload = {
"name": "ACME Inc.",
"legalCompanyName": "ACME Inc.",
"username": "acme-inc"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'ACME Inc.', legalCompanyName: 'ACME Inc.', username: 'acme-inc'})
};
fetch('https://coreapi.io/tenants', 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://coreapi.io/tenants",
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([
'name' => 'ACME Inc.',
'legalCompanyName' => 'ACME Inc.',
'username' => 'acme-inc'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"name": "ACME",
"legalCompanyName": "Acme Inc.",
"commercialRegister": "Berlin Charlottenburg",
"commercialRegisterNumber": "HRB 123456",
"id": "01F9Z3ZJXZQZJZJZJZJZJZJZJZ",
"username": "acme",
"vatNumber": "DE123456789",
"owner": "<unknown>",
"city": "Cologne",
"zip": "50667",
"street": "Domstraße",
"housenumber": "1",
"countryCode": "DE",
"website": "https://acme.com",
"phone": "+49 123 456 789",
"email": "info@acme.de",
"ceo": "Max Mustermann",
"iban": "DE89370400440532013000",
"environment": "sandbox",
"appearance": {
"primaryColor": "#000000",
"id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
"logoUrl": "https://example.com/logo.png",
"secondaryColor": "#000000",
"privacyUrl": "https://example.com/privacy",
"conditionsUrl": "https://example.com/terms-and-conditions",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
},
"documentSettings": {
"logoPosition": "left",
"id": "<string>",
"footer": {
"translations": {},
"id": "<string>"
}
},
"timeZone": "Europe/Berlin",
"readOnlyCustomers": true,
"createdAt": "2021-01-01T00:00:00+00:00",
"updatedAt": "2021-01-01T00:00:00+00:00"
}Autorisierungen
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
The new Tenant resource
The name of the tenant
2 - 255"ACME Inc."
The legal company name of the tenant
2 - 255"ACME Inc."
The username of the tenant
2 - 255"acme-inc"
Antwort
Tenant resource created
The name of the tenant
2 - 255"ACME"
"Acme Inc."
"Berlin Charlottenburg"
"HRB 123456"
"01F9Z3ZJXZQZJZJZJZJZJZJZJZ"
"acme"
"DE123456789"
"Cologne"
"50667"
"Domstraße"
"1"
"DE"
"https://acme.com"
"+49 123 456 789"
"info@acme.de"
"Max Mustermann"
The IBAN will be displayed on the invoice
"DE89370400440532013000"
sandbox, production Show child attributes
Show child attributes
Show child attributes
Show child attributes
"Europe/Berlin"
If true, customers are read-only in the frontend
The date and time when the resource was created.
"2021-01-01T00:00:00+00:00"
The date and time when the resource was last updated.
"2021-01-01T00:00:00+00:00"
War diese Seite hilfreich?