curl --request POST \
--url https://api.example.com/api/customers \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--header 'organization-id: <organization-id>' \
--data '
{
"customerType": "business",
"currencyCode": "USD",
"displayName": "Acme Corporation",
"billingAddress1": "<string>",
"billingAddress2": "<string>",
"billingAddressCity": "<string>",
"billingAddressCountry": "<string>",
"billingAddressEmail": "<string>",
"billingAddressPostcode": "<string>",
"billingAddressPhone": "<string>",
"billingAddressState": "<string>",
"shippingAddress1": "<string>",
"shippingAddress2": "<string>",
"shippingAddressCity": "<string>",
"shippingAddressCountry": "<string>",
"shippingAddressEmail": "<string>",
"shippingAddressPostcode": "<string>",
"shippingAddressPhone": "<string>",
"shippingAddressState": "<string>",
"openingBalance": 5000,
"openingBalanceAt": "2024-01-01",
"openingBalanceExchangeRate": 1,
"openingBalanceBranchId": 101,
"salutation": "Mr.",
"firstName": "John",
"lastName": "Smith",
"companyName": "Acme Corporation",
"website": "https://www.acmecorp.com",
"email": "[email protected]",
"workPhone": "+1 (555) 123-4567",
"personalPhone": "<string>",
"note": "<string>",
"active": true
}
'import requests
url = "https://api.example.com/api/customers"
payload = {
"customerType": "business",
"currencyCode": "USD",
"displayName": "Acme Corporation",
"billingAddress1": "<string>",
"billingAddress2": "<string>",
"billingAddressCity": "<string>",
"billingAddressCountry": "<string>",
"billingAddressEmail": "<string>",
"billingAddressPostcode": "<string>",
"billingAddressPhone": "<string>",
"billingAddressState": "<string>",
"shippingAddress1": "<string>",
"shippingAddress2": "<string>",
"shippingAddressCity": "<string>",
"shippingAddressCountry": "<string>",
"shippingAddressEmail": "<string>",
"shippingAddressPostcode": "<string>",
"shippingAddressPhone": "<string>",
"shippingAddressState": "<string>",
"openingBalance": 5000,
"openingBalanceAt": "2024-01-01",
"openingBalanceExchangeRate": 1,
"openingBalanceBranchId": 101,
"salutation": "Mr.",
"firstName": "John",
"lastName": "Smith",
"companyName": "Acme Corporation",
"website": "https://www.acmecorp.com",
"email": "[email protected]",
"workPhone": "+1 (555) 123-4567",
"personalPhone": "<string>",
"note": "<string>",
"active": True
}
headers = {
"Authorization": "<authorization>",
"organization-id": "<organization-id>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: '<authorization>',
'organization-id': '<organization-id>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
customerType: 'business',
currencyCode: 'USD',
displayName: 'Acme Corporation',
billingAddress1: '<string>',
billingAddress2: '<string>',
billingAddressCity: '<string>',
billingAddressCountry: '<string>',
billingAddressEmail: '<string>',
billingAddressPostcode: '<string>',
billingAddressPhone: '<string>',
billingAddressState: '<string>',
shippingAddress1: '<string>',
shippingAddress2: '<string>',
shippingAddressCity: '<string>',
shippingAddressCountry: '<string>',
shippingAddressEmail: '<string>',
shippingAddressPostcode: '<string>',
shippingAddressPhone: '<string>',
shippingAddressState: '<string>',
openingBalance: 5000,
openingBalanceAt: '2024-01-01',
openingBalanceExchangeRate: 1,
openingBalanceBranchId: 101,
salutation: 'Mr.',
firstName: 'John',
lastName: 'Smith',
companyName: 'Acme Corporation',
website: 'https://www.acmecorp.com',
email: '[email protected]',
workPhone: '+1 (555) 123-4567',
personalPhone: '<string>',
note: '<string>',
active: true
})
};
fetch('https://api.example.com/api/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.example.com/api/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([
'customerType' => 'business',
'currencyCode' => 'USD',
'displayName' => 'Acme Corporation',
'billingAddress1' => '<string>',
'billingAddress2' => '<string>',
'billingAddressCity' => '<string>',
'billingAddressCountry' => '<string>',
'billingAddressEmail' => '<string>',
'billingAddressPostcode' => '<string>',
'billingAddressPhone' => '<string>',
'billingAddressState' => '<string>',
'shippingAddress1' => '<string>',
'shippingAddress2' => '<string>',
'shippingAddressCity' => '<string>',
'shippingAddressCountry' => '<string>',
'shippingAddressEmail' => '<string>',
'shippingAddressPostcode' => '<string>',
'shippingAddressPhone' => '<string>',
'shippingAddressState' => '<string>',
'openingBalance' => 5000,
'openingBalanceAt' => '2024-01-01',
'openingBalanceExchangeRate' => 1,
'openingBalanceBranchId' => 101,
'salutation' => 'Mr.',
'firstName' => 'John',
'lastName' => 'Smith',
'companyName' => 'Acme Corporation',
'website' => 'https://www.acmecorp.com',
'email' => '[email protected]',
'workPhone' => '+1 (555) 123-4567',
'personalPhone' => '<string>',
'note' => '<string>',
'active' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: application/json",
"organization-id: <organization-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.example.com/api/customers"
payload := strings.NewReader("{\n \"customerType\": \"business\",\n \"currencyCode\": \"USD\",\n \"displayName\": \"Acme Corporation\",\n \"billingAddress1\": \"<string>\",\n \"billingAddress2\": \"<string>\",\n \"billingAddressCity\": \"<string>\",\n \"billingAddressCountry\": \"<string>\",\n \"billingAddressEmail\": \"<string>\",\n \"billingAddressPostcode\": \"<string>\",\n \"billingAddressPhone\": \"<string>\",\n \"billingAddressState\": \"<string>\",\n \"shippingAddress1\": \"<string>\",\n \"shippingAddress2\": \"<string>\",\n \"shippingAddressCity\": \"<string>\",\n \"shippingAddressCountry\": \"<string>\",\n \"shippingAddressEmail\": \"<string>\",\n \"shippingAddressPostcode\": \"<string>\",\n \"shippingAddressPhone\": \"<string>\",\n \"shippingAddressState\": \"<string>\",\n \"openingBalance\": 5000,\n \"openingBalanceAt\": \"2024-01-01\",\n \"openingBalanceExchangeRate\": 1,\n \"openingBalanceBranchId\": 101,\n \"salutation\": \"Mr.\",\n \"firstName\": \"John\",\n \"lastName\": \"Smith\",\n \"companyName\": \"Acme Corporation\",\n \"website\": \"https://www.acmecorp.com\",\n \"email\": \"[email protected]\",\n \"workPhone\": \"+1 (555) 123-4567\",\n \"personalPhone\": \"<string>\",\n \"note\": \"<string>\",\n \"active\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("organization-id", "<organization-id>")
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.example.com/api/customers")
.header("Authorization", "<authorization>")
.header("organization-id", "<organization-id>")
.header("Content-Type", "application/json")
.body("{\n \"customerType\": \"business\",\n \"currencyCode\": \"USD\",\n \"displayName\": \"Acme Corporation\",\n \"billingAddress1\": \"<string>\",\n \"billingAddress2\": \"<string>\",\n \"billingAddressCity\": \"<string>\",\n \"billingAddressCountry\": \"<string>\",\n \"billingAddressEmail\": \"<string>\",\n \"billingAddressPostcode\": \"<string>\",\n \"billingAddressPhone\": \"<string>\",\n \"billingAddressState\": \"<string>\",\n \"shippingAddress1\": \"<string>\",\n \"shippingAddress2\": \"<string>\",\n \"shippingAddressCity\": \"<string>\",\n \"shippingAddressCountry\": \"<string>\",\n \"shippingAddressEmail\": \"<string>\",\n \"shippingAddressPostcode\": \"<string>\",\n \"shippingAddressPhone\": \"<string>\",\n \"shippingAddressState\": \"<string>\",\n \"openingBalance\": 5000,\n \"openingBalanceAt\": \"2024-01-01\",\n \"openingBalanceExchangeRate\": 1,\n \"openingBalanceBranchId\": 101,\n \"salutation\": \"Mr.\",\n \"firstName\": \"John\",\n \"lastName\": \"Smith\",\n \"companyName\": \"Acme Corporation\",\n \"website\": \"https://www.acmecorp.com\",\n \"email\": \"[email protected]\",\n \"workPhone\": \"+1 (555) 123-4567\",\n \"personalPhone\": \"<string>\",\n \"note\": \"<string>\",\n \"active\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/customers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["organization-id"] = '<organization-id>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customerType\": \"business\",\n \"currencyCode\": \"USD\",\n \"displayName\": \"Acme Corporation\",\n \"billingAddress1\": \"<string>\",\n \"billingAddress2\": \"<string>\",\n \"billingAddressCity\": \"<string>\",\n \"billingAddressCountry\": \"<string>\",\n \"billingAddressEmail\": \"<string>\",\n \"billingAddressPostcode\": \"<string>\",\n \"billingAddressPhone\": \"<string>\",\n \"billingAddressState\": \"<string>\",\n \"shippingAddress1\": \"<string>\",\n \"shippingAddress2\": \"<string>\",\n \"shippingAddressCity\": \"<string>\",\n \"shippingAddressCountry\": \"<string>\",\n \"shippingAddressEmail\": \"<string>\",\n \"shippingAddressPostcode\": \"<string>\",\n \"shippingAddressPhone\": \"<string>\",\n \"shippingAddressState\": \"<string>\",\n \"openingBalance\": 5000,\n \"openingBalanceAt\": \"2024-01-01\",\n \"openingBalanceExchangeRate\": 1,\n \"openingBalanceBranchId\": 101,\n \"salutation\": \"Mr.\",\n \"firstName\": \"John\",\n \"lastName\": \"Smith\",\n \"companyName\": \"Acme Corporation\",\n \"website\": \"https://www.acmecorp.com\",\n \"email\": \"[email protected]\",\n \"workPhone\": \"+1 (555) 123-4567\",\n \"personalPhone\": \"<string>\",\n \"note\": \"<string>\",\n \"active\": true\n}"
response = http.request(request)
puts response.read_body{
"balance": 1500,
"currencyCode": "USD",
"openingBalance": 1000,
"openingBalanceAt": "2024-01-01T00:00:00Z",
"openingBalanceExchangeRate": 1,
"displayName": "John Doe - Acme Corporation",
"note": "Important client with regular monthly orders",
"active": true,
"createdAt": "2024-01-01T00:00:00Z",
"updatedAt": "2024-01-01T00:00:00Z",
"localOpeningBalance": 1000,
"closingBalance": 1500,
"openingBalanceBranchId": 1,
"salutation": "Mr.",
"firstName": "John",
"lastName": "Doe",
"companyName": "Acme Corporation",
"email": "[email protected]",
"workPhone": "+1 (555) 123-4567",
"personalPhone": "+1 (555) 987-6543",
"website": "https://www.acme.com",
"billingAddress1": "123 Business Ave",
"billingAddress2": "Suite 100",
"billingAddressCity": "New York",
"billingAddressCountry": "United States",
"billingAddressEmail": "[email protected]",
"billingAddressPostcode": "10001",
"billingAddressPhone": "+1 (555) 111-2222",
"billingAddressState": "NY",
"shippingAddress1": "456 Shipping St",
"shippingAddress2": "Unit 200",
"shippingAddressCity": "Los Angeles",
"shippingAddressCountry": "United States",
"shippingAddressEmail": "[email protected]",
"shippingAddressPostcode": "90001",
"shippingAddressPhone": "+1 (555) 333-4444",
"shippingAddressState": "CA"
}Create a new customer.
curl --request POST \
--url https://api.example.com/api/customers \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--header 'organization-id: <organization-id>' \
--data '
{
"customerType": "business",
"currencyCode": "USD",
"displayName": "Acme Corporation",
"billingAddress1": "<string>",
"billingAddress2": "<string>",
"billingAddressCity": "<string>",
"billingAddressCountry": "<string>",
"billingAddressEmail": "<string>",
"billingAddressPostcode": "<string>",
"billingAddressPhone": "<string>",
"billingAddressState": "<string>",
"shippingAddress1": "<string>",
"shippingAddress2": "<string>",
"shippingAddressCity": "<string>",
"shippingAddressCountry": "<string>",
"shippingAddressEmail": "<string>",
"shippingAddressPostcode": "<string>",
"shippingAddressPhone": "<string>",
"shippingAddressState": "<string>",
"openingBalance": 5000,
"openingBalanceAt": "2024-01-01",
"openingBalanceExchangeRate": 1,
"openingBalanceBranchId": 101,
"salutation": "Mr.",
"firstName": "John",
"lastName": "Smith",
"companyName": "Acme Corporation",
"website": "https://www.acmecorp.com",
"email": "[email protected]",
"workPhone": "+1 (555) 123-4567",
"personalPhone": "<string>",
"note": "<string>",
"active": true
}
'import requests
url = "https://api.example.com/api/customers"
payload = {
"customerType": "business",
"currencyCode": "USD",
"displayName": "Acme Corporation",
"billingAddress1": "<string>",
"billingAddress2": "<string>",
"billingAddressCity": "<string>",
"billingAddressCountry": "<string>",
"billingAddressEmail": "<string>",
"billingAddressPostcode": "<string>",
"billingAddressPhone": "<string>",
"billingAddressState": "<string>",
"shippingAddress1": "<string>",
"shippingAddress2": "<string>",
"shippingAddressCity": "<string>",
"shippingAddressCountry": "<string>",
"shippingAddressEmail": "<string>",
"shippingAddressPostcode": "<string>",
"shippingAddressPhone": "<string>",
"shippingAddressState": "<string>",
"openingBalance": 5000,
"openingBalanceAt": "2024-01-01",
"openingBalanceExchangeRate": 1,
"openingBalanceBranchId": 101,
"salutation": "Mr.",
"firstName": "John",
"lastName": "Smith",
"companyName": "Acme Corporation",
"website": "https://www.acmecorp.com",
"email": "[email protected]",
"workPhone": "+1 (555) 123-4567",
"personalPhone": "<string>",
"note": "<string>",
"active": True
}
headers = {
"Authorization": "<authorization>",
"organization-id": "<organization-id>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: '<authorization>',
'organization-id': '<organization-id>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
customerType: 'business',
currencyCode: 'USD',
displayName: 'Acme Corporation',
billingAddress1: '<string>',
billingAddress2: '<string>',
billingAddressCity: '<string>',
billingAddressCountry: '<string>',
billingAddressEmail: '<string>',
billingAddressPostcode: '<string>',
billingAddressPhone: '<string>',
billingAddressState: '<string>',
shippingAddress1: '<string>',
shippingAddress2: '<string>',
shippingAddressCity: '<string>',
shippingAddressCountry: '<string>',
shippingAddressEmail: '<string>',
shippingAddressPostcode: '<string>',
shippingAddressPhone: '<string>',
shippingAddressState: '<string>',
openingBalance: 5000,
openingBalanceAt: '2024-01-01',
openingBalanceExchangeRate: 1,
openingBalanceBranchId: 101,
salutation: 'Mr.',
firstName: 'John',
lastName: 'Smith',
companyName: 'Acme Corporation',
website: 'https://www.acmecorp.com',
email: '[email protected]',
workPhone: '+1 (555) 123-4567',
personalPhone: '<string>',
note: '<string>',
active: true
})
};
fetch('https://api.example.com/api/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.example.com/api/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([
'customerType' => 'business',
'currencyCode' => 'USD',
'displayName' => 'Acme Corporation',
'billingAddress1' => '<string>',
'billingAddress2' => '<string>',
'billingAddressCity' => '<string>',
'billingAddressCountry' => '<string>',
'billingAddressEmail' => '<string>',
'billingAddressPostcode' => '<string>',
'billingAddressPhone' => '<string>',
'billingAddressState' => '<string>',
'shippingAddress1' => '<string>',
'shippingAddress2' => '<string>',
'shippingAddressCity' => '<string>',
'shippingAddressCountry' => '<string>',
'shippingAddressEmail' => '<string>',
'shippingAddressPostcode' => '<string>',
'shippingAddressPhone' => '<string>',
'shippingAddressState' => '<string>',
'openingBalance' => 5000,
'openingBalanceAt' => '2024-01-01',
'openingBalanceExchangeRate' => 1,
'openingBalanceBranchId' => 101,
'salutation' => 'Mr.',
'firstName' => 'John',
'lastName' => 'Smith',
'companyName' => 'Acme Corporation',
'website' => 'https://www.acmecorp.com',
'email' => '[email protected]',
'workPhone' => '+1 (555) 123-4567',
'personalPhone' => '<string>',
'note' => '<string>',
'active' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: application/json",
"organization-id: <organization-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.example.com/api/customers"
payload := strings.NewReader("{\n \"customerType\": \"business\",\n \"currencyCode\": \"USD\",\n \"displayName\": \"Acme Corporation\",\n \"billingAddress1\": \"<string>\",\n \"billingAddress2\": \"<string>\",\n \"billingAddressCity\": \"<string>\",\n \"billingAddressCountry\": \"<string>\",\n \"billingAddressEmail\": \"<string>\",\n \"billingAddressPostcode\": \"<string>\",\n \"billingAddressPhone\": \"<string>\",\n \"billingAddressState\": \"<string>\",\n \"shippingAddress1\": \"<string>\",\n \"shippingAddress2\": \"<string>\",\n \"shippingAddressCity\": \"<string>\",\n \"shippingAddressCountry\": \"<string>\",\n \"shippingAddressEmail\": \"<string>\",\n \"shippingAddressPostcode\": \"<string>\",\n \"shippingAddressPhone\": \"<string>\",\n \"shippingAddressState\": \"<string>\",\n \"openingBalance\": 5000,\n \"openingBalanceAt\": \"2024-01-01\",\n \"openingBalanceExchangeRate\": 1,\n \"openingBalanceBranchId\": 101,\n \"salutation\": \"Mr.\",\n \"firstName\": \"John\",\n \"lastName\": \"Smith\",\n \"companyName\": \"Acme Corporation\",\n \"website\": \"https://www.acmecorp.com\",\n \"email\": \"[email protected]\",\n \"workPhone\": \"+1 (555) 123-4567\",\n \"personalPhone\": \"<string>\",\n \"note\": \"<string>\",\n \"active\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("organization-id", "<organization-id>")
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.example.com/api/customers")
.header("Authorization", "<authorization>")
.header("organization-id", "<organization-id>")
.header("Content-Type", "application/json")
.body("{\n \"customerType\": \"business\",\n \"currencyCode\": \"USD\",\n \"displayName\": \"Acme Corporation\",\n \"billingAddress1\": \"<string>\",\n \"billingAddress2\": \"<string>\",\n \"billingAddressCity\": \"<string>\",\n \"billingAddressCountry\": \"<string>\",\n \"billingAddressEmail\": \"<string>\",\n \"billingAddressPostcode\": \"<string>\",\n \"billingAddressPhone\": \"<string>\",\n \"billingAddressState\": \"<string>\",\n \"shippingAddress1\": \"<string>\",\n \"shippingAddress2\": \"<string>\",\n \"shippingAddressCity\": \"<string>\",\n \"shippingAddressCountry\": \"<string>\",\n \"shippingAddressEmail\": \"<string>\",\n \"shippingAddressPostcode\": \"<string>\",\n \"shippingAddressPhone\": \"<string>\",\n \"shippingAddressState\": \"<string>\",\n \"openingBalance\": 5000,\n \"openingBalanceAt\": \"2024-01-01\",\n \"openingBalanceExchangeRate\": 1,\n \"openingBalanceBranchId\": 101,\n \"salutation\": \"Mr.\",\n \"firstName\": \"John\",\n \"lastName\": \"Smith\",\n \"companyName\": \"Acme Corporation\",\n \"website\": \"https://www.acmecorp.com\",\n \"email\": \"[email protected]\",\n \"workPhone\": \"+1 (555) 123-4567\",\n \"personalPhone\": \"<string>\",\n \"note\": \"<string>\",\n \"active\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/customers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["organization-id"] = '<organization-id>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customerType\": \"business\",\n \"currencyCode\": \"USD\",\n \"displayName\": \"Acme Corporation\",\n \"billingAddress1\": \"<string>\",\n \"billingAddress2\": \"<string>\",\n \"billingAddressCity\": \"<string>\",\n \"billingAddressCountry\": \"<string>\",\n \"billingAddressEmail\": \"<string>\",\n \"billingAddressPostcode\": \"<string>\",\n \"billingAddressPhone\": \"<string>\",\n \"billingAddressState\": \"<string>\",\n \"shippingAddress1\": \"<string>\",\n \"shippingAddress2\": \"<string>\",\n \"shippingAddressCity\": \"<string>\",\n \"shippingAddressCountry\": \"<string>\",\n \"shippingAddressEmail\": \"<string>\",\n \"shippingAddressPostcode\": \"<string>\",\n \"shippingAddressPhone\": \"<string>\",\n \"shippingAddressState\": \"<string>\",\n \"openingBalance\": 5000,\n \"openingBalanceAt\": \"2024-01-01\",\n \"openingBalanceExchangeRate\": 1,\n \"openingBalanceBranchId\": 101,\n \"salutation\": \"Mr.\",\n \"firstName\": \"John\",\n \"lastName\": \"Smith\",\n \"companyName\": \"Acme Corporation\",\n \"website\": \"https://www.acmecorp.com\",\n \"email\": \"[email protected]\",\n \"workPhone\": \"+1 (555) 123-4567\",\n \"personalPhone\": \"<string>\",\n \"note\": \"<string>\",\n \"active\": true\n}"
response = http.request(request)
puts response.read_body{
"balance": 1500,
"currencyCode": "USD",
"openingBalance": 1000,
"openingBalanceAt": "2024-01-01T00:00:00Z",
"openingBalanceExchangeRate": 1,
"displayName": "John Doe - Acme Corporation",
"note": "Important client with regular monthly orders",
"active": true,
"createdAt": "2024-01-01T00:00:00Z",
"updatedAt": "2024-01-01T00:00:00Z",
"localOpeningBalance": 1000,
"closingBalance": 1500,
"openingBalanceBranchId": 1,
"salutation": "Mr.",
"firstName": "John",
"lastName": "Doe",
"companyName": "Acme Corporation",
"email": "[email protected]",
"workPhone": "+1 (555) 123-4567",
"personalPhone": "+1 (555) 987-6543",
"website": "https://www.acme.com",
"billingAddress1": "123 Business Ave",
"billingAddress2": "Suite 100",
"billingAddressCity": "New York",
"billingAddressCountry": "United States",
"billingAddressEmail": "[email protected]",
"billingAddressPostcode": "10001",
"billingAddressPhone": "+1 (555) 111-2222",
"billingAddressState": "NY",
"shippingAddress1": "456 Shipping St",
"shippingAddress2": "Unit 200",
"shippingAddressCity": "Los Angeles",
"shippingAddressCountry": "United States",
"shippingAddressEmail": "[email protected]",
"shippingAddressPostcode": "90001",
"shippingAddressPhone": "+1 (555) 333-4444",
"shippingAddressState": "CA"
}Headers
Value must be 'Bearer ' where is an API key prefixed with 'bc_' or a JWT token.
"Bearer bc_1234567890abcdef"
Required if Authorization is a JWT token. The organization ID to operate within.
Body
Customer type
"business"
Currency code
"USD"
Display name
"Acme Corporation"
Billing address line 1
Billing address line 2
Billing address city
Billing address country
Billing address email
Billing address postcode
Billing address phone
Billing address state
Shipping address line 1
Shipping address line 2
Shipping address city
Shipping address country
Shipping address email
Shipping address postcode
Shipping address phone
Shipping address state
Opening balance
5000
Opening balance date (required when openingBalance is provided)
"2024-01-01"
Opening balance exchange rate
1
Opening balance branch ID
101
Salutation
"Mr."
First name
"John"
Last name
"Smith"
Company name
"Acme Corporation"
Website
"https://www.acmecorp.com"
Work phone
"+1 (555) 123-4567"
Personal phone
Note
Active status
Response
The customer has been successfully created.
1500
"USD"
1000
"2024-01-01T00:00:00Z"
1
"John Doe - Acme Corporation"
"Important client with regular monthly orders"
true
"2024-01-01T00:00:00Z"
"2024-01-01T00:00:00Z"
1000
1500
1
"Mr."
"John"
"Doe"
"Acme Corporation"
"+1 (555) 123-4567"
"+1 (555) 987-6543"
"https://www.acme.com"
"123 Business Ave"
"Suite 100"
"New York"
"United States"
"10001"
"+1 (555) 111-2222"
"NY"
"456 Shipping St"
"Unit 200"
"Los Angeles"
"United States"
"90001"
"+1 (555) 333-4444"
"CA"