This is a staging build of the docs
Skip to main content

Expense transactions

Create expense-transaction datasets to represent your customers spend

An expense transaction represents the context behind the purchase.

It can include details about the purchase from the mapping options, for example:

  • The type of transaction, e.g. a payment or refund

  • Which account in the general ledger the transaction should be reconciled to accountRef

  • The associated tax rates taxRateRef

  • Any applicable tracking categories trackingRefs

When pushing expenses, use your transaction id so that it can serve as an idempotency key. Codat validates id's to ensure that every id is unique to a company. This approach prevents duplicate transactions being created in your SMBs' accounting software.

Expense transaction
{
"items": [
{
"id": "08ca1f02-0374-11ed-b939-0242ac120002",
"type": "Payment",
"issueDate": "2023-12-13T00:00:00+00:00",
"currency": "GBP",
"currencyRate": 1.26,
"contactRef":{
"id":"an-id-to-a-suppliers-record",
"type": "Supplier"
},
"postAsDraft": false,
"merchantName": "Amazon UK",
"lines": [
{
"netAmount": 110.42,
"taxAmount": 14.43,
"taxRateRef": {
"id": "an-id-to-a-taxRates-record"
},
"accountRef": {
"id": "id-of-the-expense-nominal-account"
},
"trackingRefs": [
{
"id": "an-id-to-a-trackingCategories-record",
"dataType": "trackingCategories"
}
],
"invoiceTo": {
"id": "an-id-to-a-customers-record",
"dataType": "customers"
}
}
],
"notes": "Amazon UK | Online Purchase | Order 123XX45"
}
]
}

Draft state transactions

Some accounting platforms allow users to create their transactions in a draft state. This means users can review the transaction in the accounting platform before the expense is finalized and posted prior to reconciliation. Use the postedAsDraft item to choose whether the expense should be created in a draft or final posted state. This functionality is currently only supported by Dynamics 365 Business Central.

Tax rate reference default values

In some cases, you may wish to remove an associated tax rate from an expense. For each accounting platform there is a default value to use so it has no impact on the expense:

  • QBO: NON
  • Xero: NONE
  • Netsuite: -7
  • Dynamics: we recommend to set up a 0% tax rate and apply it against the expense transaction.

Transaction types

The way Codat handles, maps and processes a transaction is based on the specified type of the transaction.

  • Payment

    Is used to represent any spend that takes place on the account and interest on credit purchases.

  • Refund

    Can be used to represent any refunds and returns on an original transaction.

  • Reward

    Can be used to represent reward redemptions such as cashback.

  • Chargeback

    Is similar to a refund in behavior and represents a return of transaction or payment sum which may have been disputed.

  • TransferIn

    A transfer that decreases the balance of the credit card account or increases the balance of a bank account.

    Can be used to represent a top up of debit card account, a pay down of a credit card account or a balance transfer to another credit card.

  • TransferOut

    A transfer that increases the balance of the credit account or decreases the balance of a bank account.

    Can be used to represent cash withdrawals or balance transfer to another credit card.

  • AdjustmentIn

    An adjustment that decreases the balance of the credit account or increases the balance of a bank account.

    Can be used to represent write-offs & transaction adjustments such as foreign exchange adjustments.

  • AdjustmentOut

    An adjustment that increases the balance of the credit account or decreases the balance of a bank account.

    Can be used to represent write-offs & transaction adjustments such as foreign exchange adjustments.


Was this page useful?
❤️
👍
🤔
👎
😭