curl --request GET \
--url https://app.synthetic.ai/api/v1/customers/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.synthetic.ai/api/v1/customers/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.synthetic.ai/api/v1/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://app.synthetic.ai/api/v1/customers/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.synthetic.ai/api/v1/customers/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://app.synthetic.ai/api/v1/customers/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.synthetic.ai/api/v1/customers/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"billingEmail": "<string>",
"invoiceCcEmails": [
"<string>"
],
"emailPaymentFollowUps": true,
"lastPaymentFollowUpAt": "<string>",
"note": "<string>",
"invoiceNote": "<string>",
"outstandingIssuedAmount": {},
"contractCount": 0,
"contractValueAmount": {},
"remainingToInvoiceAmount": {},
"contractHealth": "RENEWAL_DUE",
"coverageContractId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"coverageContractStartAt": "2023-11-07T05:31:56Z",
"coverageContractEndAt": "2023-11-07T05:31:56Z",
"coverageContractAutoRenew": true,
"coverageContractRenewed": true,
"createdAt": "<string>",
"updatedAt": "<string>"
}{
"code": "BAD_REQUEST",
"message": "Input validation failed",
"issues": []
}{
"code": "UNAUTHORIZED",
"message": "Unauthorized",
"issues": []
}{
"code": "NOT_FOUND",
"message": "The record does not exist for your business.",
"issues": []
}{
"code": "INTERNAL_SERVER_ERROR",
"message": "An unexpected error occurred.",
"issues": []
}Get a customer
One customer by id. A customer of another entity, or a deleted one, is not found. Needs a key holding customers:read.
curl --request GET \
--url https://app.synthetic.ai/api/v1/customers/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.synthetic.ai/api/v1/customers/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.synthetic.ai/api/v1/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://app.synthetic.ai/api/v1/customers/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.synthetic.ai/api/v1/customers/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://app.synthetic.ai/api/v1/customers/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.synthetic.ai/api/v1/customers/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"billingEmail": "<string>",
"invoiceCcEmails": [
"<string>"
],
"emailPaymentFollowUps": true,
"lastPaymentFollowUpAt": "<string>",
"note": "<string>",
"invoiceNote": "<string>",
"outstandingIssuedAmount": {},
"contractCount": 0,
"contractValueAmount": {},
"remainingToInvoiceAmount": {},
"contractHealth": "RENEWAL_DUE",
"coverageContractId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"coverageContractStartAt": "2023-11-07T05:31:56Z",
"coverageContractEndAt": "2023-11-07T05:31:56Z",
"coverageContractAutoRenew": true,
"coverageContractRenewed": true,
"createdAt": "<string>",
"updatedAt": "<string>"
}{
"code": "BAD_REQUEST",
"message": "Input validation failed",
"issues": []
}{
"code": "UNAUTHORIZED",
"message": "Unauthorized",
"issues": []
}{
"code": "NOT_FOUND",
"message": "The record does not exist for your business.",
"issues": []
}{
"code": "INTERNAL_SERVER_ERROR",
"message": "An unexpected error occurred.",
"issues": []
}Authorizations
An API key created in Settings, sent as Authorization: Bearer <key>.
Path Parameters
The customer id.
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$Response
Successful response
Someone the entity bills: who to send invoices to, and what their contracts and invoices add up to.
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$The address invoices, payment receipts, payment reminders and autopay notices are sent to.
Addresses copied on invoice, payment receipt, payment reminder and autopay notice emails.
Whether Synthetic emails this customer reminders about unpaid invoices.
When Synthetic last started a reminder to this customer, whether or not the email went out; null if it never has.
A note for the entity's own staff. It is never printed on an invoice.
Text printed on this customer's invoices. An invoice copies it when issued and keeps that copy if this changes; an invoice issued while this was empty shows the current note.
What the customer still owes on issued invoices: their totals less what payments with status POSTED have paid on them. Keyed by currency code, one money object per currency, in the currency of the contract each invoice bills; amounts in different currencies are never added together. A currency whose total is 0 is left out, so {} means nothing is owed. Each value is a whole number of the currency's smallest unit, so { "USD": { "value": 200000, "currencyCode": "USD" } } is $2,000.00.
Show child attributes
Show child attributes
How many contracts the customer has that are not deleted.
-9007199254740991 <= x <= 9007199254740991The total of every invoice that is not voided on the customer's contracts that are not deleted, keyed by currency the same way.
Show child attributes
Show child attributes
The total of the invoices on those contracts that have not been issued yet, keyed by currency the same way.
Show child attributes
Show child attributes
The first of these states, in this order, that any of the customer's contracts is in. Each is read from the terms in force today, whose end can differ from the contract's end date while agreed terms that change it have not started. A contract is running when its terms are agreed and today is between its start date and the end of its terms in force. RENEWAL_DUE: running, does not renew automatically, has no agreed cancellation, is inside its renewal notice period, and the customer has no other agreed contract that begins on or after the end of its terms in force. ENDING: running, does not renew automatically, has no agreed cancellation and no renewal notice period, and its terms in force end within 30 days. HEALTHY: running. UPCOMING: agreed but not started. NO_ACTIVE_CONTRACT: ended or cancelled. DRAFT_ONLY: its terms are still being written. NO_CONTRACTS: the customer has no contract that is not deleted.
RENEWAL_DUE, ENDING, HEALTHY, UPCOMING, NO_ACTIVE_CONTRACT, DRAFT_ONLY, NO_CONTRACTS The contract contractHealth is read from; null when the customer has no contract that is not deleted.
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$The calendar date that contract starts, carried at UTC midnight; null when the customer has no contract that is not deleted. The time is not data.
The calendar date that contract ends, carried at UTC midnight: it covers the days before this date, not the date itself. Null when the customer has no contract that is not deleted. The time is not data.
Whether that contract renews automatically; false when the customer has no contract that is not deleted.
Whether the customer has another contract, not deleted, that renews that contract and whose terms are agreed and not cancelled or ended. False when the customer has no contract that is not deleted.