Update client
curl --request PUT \
--url https://app.blinksale.test/api/v1/clients/{clientId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Acme Inc.",
"email": "[email protected]",
"kind": "BUSINESS",
"profile": {
"company_name": "Acme Inc.",
"website": "https://acme.com"
},
"document_defaults": {
"currency": "USD"
},
"address": {
"line1": "123 Main St",
"line2": "Suite 101",
"city": "San Francisco",
"state": "CA",
"zip": "94107",
"country": "US"
}
}
'import requests
url = "https://app.blinksale.test/api/v1/clients/{clientId}"
payload = {
"name": "Acme Inc.",
"email": "[email protected]",
"kind": "BUSINESS",
"profile": {
"company_name": "Acme Inc.",
"website": "https://acme.com"
},
"document_defaults": { "currency": "USD" },
"address": {
"line1": "123 Main St",
"line2": "Suite 101",
"city": "San Francisco",
"state": "CA",
"zip": "94107",
"country": "US"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Acme Inc.',
email: '[email protected]',
kind: 'BUSINESS',
profile: {company_name: 'Acme Inc.', website: 'https://acme.com'},
document_defaults: {currency: 'USD'},
address: {
line1: '123 Main St',
line2: 'Suite 101',
city: 'San Francisco',
state: 'CA',
zip: '94107',
country: 'US'
}
})
};
fetch('https://app.blinksale.test/api/v1/clients/{clientId}', 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://app.blinksale.test/api/v1/clients/{clientId}",
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([
'name' => 'Acme Inc.',
'email' => '[email protected]',
'kind' => 'BUSINESS',
'profile' => [
'company_name' => 'Acme Inc.',
'website' => 'https://acme.com'
],
'document_defaults' => [
'currency' => 'USD'
],
'address' => [
'line1' => '123 Main St',
'line2' => 'Suite 101',
'city' => 'San Francisco',
'state' => 'CA',
'zip' => '94107',
'country' => 'US'
]
]),
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://app.blinksale.test/api/v1/clients/{clientId}"
payload := strings.NewReader("{\n \"name\": \"Acme Inc.\",\n \"email\": \"[email protected]\",\n \"kind\": \"BUSINESS\",\n \"profile\": {\n \"company_name\": \"Acme Inc.\",\n \"website\": \"https://acme.com\"\n },\n \"document_defaults\": {\n \"currency\": \"USD\"\n },\n \"address\": {\n \"line1\": \"123 Main St\",\n \"line2\": \"Suite 101\",\n \"city\": \"San Francisco\",\n \"state\": \"CA\",\n \"zip\": \"94107\",\n \"country\": \"US\"\n }\n}")
req, _ := http.NewRequest("PUT", 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.put("https://app.blinksale.test/api/v1/clients/{clientId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Acme Inc.\",\n \"email\": \"[email protected]\",\n \"kind\": \"BUSINESS\",\n \"profile\": {\n \"company_name\": \"Acme Inc.\",\n \"website\": \"https://acme.com\"\n },\n \"document_defaults\": {\n \"currency\": \"USD\"\n },\n \"address\": {\n \"line1\": \"123 Main St\",\n \"line2\": \"Suite 101\",\n \"city\": \"San Francisco\",\n \"state\": \"CA\",\n \"zip\": \"94107\",\n \"country\": \"US\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.blinksale.test/api/v1/clients/{clientId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Acme Inc.\",\n \"email\": \"[email protected]\",\n \"kind\": \"BUSINESS\",\n \"profile\": {\n \"company_name\": \"Acme Inc.\",\n \"website\": \"https://acme.com\"\n },\n \"document_defaults\": {\n \"currency\": \"USD\"\n },\n \"address\": {\n \"line1\": \"123 Main St\",\n \"line2\": \"Suite 101\",\n \"city\": \"San Francisco\",\n \"state\": \"CA\",\n \"zip\": \"94107\",\n \"country\": \"US\"\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Client updated successfully",
"data": {
"id": "01jtbf0c9zaraqx3swthf88n5y",
"name": "Acme Inc",
"email": "[email protected]",
"kind": "BUSINESS",
"kind_name": "Business",
"profile": {
"company_name": "Acme Inc",
"website": "https://acme.com"
},
"address": {
"line1": "123 Main St",
"line2": "Suite 101",
"city": "San Francisco",
"state": "CA",
"zip": "94107",
"country": "US"
},
"document_defaults": {
"currency": "USD"
},
"contact_count": 3,
"note_count": 2,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"success": false,
"message": "An error occurred",
"errors": {
"email": [
"The email field is required."
]
}
}{
"success": false,
"message": "An error occurred",
"errors": {
"email": [
"The email field is required."
]
}
}{
"success": false,
"message": "An error occurred",
"errors": {
"email": [
"The email field is required."
]
}
}{
"success": false,
"message": "Validation error",
"errors": {
"email": [
"The email field must be a valid email address."
]
}
}{
"success": false,
"message": "An error occurred",
"errors": {
"email": [
"The email field is required."
]
}
}Clients
Update Client
Update an existing client
PUT
/
v1
/
clients
/
{clientId}
Update client
curl --request PUT \
--url https://app.blinksale.test/api/v1/clients/{clientId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Acme Inc.",
"email": "[email protected]",
"kind": "BUSINESS",
"profile": {
"company_name": "Acme Inc.",
"website": "https://acme.com"
},
"document_defaults": {
"currency": "USD"
},
"address": {
"line1": "123 Main St",
"line2": "Suite 101",
"city": "San Francisco",
"state": "CA",
"zip": "94107",
"country": "US"
}
}
'import requests
url = "https://app.blinksale.test/api/v1/clients/{clientId}"
payload = {
"name": "Acme Inc.",
"email": "[email protected]",
"kind": "BUSINESS",
"profile": {
"company_name": "Acme Inc.",
"website": "https://acme.com"
},
"document_defaults": { "currency": "USD" },
"address": {
"line1": "123 Main St",
"line2": "Suite 101",
"city": "San Francisco",
"state": "CA",
"zip": "94107",
"country": "US"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Acme Inc.',
email: '[email protected]',
kind: 'BUSINESS',
profile: {company_name: 'Acme Inc.', website: 'https://acme.com'},
document_defaults: {currency: 'USD'},
address: {
line1: '123 Main St',
line2: 'Suite 101',
city: 'San Francisco',
state: 'CA',
zip: '94107',
country: 'US'
}
})
};
fetch('https://app.blinksale.test/api/v1/clients/{clientId}', 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://app.blinksale.test/api/v1/clients/{clientId}",
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([
'name' => 'Acme Inc.',
'email' => '[email protected]',
'kind' => 'BUSINESS',
'profile' => [
'company_name' => 'Acme Inc.',
'website' => 'https://acme.com'
],
'document_defaults' => [
'currency' => 'USD'
],
'address' => [
'line1' => '123 Main St',
'line2' => 'Suite 101',
'city' => 'San Francisco',
'state' => 'CA',
'zip' => '94107',
'country' => 'US'
]
]),
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://app.blinksale.test/api/v1/clients/{clientId}"
payload := strings.NewReader("{\n \"name\": \"Acme Inc.\",\n \"email\": \"[email protected]\",\n \"kind\": \"BUSINESS\",\n \"profile\": {\n \"company_name\": \"Acme Inc.\",\n \"website\": \"https://acme.com\"\n },\n \"document_defaults\": {\n \"currency\": \"USD\"\n },\n \"address\": {\n \"line1\": \"123 Main St\",\n \"line2\": \"Suite 101\",\n \"city\": \"San Francisco\",\n \"state\": \"CA\",\n \"zip\": \"94107\",\n \"country\": \"US\"\n }\n}")
req, _ := http.NewRequest("PUT", 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.put("https://app.blinksale.test/api/v1/clients/{clientId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Acme Inc.\",\n \"email\": \"[email protected]\",\n \"kind\": \"BUSINESS\",\n \"profile\": {\n \"company_name\": \"Acme Inc.\",\n \"website\": \"https://acme.com\"\n },\n \"document_defaults\": {\n \"currency\": \"USD\"\n },\n \"address\": {\n \"line1\": \"123 Main St\",\n \"line2\": \"Suite 101\",\n \"city\": \"San Francisco\",\n \"state\": \"CA\",\n \"zip\": \"94107\",\n \"country\": \"US\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.blinksale.test/api/v1/clients/{clientId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Acme Inc.\",\n \"email\": \"[email protected]\",\n \"kind\": \"BUSINESS\",\n \"profile\": {\n \"company_name\": \"Acme Inc.\",\n \"website\": \"https://acme.com\"\n },\n \"document_defaults\": {\n \"currency\": \"USD\"\n },\n \"address\": {\n \"line1\": \"123 Main St\",\n \"line2\": \"Suite 101\",\n \"city\": \"San Francisco\",\n \"state\": \"CA\",\n \"zip\": \"94107\",\n \"country\": \"US\"\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Client updated successfully",
"data": {
"id": "01jtbf0c9zaraqx3swthf88n5y",
"name": "Acme Inc",
"email": "[email protected]",
"kind": "BUSINESS",
"kind_name": "Business",
"profile": {
"company_name": "Acme Inc",
"website": "https://acme.com"
},
"address": {
"line1": "123 Main St",
"line2": "Suite 101",
"city": "San Francisco",
"state": "CA",
"zip": "94107",
"country": "US"
},
"document_defaults": {
"currency": "USD"
},
"contact_count": 3,
"note_count": 2,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"success": false,
"message": "An error occurred",
"errors": {
"email": [
"The email field is required."
]
}
}{
"success": false,
"message": "An error occurred",
"errors": {
"email": [
"The email field is required."
]
}
}{
"success": false,
"message": "An error occurred",
"errors": {
"email": [
"The email field is required."
]
}
}{
"success": false,
"message": "Validation error",
"errors": {
"email": [
"The email field must be a valid email address."
]
}
}{
"success": false,
"message": "An error occurred",
"errors": {
"email": [
"The email field is required."
]
}
}Authorizations
Access token obtained from the /v1/auth/login endpoint
Path Parameters
The ID of the client to update
Body
application/json
⌘I

