Customers

Customer master records for sales documents.

GET/api/v1/customers

List customers

Scope: customers.read

Parameters

NameInTypeRequiredDescription
pagequerynumberOptional1-based page number.
limitquerynumberOptionalPage size, max 200.
qquerystringOptionalFree-text search across display name, GSTIN, phone, email.

Example request

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

Example response

JSON
{
  "id": "clx1a2b3c4d5e6f7g8h9i0j1",
  "organizationId": "clx0org000000000000000001",
  "displayName": "Bansal Textiles Pvt Ltd",
  "legalName": "Bansal Textiles Private Limited",
  "email": "accounts@bansaltextiles.in",
  "phone": "9876543210",
  "gstin": "07AAACB1234C1Z5",
  "pan": "AAACB1234C",
  "currencyCode": "INR",
  "paymentTermId": "clxpt00000000000000000001",
  "paymentTermsDays": 30,
  "placeOfSupplyStateCode": "07",
  "billingAddress": {
    "line1": "12 Nehru Market",
    "line2": "Chandni Chowk",
    "city": "New Delhi",
    "state": "Delhi",
    "stateCode": "07",
    "pincode": "110006",
    "country": "India"
  },
  "shippingAddress": null,
  "openingBalance": 15000.5,
  "notes": "Prefers e-invoices before the 5th of every month.",
  "isActive": true,
  "tenantOrgId": null,
  "portalEnabled": false,
  "portalEnabledAt": null,
  "createdBy": "clxusr0000000000000000001",
  "updatedBy": "clxusr0000000000000000001",
  "createdAt": "2026-08-01T09:15:00.000Z",
  "updatedAt": "2026-08-20T11:42:00.000Z"
}

Possible errors: unauthorized, insufficient_scope, forbidden

POST/api/v1/customers

Create a customer

Scope: customers.create

Request body

FieldTypeRequiredConstraints
displayNamestringRequiredmin length 1; max length 191
legalNameanyOptional—
emailanyOptional—
phoneanyOptional—
gstinanyOptional—
pananyOptional—
currencyCodestringOptionalmin length 3; max length 3; default "INR"
paymentTermIdanyOptional—
priceListIdanyOptional—
salespersonIdstringOptionalmax length 30
placeOfSupplyStateCodeanyOptional—
openingBalancenumberOptionalmin 0; default 0
billingAddressobjectOptional—
line1stringOptionalmax length 255
line2stringOptionalmax length 255
citystringOptionalmax length 100
statestringOptionalmax length 100
stateCodestringOptionalmin length 2; max length 2
pincodestringOptionalmax length 10
countrystringOptionalmax length 100
shippingAddressobjectOptional—
line1stringOptionalmax length 255
line2stringOptionalmax length 255
citystringOptionalmax length 100
statestringOptionalmax length 100
stateCodestringOptionalmin length 2; max length 2
pincodestringOptionalmax length 10
countrystringOptionalmax length 100
notesanyOptional—

Example request

curl -X POST "https://pre-invoice.avscorp.in/api/v1/customers" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "displayName": "Bansal Textiles Pvt Ltd",
  "email": "accounts@bansaltextiles.in",
  "gstin": "07AAACB1234C1Z5",
  "currencyCode": "INR"
}'

Example response

JSON
{
  "id": "clx1a2b3c4d5e6f7g8h9i0j1",
  "organizationId": "clx0org000000000000000001",
  "displayName": "Bansal Textiles Pvt Ltd",
  "legalName": "Bansal Textiles Private Limited",
  "email": "accounts@bansaltextiles.in",
  "phone": "9876543210",
  "gstin": "07AAACB1234C1Z5",
  "pan": "AAACB1234C",
  "currencyCode": "INR",
  "paymentTermId": "clxpt00000000000000000001",
  "paymentTermsDays": 30,
  "placeOfSupplyStateCode": "07",
  "billingAddress": {
    "line1": "12 Nehru Market",
    "line2": "Chandni Chowk",
    "city": "New Delhi",
    "state": "Delhi",
    "stateCode": "07",
    "pincode": "110006",
    "country": "India"
  },
  "shippingAddress": null,
  "openingBalance": 15000.5,
  "notes": "Prefers e-invoices before the 5th of every month.",
  "isActive": true,
  "tenantOrgId": null,
  "portalEnabled": false,
  "portalEnabledAt": null,
  "createdBy": "clxusr0000000000000000001",
  "updatedBy": "clxusr0000000000000000001",
  "createdAt": "2026-08-01T09:15:00.000Z",
  "updatedAt": "2026-08-20T11:42:00.000Z"
}

Possible errors: unauthorized, insufficient_scope, forbidden, validation_error

GET/api/v1/customers/{id}

Get a customer

Scope: customers.read

Parameters

NameInTypeRequiredDescription
idpathstringRequiredCustomer ID.

Example request

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

Example response

JSON
{
  "id": "clx1a2b3c4d5e6f7g8h9i0j1",
  "organizationId": "clx0org000000000000000001",
  "displayName": "Bansal Textiles Pvt Ltd",
  "legalName": "Bansal Textiles Private Limited",
  "email": "accounts@bansaltextiles.in",
  "phone": "9876543210",
  "gstin": "07AAACB1234C1Z5",
  "pan": "AAACB1234C",
  "currencyCode": "INR",
  "paymentTermId": "clxpt00000000000000000001",
  "paymentTermsDays": 30,
  "placeOfSupplyStateCode": "07",
  "billingAddress": {
    "line1": "12 Nehru Market",
    "line2": "Chandni Chowk",
    "city": "New Delhi",
    "state": "Delhi",
    "stateCode": "07",
    "pincode": "110006",
    "country": "India"
  },
  "shippingAddress": null,
  "openingBalance": 15000.5,
  "notes": "Prefers e-invoices before the 5th of every month.",
  "isActive": true,
  "tenantOrgId": null,
  "portalEnabled": false,
  "portalEnabledAt": null,
  "createdBy": "clxusr0000000000000000001",
  "updatedBy": "clxusr0000000000000000001",
  "createdAt": "2026-08-01T09:15:00.000Z",
  "updatedAt": "2026-08-20T11:42:00.000Z"
}

Possible errors: unauthorized, insufficient_scope, forbidden, not_found

PATCH/api/v1/customers/{id}

Update a customer

Scope: customers.update

PATCH validates against the full customer schema (same as create) — displayName is required in every update, not just changed fields.

Parameters

NameInTypeRequiredDescription
idpathstringRequiredCustomer ID.

Request body

FieldTypeRequiredConstraints
displayNamestringRequiredmin length 1; max length 191
legalNameanyOptional—
emailanyOptional—
phoneanyOptional—
gstinanyOptional—
pananyOptional—
currencyCodestringOptionalmin length 3; max length 3; default "INR"
paymentTermIdanyOptional—
priceListIdanyOptional—
salespersonIdstringOptionalmax length 30
placeOfSupplyStateCodeanyOptional—
openingBalancenumberOptionalmin 0; default 0
billingAddressobjectOptional—
line1stringOptionalmax length 255
line2stringOptionalmax length 255
citystringOptionalmax length 100
statestringOptionalmax length 100
stateCodestringOptionalmin length 2; max length 2
pincodestringOptionalmax length 10
countrystringOptionalmax length 100
shippingAddressobjectOptional—
line1stringOptionalmax length 255
line2stringOptionalmax length 255
citystringOptionalmax length 100
statestringOptionalmax length 100
stateCodestringOptionalmin length 2; max length 2
pincodestringOptionalmax length 10
countrystringOptionalmax length 100
notesanyOptional—

Example request

curl -X PATCH "https://pre-invoice.avscorp.in/api/v1/customers/clx1a2b3c4d5e6f7g8h9i0j1" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "displayName": "Bansal Textiles Pvt Ltd",
  "email": "accounts@bansaltextiles.in",
  "gstin": "07AAACB1234C1Z5",
  "currencyCode": "INR",
  "phone": "9000011111"
}'

Example response

JSON
{
  "id": "clx1a2b3c4d5e6f7g8h9i0j1",
  "organizationId": "clx0org000000000000000001",
  "displayName": "Bansal Textiles Pvt Ltd",
  "legalName": "Bansal Textiles Private Limited",
  "email": "accounts@bansaltextiles.in",
  "phone": "9876543210",
  "gstin": "07AAACB1234C1Z5",
  "pan": "AAACB1234C",
  "currencyCode": "INR",
  "paymentTermId": "clxpt00000000000000000001",
  "paymentTermsDays": 30,
  "placeOfSupplyStateCode": "07",
  "billingAddress": {
    "line1": "12 Nehru Market",
    "line2": "Chandni Chowk",
    "city": "New Delhi",
    "state": "Delhi",
    "stateCode": "07",
    "pincode": "110006",
    "country": "India"
  },
  "shippingAddress": null,
  "openingBalance": 15000.5,
  "notes": "Prefers e-invoices before the 5th of every month.",
  "isActive": true,
  "tenantOrgId": null,
  "portalEnabled": false,
  "portalEnabledAt": null,
  "createdBy": "clxusr0000000000000000001",
  "updatedBy": "clxusr0000000000000000001",
  "createdAt": "2026-08-01T09:15:00.000Z",
  "updatedAt": "2026-08-20T11:42:00.000Z"
}

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

DELETE/api/v1/customers/{id}

Delete a customer

Scope: customers.delete

Parameters

NameInTypeRequiredDescription
idpathstringRequiredCustomer ID.

Example request

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

Example response

JSON
{
  "deleted": true
}

Possible errors: unauthorized, insufficient_scope, forbidden, not_found

GET/api/v1/customers/{id}/summary

Get a customer's summary figures

Scope: customers.read

The figures on the customer page: issued-invoice total and count, payments received, balance due, overdue amount (open invoices whose due date, or invoice date when there is none, is before today, IST), opening balance, open credit notes (up to 5) with the credit balance, unapplied payments (up to 100 listed, newest first; the total covers all), and whether the caller may send a statement (needs collections.send). Dates are YYYY-MM-DD. Credit figures are zero unless both the token and the member's role allow creditNotes.read.

Parameters

NameInTypeRequiredDescription
idpathstringRequiredCustomer ID.

Example request

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

Example response

JSON
{
  "totalInvoiced": 125000,
  "invoiceCount": 9,
  "amountReceived": 80000,
  "paymentCount": 4,
  "balanceDue": 45000,
  "overdueAmount": 30000,
  "openingBalance": 0,
  "creditBalance": 1200,
  "openCreditNotes": [
    {
      "id": "clx2…",
      "number": "CN-0007",
      "date": "2026-11-10",
      "unallocated": 1200
    }
  ],
  "unappliedPayments": {
    "total": 500,
    "items": [
      {
        "id": "clx3…",
        "number": "CR-00012",
        "date": "2026-11-15",
        "unapplied": 500
      }
    ]
  },
  "canSendStatement": true
}

Possible errors: unauthorized, insufficient_scope, forbidden, not_found

GET/api/v1/customers/{id}/ledger-pdf

Render the customer ledger statement as a PDF

Scope: customers.read

Bearer-token counterpart to the session-authed web ledger PDF — same builder, so the two are always in sync.

Parameters

NameInTypeRequiredDescription
idpathstringRequiredCustomer ID.
fromquerystringOptionalStatement start date, YYYY-MM-DD. Omit for no lower bound.
toquerystringOptionalStatement end date, YYYY-MM-DD. Omit for no upper bound.

Example request

curl "https://pre-invoice.avscorp.in/api/v1/customers/clx1a2b3c4d5e6f7g8h9i0j1/ledger-pdf" \
  -H "Authorization: Bearer YOUR_API_KEY"

Example response

Binary response — application/pdf. The ledger statement as a PDF, streamed inline with a Content-Disposition filename.

Possible errors: unauthorized, insufficient_scope, forbidden, not_found

POST/api/v1/customers/{id}/statement/preview

Preview a customer statement

Scope: collections.send

Figures, recipients and the WhatsApp text the Send statement dialog shows, without sending anything. The customer comes from the path; a customerId in the body is ignored. period is THIS_FY, LAST_3_MONTHS, OPEN_ITEMS or CUSTOM (CUSTOM needs from and to, YYYY-MM-DD, from on or before to). Money fields are formatted strings.

Parameters

NameInTypeRequiredDescription
idpathstringRequiredCustomer ID.

Request body

FieldTypeRequiredConstraints
periodobjectRequired—
periodstringRequiredone of: THIS_FY, LAST_3_MONTHS, CUSTOM, OPEN_ITEMS
fromanyOptional—
toanyOptional—
includePayLinkbooleanRequired—

Example request

curl -X POST "https://pre-invoice.avscorp.in/api/v1/customers/clx1a2b3c4d5e6f7g8h9i0j1/statement/preview" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "period": {
    "period": "THIS_FY"
  },
  "includePayLink": true
}'

Example response

JSON
{
  "ok": true,
  "preview": {
    "customerName": "Ravi Hardware",
    "periodLabel": "1 Apr 2026 to 5 Oct 2026",
    "closingBalance": "₹5,700.00",
    "overdueAmount": "₹2,000.00",
    "recipients": {
      "phones": [
        {
          "value": "+919800000001",
          "label": "Ravi Hardware",
          "primary": true
        }
      ],
      "emails": [
        {
          "value": "ravi@example.test",
          "label": "Ravi Hardware",
          "primary": true
        }
      ]
    },
    "payLink": {
      "available": false,
      "reason": "Razorpay isn't connected"
    },
    "whatsapp": {
      "blockedReason": null,
      "text": "Hello Ravi Hardware, ..."
    }
  }
}

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

POST/api/v1/customers/{id}/statement/send

Send a customer statement

Scope: collections.send

Sends the statement link (and pay link when included and available) by WhatsApp and/or email to the chosen recipients, who must be the customer's own numbers or addresses. The customer comes from the path; a customerId in the body is ignored. The response lists each recipient's own result, so some can fail while others succeed.

Parameters

NameInTypeRequiredDescription
idpathstringRequiredCustomer ID.

Request body

FieldTypeRequiredConstraints
periodobjectRequired—
periodstringRequiredone of: THIS_FY, LAST_3_MONTHS, CUSTOM, OPEN_ITEMS
fromanyOptional—
toanyOptional—
includePayLinkbooleanRequired—
channelsobjectRequired—
whatsappbooleanRequired—
emailbooleanRequired—
phonesarrayRequired—
emailsarrayRequired—

Example request

curl -X POST "https://pre-invoice.avscorp.in/api/v1/customers/clx1a2b3c4d5e6f7g8h9i0j1/statement/send" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "period": {
    "period": "THIS_FY"
  },
  "includePayLink": true,
  "channels": {
    "whatsapp": true,
    "email": true
  },
  "phones": [
    "+919800000001"
  ],
  "emails": [
    "ravi@example.test"
  ]
}'

Example response

JSON
{
  "ok": true,
  "result": {
    "whatsapp": [
      {
        "to": "+919800000001",
        "ok": true
      }
    ],
    "email": [
      {
        "to": "ravi@example.test",
        "ok": false,
        "error": "Mailbox full"
      }
    ],
    "payLinkIncluded": false,
    "payLinkReason": "Razorpay isn't connected",
    "statementUrl": "https://example.com/statement/token",
    "closingBalance": 5700,
    "overdueAmount": 2000
  }
}

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

POST/api/v1/customers/{id}/ledger/email

Email the customer ledger

Scope: customers.read

Emails the ledger statement PDF (Ledger_<name>.pdf) to the customer's email address, on the organization's own SMTP when it has one, else the platform account. from and to (YYYY-MM-DD, both optional) bound the statement. A send that can't happen (no email address, mail not configured, the mail server refused) is a 400 with the reason.

Parameters

NameInTypeRequiredDescription
idpathstringRequiredCustomer ID.

Request body

FieldTypeRequiredConstraints
fromstringOptional—
tostringOptional—

Example request

curl -X POST "https://pre-invoice.avscorp.in/api/v1/customers/clx1a2b3c4d5e6f7g8h9i0j1/ledger/email" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "from": "2026-04-01",
  "to": "2026-11-21"
}'

Example response

JSON
{
  "sent": true
}

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

POST/api/v1/customers/{id}/ledger/whatsapp

Send the customer ledger on WhatsApp

Scope: customers.read

Sends the ledger statement PDF on WhatsApp with the CUSTOMER_LEDGER template and the total outstanding in the message. Needs WhatsApp set up and an approved template for that event. from and to (YYYY-MM-DD, both optional) bound the statement. A send that can't happen (no phone number, no template) is a 400 with the reason.

Parameters

NameInTypeRequiredDescription
idpathstringRequiredCustomer ID.

Request body

FieldTypeRequiredConstraints
fromstringOptional—
tostringOptional—

Example request

curl -X POST "https://pre-invoice.avscorp.in/api/v1/customers/clx1a2b3c4d5e6f7g8h9i0j1/ledger/whatsapp" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "from": "2026-04-01",
  "to": "2026-11-21"
}'

Example response

JSON
{
  "sent": true
}

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

GET/api/v1/customers/{id}/balance-sheet

Get a customer's balance sheet

Scope: customers.read

The customer's unpaid and partly paid invoices, split by the company (seller GST registration) that billed them, with pending and overdue totals: the figures on the customer page's Balance sheet tab. status is Unpaid or Partially paid; totalDays counts calendar days since the invoice date; overdue means past its due date. Dates are YYYY-MM-DD (IST). Nothing pending returns an empty groups list.

Parameters

NameInTypeRequiredDescription
idpathstringRequiredCustomer ID.
fromquerystringOptionalOnly invoices dated on or after this day, YYYY-MM-DD.
toquerystringOptionalOnly invoices dated on or before this day, YYYY-MM-DD. Must not be before from.

Example request

curl "https://pre-invoice.avscorp.in/api/v1/customers/clx1a2b3c4d5e6f7g8h9i0j1/balance-sheet" \
  -H "Authorization: Bearer YOUR_API_KEY"

Example response

JSON
{
  "groups": [
    {
      "registrationId": "clxreg000000000000000001",
      "name": "Bansal Textiles Pvt Ltd",
      "pending": 5000,
      "overdue": 2000,
      "invoices": [
        {
          "id": "clxinv000000000000000001",
          "invoiceNumber": "INV-0042",
          "invoiceDate": "2026-08-01",
          "dueDate": "2026-09-01",
          "status": "Partially paid",
          "total": 5000,
          "paid": 3000,
          "balanceDue": 2000,
          "totalDays": 65,
          "overdue": true
        },
        {
          "id": "clxinv000000000000000002",
          "invoiceNumber": "INV-0051",
          "invoiceDate": "2026-09-20",
          "dueDate": "2026-10-20",
          "status": "Unpaid",
          "total": 3000,
          "paid": 0,
          "balanceDue": 3000,
          "totalDays": 15,
          "overdue": false
        }
      ]
    }
  ],
  "totalPending": 5000,
  "totalOverdue": 2000
}

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

GET/api/v1/customers/{id}/balance-sheet-pdf

Render the customer balance sheet as a PDF

Scope: customers.read

Bearer-token counterpart to the web balance sheet PDF, same loader and renderer. 404 with "This customer has no unpaid or partly paid invoices" when nothing is pending.

Parameters

NameInTypeRequiredDescription
idpathstringRequiredCustomer ID.
fromquerystringOptionalOnly invoices dated on or after this day, YYYY-MM-DD.
toquerystringOptionalOnly invoices dated on or before this day, YYYY-MM-DD. Must not be before from.

Example request

curl "https://pre-invoice.avscorp.in/api/v1/customers/clx1a2b3c4d5e6f7g8h9i0j1/balance-sheet-pdf" \
  -H "Authorization: Bearer YOUR_API_KEY"

Example response

Binary response — application/pdf. The balance sheet as a PDF, streamed inline with a Content-Disposition filename.

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

POST/api/v1/customers/{id}/balance-sheet/whatsapp

Send the customer balance sheet on WhatsApp

Scope: customers.read

Sends the balance sheet PDF on WhatsApp with the BALANCE_SHEET template, the invoice count and the total pending. Needs the WhatsApp feature on the plan and an approved template for that event. from and to (YYYY-MM-DD, both optional) narrow it to invoices dated in that window. A send that can't happen (nothing pending, no phone number, no template) is a 400 with the reason.

Parameters

NameInTypeRequiredDescription
idpathstringRequiredCustomer ID.

Request body

FieldTypeRequiredConstraints
fromstringOptional—
tostringOptional—

Example request

curl -X POST "https://pre-invoice.avscorp.in/api/v1/customers/clx1a2b3c4d5e6f7g8h9i0j1/balance-sheet/whatsapp" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'

Example response

JSON
{
  "sent": true
}

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

POST/api/v1/customers/{id}/adjustments

Add a customer adjustment

Scope: customers.create

Adds a debit (the customer owes more) or credit (owes less) adjustment to the customer's ledger, numbered from the DEBIT_ADJUSTMENT or CREDIT_ADJUSTMENT series. adjustmentDate is YYYY-MM-DD; amount must be greater than 0; description is 1-500 characters. The customer comes from the path. Same rules as the web customer page.

Parameters

NameInTypeRequiredDescription
idpathstringRequiredCustomer ID.

Request body

FieldTypeRequiredConstraints
adjustmentDatestringRequired—
directionstringRequiredone of: DEBIT, CREDIT
amountnumberRequired—
descriptionstringRequiredmin length 1; max length 500

Example request

curl -X POST "https://pre-invoice.avscorp.in/api/v1/customers/clx1a2b3c4d5e6f7g8h9i0j1/adjustments" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "adjustmentDate": "2026-11-21",
  "direction": "DEBIT",
  "amount": 450,
  "description": "Courier charges"
}'

Example response

JSON
{
  "id": "clx2adj001000000000000001",
  "adjustmentNumber": "DADJ-00003"
}

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

PATCH/api/v1/customer-adjustments/{adjId}

Edit a customer adjustment

Scope: customers.update

Changes an adjustment's date, amount or description. Takes the create body with every field optional; missing fields keep their stored value. The direction can't change, and an adjustment with payment allocations can't be edited: both are a 409 with the reason. An adjustment whose customer is outside your scope is a 404.

Parameters

NameInTypeRequiredDescription
adjIdpathstringRequiredCustomer adjustment ID.

Request body

FieldTypeRequiredConstraints
adjustmentDatestringOptional—
directionstringOptionalone of: DEBIT, CREDIT
amountnumberOptional—
descriptionstringOptionalmin length 1; max length 500

Example request

curl -X PATCH "https://pre-invoice.avscorp.in/api/v1/customer-adjustments/clx2adj001000000000000001" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "amount": 500,
  "description": "Courier charges (revised)"
}'

Example response

JSON
{
  "id": "clx2adj001000000000000001",
  "adjustmentNumber": "DADJ-00003"
}

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

DELETE/api/v1/customer-adjustments/{adjId}

Delete a customer adjustment

Scope: customers.update

Deletes an adjustment and releases its number. An adjustment with payment allocations can't be deleted (409 with the reason). An adjustment whose customer is outside your scope is a 404.

Parameters

NameInTypeRequiredDescription
adjIdpathstringRequiredCustomer adjustment ID.

Example request

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

Example response

JSON
{
  "deleted": true
}

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