Transactions APIs
Get by Id
Get a transaction by transaction id and account id.
| Verb | GET |
| URL | https://api.s.unit.sh/accounts/:accountId/transactions/{transactionId} |
| Required Scope | transactions |
| Timeout (Seconds) | 5 |
Query Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| filter[customerId] | string | (none) | Optional. Filters the result by the specified customer id. |
| include | string | (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
| Name | Type | Description |
|---|---|---|
| data | A Transaction | A Transaction resource. |
| included | Array of DepositAccount or CreditAccount or Customer | Array 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 and sorting can be applied. Paging is available only when filtering by customer id or account id.
| Verb | GET |
| URL | https://api.s.unit.sh/transactions |
| Required Scope | transactions |
| Timeout (Seconds) | 5 |
Query Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| page[limit] | integer | 100 | Optional. Maximum number of resources that will be returned. Maximum is 1000 resources. See Pagination. |
| page[offset] | integer | 0 | Optional. Number of resources to skip. See Pagination. |
| filter[accountId] | string | (empty) | Optional. Filters the results by the specified account id. |
| filter[accountIds][] | string | (empty) | Optional. Filters the results by the specified account ids. Usage example: filter[accountIds][0]=10000&filter[accountIds][1]=10001 |
| 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. |
| filter[type][] | string | (empty) | Optional. Filter Transactions by Transaction type. Possible values include: OriginatedAch, ReceivedAch, ReturnedAch, DishonoredAch, Book, Purchase, Atm, Fee, Reversal, CardTransaction, BatchRelease, Wire, ReturnedWire, Dispute, Adjustment, Interest, Reward, CheckDeposit, ReturnedCheckDeposit, PaymentCanceled, CustomerRepayment. Usage example: filter[type][0]=OriginatedAch&filter[type][1]=ReceivedAch |
| filter[fromAmount] | Integer | (empty) | Optional. Filters the Transactions that have an amount that is higher or equal to the specified amount (in cents). e.g. 5000 |
| filter[toAmount] | Integer | (empty) | Optional. Filters the Transactions that have an amount that is lower or equal to the specified amount (in cents). e.g. 7000 |
| filter[direction][] | string | (empty) | Optional. Filter Transactions by direction (Debit, Credit). Usage example: filter[direction][0]=Debit |
| filter[excludeFees] | boolean | (empty) | Optional. Filter Fee type Transactions. |
| filter[accountType] | string | (empty) | Optional. Filter Transactions by account type (deposit, credit). |
| sort | string | sort=createdAt | Optional. Leave empty or provide sort=createdAt for ascending order. Provide sort=-createdAt (leading minus sign) for descending order. |
| include | string | (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
| Name | Type | Description |
|---|---|---|
| data | Array of Transactions | Array of transaction resources. |
| included | Array of DepositAccount or CreditAccount or Customer | Array of resources requested by the include query parameter. |
| meta Optional | JSON object that contains pagination data | Optional. Will be defined only when filtered by customer or account id. Pagination data includes offset, limit and total (estimated total items). |
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"
}
}
}
}
],
"meta": {
"pagination": {
"total": 2,
"limit": 100,
"offset": 0
}
}
}
Update Tags
Update Tags Transaction
| Verb | PATCH |
| URL | https://api.s.unit.sh/accounts/:accountId/transactions/:transactionId |
| Required Scope | transactions-write |
| Timeout (Seconds) | 5 |
Attributes
| Name | Type | Description |
|---|---|---|
| tags Optional | object | Optional. See Updating Tags. |
Response
Response is a JSON:API document.
200 OK
| Name | Type | Description |
|---|---|---|
| data | A Transaction | A Transaction resource. |
Example Request:
{
"data": {
"type": "transaction",
"attributes": {
"tags": {
"trackUserId": "1234"
}
}
}
}
Update Book Transaction
Update Book Transaction
| Verb | PATCH |
| URL | https://api.s.unit.sh/transactions/:transactionId |
| Required Scope | transactions-write |
| Timeout (Seconds) | 5 |
Attributes
| Name | Type | Description |
|---|---|---|
| summary Optional | string | Optional. Summary of the transaction. |
| tags Optional | object | Optional. See Updating Tags. |
Relationships
| Name | Type | Description |
|---|---|---|
| account | JSON:API Relationship | The originating or the receiving account. |
Response
Response is a JSON:API document.
200 OK
| Name | Type | Description |
|---|---|---|
| data | A Transaction | A Transaction resource. |
Example Request:
{
"data": {
"type": "bookTransaction",
"attributes": {
"summary": "Counterparty: Unit Inc | Description: Funding",
"tags": {
"trackUserId": "1234"
}
},
"relationships": {
"account": {
"data": {
"type": "account",
"id": "555"
}
}
}
}
}
Update Chargeback Transaction
Update Chargeback Transaction
| Verb | PATCH |
| URL | https://api.s.unit.sh/transactions/:transactionId |
| Required Scope | transactions-write |
| Timeout (Seconds) | 5 |
Attributes
| Name | Type | Description |
|---|---|---|
| summary Optional | string | Optional. Summary of the transaction. |
| tags Optional | object | Optional. See Updating Tags. |
Relationships
| Name | Type | Description |
|---|---|---|
| account | JSON:API Relationship | The originating or the receiving account. |
Response
Response is a JSON:API document.
200 OK
| Name | Type | Description |
|---|---|---|
| data | A Transaction | A Transaction resource. |
Example Request:
{
"data": {
"type": "chargebackTransaction",
"attributes": {
"summary": "Description: Funding",
"tags": {
"trackUserId": "1234"
}
},
"relationships": {
"account": {
"data": {
"type": "account",
"id": "555"
}
}
}
}
}