Skip to main content
Vendor Creation API
curl --request POST \
  --url https://api.pazy.io/v1.0/vendor

Authentication

All requests require an API key in the request headers. Headers:
Authorization: Api-Key YOUR_API_KEY
Content-Type: application/json

Request

Content-Type: application/json

Body Parameters

ParameterTypeRequiredDescription
namestringYesVendor name (1-255 characters)
emailstringNoVendor email address (must be valid email format)
phonestringNoVendor phone number (must include country code, e.g., +919876543210)
localitystringNoVendor locality type. Valid values: DOMESTIC, INTERNATIONAL. Defaults to DOMESTIC if not provided
paymentTermsstringNoPayment terms for the vendor. See accepted values below
gstNumberstringNoGST number for the vendor
panNumberstringNoPAN number for the vendor
addressobjectNoVendor address details (see Address Object below)

Address Object

If you provide a valid and verified gstNumber, the address will be automatically extracted from GST data. However, if you also provide an address object, the user-provided address will always take precedence over the GST-derived one. When providing an address, the following fields are available:
ParameterTypeRequiredDescription
addressLine1stringYesPrimary address line
addressLine2stringNoSecondary address line
citystringNoCity name
statestringYesState Name (below is the list of valid values)
zipCodestringYesZIP or postal code
countrystringNoCountry name
*Required only if address object is provided

State Values

The state field should use uppercase underscore-separated codes (e.g., UTTAR_PRADESH, MAHARASHTRA, etc.). Below is the complete list of supported State and Union Territory values:
State / UT NameValue
Andhra PradeshANDHRA_PRADESH
Arunachal PradeshARUNACHAL_PRADESH
AssamASSAM
BiharBIHAR
ChhattisgarhCHHATTISGARTH
GoaGOA
GujaratGUJARAT
HaryanaHARYANA
Himachal PradeshHIMACHAL_PRADESH
JharkhandJHARKHAND
KarnatakaKARNATAKA
KeralaKERALA
Madhya PradeshMADHYA_PRADESH
MaharashtraMAHARASHTRA
ManipurMANIPUR
MeghalayaMEGHALAYA
MizoramMIZORAM
NagalandNAGALAND
OdishaODISHA
PunjabPUNJAB
RajasthanRAJASTHAN
SikkimSIKKIM
Tamil NaduTAMIL_NADU
TelanganaTELANGANA
TripuraTRIPURA
Uttar PradeshUTTAR_PRADESH
UttarakhandUTTARAKHAND
West BengalWEST_BENGAL
Andaman and Nicobar IslandsANDAMAN_AND_NICOBAR_ISLANDS
ChandigarhCHANDIGARH
Dadra and Nagar Haveli and Daman and DiuDADRA_AND_NAGAR_HAVELI_AND_DAMAN_AND_DIU
LakshadweepLAKSHADWEEP
DelhiDELHI
PuducherryPUDUCHERRY
Jammu and KashmirJAMMU_AND_KASHMIR
LadakhLADAKH

Payment Terms Values

Payment terms defaults to organization’s default if not provided. The paymentTerms field accepts the following values:
  • due_eom
  • due_on_receipt
  • net_7
  • net_15
  • net_30
  • net_45
  • net_60
  • net_90
  • net_120
  • net_150
  • net_180
  • none

Code Examples

curl -X POST https://api.pazy.io/v1.0/vendor \
  -H "Authorization: Api-Key YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "ABC Suppliers",
    "email": "[email protected]",
    "phone": "+919876543210",
    "locality": "DOMESTIC",
    "paymentTerms": "net_30",
    "gstNumber": "29ABCDE1234F1Z5",
    "panNumber": "ABCDE1234F",
    "address": {
      "addressLine1": "123 Business Park",
      "addressLine2": "Near Tech Hub",
      "city": "Mumbai",
      "state": "MAHARASHTRA",
      "zipCode": "400001",
      "country": "India"
    }
  }'

Success Response

HTTP Status: 200 OK Response Fields:
FieldTypeDescription
okbooleanIndicates whether the request was successful
dataobjectContains the created vendor details
data.vendorIdstringUnique vendor ID
data.vendorStatestringCreated Vendor State

VendorStatus Values

  • ACTIVE: The vendor is created and is in active state
  • APPROVAL_PENDING: The vendor is yet to be approved by the organization’s vendor admins

Response Example

{
  "ok": true,
  "data": {
    "vendorId": "vaz0eCPVFvCU2X1gW2Z",
    "vendorState": "ACTIVE"
  }
}

Error Responses

Missing Required Fields

HTTP Status: 400 Bad Request
{
  "ok": false,
  "error": {
    "code": "MISSING_REQUIRED_FIELD",
    "message": "Name is required"
  }
}

Invalid Email Format

HTTP Status: 400 Bad Request
{
  "ok": false,
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Validation failed: /body/email: must match format \"email\""
  }
}

Invalid Locality

HTTP Status: 400 Bad Request
{
  "ok": false,
  "error": {
    "code": "INVALID_LOCALITY",
    "message": "Invalid locality. Must be DOMESTIC or INTERNATIONAL"
  }
}

Invalid Payment Terms

HTTP Status: 400 Bad Request
{
  "ok": false,
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Invalid payment terms value"
  }
}

Address Validation Errors

HTTP Status: 400 Bad Request
{
  "ok": false,
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Address validation failed: addressLine1, state, and zipCode are required when address is provided"
  }
}
HTTP Status: 400 Bad Request
{
    "ok": false,
    "error": {
        "code": "INVALID_ADDRESS",
        "message": "Invalid zipCode format"
    }
}
HTTP Status: 400 Bad Request
{
    "ok": false,
    "error": {
        "code": "INVALID_ADDRESS",
        "message": "Invalid state value"
    }
}

Duplicate Vendor Errors

HTTP Status: 400 Bad Request Duplicate Phone Number:
{
  "ok": false,
  "error": {
    "code": "DUPLICATE_PHONE_NUMBER",
    "message": "Vendor with same phone number already exists"
  }
}
Duplicate Email:
{
  "ok": false,
  "error": {
    "code": "DUPLICATE_EMAIL",
    "message": "Vendor with same email already exists"
  }
}
Duplicate Vendor Name:
{
  "ok": false,
  "error": {
    "code": "DUPLICATE_VENDOR_NAME",
    "message": "Vendor with same name already exists"
  }
}

Authentication Errors

HTTP Status: 401 Unauthorized
{
  "ok": false,
  "error": {
    "code": "MISSING_CREDENTIALS",
    "message": "Missing Credentials"
  }
}
{
  "ok": false,
  "error": {
    "code": "INVALID_API_KEY",
    "message": "Invalid API Key"
  }
}

Permission Errors

HTTP Status: 403 Forbidden
{
  "ok": false,
  "error": {
    "code": "INSUFFICIENT_PERMISSIONS",
    "message": "Permission check failed - PERMISSION_CHECK_FAILED"
  }
}

Vendor Creation Errors

HTTP Status: 400 Bad Request or 500 Internal Server Error
{
  "ok": false,
  "error" : {
    "code": "VENDOR_CREATION_FAILED",
    "message": "Error creating vendor"
  }
}
{
  "ok": false,
   "error" : {
    "code": "USER_CREATION_FAILED",
    "message": "Failed to create vendor user"
  }
}

Best Practices

Vendor Creation

  • Only name is required; all other fields are optional
  • Provide complete address information if you include the address object (addressLine1, state, and zipCode are mandatory within the address)
  • Use appropriate locality values (DOMESTIC for vendors within your country, INTERNATIONAL for foreign vendors)
  • Include GST and PAN numbers for Indian domestic vendors for tax compliance
  • Ensure vendor contact information (email, phone) is unique to avoid duplicate errors
  • Validate payment terms against your organization’s configured options