APIs
Get by Id
Get a received payment by id.
| Verb | GET |
| URL | https://api.s.unit.sh/received-payments/{id} |
| Required Scope | received-payments |
| Timeout (Seconds) | 5 |
Query Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| 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 | Received Payment | A ReceivedPayment resource. |
| included | Array of DepositAccount or Customer | Array of resources requested by the include query parameter. |
curl -X GET 'https://api.s.unit.sh/received-payments/100' \
-H "Authorization: Bearer ${TOKEN}"
List
List received payments. Filtering, paging and sorting can be applied.
| Verb | GET |
| URL | https://api.s.unit.sh/received-payments |
| Required Scope | received-payments |
| Timeout (Seconds) | 5 |
Query Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| page[limit] | integer | 100 | Maximum number of resources that will be returned. Maximum is 1000 resources. See Pagination. |
| page[offset] | integer | 0 | Number 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[since] | ISO Local Date string | (empty) | Optional. Filters before the specified date. e.g. 2021-06-01 |
| filter[until] | ISO Local Date string | (empty) | Optional. Filters after the specified date. e.g. 2021-07-01 |
| filter[status][] | ReceivedPayment Status (JSON) | (empty) | Optional. Filter Received Payments by status. Usage example: filter[status][0]=Pending&filter[status][1]=Advanced. Can't be stated with includeCompleted. |
| filter[fromAmount] | Integer | (empty) | Optional. Filters the Received Payment 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 Received Payment that have an amount that is lower or equal to the specified amount (in cents). e.g. 7000 |
| filter[includeCompleted] | boolean | (empty) | Optional. Filter to include ReceivedPayment with Status 'Completed', default False. Can't be stated with filter[status[]. |
| filter[canBeReprocessed] | boolean | (empty) | Optional. If set to true, returns only Received Payments that can be reprocessed. If set to false only returns Received Payments that can't be reprocessed. |
| filter[type] | string | (empty) | Optional. Filter received payments by type. Valid values: Ach, Wire. Defaults to both Ach and Wire if not specified. |
| filter[tags] | Tags (JSON) | (empty) | Optional. Filter received payments by Tags. |
| 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/received-payments?page[limit]=20&page[offset]=10&filter[includeCompleted]=true' \
-H "Authorization: Bearer ${TOKEN}"
Response
Response is a JSON:API document.
200 OK
| Name | Type | Description |
|---|---|---|
| data | Array of Received Payment | Array of received payment resources. |
| included | Array of DepositAccount or Customer or Transaction | Array of resources requested by the include query parameter. |
| meta | JSON object that contains pagination data | Pagination data includes offset, limit and total (estimated total items). |
{
"data": [
{
"type": "achReceivedPayment",
"id": "1337",
"attributes": {
"createdAt": "2022-02-01T12:03:14.406Z",
"status": "Pending",
"wasAdvanced": false,
"isAdvanceable": false,
"direction": "Credit",
"amount": 500000,
"completionDate": "2020-07-30",
"companyName": "UBER LTD",
"counterpartyRoutingNumber": "051402372",
"description": "Paycheck",
"traceNumber": "123456789123456",
"secCode": "PPD"
},
"relationships": {
"account": {
"data": {
"type": "account",
"id": "163575"
}
},
"customer": {
"data": {
"type": "customer",
"id": "129528"
}
}
}
},
{
"type": "achReceivedPayment",
"id": "1339",
"attributes": {
"createdAt": "2022-03-01T12:03:14.406Z",
"status": "Completed",
"wasAdvanced": true,
"amount": 100000,
"completionDate": "2020-07-30",
"companyName": "UBER LTD",
"counterpartyRoutingNumber": "051402372",
"description": "Paycheck",
"traceNumber": "123456789123456",
"secCode": "PPD"
},
"relationships": {
"account": {
"data": {
"type": "account",
"id": "163555"
}
},
"customer": {
"data": {
"type": "customer",
"id": "129522"
}
},
"receivePaymentTransaction": {
"data": {
"type": "transaction",
"id": "101"
}
},
"paymentAdvanceTransaction": {
"data": {
"type": "transaction",
"id": "202"
}
},
"repayPaymentAdvanceTransaction": {
"data": {
"type": "transaction",
"id": "890"
}
}
}
}
],
"meta": {
"pagination": {
"total": 2,
"limit": 100,
"offset": 0
}
}
}
Update
Update a Received Payment.
| Verb | PATCH |
| URL | https://api.s.unit.sh/received-payments/:id |
| Required Scope | received-payments-write |
| Timeout (Seconds) | 5 |
Attributes
| Name | Type | Description |
|---|---|---|
| tags Required | object | See Updating Tags. |
Response
Response is a JSON:API document.
200 OK
| Name | Type | Description |
|---|---|---|
| data | Received Payment | The updated Received Payment resource. |
curl -X PATCH 'https://api.s.unit.sh/received-payments/:id'
-H 'Content-Type: application/vnd.api+json'
-H 'Authorization: Bearer ${TOKEN}'
--data-raw '{
"data": {
"type": "achReceivedPayment",
"attributes": {
"tags": {
"by": "Richard Hendricks",
"id": "23033b64-38f8-4dbc-91a1-313ff0156d02"
}
}
}
}'
Advance Received Payment
Advance a Received Payment to provide early access to funds before the completion date.
In order to use this API, you must implement the Advance Received Payment capability.
Only received payments that are in status Pending can be advanced.
| Verb | POST |
| URL | https://api.s.unit.sh/received-payments/{id}/advance |
| Required Scope | received-payments-write |
| Timeout (Seconds) | 5 |
Response
Response is a JSON:API document.
200 OK
| Name | Type | Description |
|---|---|---|
| data | Received Payment | The advanced received payment. |
curl -X POST 'https://api.s.unit.sh/received-payments/61212/advance' \
-H "Authorization: Bearer ${TOKEN}"
Reprocess Received Payment
Reprocess a Received ACH Debit Payment in case it was MarkedForReturn due to InsufficientFunds.
The reprocess functionality is disabled by default. If you would like to enable it, please contact Unit.
Only received payments that are in status MarkedForReturn can be reprocessed.
| Verb | POST |
| URL | https://api.s.unit.sh/received-payments/{id}/reprocess |
| Required Scope | received-payments-write |
| Timeout (Seconds) | 5 |
Response
Response is a JSON:API document.
200 OK
| Name | Type | Description |
|---|---|---|
| data | Received Payment | The reprocessed received payment. |
curl -X POST 'https://api.s.unit.sh/received-payments/61212/reprocess' \
-H "Authorization: Bearer ${TOKEN}"
Return Received ACH Transaction
Returns a Received ACH transaction with a specified ACH Return Reason.
Returning a Received ACH transaction creates a Returned Received ACH transaction, posting the funds immediately in the opposite direction.
This API is not enabled by default for all customers. Please contact Unit if you need to enable this functionality.
| Verb | POST |
| URL | https://api.s.unit.sh/returns/:transactionId |
| Data Type | returnAch |
| Timeout (Seconds) | 5 |
Attributes
| Name | Type | Description |
|---|---|---|
| reason | string | The ACH Return Reason for returning the transaction. |
Relationships
| Name | Type | Description |
|---|---|---|
| account | JSON:API Relationship | The Deposit Account of the customer. |
Response
Response is a JSON:API document.
200 OK
| Name | Type | Description |
|---|---|---|
| data | ReturnedReceivedAchTransaction | Transaction resource. |
{
"data": {
"type": "returnAch",
"attributes": {
"reason": "AccountFrozen"
},
"relationships": {
"account": {
"data": {
"type": "depositAccount",
"id": "13052"
}
}
}
}
}
Reasons for Returning a Received ACH Transaction
The following reasons can be used to initiate a return of a received ACH transaction:
| Type | Short Description |
|---|---|
AccountFrozen | Account is not authorized to receive the funds |
UncollectedFunds | Although there's currently sufficient balance in the account, the balance that is available for spending is below this dollar value, since some of the funds are committed to payments that have not been settled yet. |