Vendors
Vendor master records for purchase documents.
/api/v1/vendorsList vendors
vendors.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 across display name, GSTIN, phone, email. |
Example request
curl "https://pre-invoice.avscorp.in/api/v1/vendors" \
-H "Authorization: Bearer YOUR_API_KEY"Example response
{
"id": "clx2v1e2n3d4o5r6a7b8c9d0",
"organizationId": "clx0org000000000000000001",
"displayName": "Shree Fabrics Suppliers",
"legalName": "Shree Fabrics Suppliers LLP",
"email": "sales@shreefabrics.com",
"phone": "9123456780",
"gstin": "27AAECS5678D1Z2",
"pan": "AAECS5678D",
"currencyCode": "INR",
"paymentTermId": null,
"paymentTermsDays": 45,
"placeOfSupplyStateCode": "27",
"billingAddress": {
"line1": "Plot 22, MIDC Industrial Area",
"city": "Mumbai",
"state": "Maharashtra",
"stateCode": "27",
"pincode": "400093",
"country": "India"
},
"shippingAddress": null,
"openingBalance": 0,
"notes": null,
"isActive": true,
"vendorCode": "SFS",
"lastLotSequence": 128,
"msmeType": "SMALL",
"udyamNumber": "UDYAM-MH-19-0012345",
"msmeAgreedCreditDays": 45,
"createdBy": "clxusr0000000000000000001",
"updatedBy": "clxusr0000000000000000002",
"createdAt": "2026-06-15T07:30:00.000Z",
"updatedAt": "2026-09-01T13:05:00.000Z"
}Possible errors: unauthorized, insufficient_scope, forbidden
/api/v1/vendorsCreate a vendor
vendors.createRequest body
| Field | Type | Required | Constraints |
|---|---|---|---|
displayName | string | Required | min length 1; max length 191 |
vendorCode | any | Optional | — |
legalName | any | Optional | — |
email | any | Optional | — |
phone | any | Optional | — |
gstin | any | Optional | — |
pan | any | Optional | — |
currencyCode | string | Optional | min length 3; max length 3; default "INR" |
paymentTermsDays | integer | Optional | min 0; max 365; default 0 |
placeOfSupplyStateCode | any | Optional | — |
openingBalance | number | Optional | min 0; default 0 |
billingAddress | object | Optional | — |
line1 | string | Optional | max length 255 |
line2 | string | Optional | max length 255 |
city | string | Optional | max length 100 |
state | string | Optional | max length 100 |
stateCode | string | Optional | min length 2; max length 2 |
pincode | string | Optional | max length 10 |
country | string | Optional | max length 100 |
shippingAddress | object | Optional | — |
line1 | string | Optional | max length 255 |
line2 | string | Optional | max length 255 |
city | string | Optional | max length 100 |
state | string | Optional | max length 100 |
stateCode | string | Optional | min length 2; max length 2 |
pincode | string | Optional | max length 10 |
country | string | Optional | max length 100 |
notes | any | Optional | — |
leadTimeDays | any | Required | — |
msmeType | any | Required | — |
udyamNumber | any | Required | — |
msmeHasAgreement | boolean | Optional | — |
msmeAgreedCreditDays | any | Required | — |
Example request
curl -X POST "https://pre-invoice.avscorp.in/api/v1/vendors" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"displayName": "Shree Fabrics Suppliers",
"currencyCode": "INR",
"paymentTermsDays": 45
}'Example response
{
"id": "clx2v1e2n3d4o5r6a7b8c9d0",
"organizationId": "clx0org000000000000000001",
"displayName": "Shree Fabrics Suppliers",
"legalName": "Shree Fabrics Suppliers LLP",
"email": "sales@shreefabrics.com",
"phone": "9123456780",
"gstin": "27AAECS5678D1Z2",
"pan": "AAECS5678D",
"currencyCode": "INR",
"paymentTermId": null,
"paymentTermsDays": 45,
"placeOfSupplyStateCode": "27",
"billingAddress": {
"line1": "Plot 22, MIDC Industrial Area",
"city": "Mumbai",
"state": "Maharashtra",
"stateCode": "27",
"pincode": "400093",
"country": "India"
},
"shippingAddress": null,
"openingBalance": 0,
"notes": null,
"isActive": true,
"vendorCode": "SFS",
"lastLotSequence": 128,
"msmeType": "SMALL",
"udyamNumber": "UDYAM-MH-19-0012345",
"msmeAgreedCreditDays": 45,
"createdBy": "clxusr0000000000000000001",
"updatedBy": "clxusr0000000000000000002",
"createdAt": "2026-06-15T07:30:00.000Z",
"updatedAt": "2026-09-01T13:05:00.000Z"
}Possible errors: unauthorized, insufficient_scope, forbidden, validation_error
/api/v1/vendors/{id}Get a vendor
vendors.readParameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Required | Vendor ID. |
Example request
curl "https://pre-invoice.avscorp.in/api/v1/vendors/clx2v1e2n3d4o5r6a7b8c9d0" \
-H "Authorization: Bearer YOUR_API_KEY"Example response
{
"id": "clx2v1e2n3d4o5r6a7b8c9d0",
"organizationId": "clx0org000000000000000001",
"displayName": "Shree Fabrics Suppliers",
"legalName": "Shree Fabrics Suppliers LLP",
"email": "sales@shreefabrics.com",
"phone": "9123456780",
"gstin": "27AAECS5678D1Z2",
"pan": "AAECS5678D",
"currencyCode": "INR",
"paymentTermId": null,
"paymentTermsDays": 45,
"placeOfSupplyStateCode": "27",
"billingAddress": {
"line1": "Plot 22, MIDC Industrial Area",
"city": "Mumbai",
"state": "Maharashtra",
"stateCode": "27",
"pincode": "400093",
"country": "India"
},
"shippingAddress": null,
"openingBalance": 0,
"notes": null,
"isActive": true,
"vendorCode": "SFS",
"lastLotSequence": 128,
"msmeType": "SMALL",
"udyamNumber": "UDYAM-MH-19-0012345",
"msmeAgreedCreditDays": 45,
"createdBy": "clxusr0000000000000000001",
"updatedBy": "clxusr0000000000000000002",
"createdAt": "2026-06-15T07:30:00.000Z",
"updatedAt": "2026-09-01T13:05:00.000Z"
}Possible errors: unauthorized, insufficient_scope, forbidden, not_found
/api/v1/vendors/{id}Update a vendor
vendors.updatePATCH validates against the full vendor schema (same as create) — displayName is required in every update, not just changed fields. The MSME block (msmeType, udyamNumber, msmeAgreedCreditDays) is only written when the body names at least one of those fields, and is then replaced as a unit; send msmeType: null to clear it. msmeAgreedCreditDays null means no written agreement (15-day rule); the maximum is 45.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Required | Vendor ID. |
Request body
| Field | Type | Required | Constraints |
|---|---|---|---|
displayName | string | Required | min length 1; max length 191 |
vendorCode | any | Optional | — |
legalName | any | Optional | — |
email | any | Optional | — |
phone | any | Optional | — |
gstin | any | Optional | — |
pan | any | Optional | — |
currencyCode | string | Optional | min length 3; max length 3; default "INR" |
paymentTermsDays | integer | Optional | min 0; max 365; default 0 |
placeOfSupplyStateCode | any | Optional | — |
openingBalance | number | Optional | min 0; default 0 |
billingAddress | object | Optional | — |
line1 | string | Optional | max length 255 |
line2 | string | Optional | max length 255 |
city | string | Optional | max length 100 |
state | string | Optional | max length 100 |
stateCode | string | Optional | min length 2; max length 2 |
pincode | string | Optional | max length 10 |
country | string | Optional | max length 100 |
shippingAddress | object | Optional | — |
line1 | string | Optional | max length 255 |
line2 | string | Optional | max length 255 |
city | string | Optional | max length 100 |
state | string | Optional | max length 100 |
stateCode | string | Optional | min length 2; max length 2 |
pincode | string | Optional | max length 10 |
country | string | Optional | max length 100 |
notes | any | Optional | — |
leadTimeDays | any | Required | — |
msmeType | any | Required | — |
udyamNumber | any | Required | — |
msmeHasAgreement | boolean | Optional | — |
msmeAgreedCreditDays | any | Required | — |
Example request
curl -X PATCH "https://pre-invoice.avscorp.in/api/v1/vendors/clx2v1e2n3d4o5r6a7b8c9d0" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"displayName": "Shree Fabrics Suppliers",
"currencyCode": "INR",
"paymentTermsDays": 45,
"phone": "9000011111"
}'Example response
{
"id": "clx2v1e2n3d4o5r6a7b8c9d0",
"organizationId": "clx0org000000000000000001",
"displayName": "Shree Fabrics Suppliers",
"legalName": "Shree Fabrics Suppliers LLP",
"email": "sales@shreefabrics.com",
"phone": "9123456780",
"gstin": "27AAECS5678D1Z2",
"pan": "AAECS5678D",
"currencyCode": "INR",
"paymentTermId": null,
"paymentTermsDays": 45,
"placeOfSupplyStateCode": "27",
"billingAddress": {
"line1": "Plot 22, MIDC Industrial Area",
"city": "Mumbai",
"state": "Maharashtra",
"stateCode": "27",
"pincode": "400093",
"country": "India"
},
"shippingAddress": null,
"openingBalance": 0,
"notes": null,
"isActive": true,
"vendorCode": "SFS",
"lastLotSequence": 128,
"msmeType": "SMALL",
"udyamNumber": "UDYAM-MH-19-0012345",
"msmeAgreedCreditDays": 45,
"createdBy": "clxusr0000000000000000001",
"updatedBy": "clxusr0000000000000000002",
"createdAt": "2026-06-15T07:30:00.000Z",
"updatedAt": "2026-09-01T13:05:00.000Z"
}Possible errors: unauthorized, insufficient_scope, forbidden, not_found, validation_error
/api/v1/vendors/{id}Delete a vendor
vendors.deleteParameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Required | Vendor ID. |
Example request
curl -X DELETE "https://pre-invoice.avscorp.in/api/v1/vendors/clx2v1e2n3d4o5r6a7b8c9d0" \
-H "Authorization: Bearer YOUR_API_KEY"Example response
{
"deleted": true
}Possible errors: unauthorized, insufficient_scope, forbidden, not_found