Skip to main content

Repayments

Repayments are payments made towards a Credit Account to reduce outstanding balance (debt) and increase available credit limit. Repayments can represent actual money movement within the Unit platform, or simple ledger updates for funds collected externally.

Repayment Types

Unit supports two primary types of repayments, determined by where the money movement occurs:

Repayment TypeMoney MovementUnit Action
NativeOccurs on the Unit platform (same or different bank partners).Executes money movement (Book or ACH Payment) and updates the credit ledger.
ExternalOccurs outside of the Unit platform.Only records the repayment amount on the credit ledger. No real money movement is initiated by Unit.

Usage

Native repayments are applicable for:

In majority of cases, this type of repayments are used.

External repayments can be used only for:

Used in specific configurations of the loan product. Please contact Unit's support team in case of doubts.

Native Repayments

Native repayments are used when the funds are sourced from a deposit account that is accessible or present on the Unit platform. These repayments initiate an actual payment transaction.

Client Capital Used

This flow is used when you are providing the capital for the underlying lending program.

An end-customer can make a repayment using:

  • Book Repayment: Repayments from a deposit account held at the same bank partner on the Unit platform are made using a Book Repayment (an internal transfer).
  • ACH Repayment: Repayments from deposit accounts held at other banks that are integrated with Unit are made using an ACH Repayment.

Once you successfully create a repayment, a repayment.created event will be raised. If the repayment is successfully created, an underlying payment will be created, and a subsequent payment.created event will be raised.

Required Accounts for Repayment Creation

When creating such repayment, you are required to specify three accounts:

ParameterRoleDescription
accountReceiving AccountThe Deposit Account that the repayment funds will be deposited in. This is typically your client's settlement or operating account.
creditAccountDebt AccountThe Credit Account that the repayment is made against (e.g., the credit account that represents the customer's charge card debt).
counterpartySource AccountThe Deposit Account that the repayment funds will be taken from (the end-customer's account).

Unit Capital Used (Capital Partner Repayments)

When using Unit Capital as part of your lending program, end-customer repayments should be directed to the specific Capital Partner's account.

These repayments can be made using Capital Partner ACH Repayment or Capital Partner Book Repayment. You do not need to provide the details of the receiving account when creating these repayments, as the Capital Partner's account will be pre-configured during program setup.

External Repayments

External repayments are used when you collect a repayment from the end-customer and facilitate money movement outside of the Unit platform.

The primary purpose of an external repayment is to inform Unit:

  1. To update the credit ledger.
  2. To reduce the balance on the customer's credit account.
  3. To increase the customer's available credit limit.

Since the actual money movement occurs off-platform, Unit only updates the credit ledger. Once the external repayment is created, a repayment.created event will be raised.

Repayment Returns

There are situations when a repayment can be returned (e.g., due to insufficient funds, fraud detection, or bank error).

When a return occurs, it impacts the credit account balance, and Unit performs necessary adjustments to the credit account and ledger records (e.g., increases the balance and decreases the available credit).

Repayment TypeReturn ProcessingRequired Client Action
Native RepaymentsAutomatic. Unit detects the return (via ACH network, etc.) and processes all credit account adjustments automatically.None is required from the client.
External RepaymentsManual. Since Unit was not involved in the original money movement, the return is not automatically detected.Client needs to inform Unit using the Return External Repayment API to update the credit ledger and reverse the original external repayment entry.

Repayment Statuses

Repayments share the status of the underlying payments (e.g., Book or ACH Debit). When the Repayment status changes, a repayment.statusChanged event will be raised.

Book Repayment Statuses

StatusDescription
SentThe repayment has been completed and the funds have been debited from the counterparty, deposited into the account, and the creditAccount balance has been updated .
RejectedThe repayment has been rejected, either because the amount exceeds the balance of the creditAccount, or because the book payment has been rejected.

ACH Repayment Statuses

StatusDescriptionPossible Next states
PendingThe repayment and associated payment have been created, but have not yet been transmitted to the ACH network.The status will change to clearing once the payment is transmitted to the ACH network, or to canceled (if the payment is canceled).
PendingReviewThe ACH debit payment has been sent to manual review in cases of elevated fraud riskrejected (if rejected by the reviewer) pending (if approved by the reviewer) or canceled (if the payment is canceled).
ClearingThe funds have been debited from the counterparty and are now in clearing to mitigate the risk of ACH debit fraudsent (once the clearing period is over) or returned if the payment was returned before the clearing period ends.
SentThe funds have been cleared and released to the account. The creditAccount balance has been updatedThis is a final state, unless the payment is returned.
ReturnedThe bank that the funds were pulled from has returned the ACH payment. The funds have been returned from the account to the counterparty and the creditAccount balance has been updated.
RejectedThe repayment has been rejected, either because the amount exceeds the balance of the creditAccount, or because the ACH has been rejected
CanceledThe ACH payment has been canceled

External Repayment Statuses

StatusDescription
SentThe external repayment has been applied to the credit account. The creditAccount balance has been decreased and available credit limit increased.
ReturnedThe external repayment has been returned. The creditAccount balance has been increased and available credit limit decreased.

Create Book Repayment

Creates a repayment for a credit account.

Book Repayment creation requests support Idempotency, ensuring that performing multiple identical requests will have the same result as a single request.

VerbPOST
URLhttps://api.s.unit.sh/repayments
Required Scoperepayments-write or payments-write
Data Typerepayment
Timeout (Seconds)5

Attributes

NameTypeDescription
descriptionstringRepayment description (maximum of 80 characters), this will show up on statement of the counterparty.
amountIntegerThe amount (cents) to repay.
transactionSummaryOverridestringIf this field is populated, its contents will be returned as the bookTransaction’s summary field (maximum of 100 characters).
tagsobjectOptional. See Tags.
idempotencyKeystringOptional. See Idempotency.

Relationships

NameTypeDescription
accountJSON:API RelationshipThe Deposit Account the repayment will be deposited into.
creditAccountJSON:API RelationshipThe Credit Account that the repayment is made against.
counterpartyAccountJSON:API RelationshipThe Deposit Account the repayment funds are taken from.
Example Request:
curl -X POST 'https://api.s.unit.sh/repayments'
-H 'Content-Type: application/vnd.api+json'
-H 'Authorization: Bearer ${TOKEN}'
--data-raw '{
"data": {
"type": "bookRepayment",
"attributes": {
"amount": 20,
"description": "test",
"transactionSummaryOverride": "override",
"idempotencyKey": "3a1a33be-4e12-4603-9ed0-820922389fb8"
},
"relationships": {
"account": {
"data": {
"type": "depositAccount",
"id": "10006"
}
},
"creditAccount": {
"data": {
"type": "creditAccount",
"id": "10007"
}
},
"counterpartyAccount": {
"data": {
"type": "account",
"id": "10008"
}
}
}
}
}'

Response

Response is a JSON:API document.

201 Created

FieldTypeDescription
dataBookRepaymentThe requested resource after the operation was completed.
Example Response:
{
"data": {
"type": "bookRepayment",
"id": "4",
"attributes": {
"createdAt": "2022-09-19T09:10:09.206Z",
"updatedAt": "2022-09-19T09:10:09.206Z",
"amount": 20,
"status": "Sent"
},
"relationships": {
"counterparty": {
"data": {
"type": "account",
"id": "10008"
}
},
"account": {
"data": {
"type": "account",
"id": "10006"
}
},
"creditAccount": {
"data": {
"type": "creditAccount",
"id": "10007"
}
},
"customer": {
"data": {
"type": "customer",
"id": "10002"
}
},
"org": {
"data": {
"type": "org",
"id": "2"
}
},
"payment": {
"data": {
"type": "payment",
"id": "5"
}
}
}
}
}

Create ACH Repayment

Creates a repayment for a credit account. Both repayment.created and payment.created events are raised when the call is successful.

ACH Repayment creation requests support Idempotency, ensuring that performing multiple identical requests will have the same effect as performing a single request.

VerbPOST
URLhttps://api.s.unit.sh/repayments
Required Scoperepayments-write or payments-write
Data Typerepayment
Timeout (Seconds)5

Attributes

NameTypeDescription
descriptionstringPayment description (maximum of 10 characters), also known as Company Entry Description, this will show up on statement of the counterparty.
amountInteger (Cents)The amount to repay.
addendastringOptional, additional payment description (maximum of 80 characters), not all institutions present that.
tagsobjectOptional. See Tags.
sameDaybooleanOptional, default is false. See Same Day ACH.
secCodestringOptional. See Use a custom SEC Code.
clearingDaysOverridenumberOptional. See Dynamic Clearing Period.
idempotencyKeystringOptional. See Idempotency.

Relationships

NameTypeDescription
accountJSON:API RelationshipThe Deposit Account the repayment will be deposited into.
creditAccountJSON:API RelationshipThe Credit Account that the repayment is made against.
counterpartyJSON:API RelationshipThe ACH Counterparty the repayment will come from.
Example Request:
curl -X POST 'https://api.s.unit.sh/repayments'
-H 'Content-Type: application/vnd.api+json'
-H 'Authorization: Bearer ${TOKEN}'
--data-raw '{
"data": {
"type": "achRepayment",
"attributes": {
"amount": 200,
"description": "test"
},
"relationships": {
"account": {
"data": {
"type": "depositAccount",
"id": "10076"
}
},
"creditAccount": {
"data": {
"type": "creditAccount",
"id": "10082"
}
},
"counterparty": {
"data": {
"type": "counterparty",
"id": "3"
}
}
}
}
}'

Response

Response is a JSON:API document.

201 Created

FieldTypeDescription
dataAchRepaymentThe requested resource after the operation was completed.
Example Response:
{
"data": {
"type": "achRepayment",
"id": "1",
"attributes": {
"createdAt": "2022-09-19T09:02:13.343Z",
"updatedAt": "2022-09-19T09:02:13.343Z",
"amount": 200,
"status": "Pending"
},
"relationships": {
"org": {
"data": {
"type": "org",
"id": "1"
}
},
"account": {
"data": {
"type": "account",
"id": "10003"
}
},
"counterparty": {
"data": {
"type": "counterparty",
"id": "1"
}
},
"creditAccount": {
"data": {
"type": "creditAccount",
"id": "10007"
}
},
"customer": {
"data": {
"type": "customer",
"id": "10002"
}
},
"payment": {
"data": {
"type": "payment",
"id": "1"
}
},
"recurringRepayment": {
"data": {
"type": "recurringRepayment",
"id": "4"
}
}
}
}
}

Create Capital Partner ACH Repayment

Creates a repayment for a credit account. Both repayment.created and payment.created events are raised when the call is successful.

Capital Partner Repayment creation requests support Idempotency, ensuring that performing multiple identical requests will have the same effect as performing a single request.

VerbPOST
URLhttps://api.s.unit.sh/repayments
Required Scoperepayments-write or payments-write
Data Typerepayment
Timeout (Seconds)5

Attributes

NameTypeDescription
descriptionstringPayment description (maximum of 10 characters), also known as Company Entry Description, this will show up on statement of the counterparty.
amountInteger (Cents)The amount to repay.
addendastringOptional, additional payment description (maximum of 80 characters), not all institutions present that.
tagsobjectOptional. See Tags.
sameDaybooleanOptional, default is false. See Same Day ACH.
secCodestringOptional. See Use a custom SEC Code.
idempotencyKeystringOptional. See Idempotency.

Relationships

NameTypeDescription
creditAccountJSON:API RelationshipThe Credit Account that the repayment is made against.
counterpartyJSON:API RelationshipThe ACH Counterparty the repayment will come from.
Example Request:
curl -X POST 'https://api.s.unit.sh/repayments'
-H 'Content-Type: application/vnd.api+json'
-H 'Authorization: Bearer ${TOKEN}'
--data-raw '{
"data": {
"type": "capitalPartnerAchRepayment",
"attributes": {
"amount": 200,
"description": "test"
},
"relationships": {
"creditAccount": {
"data": {
"type": "creditAccount",
"id": "10082"
}
},
"counterparty": {
"data": {
"type": "counterparty",
"id": "3"
}
}
}
}
}'

Response

Response is a JSON:API document.

201 Created

FieldTypeDescription
dataCapitalPartnerAchRepaymentThe requested resource after the operation was completed.
Example Response:
{
"data": {
"type": "capitalPartnerAchRepayment",
"id": "1",
"attributes": {
"createdAt": "2022-09-19T09:02:13.343Z",
"updatedAt": "2022-09-19T09:02:13.343Z",
"amount": 200,
"status": "Pending"
},
"relationships": {
"org": {
"data": {
"type": "org",
"id": "1"
}
},
"counterparty": {
"data": {
"type": "counterparty",
"id": "1"
}
},
"creditAccount": {
"data": {
"type": "creditAccount",
"id": "10007"
}
},
"payment": {
"data": {
"type": "payment",
"id": "1"
}
}
}
}
}

Create Capital Partner Book Repayment

Creates a repayment for a credit account.

Book Repayment creation requests support Idempotency, ensuring that performing multiple identical requests will have the same result as a single request.

VerbPOST
URLhttps://api.s.unit.sh/repayments
Required Scoperepayments-write or payments-write
Data Typerepayment
Timeout (Seconds)5

Attributes

NameTypeDescription
descriptionstringRepayment description (maximum of 80 characters), this will show up on statement of the counterparty.
amountIntegerThe amount (cents) to repay.
transactionSummaryOverridestringIf this field is populated, its contents will be returned as the bookTransaction’s summary field (maximum of 100 characters).
tagsobjectOptional. See Tags.
idempotencyKeystringOptional. See Idempotency.

Relationships

NameTypeDescription
creditAccountJSON:API RelationshipThe Credit Account that the repayment is made against.
counterpartyAccountJSON:API RelationshipThe Deposit Account the repayment funds are taken from.
Example Request:
curl -X POST 'https://api.s.unit.sh/repayments'
-H 'Content-Type: application/vnd.api+json'
-H 'Authorization: Bearer ${TOKEN}'
--data-raw '{
"data": {
"type": "capitalPartnerBookRepayment",
"attributes": {
"amount": 20,
"description": "test",
"transactionSummaryOverride": "override",
"idempotencyKey": "3a1a33be-4e12-4603-9ed0-820922389fb8"
},
"relationships": {
"creditAccount": {
"data": {
"type": "creditAccount",
"id": "10007"
}
},
"counterpartyAccount": {
"data": {
"type": "account",
"id": "10008"
}
}
}
}
}'

Response

Response is a JSON:API document.

201 Created

FieldTypeDescription
dataCapitalPartnerBookRepaymentThe requested resource after the operation was completed.
Example Response:
{
"data": {
"type": "capitalPartnerBookRepayment",
"id": "4",
"attributes": {
"createdAt": "2022-09-19T09:10:09.206Z",
"updatedAt": "2022-09-19T09:10:09.206Z",
"amount": 20,
"status": "Sent"
},
"relationships": {
"org": {
"data": {
"type": "org",
"id": "1"
}
},
"counterparty": {
"data": {
"type": "account",
"id": "10008"
}
},
"creditAccount": {
"data": {
"type": "creditAccount",
"id": "10007"
}
},
"customer": {
"data": {
"type": "customer",
"id": "10002"
}
},
"payment": {
"data": {
"type": "payment",
"id": "5"
}
},
"recurringRepayment": {
"data": {
"type": "recurringRepayment",
"id": "4"
}
}
}
}
}

Create External Repayment

Creates an external repayment for a credit account. This is used to record repayments made from sources outside the Unit platform.

External Repayment creation requests support Idempotency, ensuring that performing multiple identical requests will have the same result as a single request.

VerbPOST
URLhttps://api.s.unit.sh/repayments
Required Scoperepayments-write
Data TypeexternalRepayment
Timeout (Seconds)5

Attributes

NameTypeDescription
descriptionstringRepayment description (maximum of 80 characters).
amountIntegerThe amount (cents) to repay.
tagsobjectOptional. See Tags.
idempotencyKeystringOptional. See Idempotency.

Relationships

NameTypeDescription
creditAccountJSON:API RelationshipThe Credit Account that the repayment is made against.
Example Request:
curl -X POST 'https://api.s.unit.sh/repayments'
-H 'Content-Type: application/vnd.api+json'
-H 'Authorization: Bearer ${TOKEN}'
--data-raw '{
"data": {
"type": "externalRepayment",
"attributes": {
"amount": 50000,
"description": "External payment"
},
"relationships": {
"creditAccount": {
"data": {
"type": "creditAccount",
"id": "10007"
}
}
}
}
}'

Response

Response is a JSON:API document.

201 Created

FieldTypeDescription
dataExternalRepaymentThe requested resource after the operation was completed.
Example Response:
{
"data": {
"type": "externalRepayment",
"id": "1",
"attributes": {
"createdAt": "2024-01-15T10:30:00.000Z",
"updatedAt": "2024-01-15T10:30:00.000Z",
"amount": 50000,
"status": "Sent",
"description": "External payment"
},
"relationships": {
"creditAccount": {
"data": {
"type": "creditAccount",
"id": "10007"
}
},
"customer": {
"data": {
"type": "customer",
"id": "10002"
}
},
"org": {
"data": {
"type": "org",
"id": "1"
}
}
}
}
}

Return External Repayment

Returns an external repayment that was previously created with Sent status. This is used when the external payment needs to be reversed. When an external repayment is returned, the credit account balance will increase and the available credit limit will decrease.

A repayment.statusChanged event will be raised when an external repayment is returned.

VerbPOST
URLhttps://api.s.unit.sh/repayments/{repaymentId}/return
Required Scoperepayments-write
Data TypeexternalRepaymentReturn
Timeout (Seconds)5

Relationships

NameTypeDescription
repaymentJSON:API RelationshipThe External Repayment to return.
Example Request:
curl -X POST 'https://api.s.unit.sh/repayments/{repaymentId}/return'
-H 'Content-Type: application/vnd.api+json'
-H 'Authorization: Bearer ${TOKEN}'
--data-raw '{
"data": {
"type": "externalRepaymentReturn",
"relationships": {
"repayment": {
"data": {
"type": "externalRepayment",
"id": "1"
}
}
}
}
}'

Response

Response is a JSON:API document.

200 OK

FieldTypeDescription
dataExternalRepaymentThe requested resource after the operation was completed.
Example Response:
{
"data": {
"type": "externalRepayment",
"id": "1",
"attributes": {
"createdAt": "2024-01-15T10:30:00.000Z",
"updatedAt": "2024-01-15T11:00:00.000Z",
"amount": 50000,
"status": "Returned",
"description": "External payment"
},
"relationships": {
"creditAccount": {
"data": {
"type": "creditAccount",
"id": "10007"
}
},
"customer": {
"data": {
"type": "customer",
"id": "10002"
}
},
"org": {
"data": {
"type": "org",
"id": "1"
}
}
}
}
}

Get by Id

Get a repayment by id.

VerbGET
URLhttps://api.s.unit.sh/repayments/{id}
Required Scoperepayments
Timeout (Seconds)5

Response

Response is a JSON:API document.

200 OK

FieldTypeDescription
dataOne of the following types (ACH Repayment, Book Repayment, or External Repayment)Repayment resource.
curl -X GET 'https://api.s.unit.sh/repayments/100' \
-H "Authorization: Bearer ${TOKEN}"

List Repayments

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

VerbGET
URLhttps://api.s.unit.sh/repayments
Required Scoperepayments
Timeout (Seconds)5

Query Parameters

NameTypeDefaultDescription
page[limit]integer100Optional. Maximum number of resources that will be returned. Maximum is 1000 resources. See Pagination.
page[offset]integer0Optional. Number of resources to skip. See Pagination.
filter[accountId]string(empty)Optional. Filters the results by the specified account id.
filter[creditAccountId]string(empty)Optional. Filters the results by the specified credit account id.
filter[recurringRepaymentId]string(empty)Optional. Filters the result according to the associated Recurring Repayment id
filter[customerId]string(empty)Optional. Filters the results by the specified customer id.
filter[status][]string(empty)Optional. Filter repayments by status (Pending, PendingReview, Returned, Sent or Rejected). Usage example: *filter[status][0]=Active
filter[type][]string(empty)Optional. Filter repayments by Repayment type. such as (AchRepayment, BookRepayment, ExternalRepayment). Usage example: filter[type][0]=AchRepayment&filter[type][1]=BookRepayment
filter[since]RFC3339 Date string(empty)Optional. Filters Repayments that occurred after the specified date. e.g. 2020-01-13T16:01:19.346Z
filter[until]RFC3339 Date string(empty)Optional. Filters the Repayments that occurred before the specified date. e.g. 2020-01-02T20:06:23.486Z
curl -X GET 'https://api.s.unit.sh/repayments?page[limit]=20&page[offset]=10&filter[status]=Pending' \
-H "Authorization: Bearer ${TOKEN}"

Response

Response is a JSON:API document.

200 OK

FieldTypeDescription
dataArray of Repayments (ACH Repayment, Book Repayment, External Repayment)Array of repayment resources.
metaJSON object that contains pagination dataPagination data includes offset, limit and total (estimated total items).
Example Response:
{
"data": [
{
"type": "achRepayment",
"id": "1",
"attributes": {
"createdAt": "2022-09-19T09:02:13.343Z",
"updatedAt": "2022-09-19T09:02:13.343Z",
"amount": 200,
"status": "Pending"
},
"relationships": {
"org": {
"data": {
"type": "org",
"id": "1"
}
},
"account": {
"data": {
"type": "account",
"id": "10003"
}
},
"counterparty": {
"data": {
"type": "counterparty",
"id": "1"
}
},
"creditAccount": {
"data": {
"type": "creditAccount",
"id": "10007"
}
},
"customer": {
"data": {
"type": "customer",
"id": "10002"
}
},
"payment": {
"data": {
"type": "payment",
"id": "1"
}
}
}
},
{
"type": "bookRepayment",
"id": "2",
"attributes": {
"createdAt": "2022-09-19T09:06:52.566Z",
"updatedAt": "2022-09-19T09:06:52.566Z",
"amount": 20,
"status": "Rejected"
},
"relationships": {
"counterparty": {
"data": {
"type": "account",
"id": "10003"
}
},
"account": {
"data": {
"type": "account",
"id": "10002"
}
},
"creditAccount": {
"data": {
"type": "creditAccount",
"id": "10002"
}
},
"customer": {
"data": {
"type": "customer",
"id": "10007"
}
},
"org": {
"data": {
"type": "org",
"id": "1"
}
},
"payment": {
"data": {
"type": "payment",
"id": "3"
}
}
}
},
{
"type": "bookRepayment",
"id": "3",
"attributes": {
"createdAt": "2022-09-19T09:07:40.314Z",
"updatedAt": "2022-09-19T09:07:40.314Z",
"amount": 20,
"status": "Rejected"
},
"relationships": {
"counterparty": {
"data": {
"type": "account",
"id": "10003"
}
},
"account": {
"data": {
"type": "account",
"id": "10002"
}
},
"creditAccount": {
"data": {
"type": "creditAccount",
"id": "10002"
}
},
"customer": {
"data": {
"type": "customer",
"id": "10007"
}
},
"org": {
"data": {
"type": "org",
"id": "1"
}
},
"payment": {
"data": {
"type": "payment",
"id": "4"
}
}
}
},
{
"type": "capitalPartnerAchRepayment",
"id": "4",
"attributes": {
"createdAt": "2022-09-19T09:02:13.343Z",
"updatedAt": "2022-09-19T09:02:13.343Z",
"amount": 200,
"status": "Pending"
},
"relationships": {
"counterparty": {
"data": {
"type": "counterparty",
"id": "1"
}
},
"creditAccount": {
"data": {
"type": "creditAccount",
"id": "10007"
}
},
"org": {
"data": {
"type": "org",
"id": "1"
}
},
"customer": {
"data": {
"type": "customer",
"id": "10002"
}
},
"payment": {
"data": {
"type": "payment",
"id": "1"
}
}
}
}
],
"meta": {
"pagination": {
"total": 3,
"limit": 100,
"offset": 0
}
}
}