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

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)
emailstringYesVendor 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
sendEmailbooleanNoWhether to send an email invitation to the vendor. Defaults to false if not provided

Code Examples

curl -X POST https://api.pazy.io/v1.0/vendor/invite \
  -H "Authorization: Api-Key YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "ABC Suppliers",
    "email": "[email protected]",
    "phone": "+919876543210",
    "locality": "DOMESTIC",
    "sendEmail": true
  }'

Success Response

HTTP Status: 200 OK Response Fields:
FieldTypeDescription
okbooleanIndicates whether the request was successful
dataobjectContains the vendor invite creation response data
data.inviteLinkstringUnique invitation link that can be shared with the vendor to complete their onboarding. The vendor can use this link to access the invitation form

Response Example

{
  "ok": true,
  "data": {
    "inviteLink": "https://app.pazy.io/p/vendor-invite/abc123xyz"
  }
}
If sendEmail is set to true, the invitation email will be sent automatically to the vendor’s email address. Otherwise, you can share the inviteLink manually.

Error Responses

Missing Required Fields

HTTP Status: 400 Bad Request
{
  "ok": false,
  "error": {
    "code": "MISSING_REQUIRED_FIELD",
    "message": "Name and email are 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"
  }
}

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"
  }
}

Invalid Phone Number

HTTP Status: 400 Bad Request
{
  "ok": false,
  "error": {
    "code": "INVALID_PHONE",
    "message": "Invalid phone number"
  }
}

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 Invitations

  • Use sendEmail: true if you want automatic email delivery
  • If sendEmail: false, share the inviteLink manually with the vendor
  • Ensure vendor contact information (email, phone) is accurate to avoid duplicate errors
  • Check for duplicate errors before attempting to create a vendor invite