Vendor Invite Creation API
curl --request POST \
--url https://api.pazy.io/v1.0/vendor/inviteimport requests
url = "https://api.pazy.io/v1.0/vendor/invite"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.pazy.io/v1.0/vendor/invite', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.pazy.io/v1.0/vendor/invite",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.pazy.io/v1.0/vendor/invite"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.pazy.io/v1.0/vendor/invite")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pazy.io/v1.0/vendor/invite")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyVendor APIs
Vendor Invite Creation API
Create vendor invitations to onboard new vendors to your organization
Vendor Invite Creation API
curl --request POST \
--url https://api.pazy.io/v1.0/vendor/inviteimport requests
url = "https://api.pazy.io/v1.0/vendor/invite"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.pazy.io/v1.0/vendor/invite', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.pazy.io/v1.0/vendor/invite",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.pazy.io/v1.0/vendor/invite"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.pazy.io/v1.0/vendor/invite")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pazy.io/v1.0/vendor/invite")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyAuthentication
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
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Vendor name (1-255 characters) |
email | string | Yes | Vendor email address (must be valid email format) |
phone | string | No | Vendor phone number (must include country code, e.g., +919876543210) |
locality | string | No | Vendor locality type. Valid values: DOMESTIC, INTERNATIONAL. Defaults to DOMESTIC if not provided |
sendEmail | boolean | No | Whether 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": "contact@abcsuppliers.com",
"phone": "+919876543210",
"locality": "DOMESTIC",
"sendEmail": true
}'
const response = await fetch('https://api.pazy.io/v1.0/vendor/invite', {
method: 'POST',
headers: {
'Authorization': 'Api-Key YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'ABC Suppliers',
email: 'contact@abcsuppliers.com',
phone: '+919876543210',
locality: 'DOMESTIC',
sendEmail: true
})
});
const result = await response.json();
import requests
url = "https://api.pazy.io/v1.0/vendor/invite"
headers = {
"Authorization": "Api-Key YOUR_API_KEY",
"Content-Type": "application/json"
}
payload = {
"name": "ABC Suppliers",
"email": "contact@abcsuppliers.com",
"phone": "+919876543210",
"locality": "DOMESTIC",
"sendEmail": True
}
response = requests.post(url, headers=headers, json=payload)
result = response.json()
Success Response
HTTP Status:200 OK
Response Fields:
| Field | Type | Description |
|---|---|---|
ok | boolean | Indicates whether the request was successful |
data | object | Contains the vendor invite creation response data |
data.inviteLink | string | Unique 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"
}
}
{
"ok": false,
"error": {
"code": "DUPLICATE_EMAIL",
"message": "Vendor with same email already exists"
}
}
{
"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: trueif you want automatic email delivery - If
sendEmail: false, share theinviteLinkmanually 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
Was this page helpful?