APIs
Create Wallet
Creates a wallet account for a BusinessCustomer (created via Create Business Application), a BusinessWalletCustomer (created via Create Business Wallet Customer), or an IndividualCustomer created from a Sole Proprietor Application with the soleProprietorship attribute set to true.
A successful call triggers an account.created event.
Each wallet is created using a specific wallet terms. Wallet terms are a predefined set of terms associated with this wallet (e.g. Fees, Limits, Card settings).
Use walletDefault as the default value for the wallet terms field while building your solution in sandbox . Contact Unit to create other wallet terms under your organization.
Wallet creation request supports Idempotency, ensuring that performing multiple identical requests will have the same effect as performing a single request.
A successful wallet creation will result in an wallet in Open status. Later on, wallets can be either frozen, closed and in some cases reopened.
| Verb | POST |
| URL | https://api.s.unit.sh/accounts |
| Required Scope | accounts-write |
| Data Type | walletAccount |
| Timeout (Seconds) | 5 |
Attributes
| Name | Type | Description |
|---|---|---|
| walletTerms | string | The name of the wallet terms. |
| tags Optional | object | Optional. See Tags. |
| idempotencyKey Optional | string | Optional. See Idempotency. |
Relationships
| Name | Type | Description |
|---|---|---|
| customer | JSON:API Relationship | The customer the wallet belongs to. The customer is either a BusinessCustomer, BusinessWalletCustomer or an IndividualCustomer (with a soleProprietorship attribute set to true). |
curl -X POST 'https://api.s.unit.sh/accounts'
-H 'Content-Type: application/vnd.api+json'
-H 'Authorization: Bearer ${TOKEN}'
--data-raw '{
"data": {
"type": "walletAccount",
"attributes": {
"walletTerms": "walletDefault",
"tags": {
"purpose": "Healthcare"
},
"idempotencyKey": "3a1a33be-4e12-4603-9ed0-820922389fb8"
},
"relationships": {
"customer": {
"data": {
"type": "customer",
"id": "45555"
}
}
}
}
}'
Response
Response is a JSON:API document.
201 Created
| Name | Type | Description |
|---|---|---|
| data | WalletAccount | The requested resource after the operation was completed. |
{
"data": {
"type": "walletAccount",
"id": "42",
"attributes": {
"createdAt": "2000-05-11T10:19:30.409Z",
"name": "Peter Parker",
"status": "Open",
"walletTerms": "walletDefault",
"routingNumber": "812345678",
"accountNumber": "1000000002",
"currency": "USD",
"balance": 10000,
"hold": 0,
"available": 10000,
"tags": {
"purpose": "Healthcare"
}
},
"relationships": {
"customer": {
"data": {
"type": "customer",
"id": "45555"
}
}
}
}
}
Update Wallet
Update a wallet account.
| Verb | PATCH |
| URL | https://api.s.unit.sh/accounts/:accountId |
| Required Scope | accounts-write |
| Data Type | walletAccount |
| Timeout (Seconds) | 5 |
Attributes
| Name | Type | Description |
|---|---|---|
| name Optional | string | Optional. The name of the wallet. |
| tags Optional | object | Optional. See Tags. |
| walletTerms Optional | string | Optional. The name of the selected wallet terms. |
Response
Response is a JSON:API document.
200 OK
| Name | Type | Description |
|---|---|---|
| data | WalletAccount | Wallet resource. |
curl -X PATCH 'https://api.s.unit.sh/accounts/10000'
-H 'Content-Type: application/vnd.api+json'
-H 'Authorization: Bearer ${TOKEN}'
--data-raw '{
"data": {
"type": "walletAccount",
"attributes": {
"tags": {
"purpose": "checking"
}
}
}
}'
Close Wallet
Closes a wallet. Closing a wallet is irreversible and can only be done by an Org user. An account.closed event is raised when the call was successful.
Closing a wallet will also close the cards associated with the wallet.
| Verb | POST |
| URL | https://api.s.unit.sh/accounts/:accountId/close |
| Required Scope | accounts-write |
| Data Type | walletAccountClose |
| Timeout (Seconds) | 5 |
Attributes
| Name | Type | Description |
|---|---|---|
| reason | string | The reason for closing the wallet. Either ByCustomer, Fraud, ByBank, or NegativeBalance. |
| fraudReason Optional | string | Optional. The expanded fraud reason for closing the wallet when Fraud is specified as the reason. Can be one of: (ACHActivity, CardActivity, CheckActivity, ApplicationHistory, AccountActivity, ClientIdentified, IdentityTheft, LinkedToFraudulentCustomer). |
| bankReason Optional | string | Optional. The expanded bank reason for closing the wallet when ByBank is specified as the reason. Can be one of: (ProhibitedBusiness, MissingCddEdd, NonUsOperations, SuspectedFraud). This list is subject to change. |
Response
Response is a JSON:API document.
200 OK
| Name | Type | Description |
|---|---|---|
| data | WalletAccount | Wallet 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": "walletAccountClose",
"attributes": {
"reason": "ByCustomer"
}
}
}'
Reopen Wallet
Reopens a wallet.
Reopening a wallet will not reopen cards associated with the wallet. Closed cards cannot be reactivated.
This API can only be used to reopen wallets which were closed by customers. In order to reopen a wallet that was closed due to fraud, please contact Unit.