Currencies

Currencies available for multi-currency sales/purchase documents.

GET/api/v1/currencies

List currencies

Scope: currencies.read

Parameters

NameInTypeRequiredDescription
pagequerynumberOptional1-based page number.
limitquerynumberOptionalPage size, max 200.

Example request

curl "https://pre-invoice.avscorp.in/api/v1/currencies" \
  -H "Authorization: Bearer YOUR_API_KEY"

Example response

JSON
{
  "id": "clx8cur000000000000000001",
  "organizationId": "clx0org000000000000000001",
  "code": "USD",
  "name": "US Dollar",
  "symbol": "$",
  "exchangeRate": 83.245,
  "isBase": false,
  "isActive": true,
  "createdAt": "2026-02-10T06:00:00.000Z",
  "updatedAt": "2026-09-01T06:00:00.000Z"
}

Possible errors: unauthorized, insufficient_scope, forbidden

POST/api/v1/currencies

Create a currency

Scope: currencies.create

Request body

FieldTypeRequiredConstraints
codestringRequiredmin length 3; max length 3
namestringRequiredmin length 1; max length 50
symbolstringRequiredmin length 1; max length 10
exchangeRatenumberRequired—
isBasebooleanOptionaldefault false
isActivebooleanOptionaldefault true

Example request

curl -X POST "https://pre-invoice.avscorp.in/api/v1/currencies" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "code": "USD",
  "name": "US Dollar",
  "symbol": "$",
  "exchangeRate": 83.245
}'

Example response

JSON
{
  "id": "clx8cur000000000000000001",
  "organizationId": "clx0org000000000000000001",
  "code": "USD",
  "name": "US Dollar",
  "symbol": "$",
  "exchangeRate": 83.245,
  "isBase": false,
  "isActive": true,
  "createdAt": "2026-02-10T06:00:00.000Z",
  "updatedAt": "2026-09-01T06:00:00.000Z"
}

Possible errors: unauthorized, insufficient_scope, forbidden, validation_error

GET/api/v1/currencies/{id}

Get a currency

Scope: currencies.read

Parameters

NameInTypeRequiredDescription
idpathstringRequiredCurrency ID.

Example request

curl "https://pre-invoice.avscorp.in/api/v1/currencies/clx8cur000000000000000001" \
  -H "Authorization: Bearer YOUR_API_KEY"

Example response

JSON
{
  "id": "clx8cur000000000000000001",
  "organizationId": "clx0org000000000000000001",
  "code": "USD",
  "name": "US Dollar",
  "symbol": "$",
  "exchangeRate": 83.245,
  "isBase": false,
  "isActive": true,
  "createdAt": "2026-02-10T06:00:00.000Z",
  "updatedAt": "2026-09-01T06:00:00.000Z"
}

Possible errors: unauthorized, insufficient_scope, forbidden, not_found

PATCH/api/v1/currencies/{id}

Update a currency

Scope: currencies.update

PATCH validates against the full currency schema (same as create) — code, name, symbol, and exchangeRate are all required in every update.

Parameters

NameInTypeRequiredDescription
idpathstringRequiredCurrency ID.

Request body

FieldTypeRequiredConstraints
codestringRequiredmin length 3; max length 3
namestringRequiredmin length 1; max length 50
symbolstringRequiredmin length 1; max length 10
exchangeRatenumberRequired—
isBasebooleanOptionaldefault false
isActivebooleanOptionaldefault true

Example request

curl -X PATCH "https://pre-invoice.avscorp.in/api/v1/currencies/clx8cur000000000000000001" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "code": "USD",
  "name": "US Dollar",
  "symbol": "$",
  "exchangeRate": 84.1
}'

Example response

JSON
{
  "id": "clx8cur000000000000000001",
  "organizationId": "clx0org000000000000000001",
  "code": "USD",
  "name": "US Dollar",
  "symbol": "$",
  "exchangeRate": 83.245,
  "isBase": false,
  "isActive": true,
  "createdAt": "2026-02-10T06:00:00.000Z",
  "updatedAt": "2026-09-01T06:00:00.000Z"
}

Possible errors: unauthorized, insufficient_scope, forbidden, not_found, validation_error

DELETE/api/v1/currencies/{id}

Delete a currency

Scope: currencies.delete

Parameters

NameInTypeRequiredDescription
idpathstringRequiredCurrency ID.

Example request

curl -X DELETE "https://pre-invoice.avscorp.in/api/v1/currencies/clx8cur000000000000000001" \
  -H "Authorization: Bearer YOUR_API_KEY"

Example response

JSON
{
  "deleted": true
}

Possible errors: unauthorized, insufficient_scope, forbidden, not_found