Get a payment
curl --request GET \
--url https://app.synthetic.ai/api/v1/payments/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.synthetic.ai/api/v1/payments/{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/payments/{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/payments/{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/payments/{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/payments/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.synthetic.ai/api/v1/payments/{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",
"type": "CASH",
"parentPaymentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"receivedDate": "2023-11-07T05:31:56Z",
"customerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customerName": "<string>",
"amountCents": 0,
"appliedAmountCents": 0,
"unappliedAmountCents": 0,
"journalEntryId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"bankFee": "<unknown>",
"createdAt": "<string>",
"updatedAt": "<string>"
}{
"code": "BAD_REQUEST",
"message": "Input validation failed",
"issues": []
}{
"code": "UNAUTHORIZED",
"message": "Unauthorized",
"issues": []
}{
"code": "NOT_FOUND",
"message": "Payment not found",
"issues": []
}{
"code": "INTERNAL_SERVER_ERROR",
"message": "An unexpected error occurred.",
"issues": []
}Payments
Get a payment
One cash payment by id. A payment of another entity, or a bank fee on its own, is not found.
GET
/
payments
/
{id}
Get a payment
curl --request GET \
--url https://app.synthetic.ai/api/v1/payments/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.synthetic.ai/api/v1/payments/{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/payments/{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/payments/{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/payments/{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/payments/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.synthetic.ai/api/v1/payments/{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",
"type": "CASH",
"parentPaymentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"receivedDate": "2023-11-07T05:31:56Z",
"customerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customerName": "<string>",
"amountCents": 0,
"appliedAmountCents": 0,
"unappliedAmountCents": 0,
"journalEntryId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"bankFee": "<unknown>",
"createdAt": "<string>",
"updatedAt": "<string>"
}{
"code": "BAD_REQUEST",
"message": "Input validation failed",
"issues": []
}{
"code": "UNAUTHORIZED",
"message": "Unauthorized",
"issues": []
}{
"code": "NOT_FOUND",
"message": "Payment not found",
"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 payment id.
Pattern:
^([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
Money a customer paid: how much, which customer, how much of it has been applied to invoices, and the bank fee charged on it, which is a payment of type BANK_FEE.
Pattern:
^([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)$CASH for money received; BANK_FEE for the fee nested in a cash payment.
Available options:
CASH, BANK_FEE For a bank fee, the cash payment it was charged against; null for a cash payment.
Pattern:
^([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 the payment was received, carried at UTC midnight. The time is not data.
Pattern:
^([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)$Required range:
-9007199254740991 <= x <= 9007199254740991Required range:
-9007199254740991 <= x <= 9007199254740991Required range:
-9007199254740991 <= x <= 9007199254740991Pattern:
^([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 bank fee charged against this payment, itself a payment. A fee has none.