Vendors

Vendor master records for purchase documents.

GET/api/v1/vendors

List vendors

Scope: vendors.read

Parameters

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

Example request

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

Example response

JSON
{
  "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

POST/api/v1/vendors

Create a vendor

Scope: vendors.create

Request body

FieldTypeRequiredConstraints
displayNamestringRequiredmin length 1; max length 191
vendorCodeanyOptional—
legalNameanyOptional—
emailanyOptional—
phoneanyOptional—
gstinanyOptional—
pananyOptional—
currencyCodestringOptionalmin length 3; max length 3; default "INR"
paymentTermsDaysintegerOptionalmin 0; max 365; default 0
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—
leadTimeDaysanyRequired—
msmeTypeanyRequired—
udyamNumberanyRequired—
msmeHasAgreementbooleanOptional—
msmeAgreedCreditDaysanyRequired—

Example request

curl -X POST "https://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

JSON
{
  "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

GET/api/v1/vendors/{id}

Get a vendor

Scope: vendors.read

Parameters

NameInTypeRequiredDescription
idpathstringRequiredVendor ID.

Example request

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

Example response

JSON
{
  "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

PATCH/api/v1/vendors/{id}

Update a vendor

Scope: vendors.update

PATCH 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

NameInTypeRequiredDescription
idpathstringRequiredVendor ID.

Request body

FieldTypeRequiredConstraints
displayNamestringRequiredmin length 1; max length 191
vendorCodeanyOptional—
legalNameanyOptional—
emailanyOptional—
phoneanyOptional—
gstinanyOptional—
pananyOptional—
currencyCodestringOptionalmin length 3; max length 3; default "INR"
paymentTermsDaysintegerOptionalmin 0; max 365; default 0
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—
leadTimeDaysanyRequired—
msmeTypeanyRequired—
udyamNumberanyRequired—
msmeHasAgreementbooleanOptional—
msmeAgreedCreditDaysanyRequired—

Example request

curl -X PATCH "https://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

JSON
{
  "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

DELETE/api/v1/vendors/{id}

Delete a vendor

Scope: vendors.delete

Parameters

NameInTypeRequiredDescription
idpathstringRequiredVendor ID.

Example request

curl -X DELETE "https://invoice.avscorp.in/api/v1/vendors/clx2v1e2n3d4o5r6a7b8c9d0" \
  -H "Authorization: Bearer YOUR_API_KEY"

Example response

JSON
{
  "deleted": true
}

Possible errors: unauthorized, insufficient_scope, forbidden, not_found