APIs
Create Recurring Credit ACH Payment
Originates a Recurring Credit ACH payment to a Counterparty. The counterparty should be created separately through the Create Counterparty API. The Recurring Payment Created webhook event will be fired.
| Verb | POST |
| URL | https://api.s.unit.sh/recurring-payments |
| Required Scope | payments-write-counterparty or payments-write or ach-payments-write |
| Data Type | recurringCreditAchPayment |
| Timeout (Seconds) | 5 |
Attributes
Relationships
curl -X POST 'https://api.s.unit.sh/recurring-payments'
-H 'Content-Type: application/vnd.api+json'
-H 'Authorization: Bearer ${TOKEN}'
--data-raw '{
"data": {
"type": "recurringCreditAchPayment",
"attributes": {
"schedule": {
"interval": "Monthly",
"dayOfMonth": 16,
"totalNumberOfPayments": 12
},
"amount": 1000,
"description": "Rent-Apt15"
},
"relationships": {
"account": {
"data": {
"type": "depositAccount",
"id": "10002"
}
},
"counterparty": {
"data": {
"type": "counterparty",
"id": "1"
}
}
}
}
}'
Response
{
"data": {
"type": "recurringCreditAchPayment",
"id": "1",
"attributes": {
"createdAt": "2022-06-25T08:50:49.391Z",
"updatedAt": "2022-06-25T08:50:49.391Z",
"amount": 1000,
"description": "Rent-Apt15",
"schedule": {
"startTime": "2022-06-25",
"interval": "Monthly",
"nextScheduledAction": "2022-07-18",
"dayOfMonth": 16,
"totalNumberOfPayments": 12
},
"status": "Active",
"numberOfPayments": 0
},
"relationships": {
"counterparty": {
"data": {
"type": "counterparty",
"id": "1"
}
},
"account": {
"data": {
"type": "account",
"id": "10002"
}
},
"customer": {
"data": {
"type": "customer",
"id": "10004"
}
},
"org": {
"data": {
"type": "org",
"id": "1"
}
}
}
}
}
Create Recurring Debit ACH Payment
Originates a Recurring Debit ACH payment to a Counterparty. The counterparty should be created separately through the Create Counterparty API. The Recurring Payment Created webhook event will be fired.
| Verb | POST |
| URL | https://api.s.unit.sh/recurring-payments |
| Required Scope | payments-write-counterparty or payments-write or ach-payments-write |
| Data Type | recurringDebitAchPayment |
| Timeout (Seconds) | 5 |
Attributes
false. Verify the counterparty balance, if balance verification fails the payment will be rejected with reason set to CounterpartyInsufficientFunds.Relationships
curl -X POST 'https://api.s.unit.sh/recurring-payments'
-H 'Content-Type: application/vnd.api+json'
-H 'Authorization: Bearer ${TOKEN}'
--data-raw '{
"data": {
"type": "recurringDebitAchPayment",
"attributes": {
"schedule": {
"interval": "Monthly",
"dayOfMonth": 16,
"totalNumberOfPayments": 12
},
"amount": 1000,
"description": "Rent-Apt15",
"verifyCounterpartyBalance": true
},
"relationships": {
"account": {
"data": {
"type": "depositAccount",
"id": "10002"
}
},
"counterparty": {
"data": {
"type": "counterparty",
"id": "1"
}
}
}
}
}'
Response
{
"data": {
"type": "recurringDebitAchPayment",
"id": "1",
"attributes": {
"createdAt": "2022-06-25T08:50:49.391Z",
"updatedAt": "2022-06-25T08:50:49.391Z",
"amount": 1000,
"description": "Rent-Apt15",
"schedule": {
"startTime": "2022-06-25",
"interval": "Monthly",
"nextScheduledAction": "2022-07-18",
"dayOfMonth": 16,
"totalNumberOfPayments": 12
},
"status": "Active",
"numberOfPayments": 0
},
"relationships": {
"counterparty": {
"data": {
"type": "counterparty",
"id": "1"
}
},
"account": {
"data": {
"type": "account",
"id": "10002"
}
},
"customer": {
"data": {
"type": "customer",
"id": "10004"
}
},
"org": {
"data": {
"type": "org",
"id": "1"
}
}
}
}
}
Create Recurring Credit Book Payment
The Recurring Payment Created webhook event will be fired.
| Verb | POST |
| URL | https://api.s.unit.sh/recurring-payments |
| Required Scope | payments-write |
| Data Type | recurringBookPayment |
| Timeout (Seconds) | 5 |
Attributes
Relationships
curl -X POST 'https://api.s.unit.sh/recurring-payments'
-H 'Content-Type: application/vnd.api+json'
-H 'Authorization: Bearer ${TOKEN}'
--data-raw '{
"data": {
"type": "recurringCreditBookPayment",
"attributes": {
"amount": 40,
"description": "Subscription - Basic Plan",
"tags": {
"test": "test"
},
"schedule": {
"interval": "Monthly",
"dayOfMonth": 5
}
},
"relationships": {
"account": {
"data": {
"type": "depositAccount",
"id": "10002"
}
},
"counterpartyAccount": {
"data": {
"type": "depositAccount",
"id": "10000"
}
}
}
}
}'
Response
{
"data": {
"type": "recurringCreditBookPayment",
"id": "4",
"attributes": {
"createdAt": "2022-06-25T14:27:41.093Z",
"updatedAt": "2022-06-25T14:27:41.093Z",
"amount": 40,
"description": "Subscription - Basic Plan",
"schedule": {
"startTime": "2022-06-25",
"interval": "Monthly",
"nextScheduledAction": "2022-07-05",
"dayOfMonth": 5
},
"status": "Active",
"tags": {
"test": "test"
},
"numberOfPayments": 0
},
"relationships": {
"org": {
"data": {
"type": "org",
"id": "1"
}
},
"account": {
"data": {
"type": "account",
"id": "10002"
}
},
"counterpartyAccount": {
"data": {
"type": "account",
"id": "10000"
}
},
"customer": {
"data": {
"type": "customer",
"id": "10004"
}
}
}
}
}
Disable Recurring Payment
Disable a Recurring Payment by id. When a Recurring Payment is disabled, the Recurring Payment Status Changed webhook event is fired and future payments will no longer be created according to the defined schedule.
| Verb | POST |
| URL | https://api.s.unit.sh/recurring-payments/{id}/disable |
| Required Scope | payments |
| Timeout (Seconds) | 5 |
Response
Response is a JSON:API document.
200 OK
curl -X POST 'https://api.s.unit.sh/recurring-payments/12/disable'
-H 'Content-Type: application/vnd.api+json'
-H 'Authorization: Bearer ${TOKEN}'
Response
Response is a JSON:API document.
{
"data": {
"type": "recurringCreditBookPayment",
"id": "4",
"attributes": {
"createdAt": "2022-06-25T14:27:41.093Z",
"updatedAt": "2022-06-25T15:43:07.516Z",
"amount": 40,
"description": "Subscription - Basic Plan",
"schedule": {
"startTime": "2022-06-25",
"interval": "Monthly",
"nextScheduledAction": "2022-07-05",
"dayOfMonth": 5
},
"status": "Disabled",
"tags": {
"test": "test"
},
"numberOfPayments": 0
},
"relationships": {
"org": {
"data": {
"type": "org",
"id": "1"
}
},
"account": {
"data": {
"type": "account",
"id": "10002"
}
},
"counterpartyAccount": {
"data": {
"type": "account",
"id": "10000"
}
},
"customer": {
"data": {
"type": "customer",
"id": "10004"
}
}
}
}
}
Enable Recurring Payment
Enable a recurring payment by id. When a Recurring Payment is enabled, its status is set to Active/Completed according to the start date and end date that were defined in the schedule. See Recurring Payment Statuses. When enabled, the Recurring Payment Status Changed webhook event is fired.
| Verb | POST |
| URL | https://api.s.unit.sh/recurring-payments/{id}/enable |
| Required Scope | payments |
| Timeout (Seconds) | 5 |
Response
Response is a JSON:API document.
200 OK
curl -X POST 'https://api.s.unit.sh/recurring-payments/12/enable'
-H 'Content-Type: application/vnd.api+json'
-H 'Authorization: Bearer ${TOKEN}'
Response
Response is a JSON:API document.
{
"data": {
"type": "recurringCreditAchPayment",
"id": "1",
"attributes": {
"createdAt": "2022-06-25T08:50:49.391Z",
"updatedAt": "2022-06-25T14:28:23.376Z",
"amount": 1000,
"description": "Rent - Apartment 15",
"schedule": {
"startTime": "2022-06-25",
"interval": "Monthly",
"nextScheduledAction": "2022-07-18",
"dayOfMonth": 16
},
"status": "Active",
"numberOfPayments": 1
},
"relationships": {
"counterparty": {
"data": {
"type": "counterparty",
"id": "1"
}
},
"account": {
"data": {
"type": "account",
"id": "10002"
}
},
"customer": {
"data": {
"type": "customer",
"id": "10004"
}
},
"org": {
"data": {
"type": "org",
"id": "1"
}
}
}
}
}
Delete Recurring Payment
Delete a Recurring Payment by id. When a Recurring Payment is deleted, the Recurring Payment Status Changed webhook event is fired and future payments will no longer be created according to the defined schedule.
| Verb | DELETE |
| URL | https://api.s.unit.sh/recurring-payments/{id} |
| Required Scope | payments-write |
| Timeout (Seconds) | 5 |
Response
Response is a JSON:API document.
200 OK
curl -X DELETE 'https://api.s.unit.sh/recurring-payments/12'
-H 'Content-Type: application/vnd.api+json'
-H 'Authorization: Bearer ${TOKEN}'
Response
Response is a JSON:API document.
{
"data": {
"type": "recurringCreditBookPayment",
"id": "4",
"attributes": {
"createdAt": "2022-06-25T14:27:41.093Z",
"updatedAt": "2022-06-25T15:43:07.516Z",
"amount": 40,
"description": "Subscription - Basic Plan",
"schedule": {
"startTime": "2022-06-25",
"interval": "Monthly",
"nextScheduledAction": "2022-07-05",
"dayOfMonth": 5
},
"status": "Deleted",
"tags": {
"test": "test"
},
"numberOfPayments": 0
},
"relationships": {
"org": {
"data": {
"type": "org",
"id": "1"
}
},
"account": {
"data": {
"type": "account",
"id": "10002"
}
},
"counterpartyAccount": {
"data": {
"type": "account",
"id": "10000"
}
},
"customer": {
"data": {
"type": "customer",
"id": "10004"
}
}
}
}
}
Get by Id
Get a recurring payment by id.
| Verb | GET |
| URL | https://api.s.unit.sh/recurring-payments/{id} |
| Required Scope | payments |
| Timeout (Seconds) | 5 |
Response
Response is a JSON:API document.
200 OK
curl -X GET 'https://api.s.unit.sh/recurring-payments/100' \
-H "Authorization: Bearer ${TOKEN}"
List
List recurring payments resources. Filtering, paging and sorting can be applied.
| Verb | GET |
| URL | https://api.s.unit.sh/recurring-payments |
| Required Scope | payments |
| 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[customerId] | string | (empty) | Optional. Filters the results by the specified customer id. |
| filter[status][] | string | (empty) | Optional. Filter recurring payments by status (Active, Completed or Disabled). Usage example: *filter[status][0]=Active |
| filter[type][] | string | (empty) | Optional. Filter recurring payments by Recurring Payment type. such as (RecurringCreditAchPayment, RecurringCreditBookPayment). Usage example: filter[type][0]=RecurringCreditAchPayment&filter[type][1]=RecurringCreditBookPayment |
| filter[fromStartTime] | RFC3339 Date string | (empty) | Optional. Filters the Recurring Payments that their start time occurred after the specified date. e.g. 2022-06-13 |
| filter[toStartTime] | RFC3339 Date string | (empty) | Optional. Filters the Recurring Payments that their start time occurred before the specified date. e.g. 2022-05-13 |
| filter[fromEndTime] | RFC3339 Date string | (empty) | Optional. Filters the Recurring Payments that their end time occurred after the specified date. e.g. 2022-06-13 |
| filter[toEndTime] | RFC3339 Date string | (empty) | Optional. Filters the Recurring Payments that their end time occurred before the specified date. e.g. 2022-05-13 |
| sort | string | sort=-createdAt | Optional. Leave empty or provide sort=createdAt for ascending order. Provide sort=-createdAt (leading minus sign) for descending order. |
curl -X GET 'https://api.s.unit.sh/recurring-payments?page[limit]=20&page[offset]=10&filter[status][]=Enabled' \
-H "Authorization: Bearer ${TOKEN}"
Response
Response is a JSON:API document.
200 OK
{
"data": [
{
"type": "recurringCreditAchPayment",
"id": "1",
"attributes": {
"createdAt": "2022-06-25T08:50:49.391Z",
"updatedAt": "2022-06-25T14:28:23.376Z",
"amount": 200,
"description": "ACH PYMT",
"schedule": {
"startTime": "2022-06-25",
"interval": "Monthly",
"nextScheduledAction": "2022-07-18",
"dayOfMonth": 16
},
"status": "Active",
"numberOfPayments": 1
},
"relationships": {
"counterparty": {
"data": {
"type": "counterparty",
"id": "1"
}
},
"account": {
"data": {
"type": "account",
"id": "10002"
}
},
"customer": {
"data": {
"type": "customer",
"id": "10004"
}
},
"org": {
"data": {
"type": "org",
"id": "1"
}
}
}
},
{
"type": "recurringCreditAchPayment",
"id": "3",
"attributes": {
"createdAt": "2022-06-25T08:53:02.265Z",
"updatedAt": "2022-06-25T08:53:02.265Z",
"amount": 200,
"description": "ACH PYMT",
"schedule": {
"startTime": "2022-06-25",
"interval": "Monthly",
"nextScheduledAction": "2022-07-18",
"dayOfMonth": 16
},
"status": "Active",
"numberOfPayments": 0
},
"relationships": {
"counterparty": {
"data": {
"type": "counterparty",
"id": "1"
}
},
"account": {
"data": {
"type": "account",
"id": "10002"
}
},
"customer": {
"data": {
"type": "customer",
"id": "10004"
}
},
"org": {
"data": {
"type": "org",
"id": "1"
}
}
}
},
{
"type": "recurringCreditBookPayment",
"id": "4",
"attributes": {
"createdAt": "2022-06-25T14:27:41.093Z",
"updatedAt": "2022-06-25T15:44:35.388Z",
"amount": 200,
"description": "Book payment",
"schedule": {
"startTime": "2022-06-25",
"interval": "Monthly",
"nextScheduledAction": "2022-07-05",
"dayOfMonth": 5
},
"status": "Active",
"tags": {
"test": "test"
},
"numberOfPayments": 0
},
"relationships": {
"org": {
"data": {
"type": "org",
"id": "1"
}
},
"account": {
"data": {
"type": "account",
"id": "10002"
}
},
"counterpartyAccount": {
"data": {
"type": "account",
"id": "10000"
}
},
"customer": {
"data": {
"type": "customer",
"id": "10004"
}
}
}
}
],
"meta": {
"pagination": {
"total": 3,
"limit": 100,
"offset": 0
}
}
}