Skip to main content

Credit Account APIs

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
creditTerms RequiredstringThe credit terms that will be associated with the account.
creditLimit RequiredInteger (Cents)The credit limit of the account. Must be greater than or equal to 0.
tags OptionalobjectSee Tags.
idempotencyKey Optionalstring1 to 255 characters. See Idempotency.

Relationships​

NameTypeDescription
customer RequiredJSON:API RelationshipThe customer the credit account belongs to. The customer is either a business or an individual.
creditDecision OptionalJSON:API RelationshipThe credit decision related to the account.
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​

NameTypeDescription
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,
"reserve": 0,
"available": 10000,
"tags": {
"purpose": "some_purpose"
},
"creditLimit": 20000
},
"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
reason RequiredstringThe reason for closing the account. One of: Overdue, Fraud, ByBank, ByCustomer, BreachOfTermsAndConditions, NoAccountActivity, ProgramChange, CustomerDeceased.
reasonText OptionalstringFree-text reason for closing the account (up to 255 characters).
fraudReason OptionalstringThe expanded fraud reason when Fraud is specified as the reason. One of: ACHActivity, CardActivity, CheckActivity, ApplicationHistory, AccountActivity, ClientIdentified, IdentityTheft, LinkedToFraudulentCustomer.
bankReason OptionalstringThe expanded bank reason when ByBank is specified as the reason. One of: ProhibitedBusiness, MissingCddEdd, NonUsOperations, SuspectedFraud, Unfunded, Inactive.

Response​

Response is a JSON:API document.

200 OK​

NameTypeDescription
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
reason RequiredstringThe reason for freezing the account. One of Fraud, ByBank or Other.
subReasonstringRequired if reason is ByBank. Optional if reason is Fraud. See the values below.
reasonTextstringRequired and non-empty if reason is Other. Optional otherwise. Free text, up to 255 characters.

Fraud subReason values: AchActivity, CardActivity, AccountActivity, CheckActivity, WireActivity, HoldHarmlessReceived, LinkedToFraudulentCustomer.

ByBank subReason values: ProhibitedBusiness, MissingCddEdd, NonUsOperations, SuspectedFraud, Inactive, Unfunded, OngoingReevaluation, LegalRequestReceived, ErroneousPayment, Other.

Response​

Response is a JSON:API document.

200 OK​

NameTypeDescription
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​

NameTypeDescription
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}'

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 resources available to include: customer, org. See Getting Related Resources

Response​

Response is a JSON:API document.

200 OK​

NameTypeDescription
dataCreditAccountCredit Account resource.
includedArray of Customer and/or org resourcesArray of resources requested by the include query parameter (customer, org, or both).
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 10000 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]string(empty)Optional. 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​

NameTypeDescription
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
tags OptionalobjectSee Updating Tags.
creditLimit OptionalInteger (Cents)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​

NameTypeDescription
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,
"reserve": 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​

NameTypeDescription
dataArray of Account End-Of-DayArray of account end-of-day resources.
metaJSON object that contains pagination dataPagination data includes offset, limit and total (estimated 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"
}
}
}