Create customer
curl --request POST \
--url https://service.incaseof.law/openapi/customers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Firma ABC GmbH",
"email": "[email protected]",
"phone": "+43 1 234 5678",
"partner_id": "a1b2c3d4-0000-0000-0000-000000000000",
"address": {
"street": "Hauptstraße 1",
"city": "Wien",
"zip": "1010",
"country": "AT"
}
}
'import requests
url = "https://service.incaseof.law/openapi/customers"
payload = {
"name": "Firma ABC GmbH",
"email": "[email protected]",
"phone": "+43 1 234 5678",
"partner_id": "a1b2c3d4-0000-0000-0000-000000000000",
"address": {
"street": "Hauptstraße 1",
"city": "Wien",
"zip": "1010",
"country": "AT"
}
}
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: 'Firma ABC GmbH',
email: '[email protected]',
phone: '+43 1 234 5678',
partner_id: 'a1b2c3d4-0000-0000-0000-000000000000',
address: {street: 'Hauptstraße 1', city: 'Wien', zip: '1010', country: 'AT'}
})
};
fetch('https://service.incaseof.law/openapi/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://service.incaseof.law/openapi/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([
'name' => 'Firma ABC GmbH',
'email' => '[email protected]',
'phone' => '+43 1 234 5678',
'partner_id' => 'a1b2c3d4-0000-0000-0000-000000000000',
'address' => [
'street' => 'Hauptstraße 1',
'city' => 'Wien',
'zip' => '1010',
'country' => 'AT'
]
]),
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://service.incaseof.law/openapi/customers"
payload := strings.NewReader("{\n \"name\": \"Firma ABC GmbH\",\n \"email\": \"[email protected]\",\n \"phone\": \"+43 1 234 5678\",\n \"partner_id\": \"a1b2c3d4-0000-0000-0000-000000000000\",\n \"address\": {\n \"street\": \"Hauptstraße 1\",\n \"city\": \"Wien\",\n \"zip\": \"1010\",\n \"country\": \"AT\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
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://service.incaseof.law/openapi/customers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Firma ABC GmbH\",\n \"email\": \"[email protected]\",\n \"phone\": \"+43 1 234 5678\",\n \"partner_id\": \"a1b2c3d4-0000-0000-0000-000000000000\",\n \"address\": {\n \"street\": \"Hauptstraße 1\",\n \"city\": \"Wien\",\n \"zip\": \"1010\",\n \"country\": \"AT\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://service.incaseof.law/openapi/customers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Firma ABC GmbH\",\n \"email\": \"[email protected]\",\n \"phone\": \"+43 1 234 5678\",\n \"partner_id\": \"a1b2c3d4-0000-0000-0000-000000000000\",\n \"address\": {\n \"street\": \"Hauptstraße 1\",\n \"city\": \"Wien\",\n \"zip\": \"1010\",\n \"country\": \"AT\"\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organization_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"partner_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"email": "[email protected]",
"phone": "<string>",
"address": {},
"metadata": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}Customers
Create customer
Create a new customer linked to a partner. Requires a valid partner_id. The organization is determined from your API token. The partner must belong to the same organization as the API token.
POST
/
openapi
/
customers
Create customer
curl --request POST \
--url https://service.incaseof.law/openapi/customers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Firma ABC GmbH",
"email": "[email protected]",
"phone": "+43 1 234 5678",
"partner_id": "a1b2c3d4-0000-0000-0000-000000000000",
"address": {
"street": "Hauptstraße 1",
"city": "Wien",
"zip": "1010",
"country": "AT"
}
}
'import requests
url = "https://service.incaseof.law/openapi/customers"
payload = {
"name": "Firma ABC GmbH",
"email": "[email protected]",
"phone": "+43 1 234 5678",
"partner_id": "a1b2c3d4-0000-0000-0000-000000000000",
"address": {
"street": "Hauptstraße 1",
"city": "Wien",
"zip": "1010",
"country": "AT"
}
}
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: 'Firma ABC GmbH',
email: '[email protected]',
phone: '+43 1 234 5678',
partner_id: 'a1b2c3d4-0000-0000-0000-000000000000',
address: {street: 'Hauptstraße 1', city: 'Wien', zip: '1010', country: 'AT'}
})
};
fetch('https://service.incaseof.law/openapi/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://service.incaseof.law/openapi/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([
'name' => 'Firma ABC GmbH',
'email' => '[email protected]',
'phone' => '+43 1 234 5678',
'partner_id' => 'a1b2c3d4-0000-0000-0000-000000000000',
'address' => [
'street' => 'Hauptstraße 1',
'city' => 'Wien',
'zip' => '1010',
'country' => 'AT'
]
]),
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://service.incaseof.law/openapi/customers"
payload := strings.NewReader("{\n \"name\": \"Firma ABC GmbH\",\n \"email\": \"[email protected]\",\n \"phone\": \"+43 1 234 5678\",\n \"partner_id\": \"a1b2c3d4-0000-0000-0000-000000000000\",\n \"address\": {\n \"street\": \"Hauptstraße 1\",\n \"city\": \"Wien\",\n \"zip\": \"1010\",\n \"country\": \"AT\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
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://service.incaseof.law/openapi/customers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Firma ABC GmbH\",\n \"email\": \"[email protected]\",\n \"phone\": \"+43 1 234 5678\",\n \"partner_id\": \"a1b2c3d4-0000-0000-0000-000000000000\",\n \"address\": {\n \"street\": \"Hauptstraße 1\",\n \"city\": \"Wien\",\n \"zip\": \"1010\",\n \"country\": \"AT\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://service.incaseof.law/openapi/customers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Firma ABC GmbH\",\n \"email\": \"[email protected]\",\n \"phone\": \"+43 1 234 5678\",\n \"partner_id\": \"a1b2c3d4-0000-0000-0000-000000000000\",\n \"address\": {\n \"street\": \"Hauptstraße 1\",\n \"city\": \"Wien\",\n \"zip\": \"1010\",\n \"country\": \"AT\"\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organization_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"partner_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"email": "[email protected]",
"phone": "<string>",
"address": {},
"metadata": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Customer name
Maximum string length:
255Customer email
UUID of the referring partner (must belong to the same organization)
Phone number (optional)
Maximum string length:
50Address object (optional)
Show child attributes
Show child attributes
Arbitrary metadata (optional)
⌘I