Accounts

Financial accounts (cash/bank/wallet/etc.) used as payment sources and destinations.

GET/api/v1/accounts

List accounts

Scope: accounts.read

Parameters

NameInTypeRequiredDescription
pagequerynumberOptional1-based page number.
limitquerynumberOptionalPage 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/accounts

Create an account

Scope: accounts.create

Request body

FieldTypeRequiredConstraints
accountNamestringRequiredmin length 1; max length 100
accountTypestringRequiredone of: CASH, BANK, WALLET, RECEIVABLE, PAYABLE, DEBT, LOAN, OTHER
bankNamestringRequiredmax length 100
accountNumberstringRequiredmax length 50
ifscCodestringRequiredmax length 20
isDefaultbooleanOptionaldefault false
isActivebooleanOptionaldefault 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.read

Parameters

NameInTypeRequiredDescription
idpathstringRequiredAccount 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.update

PATCH validates against the full account schema (same as create) — accountName and accountType are required in every update.

Parameters

NameInTypeRequiredDescription
idpathstringRequiredAccount ID.

Request body

FieldTypeRequiredConstraints
accountNamestringRequiredmin length 1; max length 100
accountTypestringRequiredone of: CASH, BANK, WALLET, RECEIVABLE, PAYABLE, DEBT, LOAN, OTHER
bankNamestringRequiredmax length 100
accountNumberstringRequiredmax length 50
ifscCodestringRequiredmax length 20
isDefaultbooleanOptionaldefault false
isActivebooleanOptionaldefault 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.delete

Parameters

NameInTypeRequiredDescription
idpathstringRequiredAccount 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