Payment Terms

Payment-term presets (net days) used by customers and invoices.

GET/api/v1/payment-terms

List payment terms

Scope: paymentTerms.read

Parameters

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

Example request

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

Example response

JSON
{
  "id": "clxpt00000000000000000001",
  "organizationId": "clx0org000000000000000001",
  "name": "Net 30",
  "days": 30,
  "isDefault": true,
  "createdAt": "2026-01-01T00:00:00.000Z",
  "updatedAt": "2026-01-01T00:00:00.000Z"
}

Possible errors: unauthorized, insufficient_scope, forbidden

POST/api/v1/payment-terms

Create a payment term

Scope: paymentTerms.create

Request body

FieldTypeRequiredConstraints
namestringRequiredmin length 1; max length 100
daysintegerRequiredmin 0; max 365
isDefaultbooleanOptionaldefault false

Example request

curl -X POST "https://invoice.avscorp.in/api/v1/payment-terms" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Net 30",
  "days": 30
}'

Example response

JSON
{
  "id": "clxpt00000000000000000001",
  "organizationId": "clx0org000000000000000001",
  "name": "Net 30",
  "days": 30,
  "isDefault": true,
  "createdAt": "2026-01-01T00:00:00.000Z",
  "updatedAt": "2026-01-01T00:00:00.000Z"
}

Possible errors: unauthorized, insufficient_scope, forbidden, validation_error

GET/api/v1/payment-terms/{id}

Get a payment term

Scope: paymentTerms.read

Parameters

NameInTypeRequiredDescription
idpathstringRequiredPayment term ID.

Example request

curl "https://invoice.avscorp.in/api/v1/payment-terms/clxpt00000000000000000001" \
  -H "Authorization: Bearer YOUR_API_KEY"

Example response

JSON
{
  "id": "clxpt00000000000000000001",
  "organizationId": "clx0org000000000000000001",
  "name": "Net 30",
  "days": 30,
  "isDefault": true,
  "createdAt": "2026-01-01T00:00:00.000Z",
  "updatedAt": "2026-01-01T00:00:00.000Z"
}

Possible errors: unauthorized, insufficient_scope, forbidden, not_found

PATCH/api/v1/payment-terms/{id}

Update a payment term

Scope: paymentTerms.update

PATCH validates against the full payment term schema (same as create) — name and days are required in every update, not just changed fields.

Parameters

NameInTypeRequiredDescription
idpathstringRequiredPayment term ID.

Request body

FieldTypeRequiredConstraints
namestringRequiredmin length 1; max length 100
daysintegerRequiredmin 0; max 365
isDefaultbooleanOptionaldefault false

Example request

curl -X PATCH "https://invoice.avscorp.in/api/v1/payment-terms/clxpt00000000000000000001" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Net 45",
  "days": 45
}'

Example response

JSON
{
  "id": "clxpt00000000000000000001",
  "organizationId": "clx0org000000000000000001",
  "name": "Net 30",
  "days": 30,
  "isDefault": true,
  "createdAt": "2026-01-01T00:00:00.000Z",
  "updatedAt": "2026-01-01T00:00:00.000Z"
}

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

DELETE/api/v1/payment-terms/{id}

Delete a payment term

Scope: paymentTerms.delete

Parameters

NameInTypeRequiredDescription
idpathstringRequiredPayment term ID.

Example request

curl -X DELETE "https://invoice.avscorp.in/api/v1/payment-terms/clxpt00000000000000000001" \
  -H "Authorization: Bearer YOUR_API_KEY"

Example response

JSON
{
  "deleted": true
}

Possible errors: unauthorized, insufficient_scope, forbidden, not_found