Counterparties
Create a Counterparty
Create a Counterparty
POST
/
v1
/
counterparties
Create a Counterparty
curl --request POST \
--url https://api.bookeeping.ai/public-api/v1/counterparties \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"accountName": "<string>",
"accountNumber": "<string>",
"email": "jsmith@example.com",
"otherEmails": [
"jsmith@example.com"
],
"phone": "<string>",
"address": {
"city": "<string>",
"country": "<string>",
"state": "<string>",
"cca2": "<string>",
"line1": "<string>",
"line2": "<string>",
"postalCode": "<string>"
},
"taxId": "<string>"
}
'import requests
url = "https://api.bookeeping.ai/public-api/v1/counterparties"
payload = {
"accountName": "<string>",
"accountNumber": "<string>",
"email": "jsmith@example.com",
"otherEmails": ["jsmith@example.com"],
"phone": "<string>",
"address": {
"city": "<string>",
"country": "<string>",
"state": "<string>",
"cca2": "<string>",
"line1": "<string>",
"line2": "<string>",
"postalCode": "<string>"
},
"taxId": "<string>"
}
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({
accountName: '<string>',
accountNumber: '<string>',
email: 'jsmith@example.com',
otherEmails: ['jsmith@example.com'],
phone: '<string>',
address: {
city: '<string>',
country: '<string>',
state: '<string>',
cca2: '<string>',
line1: '<string>',
line2: '<string>',
postalCode: '<string>'
},
taxId: '<string>'
})
};
fetch('https://api.bookeeping.ai/public-api/v1/counterparties', 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.bookeeping.ai/public-api/v1/counterparties",
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([
'accountName' => '<string>',
'accountNumber' => '<string>',
'email' => 'jsmith@example.com',
'otherEmails' => [
'jsmith@example.com'
],
'phone' => '<string>',
'address' => [
'city' => '<string>',
'country' => '<string>',
'state' => '<string>',
'cca2' => '<string>',
'line1' => '<string>',
'line2' => '<string>',
'postalCode' => '<string>'
],
'taxId' => '<string>'
]),
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://api.bookeeping.ai/public-api/v1/counterparties"
payload := strings.NewReader("{\n \"accountName\": \"<string>\",\n \"accountNumber\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"otherEmails\": [\n \"jsmith@example.com\"\n ],\n \"phone\": \"<string>\",\n \"address\": {\n \"city\": \"<string>\",\n \"country\": \"<string>\",\n \"state\": \"<string>\",\n \"cca2\": \"<string>\",\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"postalCode\": \"<string>\"\n },\n \"taxId\": \"<string>\"\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://api.bookeeping.ai/public-api/v1/counterparties")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"accountName\": \"<string>\",\n \"accountNumber\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"otherEmails\": [\n \"jsmith@example.com\"\n ],\n \"phone\": \"<string>\",\n \"address\": {\n \"city\": \"<string>\",\n \"country\": \"<string>\",\n \"state\": \"<string>\",\n \"cca2\": \"<string>\",\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"postalCode\": \"<string>\"\n },\n \"taxId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bookeeping.ai/public-api/v1/counterparties")
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 \"accountName\": \"<string>\",\n \"accountNumber\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"otherEmails\": [\n \"jsmith@example.com\"\n ],\n \"phone\": \"<string>\",\n \"address\": {\n \"city\": \"<string>\",\n \"country\": \"<string>\",\n \"state\": \"<string>\",\n \"cca2\": \"<string>\",\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"postalCode\": \"<string>\"\n },\n \"taxId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>",
"metaData": {
"warnings": [
"<string>"
]
},
"data": {
"_id": "<string>",
"projectId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"accountName": "<string>",
"accountNumber": "<string>",
"email": "jsmith@example.com",
"phone": "<string>",
"otherEmails": [
"jsmith@example.com"
],
"taxId": "<string>",
"address": {
"city": "<string>",
"country": "<string>",
"state": "<string>",
"cca2": "<string>",
"line1": "<string>",
"line2": "<string>",
"postalCode": "<string>"
}
}
}{
"error": "BadRequestError",
"message": "<string>"
}{
"error": "UnauthorizedError",
"message": "<string>"
}{
"error": "ConflictError",
"message": "<string>"
}{
"error": "TooManyRequestsError",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}Authorizations
API key for authentication. Get your key from the Dashboard > Settings > API Access.
Body
application/json
The account name of the counterparty
The account number of the counterparty
The type of the counterparty
Available options:
customer, vendor, both The email of the counterparty
The other emails of the counterparty
The phone of the counterparty
The address of the counterparty
Show child attributes
Show child attributes
The tax id of the counterparty
⌘I
Create a Counterparty
curl --request POST \
--url https://api.bookeeping.ai/public-api/v1/counterparties \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"accountName": "<string>",
"accountNumber": "<string>",
"email": "jsmith@example.com",
"otherEmails": [
"jsmith@example.com"
],
"phone": "<string>",
"address": {
"city": "<string>",
"country": "<string>",
"state": "<string>",
"cca2": "<string>",
"line1": "<string>",
"line2": "<string>",
"postalCode": "<string>"
},
"taxId": "<string>"
}
'import requests
url = "https://api.bookeeping.ai/public-api/v1/counterparties"
payload = {
"accountName": "<string>",
"accountNumber": "<string>",
"email": "jsmith@example.com",
"otherEmails": ["jsmith@example.com"],
"phone": "<string>",
"address": {
"city": "<string>",
"country": "<string>",
"state": "<string>",
"cca2": "<string>",
"line1": "<string>",
"line2": "<string>",
"postalCode": "<string>"
},
"taxId": "<string>"
}
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({
accountName: '<string>',
accountNumber: '<string>',
email: 'jsmith@example.com',
otherEmails: ['jsmith@example.com'],
phone: '<string>',
address: {
city: '<string>',
country: '<string>',
state: '<string>',
cca2: '<string>',
line1: '<string>',
line2: '<string>',
postalCode: '<string>'
},
taxId: '<string>'
})
};
fetch('https://api.bookeeping.ai/public-api/v1/counterparties', 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.bookeeping.ai/public-api/v1/counterparties",
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([
'accountName' => '<string>',
'accountNumber' => '<string>',
'email' => 'jsmith@example.com',
'otherEmails' => [
'jsmith@example.com'
],
'phone' => '<string>',
'address' => [
'city' => '<string>',
'country' => '<string>',
'state' => '<string>',
'cca2' => '<string>',
'line1' => '<string>',
'line2' => '<string>',
'postalCode' => '<string>'
],
'taxId' => '<string>'
]),
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://api.bookeeping.ai/public-api/v1/counterparties"
payload := strings.NewReader("{\n \"accountName\": \"<string>\",\n \"accountNumber\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"otherEmails\": [\n \"jsmith@example.com\"\n ],\n \"phone\": \"<string>\",\n \"address\": {\n \"city\": \"<string>\",\n \"country\": \"<string>\",\n \"state\": \"<string>\",\n \"cca2\": \"<string>\",\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"postalCode\": \"<string>\"\n },\n \"taxId\": \"<string>\"\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://api.bookeeping.ai/public-api/v1/counterparties")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"accountName\": \"<string>\",\n \"accountNumber\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"otherEmails\": [\n \"jsmith@example.com\"\n ],\n \"phone\": \"<string>\",\n \"address\": {\n \"city\": \"<string>\",\n \"country\": \"<string>\",\n \"state\": \"<string>\",\n \"cca2\": \"<string>\",\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"postalCode\": \"<string>\"\n },\n \"taxId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bookeeping.ai/public-api/v1/counterparties")
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 \"accountName\": \"<string>\",\n \"accountNumber\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"otherEmails\": [\n \"jsmith@example.com\"\n ],\n \"phone\": \"<string>\",\n \"address\": {\n \"city\": \"<string>\",\n \"country\": \"<string>\",\n \"state\": \"<string>\",\n \"cca2\": \"<string>\",\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"postalCode\": \"<string>\"\n },\n \"taxId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>",
"metaData": {
"warnings": [
"<string>"
]
},
"data": {
"_id": "<string>",
"projectId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"accountName": "<string>",
"accountNumber": "<string>",
"email": "jsmith@example.com",
"phone": "<string>",
"otherEmails": [
"jsmith@example.com"
],
"taxId": "<string>",
"address": {
"city": "<string>",
"country": "<string>",
"state": "<string>",
"cca2": "<string>",
"line1": "<string>",
"line2": "<string>",
"postalCode": "<string>"
}
}
}{
"error": "BadRequestError",
"message": "<string>"
}{
"error": "UnauthorizedError",
"message": "<string>"
}{
"error": "ConflictError",
"message": "<string>"
}{
"error": "TooManyRequestsError",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}