Skip to main content
POST
/
v1
/
transactions
Create a Transaction
curl --request POST \
  --url https://api.bookeeping.ai/public-api/v1/transactions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "totalAmount": 123,
  "transactionDate": "2023-11-07T05:31:56Z",
  "paymentMethod": {},
  "isReconciled": true,
  "entries": [
    {
      "id": "<string>",
      "amount": 123,
      "type": "DEBIT",
      "category": "<string>",
      "parentCategory": "INCOME",
      "isMain": true,
      "note": "<string>"
    }
  ],
  "refNo": "<string>",
  "currency": "<string>",
  "counterParty": "<string>",
  "account": "<string>"
}
'
{
  "message": "<string>",
  "metaData": {
    "warnings": [
      "<string>"
    ]
  },
  "data": {
    "transaction": {
      "_id": "<string>",
      "projectId": "<string>",
      "currency": "<string>",
      "totalAmount": 123,
      "transactionDate": "2023-11-07T05:31:56Z",
      "paymentMethod": {},
      "source": {},
      "isReconciled": true,
      "nonProfitAllocations": [
        {
          "percentage": 123,
          "program": {
            "_id": "<string>",
            "name": "<string>",
            "status": "PLANNING",
            "createdAt": "2023-11-07T05:31:56Z",
            "updatedAt": "2023-11-07T05:31:56Z",
            "hexColor": "<string>"
          },
          "grant": {
            "_id": "<string>",
            "name": "<string>",
            "status": "ACTIVE",
            "createdAt": "2023-11-07T05:31:56Z",
            "updatedAt": "2023-11-07T05:31:56Z",
            "hexColor": "<string>",
            "funder": {
              "_id": "<string>",
              "accountName": "<string>",
              "accountNumber": "<string>",
              "email": "jsmith@example.com",
              "phone": "<string>",
              "type": "customer"
            }
          },
          "note": "<string>"
        }
      ],
      "entries": [
        {
          "id": "<string>",
          "amount": 123,
          "type": "DEBIT",
          "parentCategory": "INCOME",
          "category": {
            "_id": "<string>",
            "name": "<string>",
            "emoji": "<string>",
            "parentCategory": "INCOME",
            "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>",
        "type": "customer"
      },
      "account": {
        "_id": "<string>",
        "accountType": "Depository",
        "accountName": "<string>",
        "accountNumber": "<string>"
      },
      "nonProfitGrantId": "<string>",
      "attachedTransactionId": "<string>"
    },
    "action": "CREATED"
  }
}

Authorizations

Authorization
string
header
required

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

Query Parameters

force
string
required

Force create the transaction if it already exists

Body

application/json
totalAmount
number
required

The total amount of the transaction. Same as the sum of the Total Credit = Total Debit.

transactionDate
string<date-time>
required

The transaction date of the transaction

paymentMethod
object
required

The payment method of the transaction

isReconciled
boolean
required

The reconciliation status of the transaction

entries
object[]
required

The entries of the transaction

refNo
string | null
currency
string | null
counterParty
string | null

The counter party id of the transaction. Expected to be a valid object id like 666666666666666666666666

account
string | null

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

Response

Create a Transaction executed successfully

message
string

Success message

metaData
object
data
object

The response of the transaction creation. CREATED if transaction created successfully, ALREADY_EXISTS if similar transaction already exists, send query params force=true to override