curl --request PUT \
--url https://api.example.com/api/customers/{id} \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--header 'organization-id: <organization-id>' \
--data '
{
"customerType": "<string>",
"displayName": "<string>",
"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>",
"salutation": "<string>",
"firstName": "<string>",
"lastName": "<string>",
"companyName": "<string>",
"website": "<string>",
"email": "<string>",
"workPhone": "<string>",
"personalPhone": "<string>",
"note": "<string>",
"active": true
}
'import requests
url = "https://api.example.com/api/customers/{id}"
payload = {
"customerType": "<string>",
"displayName": "<string>",
"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>",
"salutation": "<string>",
"firstName": "<string>",
"lastName": "<string>",
"companyName": "<string>",
"website": "<string>",
"email": "<string>",
"workPhone": "<string>",
"personalPhone": "<string>",
"note": "<string>",
"active": True
}
headers = {
"Authorization": "<authorization>",
"organization-id": "<organization-id>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
Authorization: '<authorization>',
'organization-id': '<organization-id>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
customerType: '<string>',
displayName: '<string>',
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>',
salutation: '<string>',
firstName: '<string>',
lastName: '<string>',
companyName: '<string>',
website: '<string>',
email: '<string>',
workPhone: '<string>',
personalPhone: '<string>',
note: '<string>',
active: true
})
};
fetch('https://api.example.com/api/customers/{id}', 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/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'customerType' => '<string>',
'displayName' => '<string>',
'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>',
'salutation' => '<string>',
'firstName' => '<string>',
'lastName' => '<string>',
'companyName' => '<string>',
'website' => '<string>',
'email' => '<string>',
'workPhone' => '<string>',
'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/{id}"
payload := strings.NewReader("{\n \"customerType\": \"<string>\",\n \"displayName\": \"<string>\",\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 \"salutation\": \"<string>\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"companyName\": \"<string>\",\n \"website\": \"<string>\",\n \"email\": \"<string>\",\n \"workPhone\": \"<string>\",\n \"personalPhone\": \"<string>\",\n \"note\": \"<string>\",\n \"active\": true\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.example.com/api/customers/{id}")
.header("Authorization", "<authorization>")
.header("organization-id", "<organization-id>")
.header("Content-Type", "application/json")
.body("{\n \"customerType\": \"<string>\",\n \"displayName\": \"<string>\",\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 \"salutation\": \"<string>\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"companyName\": \"<string>\",\n \"website\": \"<string>\",\n \"email\": \"<string>\",\n \"workPhone\": \"<string>\",\n \"personalPhone\": \"<string>\",\n \"note\": \"<string>\",\n \"active\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/customers/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<authorization>'
request["organization-id"] = '<organization-id>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customerType\": \"<string>\",\n \"displayName\": \"<string>\",\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 \"salutation\": \"<string>\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"companyName\": \"<string>\",\n \"website\": \"<string>\",\n \"email\": \"<string>\",\n \"workPhone\": \"<string>\",\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"
}Edit the given customer.
curl --request PUT \
--url https://api.example.com/api/customers/{id} \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--header 'organization-id: <organization-id>' \
--data '
{
"customerType": "<string>",
"displayName": "<string>",
"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>",
"salutation": "<string>",
"firstName": "<string>",
"lastName": "<string>",
"companyName": "<string>",
"website": "<string>",
"email": "<string>",
"workPhone": "<string>",
"personalPhone": "<string>",
"note": "<string>",
"active": true
}
'import requests
url = "https://api.example.com/api/customers/{id}"
payload = {
"customerType": "<string>",
"displayName": "<string>",
"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>",
"salutation": "<string>",
"firstName": "<string>",
"lastName": "<string>",
"companyName": "<string>",
"website": "<string>",
"email": "<string>",
"workPhone": "<string>",
"personalPhone": "<string>",
"note": "<string>",
"active": True
}
headers = {
"Authorization": "<authorization>",
"organization-id": "<organization-id>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
Authorization: '<authorization>',
'organization-id': '<organization-id>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
customerType: '<string>',
displayName: '<string>',
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>',
salutation: '<string>',
firstName: '<string>',
lastName: '<string>',
companyName: '<string>',
website: '<string>',
email: '<string>',
workPhone: '<string>',
personalPhone: '<string>',
note: '<string>',
active: true
})
};
fetch('https://api.example.com/api/customers/{id}', 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/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'customerType' => '<string>',
'displayName' => '<string>',
'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>',
'salutation' => '<string>',
'firstName' => '<string>',
'lastName' => '<string>',
'companyName' => '<string>',
'website' => '<string>',
'email' => '<string>',
'workPhone' => '<string>',
'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/{id}"
payload := strings.NewReader("{\n \"customerType\": \"<string>\",\n \"displayName\": \"<string>\",\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 \"salutation\": \"<string>\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"companyName\": \"<string>\",\n \"website\": \"<string>\",\n \"email\": \"<string>\",\n \"workPhone\": \"<string>\",\n \"personalPhone\": \"<string>\",\n \"note\": \"<string>\",\n \"active\": true\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.example.com/api/customers/{id}")
.header("Authorization", "<authorization>")
.header("organization-id", "<organization-id>")
.header("Content-Type", "application/json")
.body("{\n \"customerType\": \"<string>\",\n \"displayName\": \"<string>\",\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 \"salutation\": \"<string>\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"companyName\": \"<string>\",\n \"website\": \"<string>\",\n \"email\": \"<string>\",\n \"workPhone\": \"<string>\",\n \"personalPhone\": \"<string>\",\n \"note\": \"<string>\",\n \"active\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/customers/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<authorization>'
request["organization-id"] = '<organization-id>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customerType\": \"<string>\",\n \"displayName\": \"<string>\",\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 \"salutation\": \"<string>\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"companyName\": \"<string>\",\n \"website\": \"<string>\",\n \"email\": \"<string>\",\n \"workPhone\": \"<string>\",\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.
Path Parameters
Body
Customer type
Display name
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
Salutation
First name
Last name
Company name
Website
Work phone
Personal phone
Note
Active status
Response
The customer has been successfully updated.
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"