Account transactions

Explore the Account transactions endpoints in Swagger.

Overview

In Codat’s data model, account transactions represent bank activity within an accounting platform. All transactions that go through a bank account are recorded as account transactions.

Account transactions are created as a result of different business activities, for example:

  • Payments: for example, receiving money for payment against an invoice.
  • Bill payments: for example, spending money for a payment against a bill.
  • Direct costs: for example, withdrawing money from a bank account, either for cash purposes or to make a payment.
  • Direct incomes: for example, selling an item directly to a contact and receiving payment at point of sale.
  • Transfers: for example, transferring money between two bank accounts.

Account transactions is the parent data type of payments, bill payments, direct costs, direct incomes, and transfers.

Perform the following tasks using the Account transactions endpoints:

Supported integrations

Account transactions is currently supported for the Xero integration only.

Data model

Field

Type

Description

Id

string

Identifier of the direct cost (unique to the company).

transactionId

string

Identifier of the transaction (unique to the company).

note

string

Additional information about the account transaction, if available.

bankAccountRef

See Reference types

Reference to the bank account the account transaction is recorded against.

currency

string
See Currency

Currency of the account transaction.

currencyRate

decimal
See Currency rate

Conversion rate between the account transaction currency and the base currency used by the company.

lines

array
Account transaction lines (see below)

Array of account transaction lines.

totalAmount

decimal

Total amount of the account transactions, inclusive of tax.

modifiedDate

string
See Date

Date the record was last updated in Codat.

sourceModifiedDate

string
See Date

Date the record was last changed in the accounting platform.

Account transaction lines

Field

Type

Description

lines

description

string

Description of the account transaction.

recordRef

See Reference types

See record reference below.

amount

decimal

Amount in the bill payment currency.

Record reference

Links an account transaction line to the underlying record that created it.

Field

Type

Description

recordRef

id

string

Unique identifier of the underlying record in the Codat system.

dataType

string

Data type of the underlying record in the Codat system.

Example data: Payment on invoice

This example shows a partially paid invoice, a payment against that invoice, and the corresponding account transaction.

Example invoice

{
      "id": "b2cce0d7-08fb-44f6-bd79-a2284caa2757",
      "invoiceNumber": "INV-0046",
      "customerRef": {
        "id": "b9d4332a-26a3-4577-8db2-6e830d4b07cd",
        "companyName": "Berry Brew"
      },
      "issueDate": "2021-03-08T00:00:00Z",
      "dueDate": "2021-03-08T00:00:00Z",
      "modifiedDate": "2021-03-08T07:43:24Z",
      "sourceModifiedDate": "2021-03-08T07:41:56Z",
      "paidOnDate": "2021-03-08T00:00:00Z",
      "currency": "GBP",
      "currencyRate": 1,
      "lineItems": [
        {
          "description": "Golf balls - white single. Please reorder with code GB1-White",
          "unitAmount": 6.666,
          "quantity": 5,
          "subTotal": 33.33,
          "taxAmount": 6.67,
          "totalAmount": 40,
          "accountRef": {
            "id": "c563b607-fb0e-4d06-9ddb-76fdeef20ae3",
            "name": "Sales"
          },
          "taxRateRef": {
            "id": "OUTPUT2",
            "name": "20% (VAT on Income)",
            "effectiveTaxRate": 20
          },
          "itemRef": {
            "id": "d5b140ac-19bd-41ce-a1f0-dbb637766725",
            "name": "Golf balls - white single"
          },
          "trackingCategoryRefs": []
        }
      ],
      "paymentAllocations": [
        {
          "id": "749dd89a-e4bd-4aad-a9ca-178d73f0d606",
          "totalAmount": -30,
          "currency": "GBP",
          "currencyRate": 1,
          "date": "2021-03-08T00:00:00Z",
          "note": "Payment 1 -0803"
        }
      ],
      "totalDiscount": 0,
      "subTotal": 33.33,
      "totalTaxAmount": 6.67,
      "totalAmount": 40,
      "amountDue": 10,
      "status": "PartiallyPaid"
    }

Example payment

{
      "id": "749dd89a-e4bd-4aad-a9ca-178d73f0d606",
      "customerRef": {
        "id": "b9d4332a-26a3-4577-8db2-6e830d4b07cd",
        "companyName": "Berry Brew"
      },
      "totalAmount": 30,
      "currency": "GBP",
      "currencyRate": 1,
      "date": "2021-03-08T00:00:00Z",
      "note": "Payment 1 -0803",
      "lines": [
        {
          "amount": 30,
          "links": [
            {
              "type": "Invoice",
              "id": "b2cce0d7-08fb-44f6-bd79-a2284caa2757",
              "amount": -30,
              "currencyRate": 1
            }
          ]
        }
      ],
      "modifiedDate": "2021-03-08T07:43:10Z",
      "sourceModifiedDate": "2021-03-08T07:41:56Z"
    }

Example account transaction

{
    "AccountTransactions": [{
        "bankAccountRef": {
          "id": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4",
          "name": "Business Bank Account"
        },
        "transactionId": "749dd89a-e4bd-4aad-a9ca-178d73f0d606",
        "createdDate": "2021-03-08T00:00:00Z",
        "status": "Authorised",
        "lines": [
            {
            "description": "",
            "unitAmount": "",
            "quantity": "",
            "subtotal": "",
            "taxAmount": "",
            "totalAmount": "30.00",
            "type": "payment",
            "accountRef": {
                "id": "e0faa299-ca0d-4b0a-9e32-0dfabdf9179a",
                "name": "Accounts Payable"
            },
            "recordRef": {
                "id": "749dd89a-e4bd-4aad-a9ca-178d73f0d606",
                "datatype": "Payment"
            },
            "itemRef": {
                "id": "",
                "name": ""
            },
          "trackingCategoryRefs": []
        }
        ],
        "currency": "GBP",
        "currencyRate": 1,
        "subTotal": "30.00",
        "totalTaxAmount": "0.00",
        "totalAmount": "30.00",
        "note": "Payment 1 -0803",
        "modifiedDate": "2021-03-08T07:43:10Z",
        "sourceModifiedDate": "2021-03-08T07:41:56Z"
    }]
}

Did this page help you?