Skip to main content
POST
/
v1
/
invoices
/
{id}
/
mark-as-paid
Mark an Invoice as Paid
curl --request POST \
  --url https://api.bookeeping.ai/public-api/v1/invoices/{id}/mark-as-paid \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "strategyData": {
    "strategy": "CREATE_TRANSACTION",
    "data": {
      "transactionRefNo": "<string>",
      "transactionNote": "<string>",
      "category": "<string>",
      "account": "<string>",
      "counterParty": "<string>"
    }
  }
}
'
import requests

url = "https://api.bookeeping.ai/public-api/v1/invoices/{id}/mark-as-paid"

payload = { "strategyData": {
"strategy": "CREATE_TRANSACTION",
"data": {
"transactionRefNo": "<string>",
"transactionNote": "<string>",
"category": "<string>",
"account": "<string>",
"counterParty": "<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({
strategyData: {
strategy: 'CREATE_TRANSACTION',
data: {
transactionRefNo: '<string>',
transactionNote: '<string>',
category: '<string>',
account: '<string>',
counterParty: '<string>'
}
}
})
};

fetch('https://api.bookeeping.ai/public-api/v1/invoices/{id}/mark-as-paid', 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/invoices/{id}/mark-as-paid",
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([
'strategyData' => [
'strategy' => 'CREATE_TRANSACTION',
'data' => [
'transactionRefNo' => '<string>',
'transactionNote' => '<string>',
'category' => '<string>',
'account' => '<string>',
'counterParty' => '<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/invoices/{id}/mark-as-paid"

payload := strings.NewReader("{\n \"strategyData\": {\n \"strategy\": \"CREATE_TRANSACTION\",\n \"data\": {\n \"transactionRefNo\": \"<string>\",\n \"transactionNote\": \"<string>\",\n \"category\": \"<string>\",\n \"account\": \"<string>\",\n \"counterParty\": \"<string>\"\n }\n }\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/invoices/{id}/mark-as-paid")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"strategyData\": {\n \"strategy\": \"CREATE_TRANSACTION\",\n \"data\": {\n \"transactionRefNo\": \"<string>\",\n \"transactionNote\": \"<string>\",\n \"category\": \"<string>\",\n \"account\": \"<string>\",\n \"counterParty\": \"<string>\"\n }\n }\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.bookeeping.ai/public-api/v1/invoices/{id}/mark-as-paid")

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 \"strategyData\": {\n \"strategy\": \"CREATE_TRANSACTION\",\n \"data\": {\n \"transactionRefNo\": \"<string>\",\n \"transactionNote\": \"<string>\",\n \"category\": \"<string>\",\n \"account\": \"<string>\",\n \"counterParty\": \"<string>\"\n }\n }\n}"

response = http.request(request)
puts response.read_body
{
  "message": "<string>",
  "metaData": {
    "warnings": [
      "<string>"
    ]
  },
  "data": {
    "_id": "<string>",
    "projectId": "<string>",
    "invoiceId": "<string>",
    "discount": {
      "value": 123
    },
    "amount": 123,
    "invoiceDate": "2023-11-07T05:31:56Z",
    "dueDate": "2023-11-07T05:31:56Z",
    "currency": "<string>",
    "lineItems": [
      {
        "id": "<string>",
        "name": "<string>",
        "quantity": 123,
        "unitPrice": 123,
        "tax": {
          "value": 123
        },
        "discount": {
          "value": 123
        },
        "description": "<string>"
      }
    ],
    "note": "<string>",
    "calculated": {
      "grandTotal": 123,
      "tax": 123,
      "discount": 123,
      "subTotal": 123
    },
    "attachments": [
      "<string>"
    ],
    "createdAt": "2023-11-07T05:31:56Z",
    "updatedAt": "2023-11-07T05:31:56Z",
    "purchaseOrderId": "<string>",
    "counterParty": {
      "_id": "<string>",
      "accountName": "<string>",
      "accountNumber": "<string>",
      "email": "jsmith@example.com",
      "phone": "<string>",
      "otherEmails": [
        "jsmith@example.com"
      ],
      "address": {
        "city": "<string>",
        "country": "<string>",
        "state": "<string>",
        "cca2": "<string>",
        "line1": "<string>",
        "line2": "<string>",
        "postalCode": "<string>"
      }
    },
    "convertedAmount": 123,
    "convertedCurrency": "<string>",
    "sendDate": "2023-11-07T05:31:56Z",
    "sendBy": "<string>",
    "cancellationReason": "<string>",
    "cancellationDate": "2023-11-07T05:31:56Z",
    "cancellationBy": "<string>",
    "paidMarkedBy": "<string>",
    "paidMarkedDate": "2023-11-07T05:31:56Z",
    "attachedTransactionId": "<string>",
    "payViaStripeAccountConnectionId": "<string>"
  }
}
{
"error": "BadRequestError",
"message": "<string>"
}
{
"error": "UnauthorizedError",
"message": "<string>"
}
{
"error": "ConflictError",
"message": "<string>"
}
{
"error": "TooManyRequestsError",
"message": "<string>"
}
{
"error": "<string>",
"message": "<string>"
}

Authorizations

Authorization
string
header
required

API key for authentication. Get your key from the Dashboard > Settings > API Access.

Path Parameters

id
string
required

The id of the invoice. Expected to be a valid object id like 666666666666666666666666

Pattern: ^[0-9A-Fa-f]{24}$

Body

application/json
strategyData
object
required

Response

Mark an Invoice as Paid executed successfully

message
string

Success message

metaData
object
data
object