Create or update accounts
Accounts
Create & Update Account
Create new accounts, update existing ones, or withdraw accounts from the collection portfolio
POST
Create or update accounts
This is the primary endpoint for managing accounts in Command. It supports creating new accounts, updating existing accounts (e.g., reflecting payments), and withdrawing accounts — all through a single unified request. Accounts are processed asynchronously in the background after the request is accepted.
Request
Endpoint
| Environment | Base URL |
|---|---|
| Production | https://v3-api.cleargrid.ai/admin/v3 |
| Staging | https://stage-v3-api.cleargrid.ai/admin/v3 |
Headers
Bearer token obtained from the Lender Login endpoint. Format:
Bearer <access_token>Body Parameters
The request body contains anaccounts array. Each item represents an account or sub-account to create, update, or withdraw.
An array of account objects. You can include multiple accounts and sub-accounts in a single request.
Example Request
Understanding Accounts & Sub-Accounts
What is an accountId?
What is an accountId?
The
accountId represents the main account or primary contract with a debtor. For example, a mobile phone purchase from an online store would be a single accountId. All related financial obligations (installments, fees) are grouped under this identifier.What is a subAccountId?
What is a subAccountId?
The
subAccountId represents an individual obligation or installment under the main account. Each installment or fee is tracked as a unique subAccountId, enabling itemized tracking of payments and dues. For example, a 4-installment BNPL plan would have 4 sub-accounts under one accountId.How does the status field work?
How does the status field work?
The
Example lifecycle:
status field controls the operation:| Status | Operation | Use Case |
|---|---|---|
1 | Create | Onboarding a new account or sub-account |
2 | Update | Reflecting a payment, fee adjustment, or data correction |
3 | Withdraw | Removing or cancelling an account/sub-account |
- Status
1: Create account with principal of 100, paidAmount of 0 - Status
2: Update with paidAmount of 30 (balance becomes 70) - Status
2: Update with paidAmount of 50 (balance becomes 50)
Dynamic sub-account management
Dynamic sub-account management
Sub-accounts are uniquely identified via
subAccountId, which enables flexible real-time updates:- Add anytime — New sub-accounts (e.g., a new installment or charge) can be added independently at any time
- Update anytime — Existing sub-accounts can be updated (e.g., fees change, payments received)
- Withdraw anytime — A sub-account can be withdrawn (e.g., removed or marked as cancelled)
- Automatic aggregation — Any operation on a sub-account automatically updates the main
accountIdaggregate (outstanding balance, status, etc.)
Important Notes
Date format: All dates must be in
dd/MM/yyyy format (e.g., 15/03/2026).Country codes: Use ISO 3166-1 alpha-3 three-character codes (e.g.,
ARE for UAE, SAU for Saudi Arabia, BHR for Bahrain).Additional data: Any additional information about the debt or borrower that doesn’t fit into the standard fields should be placed in the
additionalData object.Response
- 200 — Success
- 400 — Validation Error
- 500 — Server Error
Data has been accepted and processing has started in the background.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Lender public ID (UUID) returned by the Lender Login endpoint.
Body
application/json
Array of account objects to create, update, or withdraw.