Accounts
Financial accounts (cash/bank/wallet/etc.) used as payment sources and destinations.
GET
/api/v1/accountsList accounts
Scope:
accounts.readParameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
page | query | number | Optional | 1-based page number. |
limit | query | number | Optional | Page size, max 200. |
Example request
curl "https://invoice.avscorp.in/api/v1/accounts" \
-H "Authorization: Bearer YOUR_API_KEY"Example response
JSON
{
"id": "clx3acct00000000000000001",
"organizationId": "clx0org000000000000000001",
"accountName": "HDFC Bank - Current A/C",
"accountType": "BANK",
"bankName": "HDFC Bank",
"accountNumber": "50100123456789",
"ifscCode": "HDFC0001234",
"isDefault": true,
"isActive": true,
"createdAt": "2025-04-01T06:30:00.000Z",
"updatedAt": "2025-04-01T06:30:00.000Z"
}Possible errors: unauthorized, insufficient_scope, forbidden
POST
/api/v1/accountsCreate an account
Scope:
accounts.createRequest body
| Field | Type | Required | Constraints |
|---|---|---|---|
accountName | string | Required | min length 1; max length 100 |
accountType | string | Required | one of: CASH, BANK, WALLET, RECEIVABLE, PAYABLE, DEBT, LOAN, OTHER |
bankName | string | Required | max length 100 |
accountNumber | string | Required | max length 50 |
ifscCode | string | Required | max length 20 |
isDefault | boolean | Optional | default false |
isActive | boolean | Optional | default true |
Example request
curl -X POST "https://invoice.avscorp.in/api/v1/accounts" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"accountName": "HDFC Bank - Current A/C",
"accountType": "BANK"
}'Example response
JSON
{
"id": "clx3acct00000000000000001",
"organizationId": "clx0org000000000000000001",
"accountName": "HDFC Bank - Current A/C",
"accountType": "BANK",
"bankName": "HDFC Bank",
"accountNumber": "50100123456789",
"ifscCode": "HDFC0001234",
"isDefault": true,
"isActive": true,
"createdAt": "2025-04-01T06:30:00.000Z",
"updatedAt": "2025-04-01T06:30:00.000Z"
}Possible errors: unauthorized, insufficient_scope, forbidden, validation_error
GET
/api/v1/accounts/{id}Get an account
Scope:
accounts.readParameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Required | Account ID. |
Example request
curl "https://invoice.avscorp.in/api/v1/accounts/clx3acct00000000000000001" \
-H "Authorization: Bearer YOUR_API_KEY"Example response
JSON
{
"id": "clx3acct00000000000000001",
"organizationId": "clx0org000000000000000001",
"accountName": "HDFC Bank - Current A/C",
"accountType": "BANK",
"bankName": "HDFC Bank",
"accountNumber": "50100123456789",
"ifscCode": "HDFC0001234",
"isDefault": true,
"isActive": true,
"createdAt": "2025-04-01T06:30:00.000Z",
"updatedAt": "2025-04-01T06:30:00.000Z"
}Possible errors: unauthorized, insufficient_scope, forbidden, not_found
PATCH
/api/v1/accounts/{id}Update an account
Scope:
accounts.updatePATCH validates against the full account schema (same as create) — accountName and accountType are required in every update.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Required | Account ID. |
Request body
| Field | Type | Required | Constraints |
|---|---|---|---|
accountName | string | Required | min length 1; max length 100 |
accountType | string | Required | one of: CASH, BANK, WALLET, RECEIVABLE, PAYABLE, DEBT, LOAN, OTHER |
bankName | string | Required | max length 100 |
accountNumber | string | Required | max length 50 |
ifscCode | string | Required | max length 20 |
isDefault | boolean | Optional | default false |
isActive | boolean | Optional | default true |
Example request
curl -X PATCH "https://invoice.avscorp.in/api/v1/accounts/clx3acct00000000000000001" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"accountName": "HDFC Bank - Current A/C",
"accountType": "BANK",
"isDefault": true
}'Example response
JSON
{
"id": "clx3acct00000000000000001",
"organizationId": "clx0org000000000000000001",
"accountName": "HDFC Bank - Current A/C",
"accountType": "BANK",
"bankName": "HDFC Bank",
"accountNumber": "50100123456789",
"ifscCode": "HDFC0001234",
"isDefault": true,
"isActive": true,
"createdAt": "2025-04-01T06:30:00.000Z",
"updatedAt": "2025-04-01T06:30:00.000Z"
}Possible errors: unauthorized, insufficient_scope, forbidden, not_found, validation_error
DELETE
/api/v1/accounts/{id}Delete an account
Scope:
accounts.deleteParameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Required | Account ID. |
Example request
curl -X DELETE "https://invoice.avscorp.in/api/v1/accounts/clx3acct00000000000000001" \
-H "Authorization: Bearer YOUR_API_KEY"Example response
JSON
{
"deleted": true
}Possible errors: unauthorized, insufficient_scope, forbidden, not_found