Skip to main content

Credit Accounts

Credit Accounts are accounts that represent an amount loaned to an end customer. Credit Accounts have a:

  • Credit limit, the maximum amount the customer can be loaned at any given time

  • Balance, the amount the customer currently owes

  • Hold, the amount of authorizations pending

  • Available Credit Limit, the current maximum amount the customer can be further loaned. This is calculated by subtracting the Balance and Hold from the Credit Limit.

Currently credit accounts on Unit support Business Charge Cards.

Credit Terms

When creating a credit account, you are required to select the Credit Terms for the account. The Credit Terms defines the set of terms that are applied to the account:

  • Billing cycle
  • Repayment terms
  • Fees
  • APR [in later versions]
  • Daily account spending limit

You may utilize as many credit terms as you need to make your product work, and there are many use cases for multiple credit terms products:

  • Manage fees and limits to represent different customer tiers (regular / VIP).
  • Offer multiple different credit solutions (e.g. charge cards and loans)

You may move an account between different credit terms that serve the same purpose (e.g. move an account from "regular" to "VIP" credit terms) by updating the account.

info

Credit Terms are created and updated by Unit's compliance team, to ensure any changes are in line with relevant regulation. Similarly, only Unit’s compliance team can change the Credit Terms associated to a Credit Account.

Create Credit Account

Creates a credit account for a Customer. An account.created event is raised when the call was successful.

Each credit account is created using specific credit terms.

Credit Account creation request supports Idempotency, ensuring that performing multiple identical requests will have the same effect as performing a single request.

VerbPOST
Urlhttps://api.s.unit.sh/accounts
Required Scopeaccounts-write
Data TypecreditAccount
Timeout (Seconds)5

Attributes

NameTypeDescription
creditTermsstringThe credit terms that will be associated with the account.
creditLimitInteger (Cents)The credit limit of the account.
tagsobjectOptional. See Tags.
idempotencyKeystringOptional. See Idempotency.

Relationships

NameTypeDescription
customerRequired for individual / business accounts. JSON:API RelationshipThe customer the credit account belongs to. The customer is either a business or an individual.
Example Request:
curl -X POST 'https://api.s.unit.sh/accounts'
-H 'Content-Type: application/vnd.api+json'
-H 'Authorization: Bearer ${TOKEN}'
--data-raw '{
"data": {
"type": "creditAccount",
"attributes": {
"creditTerms": "credit_terms_1",
"creditLimit": 20000,
"tags": {
"purpose": "some_purpose"
},
"idempotencyKey": "3a1a33be-4e12-4603-9ed0-820922389fb8"
},
"relationships": {
"customer": {
"data": {
"type": "customer",
"id": "45555"
}
}
}
}
}'

Response

Response is a JSON:API document.

201 Created

FieldTypeDescription
dataCreditAccountThe requested resource after the operation was completed.
Example Response:
{
"data": {
"type": "creditAccount",
"id": "42",
"attributes": {
"createdAt": "2000-05-11T10:19:30.409Z",
"name": "Peter Parker",
"status": "Open",
"creditTerms": "credit_terms_1",
"currency": "USD",
"balance": 10000,
"hold": 0,
"available": 10000,
"tags": {
"purpose": "some_purpose"
},
"creditLimit": 200000
},
"relationships": {
"customer": {
"data": {
"type": "customer",
"id": "45555"
}
},
"org": {
"data": {
"type": "org",
"id": "1"
}
}
}
}
}

Close Account

Closes an account. Closing an account is irreversible and can only be done by an Org user. An account.closed event is raised when the call was successful.

note

Closing an account will also close the cards associated with the account. Closed accounts cannot accept repayments

VerbPOST
Urlhttps://api.s.unit.sh/accounts/:accountId/close
Required Scopeaccounts-write
Data TypecreditAccountClose
Timeout (Seconds)5

Attributes

NameTypeDescription
reasonstringThe reason for closing the account. Either ByCustomer, Fraud or Overdue. If not specified, will default to ByCustomer.
fraudReasonstringOptional. The expanded fraud reason for closing the account when Fraud is specified as the reason. Can be one of: (ACHActivity, CardActivity, CheckActivity, ApplicationHistory, AccountActivity, ClientIdentified, IdentityTheft, LinkedToFraudulentCustomer).

Response

Response is a JSON:API document.

200 OK

FieldTypeDescription
dataCreditAccountCredit Account resource.
curl -X POST 'https://api.s.unit.sh/accounts/10000/close'
-H 'Content-Type: application/vnd.api+json'
-H 'Authorization: Bearer ${TOKEN}'
--data-raw '{
"data": {
"type": "creditAccountClose",
"attributes": {
"reason": "Overdue"
}
}
}'

Freeze Account

Freezes an account. An account.frozen event is raised when the call was successful. A frozen account behaves like a closed account, with the primary difference being that a frozen state should be temporary, and after evaluation should either be un-frozen, or closed.

note

Freezing an account will also freeze the cards associated with the account.

VerbPOST
Urlhttps://api.s.unit.sh/accounts/:accountId/freeze
Required Scopeaccounts-write
Timeout (Seconds)5

Attributes

NameTypeDescription
reasonstringThe reason for closing the account. Either Fraud or Other, with a specified reasonText.
reasonTextstringOptional. The free-text reason for freezing the account (up to 255 characters) when Other is specified.

Response

Response is a JSON:API document.

200 OK

FieldTypeDescription
dataCreditAccountCredit Account resource.
curl -X POST 'https://api.s.unit.sh/accounts/10000/freeze'
-H 'Content-Type: application/vnd.api+json'
-H 'Authorization: Bearer ${TOKEN}'
--data-raw '{
"data": {
"type": "creditAccountFreeze",
"attributes": {
"reason": "Other",
"reasonText": "Per request from customer"
}
}
}'

Unfreeze Account

Unfreezes an account.

note

Unfreezing an account will also unfreeze the cards associated with the account.

VerbPOST
Urlhttps://api.s.unit.sh/accounts/:accountId/unfreeze
Required Scopeaccounts-write
Timeout (Seconds)5

Response

Response is a JSON:API document.

200 OK

FieldTypeDescription
dataCreditAccountCredit Account resource.
curl -X POST 'https://api.s.unit.sh/accounts/10000/unfreeze'
-H 'Content-Type: application/vnd.api+json'
-H 'Authorization: Bearer ${TOKEN}'
--data-raw '{}'

Get by Id

Get a credit account resource by id.

VerbGET
Urlhttps://api.s.unit.sh/accounts/{id}
Required Scopeaccounts
Timeout (Seconds)5

Query Parameters

NameTypeDefaultDescription
includestring(empty)Optional. Related resource available to include: customer. See Getting Related Resources

Response

Response is a JSON:API document.

200 OK

FieldTypeDescription
dataCreditAccountCredit Account resource.
includedArray of CustomerArray of resources requested by the include query parameter.
curl -X GET 'https://api.s.unit.sh/accounts/42' \
-H "Authorization: Bearer ${TOKEN}"

List

Listing credit accounts is similar to listing deposit accounts, with a specific account type filter (see below)

VerbGET
Urlhttps://api.s.unit.sh/accounts
Required Scopeaccounts
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[customerId]string(empty)Optional. Filters the results by the specified customer id.
filter[tags]Tags (JSON)(empty)Optional. Filter Accounts by Tags.
filter[status]stringAuthorizedOptional. Filter Account by its status (Open, Frozen, or Closed). Usage example: filter[status][0]=Closed
filter[fromBalance]Integer(empty)Optional. Filters Accounts that have balance higher or equal to the specified amount (in cents). e.g. 5000
filter[toBalance]Integer(empty)Optional. Filters Accounts that have balance lower or equal to the specified amount (in cents). e.g. 7000
filter[type]string(empty)Optional. Filters Accounts by type. Valid values are deposit or credit.
includestring(empty)Optional. Related resource available to include: customer. See Getting Related Resources
curl -X GET 'https://api.s.unit.sh/accounts?page[limit]=20&page[offset]=10&filter[type]=credit' \
-H "Authorization: Bearer ${TOKEN}"

Response

Response is a JSON:API document.

200 OK

FieldTypeDescription
dataArray of DepositAccount or CreditAccountArray of account resources.
includedArray of CustomerArray of resources requested by the include query parameter.
Example Response:
{
"data": [
{
"type": "depositAccount",
"id": "42",
"attributes": {
"createdAt": "2000-05-11T10:19:30.409Z",
"name": "Peter Parker",
"status": "Open",
"depositProduct": "checking",
"routingNumber": "812345678",
"accountNumber": "1000000002",
"currency": "USD",
"balance": 10000,
"hold": 0,
"available": 10000,
"tags": {
"purpose": "tax"
}
},
"relationships": {
"customer": {
"data": {
"type": "customer",
"id": "45555"
}
}
}
}
]
}

Update

Update a credit account.

VerbPATCH
Urlhttps://api.s.unit.sh/accounts/:accountId
Data TypecreditAccount
Timeout (Seconds)5

Attributes

NameTypeDescription
tagsobjectOptional. See Updating Tags.
creditLimitInteger (Cents)Optional. The credit limit of the account.
curl -X PATCH 'https://api.s.unit.sh/accounts/42'
-H 'Content-Type: application/vnd.api+json'
-H 'Authorization: Bearer ${TOKEN}'
--data-raw '{
"data": {
"type": "creditAccount",
"attributes": {
"tags": {
"newTag": "New tag value"
}
}
}
}'

Response

Response is a JSON:API document.

200 OK

FieldTypeDescription
dataCreditAccountCredit Account resource.
Example Response:
{
"data": {
"type": "creditAccount",
"id": "42",
"attributes": {
"createdAt": "2000-05-11T10:19:30.409Z",
"name": "Peter Parker",
"status": "Open",
"creditTerms": "credit_terms_1",
"currency": "USD",
"balance": 10000,
"hold": 0,
"available": 10000,
"tags": {
"purpose": "Tax",
"newTag": "New tag value"
},
"creditLimit": 200000
},
"relationships": {
"customer": {
"data": {
"type": "customer",
"id": "45555"
}
}
}
}
}

Limits

VerbGET
Urlhttps://api.s.unit.sh/accounts/:accountId/limits
Timeout (Seconds)5
curl -X GET 'https://api.s.unit.sh/accounts/10104/limits' \
-H "Authorization: Bearer ${TOKEN}"

Some monetary transactions (such as originating ACH payments) are subject to daily and/or monthly amount limits that are defined on the account level. You can read more about the account limits on our limits guide. Note that credit accounts do not support withdrawals.

The response to this API call includes the defined limits, as well as the current total amounts on each transaction type (under the totalsDaily and totalsMonthly fields), in cents.

note

The daily limits reset at 12:00 a.m. on the timezone of relevant bank. The monthly limits are reset at the same time on the first of each month.

{
"data": {
"type": "creditLimits",
"id": "10014",
"attributes": {
"card": {
"limits": {
"dailyWithdrawal": 0,
"dailyDeposit": 0,
"dailyPurchase": 500000,
"dailyCardTransaction": 0
},
"totalsDaily": {
"withdrawals": 0,
"deposits": 0,
"purchases": 12500,
"cardTransactions": 0
}
}
}
}
}

Get Account Balance History

List account end-of-day balances history (filtering and paging can be applied).

The account balance history can be used to provide the customer with an overview of their balance across account(s) over time in a visually engaging way, providing insights and creating custom product features around it.

Account Balance Chart
note

The typical cutoff time (end-of-day) is 7PM, but may vary between banks. The exact time and timezone are determined by the partner bank you work with.

VerbGET
Urlhttps://api.s.unit.sh/account-end-of-day
Required Scopeaccount-end-of-day
Timeout (Seconds)5

Query Parameters

NameTypeDefaultDescription
page[limit]integer100Optional. Maximum number of resources that will be returned. Maximum is 1000 resources.
page[offset]integer0Optional. Number of resources to skip.
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 the account end-of-day balances after the specified date. e.g. 2021-06-01
filter[until]ISO Local Date string(empty)Optional. Filters the account end-of-day balances before the specified date. e.g. 2021-07-01
curl -X GET 'https://api.s.unit.sh/account-end-of-day?page[limit]=10&page[offset]=0&filter[customerId]=10000&filter[accountId]=30317&filter[since]=2020-10-11&filter[until]=2021-10-13' \
-H "Authorization: Bearer ${TOKEN}"

Response

Response is a JSON:API document.

200 OK

FieldTypeDescription
dataArray of Account End-Of-DayArray of account end-of-day resources.
metaJSON object that contains pagination dataPagination data includes offset, limit and total (total items).
Example Response:
{
"data": [
{
"type": "accountEndOfDay",
"id": "4925158",
"attributes": {
"date": "2021-07-10",
"balance": 1000,
"available": 500,
"hold": 500
},
"relationships": {
"customer": {
"data": {
"type": "customer",
"id": "10000"
}
},
"account": {
"data": {
"type": "account",
"id": "30317"
}
}
}
},
{
"type": "accountEndOfDay",
"id": "4925158",
"attributes": {
"date": "2021-07-11",
"balance": 1000,
"available": 500,
"hold": 500
},
"relationships": {
"customer": {
"data": {
"type": "customer",
"id": "10000"
}
},
"account": {
"data": {
"type": "account",
"id": "30317"
}
}
}
}
],
"meta": {
"pagination": {
"total": 12,
"limit": 2,
"offset": 0
}
}
}

Repayment Information

VerbGET
Urlhttps://api.s.unit.sh/accounts/:accountId/repayment-information
Timeout (Seconds)5
curl -X GET 'https://api.s.unit.sh/accounts/10104/repayment-information' \
-H "Authorization: Bearer ${TOKEN}"

The response to this API call includes the current repayment information, in cents.

{
"data": {
"type": "creditAccountRepaymentInformation",
"attributes": {
"remainingAmountDue": 10000,
"remainingAmountOverdue": 2000,
"initiatedRepayments": 100,
"statementPeriodStart": "2023-07-01",
"statementPeriodEnd": "2023-07-31",
"nextRepaymentDueDate": "2023-08-13"
}
}
}