Update a Transaction
Update a Transaction
curl --request PATCH \
--url https://api.bookeeping.ai/public-api/v1/transactions/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"refNo": "<string>",
"totalAmount": 123,
"transactionDate": "2023-11-07T05:31:56Z",
"isReconciled": true,
"currency": "<string>",
"entries": [
{
"id": "<string>",
"amount": 1,
"category": "<string>",
"isMain": true,
"note": "<string>"
}
],
"counterParty": "<string>",
"account": "<string>"
}
'import requests
url = "https://api.bookeeping.ai/public-api/v1/transactions/{id}"
payload = {
"refNo": "<string>",
"totalAmount": 123,
"transactionDate": "2023-11-07T05:31:56Z",
"isReconciled": True,
"currency": "<string>",
"entries": [
{
"id": "<string>",
"amount": 1,
"category": "<string>",
"isMain": True,
"note": "<string>"
}
],
"counterParty": "<string>",
"account": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
refNo: '<string>',
totalAmount: 123,
transactionDate: '2023-11-07T05:31:56Z',
isReconciled: true,
currency: '<string>',
entries: [
{
id: '<string>',
amount: 1,
category: '<string>',
isMain: true,
note: '<string>'
}
],
counterParty: '<string>',
account: '<string>'
})
};
fetch('https://api.bookeeping.ai/public-api/v1/transactions/{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.bookeeping.ai/public-api/v1/transactions/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'refNo' => '<string>',
'totalAmount' => 123,
'transactionDate' => '2023-11-07T05:31:56Z',
'isReconciled' => true,
'currency' => '<string>',
'entries' => [
[
'id' => '<string>',
'amount' => 1,
'category' => '<string>',
'isMain' => true,
'note' => '<string>'
]
],
'counterParty' => '<string>',
'account' => '<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/transactions/{id}"
payload := strings.NewReader("{\n \"refNo\": \"<string>\",\n \"totalAmount\": 123,\n \"transactionDate\": \"2023-11-07T05:31:56Z\",\n \"isReconciled\": true,\n \"currency\": \"<string>\",\n \"entries\": [\n {\n \"id\": \"<string>\",\n \"amount\": 1,\n \"category\": \"<string>\",\n \"isMain\": true,\n \"note\": \"<string>\"\n }\n ],\n \"counterParty\": \"<string>\",\n \"account\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.bookeeping.ai/public-api/v1/transactions/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"refNo\": \"<string>\",\n \"totalAmount\": 123,\n \"transactionDate\": \"2023-11-07T05:31:56Z\",\n \"isReconciled\": true,\n \"currency\": \"<string>\",\n \"entries\": [\n {\n \"id\": \"<string>\",\n \"amount\": 1,\n \"category\": \"<string>\",\n \"isMain\": true,\n \"note\": \"<string>\"\n }\n ],\n \"counterParty\": \"<string>\",\n \"account\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bookeeping.ai/public-api/v1/transactions/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"refNo\": \"<string>\",\n \"totalAmount\": 123,\n \"transactionDate\": \"2023-11-07T05:31:56Z\",\n \"isReconciled\": true,\n \"currency\": \"<string>\",\n \"entries\": [\n {\n \"id\": \"<string>\",\n \"amount\": 1,\n \"category\": \"<string>\",\n \"isMain\": true,\n \"note\": \"<string>\"\n }\n ],\n \"counterParty\": \"<string>\",\n \"account\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>",
"metaData": {
"warnings": [
"<string>"
]
},
"data": {
"_id": "<string>",
"projectId": "<string>",
"currency": "<string>",
"totalAmount": 123,
"transactionDate": "2023-11-07T05:31:56Z",
"isReconciled": true,
"nonProfitAllocations": [
{
"percentage": 123,
"program": {
"_id": "<string>",
"name": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"hexColor": "<string>"
},
"grant": {
"_id": "<string>",
"name": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"hexColor": "<string>",
"funders": [
"<string>"
]
},
"note": "<string>"
}
],
"entries": [
{
"id": "<string>",
"amount": 1,
"category": {
"_id": "<string>",
"name": "<string>",
"emoji": "<string>",
"number": "<string>",
"group": "<string>"
},
"isMain": true,
"note": "<string>"
}
],
"classes": [
{
"_id": "<string>",
"name": "<string>",
"description": "<string>",
"emoji": "<string>",
"color": "<string>"
}
],
"attachmentsIds": [
"<string>"
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"refNo": "<string>",
"originalAmount": 123,
"originalCurrency": "<string>",
"counterParty": {
"_id": "<string>",
"accountName": "<string>",
"accountNumber": "<string>",
"email": "jsmith@example.com",
"phone": "<string>"
},
"account": {
"_id": "<string>",
"accountName": "<string>",
"accountNumber": "<string>"
},
"nonProfitGrantId": "<string>",
"attachedTransactionId": "<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.
Path Parameters
The id of the transaction. Expected to be a valid object id like 666666666666666666666666
^[0-9A-Fa-f]{24}$Body
The reference number of the transaction
The total amount of the transaction. Same as the sum of the Total Credit = Total Debit.
The transaction date of the transaction
The payment method of the transaction
CASH, CHEQUE, NEFT, IMPS, UPI, CARD, TRANSFER, OTHER The reconciliation status of the transaction
The currency of the transaction. Use default currency if not provided
The entries of the transaction
Show child attributes
Show child attributes
The counter party id of the transaction. Expected to be a valid object id like 666666666666666666666666
^[0-9A-Fa-f]{24}$The account id of the transaction. Expected to be a valid object id like 666666666666666666666666
^[0-9A-Fa-f]{24}$curl --request PATCH \
--url https://api.bookeeping.ai/public-api/v1/transactions/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"refNo": "<string>",
"totalAmount": 123,
"transactionDate": "2023-11-07T05:31:56Z",
"isReconciled": true,
"currency": "<string>",
"entries": [
{
"id": "<string>",
"amount": 1,
"category": "<string>",
"isMain": true,
"note": "<string>"
}
],
"counterParty": "<string>",
"account": "<string>"
}
'import requests
url = "https://api.bookeeping.ai/public-api/v1/transactions/{id}"
payload = {
"refNo": "<string>",
"totalAmount": 123,
"transactionDate": "2023-11-07T05:31:56Z",
"isReconciled": True,
"currency": "<string>",
"entries": [
{
"id": "<string>",
"amount": 1,
"category": "<string>",
"isMain": True,
"note": "<string>"
}
],
"counterParty": "<string>",
"account": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
refNo: '<string>',
totalAmount: 123,
transactionDate: '2023-11-07T05:31:56Z',
isReconciled: true,
currency: '<string>',
entries: [
{
id: '<string>',
amount: 1,
category: '<string>',
isMain: true,
note: '<string>'
}
],
counterParty: '<string>',
account: '<string>'
})
};
fetch('https://api.bookeeping.ai/public-api/v1/transactions/{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.bookeeping.ai/public-api/v1/transactions/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'refNo' => '<string>',
'totalAmount' => 123,
'transactionDate' => '2023-11-07T05:31:56Z',
'isReconciled' => true,
'currency' => '<string>',
'entries' => [
[
'id' => '<string>',
'amount' => 1,
'category' => '<string>',
'isMain' => true,
'note' => '<string>'
]
],
'counterParty' => '<string>',
'account' => '<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/transactions/{id}"
payload := strings.NewReader("{\n \"refNo\": \"<string>\",\n \"totalAmount\": 123,\n \"transactionDate\": \"2023-11-07T05:31:56Z\",\n \"isReconciled\": true,\n \"currency\": \"<string>\",\n \"entries\": [\n {\n \"id\": \"<string>\",\n \"amount\": 1,\n \"category\": \"<string>\",\n \"isMain\": true,\n \"note\": \"<string>\"\n }\n ],\n \"counterParty\": \"<string>\",\n \"account\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.bookeeping.ai/public-api/v1/transactions/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"refNo\": \"<string>\",\n \"totalAmount\": 123,\n \"transactionDate\": \"2023-11-07T05:31:56Z\",\n \"isReconciled\": true,\n \"currency\": \"<string>\",\n \"entries\": [\n {\n \"id\": \"<string>\",\n \"amount\": 1,\n \"category\": \"<string>\",\n \"isMain\": true,\n \"note\": \"<string>\"\n }\n ],\n \"counterParty\": \"<string>\",\n \"account\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bookeeping.ai/public-api/v1/transactions/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"refNo\": \"<string>\",\n \"totalAmount\": 123,\n \"transactionDate\": \"2023-11-07T05:31:56Z\",\n \"isReconciled\": true,\n \"currency\": \"<string>\",\n \"entries\": [\n {\n \"id\": \"<string>\",\n \"amount\": 1,\n \"category\": \"<string>\",\n \"isMain\": true,\n \"note\": \"<string>\"\n }\n ],\n \"counterParty\": \"<string>\",\n \"account\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>",
"metaData": {
"warnings": [
"<string>"
]
},
"data": {
"_id": "<string>",
"projectId": "<string>",
"currency": "<string>",
"totalAmount": 123,
"transactionDate": "2023-11-07T05:31:56Z",
"isReconciled": true,
"nonProfitAllocations": [
{
"percentage": 123,
"program": {
"_id": "<string>",
"name": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"hexColor": "<string>"
},
"grant": {
"_id": "<string>",
"name": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"hexColor": "<string>",
"funders": [
"<string>"
]
},
"note": "<string>"
}
],
"entries": [
{
"id": "<string>",
"amount": 1,
"category": {
"_id": "<string>",
"name": "<string>",
"emoji": "<string>",
"number": "<string>",
"group": "<string>"
},
"isMain": true,
"note": "<string>"
}
],
"classes": [
{
"_id": "<string>",
"name": "<string>",
"description": "<string>",
"emoji": "<string>",
"color": "<string>"
}
],
"attachmentsIds": [
"<string>"
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"refNo": "<string>",
"originalAmount": 123,
"originalCurrency": "<string>",
"counterParty": {
"_id": "<string>",
"accountName": "<string>",
"accountNumber": "<string>",
"email": "jsmith@example.com",
"phone": "<string>"
},
"account": {
"_id": "<string>",
"accountName": "<string>",
"accountNumber": "<string>"
},
"nonProfitGrantId": "<string>",
"attachedTransactionId": "<string>"
}
}{
"error": "BadRequestError",
"message": "<string>"
}{
"error": "UnauthorizedError",
"message": "<string>"
}{
"error": "ConflictError",
"message": "<string>"
}{
"error": "TooManyRequestsError",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}