|
| 1 | +--- |
| 2 | +title: "Write bank transactions to FreeAgent" |
| 3 | +sidebar_label: Write bank transactions |
| 4 | +description: "Learn how to write your SMB users' bank transactions via our FreeAgent Bank Feeds integration" |
| 5 | +--- |
| 6 | + |
| 7 | +When an SMB user has set up a bank feed connection, you can write bank transactions for source bank accounts to FreeAgent. Write them using the [Create bank transactions](/bank-feeds-api#/operations/create-bank-transactions) endpoint, as described in [Write transactions](/bank-feeds/pushing-transactions). |
| 8 | + |
| 9 | +This article explains how FreeAgent decides whether a transaction is money in or money out, because it differs from other bank feeds integrations. |
| 10 | + |
| 11 | +## Prerequisites |
| 12 | + |
| 13 | +- Your SMB user has an authorized FreeAgent connection and has [established a bank feed](/bank-feeds/mapping/overview). |
| 14 | + |
| 15 | +## Transaction direction comes from the type |
| 16 | + |
| 17 | +In Codat's bank transactions schema, the sign of the `amount` determines the direction of a transaction: positive is money in, negative is money out. The `transactionType` describes the kind of transaction. |
| 18 | + |
| 19 | +FreeAgent takes the direction from the `transactionType` instead, and overrides the sign of the `amount` for most types. |
| 20 | + |
| 21 | +| FreeAgent behavior | Transaction types | |
| 22 | +| ------------------ | ---------------------------------------------------------------------------------------- | |
| 23 | +| Always money out | `Debit`, `Fee`, `SerChg`, `Xfer`, `Check`, `Payment`, `Cash`, `DirectDebit`, `RepeatPmt` | |
| 24 | +| Always money in | `Credit`, `Div`, `Dep`, `DirectDep` | |
| 25 | +| Uses the sign | `INT`, `ATM`, `POS`, `OTHER` | |
| 26 | + |
| 27 | +So a transaction sent as `amount: 1.60` with `transactionType: Xfer` is recorded in FreeAgent as £1.60 out, while the same transaction is recorded as £1.60 in by integrations that use the sign, such as Xero and QuickBooks Online. |
| 28 | + |
| 29 | +## Codat converts a positive transfer |
| 30 | + |
| 31 | +To keep the direction consistent with the `amount` you send, Codat writes a positive `Xfer` transaction to FreeAgent as `OTHER`. FreeAgent uses the sign for `OTHER` in both directions, so the transaction is recorded as money in, matching the sign of the `amount`. |
| 32 | + |
| 33 | +All other transactions are written to FreeAgent with the `transactionType` you supplied, unchanged. A negative `Xfer` is not converted, because the type and the sign already agree. |
| 34 | + |
| 35 | +:::caution Other conflicting types are not converted |
| 36 | + |
| 37 | +Codat only converts `Xfer`. If you send a positive amount with any other type from the "Always money out" row above, FreeAgent records it as money out. Send those transactions with a type that matches the direction you want, or use `OTHER`. |
| 38 | + |
| 39 | +::: |
| 40 | + |
| 41 | +## The type appears in the description |
| 42 | + |
| 43 | +FreeAgent includes the transaction type in the description that the SMB user sees against the bank transaction. A transaction sent as `Xfer` reads as `//XFER/`, followed by the amount: |
| 44 | + |
| 45 | +```text |
| 46 | +your-transaction-description//XFER/£1.60 |
| 47 | +``` |
| 48 | + |
| 49 | +Because a positive `Xfer` is written as `OTHER`, the SMB user sees `//OTHER/` instead: |
| 50 | + |
| 51 | +```text |
| 52 | +your-transaction-description//OTHER/£1.60 |
| 53 | +``` |
0 commit comments