Credit Notes
Customer credit notes against invoices. Uses the creditNotes.* scope (invoices.* tokens keep working).
GET
/api/v1/credit-notesList credit notes
Scope:
creditNotes.readParameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
page | query | number | Optional | 1-based page number. |
limit | query | number | Optional | Page size, max 200. |
q | query | string | Optional | Free-text search on credit note number or reason. |
Example request
curl "https://invoice.avscorp.in/api/v1/credit-notes" \
-H "Authorization: Bearer YOUR_API_KEY"Example response
JSON
{
"id": "clx9cn000000000000000001",
"organizationId": "clx0org000000000000000001",
"creditNoteNumber": "CN-00009",
"customerId": "clx1a2b3c4d5e6f7g8h9i0j1",
"invoiceId": "clxAinv0000000000000000001",
"status": "OPEN",
"creditNoteDate": "2026-09-05T00:00:00.000Z",
"sellerLegalName": "AVS Traders Pvt Ltd",
"sellerGstin": "29AAAAA0000A1Z5",
"sellerStateCode": "29",
"placeOfSupplyStateCode": "29",
"currencyCode": "INR",
"exchangeRate": 1,
"subTotal": 2000,
"discountTotal": 0,
"cgstTotal": 180,
"sgstTotal": 180,
"igstTotal": 0,
"roundOff": 0,
"total": 2360,
"allocatedAmount": 2360,
"balanceUnallocated": 0,
"reason": "Damaged goods returned",
"notes": null,
"termsAndConditions": null,
"warehouseId": "clx9wh0000000000000000001",
"createdBy": "clxusr0000000000000000001",
"updatedBy": null,
"createdAt": "2026-09-05T09:30:00.000Z",
"updatedAt": "2026-09-05T09:30:00.000Z"
}Possible errors: unauthorized, insufficient_scope, forbidden
GET
/api/v1/credit-notes/{id}Get a credit note
Scope:
creditNotes.readIncludes items, allocations (against invoices/cash), and inventory movements.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Required | Credit note ID. |
Example request
curl "https://invoice.avscorp.in/api/v1/credit-notes/clx9cn000000000000000001" \
-H "Authorization: Bearer YOUR_API_KEY"Example response
JSON
{
"id": "clx9cn000000000000000001",
"organizationId": "clx0org000000000000000001",
"creditNoteNumber": "CN-00009",
"customerId": "clx1a2b3c4d5e6f7g8h9i0j1",
"invoiceId": "clxAinv0000000000000000001",
"status": "OPEN",
"creditNoteDate": "2026-09-05T00:00:00.000Z",
"sellerLegalName": "AVS Traders Pvt Ltd",
"sellerGstin": "29AAAAA0000A1Z5",
"sellerStateCode": "29",
"placeOfSupplyStateCode": "29",
"currencyCode": "INR",
"exchangeRate": 1,
"subTotal": 2000,
"discountTotal": 0,
"cgstTotal": 180,
"sgstTotal": 180,
"igstTotal": 0,
"roundOff": 0,
"total": 2360,
"allocatedAmount": 2360,
"balanceUnallocated": 0,
"reason": "Damaged goods returned",
"notes": null,
"termsAndConditions": null,
"warehouseId": "clx9wh0000000000000000001",
"createdBy": "clxusr0000000000000000001",
"updatedBy": null,
"createdAt": "2026-09-05T09:30:00.000Z",
"updatedAt": "2026-09-05T09:30:00.000Z",
"items": [
{
"id": "clx9cni00000000000000001",
"organizationId": "clx0org000000000000000001",
"creditNoteId": "clx9cn000000000000000001",
"itemId": "clx3itm000000000000000001",
"itemVariantId": "clx7var000000000000000002",
"originalInvoiceItemId": "clxAinvi000000000000000001",
"description": "Vinyl Banner Print - Standard",
"hsnOrSac": "4911",
"quantity": 4,
"unit": "PCS",
"rate": 500,
"discount": 0,
"taxRatePercent": 18,
"taxableAmount": 2000,
"cgstAmount": 180,
"sgstAmount": 180,
"igstAmount": 0,
"total": 2360,
"restock": true,
"sortOrder": 0,
"width": null,
"height": null,
"lengthUnit": null,
"qtyCount": null
}
],
"allocations": [
{
"id": "clx9cna00000000000000001",
"organizationId": "clx0org000000000000000001",
"creditNoteId": "clx9cn000000000000000001",
"invoiceId": "clxAinv0000000000000000001",
"amount": 2360,
"allocatedAt": "2026-09-05T09:30:00.000Z",
"createdBy": "clxusr0000000000000000001"
}
],
"movements": [
{
"id": "clx9sm000000000000000001",
"organizationId": "clx0org000000000000000001",
"itemVariantId": "clx7var000000000000000002",
"warehouseId": "clx9wh0000000000000000001",
"movementType": "SALES_RETURN_IN",
"quantity": 4,
"unitCost": 250.5,
"totalCost": 1002,
"balanceAfter": 54,
"avgCostAfter": 250.5,
"sourceDocType": "CREDIT_NOTE",
"sourceDocId": "clx9cn000000000000000001",
"sourceDocLineId": "clx9cni00000000000000001",
"lotId": null,
"notes": null,
"createdBy": "clxusr0000000000000000001",
"createdAt": "2026-09-05T09:30:00.000Z"
}
]
}Possible errors: unauthorized, insufficient_scope, forbidden, not_found
POST
/api/v1/credit-notesCreate a credit note
Scope:
creditNotes.createSupports Idempotency-KeyNeeds the `creditNotes.create` permission. Accepts an optional Idempotency-Key header. Returns only { id, total }.
Request body
| Field | Type | Required | Constraints |
|---|---|---|---|
customerId | string | Required | min length 1 |
sellerRegistrationId | any | Optional | — |
invoiceId | any | Optional | — |
creditNoteDate | string | Required | — |
placeOfSupplyStateCode | any | Optional | — |
currencyCode | string | Optional | min length 3; max length 3; default "INR" |
exchangeRate | number | Optional | default 1 |
reason | any | Optional | — |
notes | any | Optional | — |
termsAndConditions | any | Optional | — |
warehouseId | any | Optional | — |
status | string | Optional | one of: DRAFT, OPEN; default "DRAFT" |
autoAllocateToInvoice | boolean | Optional | default true |
lines | array | Required | — |
Example request
curl -X POST "https://invoice.avscorp.in/api/v1/credit-notes" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"customerId": "clx1cus000000000000000001",
"creditNoteDate": "2026-10-29",
"lines": [
{
"description": "Cotton shirt",
"quantity": 2,
"rate": 450,
"taxRatePercent": 5
}
]
}'Example response
JSON
{
"id": "clx9cn000000000000000001",
"total": 945
}Possible errors: unauthorized, insufficient_scope, forbidden, validation_error, conflict