Skip to main content

Transactions

A transaction is an individual entry that represents any financial movement within an account. The Transaction resource represents confirmed transactions that were posted to the account, including their source, amount, and direction.

Transactions cannot be created using Unit's API, as they reflect the actual movement of funds, and are created by Unit at that time. For instance, if you originate an ACH Credit payment, the transaction will be created once the payment is processed and the funds have been withdrawn from the account.

Transactions are final, and cannot be deleted or changed. In order to reverse a transaction (for example, a refund after a card Purchase transaction), a new, opposite, transaction will have to be created (in our example, a Card Reversal transaction).

Unit currently supports the following types of transactions:

TypeDescription
Originated ACHAn ACH payment originated from a deposit account.
Received ACHAn ACH payment received by a deposit account.
Returned ACHAn ACH payment returned by the bank.
Dishonored Return ACHA returned ACH that was dishonored by the receiving bank.
WireA wire transaction, either received or sent.
BookA payment between two accounts on the same bank.
PurchaseA purchase via debit card.
ATMA deposit or a withdrawal of funds from an ATM with a debit card.
FeeFees incurred for a transaction.
InterestAn Interest payment to a deposit account.
Card ReversalA reversal of a previous card transaction.
Card TransactionA transaction that represents various card transactions that are not Purchase or ATM transactions. Those might be split in the future into different types.
ReleaseA transaction releasing funds from a batch account.
AdjustmentManual Adjustment is made in situations where the correction of an amount, or a reverse of a completed transaction is needed.
DisputeDispute transaction is created in order to credit or debit a customer for an ongoing card or ACH dispute. For example, when provisional credit is provided, the customer account would be credited using the Dispute Transaction.
Check DepositA received check deposit.
Returned Check DepositA check deposit returned by the bank.

In addition to their own specific fields, all transaction types are guaranteed to contain the following top-level fields:

FieldtypeDescription
directionstringThe direction in which the funds flow- Debit or Credit.
amountintegerThe amount (cents) of the transaction.
balanceintegerThe account balance (cents) after the transaction.
summarystringHuman-friendly summary of the transaction.
createdAtRFC3339 Date stringThe date the transaction was created
note

New transaction types may be added in the future, as we introduce new financial products. To minimize code changes on your side, we recommend using the summary field when displaying transactions to end-customers.

Get by Id#

Get a transaction by transaction id and account id.

VerbGET
Urlhttps://api.s.unit.sh/accounts/:accountId/transactions/{transactionId}
Required Scopetransactions

Query Parameters#

NameTypeDefaultDescription
filter[customerId]string(none)Optional. Filters the result by the specified customer id.
includestring(empty)Optional. A comma-separated list of related resources to include in the response. Related resources include: customer, account. See Getting Related Resources

Response#

Response is a JSON:API document.

200 OK#

FieldTypeDescription
dataOne of OriginatedAchTransaction
ReceivedAchTransaction
BookTransaction
PurchaseTransaction
AtmTransaction
FeeTransaction
CardTransaction
CardReversalTransaction
Transaction resources.
includedArray of DepositAccount or CustomerArray of resources requested by the include query parameter.
curl -X GET 'https://api.s.unit.sh/accounts/:accountId/transactions/:transactionId' \-H "Authorization: Bearer ${TOKEN}"

List#

List transaction resources. Filtering, paging and sorting can be applied.

VerbGET
Urlhttps://api.s.unit.sh/transactions
Required Scopetransactions

Query Parameters#

NameTypeDefaultDescription
page[limit]integer100Maximum number of resources that will be returned. Maximum is 1000 resources. See Pagination.
page[offset]integer0Number of resources to skip. See Pagination.
filter[accountId]string(empty)Optional. Filters the results by the specified account id.
filter[customerId]string(empty)Optional. Filters the results by the specified customer id.
filter[query]string(empty)Optional. search term according to the Full-Text Search Rules.
filter[tags]Tags (JSON)(empty)Optional. Filter Transactions by Tags.
filter[since]RFC3339 Date string(empty)Optional. Filters the Transactions that occurred after the specified date. e.g. 2020-01-13T16:01:19.346Z
filter[until]RFC3339 Date string(empty)Optional. Filters the Transactions that occurred before the specified date. e.g. 2020-01-02T20:06:23.486Z
filter[cardId]string(empty)Optional. Filters the results by the specified card id.
sortstringsort=-createdAtOptional. Leave empty or provide sort=createdAt for ascending order. Provide sort=-createdAt (leading minus sign) for descending order.
includestring(empty)Optional. A comma-separated list of related resources to include in the response. Related resources include: customer, account. See Getting Related Resources
curl -X GET 'https://api.s.unit.sh/transactions?page[limit]=20&page[offset]=10' \-H "Authorization: Bearer ${TOKEN}"

Response#

Response is a JSON:API document.

200 OK#

FieldTypeDescription
dataArray of TransactionsArray of transaction resources.
includedArray of DepositAccount or CustomerArray of resources requested by the include query parameter.
Example Response:
{  "data": [    {      "type": "originatedAchTransaction",      "id": "337",      "attributes": {        "createdAt": "2020-09-06T07:51:02.570Z",        "direction": "Credit",        "amount": 10000,        "balance": 10000,        "summary": "Counterparty: Unit Inc | Description: Funding",        "description": "Funding",        "counterparty": {          "name": "Unit Inc",          "routingNumber": "812345678",          "accountNumber": "1",          "accountType": "Checking"        }      },      "relationships": {        "account": {          "data": {            "type": "account",            "id": "10001"          }        },        "customer": {          "data": {            "type": "customer",            "id": "3"          }        }      }    },    {      "type": "feeTransaction",      "id": "338",      "attributes": {        "createdAt": "2020-09-06T07:51:03.094Z",        "direction": "Debit",        "amount": 10,        "balance": 9990,        "summary": "Fee - Funding"      },      "relationships": {        "account": {          "data": {            "type": "account",            "id": "10001"          }        },        "customer": {          "data": {            "type": "customer",            "id": "3"          }        },        "relatedTransaction": {          "data": {            "type": "transaction",            "id": "337"          }        }      }    }  ]}

Update#

Update Transaction

VerbPATCH
Urlhttps://api.s.unit.sh/accounts/:accountId/transactions/:transactionId
Required Scopetransactions-write

Attributes#

NameTypeDescription
tagsobjectSee Updating Tags.

Response#

Response is a JSON:API document.

200 OK#

FieldTypeDescription
dataA TransactionA Transaction resource.
Example Request:
{  "data": {    "type": "transaction",    "attributes": {      "tags": {        "trackUserId": 1234      }    }  }}