Introduction

A vendor portal is an online platform that allows businesses to interact with their suppliers, vendors, and other partners. It serves as a central hub for managing vendor relationships, facilitating communication, and streamlining procurement processes.

Vendor management: The portal allows businesses to onboard vendors, manage contracts, and update vendor information.

Purchase order management: Vendors can view and accept purchase orders, and businesses can track the status of orders in real-time.

Invoice management: Vendors can submit invoices electronically, and businesses can review, approve, and pay invoices through the portal.

Reporting and analytics: The portal provide data and insights on vendor performance, purchase history, and other metrics that help businesses optimize their supply chain.

Authentication

Get Access Token

import requests
import json
url = "{{BASE_URL}}/api/v1/auth/login"
payload = json.dumps({
"username": "admin@kaispe.com",
"password": "pass123"
})
headers = {
'x-unique-string': 'vendor_portal',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)

The above command returns JSON structured like this:

{
"token_type": "Bearer",
"expires_in": "4 hours",
"token": "accessToken"
}

This endpoint is used to get the JWT access token.

HTTP Request

POST {{BASE_URL}}/auth/login

Authorization

To authorize, use this code:

import portal
api = portal.authorize('accessToken')

Make sure to replace accessToken with the token you get by calling the Get Access Token API.

VP API uses a JWT token to allow access to the API which is retrieved by the Get Access Token API.

VP API expects for the token to be included in all API requests to the server in a header that looks like the following:

Authorization: Bearer accessToken

Manage Vendors

Create Vendor

import requests
import json
url = "{{BASE_URL}}/api/v1/user"
payload = json.dumps({
"name": "Hamza",
"email": "s@vendor.com",
"password": "pass123",
"gender": "male",
"roleId": 1001,
"vendor": {
"name": "hamza vendor",
"creditLimit": 1500,
"taxRegistrationNumber": "HAM-116",
"billingAddress": "Model colony",
"shippingAddress": "Malir",
"email": "s@vendor.com",
"phoneNo": "+92 314 2589633",
"currencyCode": 1005,
"paymentTerms": 1005,
"paymentMethod": 1001,
"companyName": "ABC Corp",
"tradeLicenseNo": "12345",
"businessAddress": "123 Main St",
"businessName": "Tech Solutions",
"businessDirectPhone": "123-456-7890",
"businessEmail": "info@example.com",
"businessCellPhone": "987-654-3210",
"bankDetails": [
{
"bank": "My Bank",
"accountTitle": "John Doe",
"accountNumber": 1234567890,
"iban": "GB12345678901234567890",
"swiftCode": "ABCDEF",
"bankBranchCode": "12345",
"bankBranchAddress": "456 Main St",
"nationalTaxNumber": 987654321
}
],
"authorizedName": "John Doe",
"authorizedTitle": "CEO",
"authorizedEmail": "john@example.com",
"authorizedDirectPhone": "123-456-7890",
"authorizedCellPhone": "987-654-3210",
"billingPOBox": "45678",
"billingZipCode": "12345",
"billingCity": "Cityville",
"billingCountry": "Countryland",
"billingName": "Jane Smith",
"billingTitle": "CFO",
"billingEmail": "jane@example.com",
"billingDirectPhone": "111-222-3333",
"billingCellPhone": "444-555-6666",
"legalStatusOfCompany": "LLC",
"auth": "Authorization Code"
}
})
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer token'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
import requests
import json
url = "{{BASE_URL}}/api/v1/vendor/1000"
payload = json.dumps(
{
"name": "",
"rating": 0,
"creditLimit": "2.00",
"taxRegistrationNumber": "8778",
"shippingAddress": "78",
"email": "admi78878n@kaispe.com",
"phoneNumber": "03311301868",
"paymentTermsId": null,
"paymentMethod": 1000,
"defaultContact": 1132,
"currencyCode": 1000,
"companyName": "7878",
"tradeLicenseNo": "7887",
"businessAddress": "",
"businessName": "",
"businessDirectPhone": "",
"businessEmail": "",
"businessCellPhone": "",
"authorizedName": "",
"authorizedTitle": "",
"authorizedEmail": "",
"authorizedDirectPhone": "",
"authorizedCellPhone": "",
"billingAddress": "7878",
"billingPOBox": "",
"billingZipCode": "",
"billingCity": "",
"billingCountry": "",
"billingName": "",
"billingTitle": "",
"billingEmail": "",
"billingDirectPhone": "",
"billingCellPhone": "",
"legalStatusOfCompany": "",
"auth": "",
"vendorGroupId": 1001,
"vendorStatus": "active",
"createdAt": "2024-05-02T12:12:55.000Z",
"updatedAt": "2024-05-02T12:20:04.000Z",
"paymentTerms": 1000
}
)
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer token'
}
response = requests.request("PATCH", url, headers=headers, data=payload)
print(response.text)

The above command returns JSON structured like this:

{
"id": 1000,
"name": "Hamza",
"email": "s@vendor.com",
"password": "pass123",
"gender": "male",
"roleId": 1001,
"vendor": {
"name": "hamza vendor",
"creditLimit": 1500,
"taxRegistrationNumber": "HAM-116",
"billingAddress": "Model colony",
"shippingAddress": "Malir",
"email": "s@vendor.com",
"phoneNo": "+92 314 2589633",
"currencyCode": 1005,
"paymentTerms": 1005,
"paymentMethod": 1001,
"companyName": "ABC Corp",
"tradeLicenseNo": "12345",
"businessAddress": "123 Main St",
"businessName": "Tech Solutions",
"businessDirectPhone": "123-456-7890",
"businessEmail": "info@example.com",
"businessCellPhone": "987-654-3210",
"bankDetails": [
{
"bank": "My Bank",
"accountTitle": "John Doe",
"accountNumber": 1234567890,
"iban": "GB12345678901234567890",
"swiftCode": "ABCDEF",
"bankBranchCode": "12345",
"bankBranchAddress": "456 Main St",
"nationalTaxNumber": 987654321
}
],
"authorizedName": "John Doe",
"authorizedTitle": "CEO",
"authorizedEmail": "john@example.com",
"authorizedDirectPhone": "123-456-7890",
"authorizedCellPhone": "987-654-3210",
"billingPOBox": "45678",
"billingZipCode": "12345",
"billingCity": "Cityville",
"billingCountry": "Countryland",
"billingName": "Jane Smith",
"billingTitle": "CFO",
"billingEmail": "jane@example.com",
"billingDirectPhone": "111-222-3333",
"billingCellPhone": "444-555-6666",
"legalStatusOfCompany": "LLC",
"auth": "Authorization Code"
}
}

This endpoint creates a Vendor.

HTTP Request

POST {{BASE_URL}}/user

Body Parameters

ParameterData TypeRequiredRestrictionsDescription
nameStringYesN/AName of the user
emailStringYesN/AEmail address of the user
passwordStringYesN/APassword for the user account
genderStringYesN/AGender of the user
roleIdIntYesN/ARole ID of the user
vendorObjectYesN/AVendor details
- nameStringYesN/AName of the vendor
- creditLimitIntYesN/ACredit limit of the vendor
- taxRegistrationNumberStringYesN/ATax registration number of the vendor
- billingAddressStringYesN/ABilling address of the vendor
- shippingAddressStringYesN/AShipping address of the vendor
- emailStringYesN/AEmail address of the vendor
- phoneNoStringYesN/APhone number of the vendor
- currencyCodeIntYesN/ACurrency code of the vendor
- paymentTermsIntYesN/APayment terms of the vendor
- paymentMethodIntYesN/APayment method of the vendor
- companyNameStringYesN/ACompany name of the vendor
- tradeLicenseNoStringYesN/ATrade license number of the vendor
- businessAddressStringYesN/ABusiness address of the vendor
- businessNameStringYesN/ABusiness name of the vendor
- businessDirectPhoneStringYesN/ABusiness direct phone number of the vendor
- businessEmailStringYesN/ABusiness email address of the vendor
- businessCellPhoneStringYesN/ABusiness cell phone number of the vendor
- bankDetailsArray of ObjectsYesN/AArray of objects containing bank details of the vendor
- bankStringYesN/ABank name
- accountTitleStringYesN/AAccount title
- accountNumberIntYesN/AAccount number
- ibanStringYesN/AInternational Bank Account Number (IBAN)
- swiftCodeStringYesN/ASWIFT code
- bankBranchCodeStringYesN/ABank branch code
- bankBranchAddressStringYesN/ABank branch address
- nationalTaxNumberIntYesN/ANational tax number
- authorizedNameStringYesN/AAuthorized person's name
- authorizedTitleStringYesN/AAuthorized person's title
- authorizedEmailStringYesN/AAuthorized person's email address
- authorizedDirectPhoneStringYesN/AAuthorized person's direct phone number
- authorizedCellPhoneStringYesN/AAuthorized person's cell phone number
- billingPOBoxStringYesN/ABilling PO Box
- billingZipCodeStringYesN/ABilling zip code
- billingCityStringYesN/ABilling city
- billingCountryStringYesN/ABilling country
- billingNameStringYesN/ABilling name
- billingTitleStringYesN/ABilling title
- billingEmailStringYesN/ABilling email address
- billingDirectPhoneStringYesN/ABilling direct phone number
- billingCellPhoneStringYesN/ABilling cell phone number
- legalStatusOfCompanyStringYesN/ALegal status of the company
- authStringYesN/AAuthorization code

Get all vendors

import requests
url = "{{BASE_URL}}/api/v1/vendor"
payload = {}
headers = {
'Authorization': 'Bearer token'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
import requests
url = "{{BASE_URL}}/api/v1/vendor/1000"
payload = {}
headers = {
'Authorization': 'Bearer token'
}
response = requests.request("DELETE", url, headers=headers, data=payload)
print(response.text)

The above command returns JSON structured like this:

{
"status": 200,
"data": {
"docs": [
{
"id": 1094,
"name": "",
"rating": 0,
"creditLimit": "2.00",
"taxRegistrationNumber": "8778",
"shippingAddress": "78",
"email": "admi78878n@kaispe.com",
"phoneNumber": "03311301868",
"paymentTermsId": null,
"paymentMethod": 1000,
"defaultContact": 1132,
"currencyCode": 1000,
"companyName": "7878",
"tradeLicenseNo": "7887",
"businessAddress": "",
"businessName": "",
"businessDirectPhone": "",
"businessEmail": "",
"businessCellPhone": "",
"authorizedName": "",
"authorizedTitle": "",
"authorizedEmail": "",
"authorizedDirectPhone": "",
"authorizedCellPhone": "",
"billingAddress": "7878",
"billingPOBox": "",
"billingZipCode": "",
"billingCity": "",
"billingCountry": "",
"billingName": "",
"billingTitle": "",
"billingEmail": "",
"billingDirectPhone": "",
"billingCellPhone": "",
"legalStatusOfCompany": "",
"auth": "",
"vendorGroupId": 1001,
"vendorStatus": "active",
"createdAt": "2024-05-02T12:12:55.000Z",
"updatedAt": "2024-05-02T12:20:04.000Z",
"paymentTerms": 1000,
"bankDetails": [
{
"id": 1005,
"bank": "787878",
"accountTitle": "87788",
"accountNumber": "8778",
"iban": "87887",
"swiftCode": "",
"bankBranchCode": "",
"bankBranchAddress": "",
"vendorId": 1094,
"deletedAt": null,
"createdAt": "2024-05-02T12:13:10.000Z",
"updatedAt": "2024-05-02T12:13:10.000Z"
}
],
"user": {
"id": 1132,
"name": "76",
"email": "SAAA@fsdsd.com",
"password": "$2b$10$ZpHMZTG3D4DHya2KBC0CQeI3GYFKYvpiuj.isRIpnA.Dj.khBQy4G",
"image": null,
"gender": "male",
"roleId": 1009,
"tenantId": 1003,
"activeStatus": "active",
"vendorId": null,
"otp": null,
"deletedAt": null,
"createdAt": "2024-05-02T12:12:02.000Z",
"updatedAt": "2024-05-02T12:12:02.000Z"
}
}
],
"totalDocs": 0,
"limit": 10,
"page": 1,
"totalPages": 1,
"pagingCounter": null,
"hasPrevPage": false,
"hasNextPage": false,
"prevPage": null,
"nextPage": null
}
}

This endpoint retrieves all vendors.

HTTP Request

GET {{BASE_URL}}/vendor

Update Vendor

import requests
import json
url = "{{BASE_URL}}/api/v1/request-for-quotation"
payload = json.dumps({
"vendorIdList": [
1005
],
"description": "one",
"documentDate": "09/28/2023",
"status": "draft",
"paymentTerms": 1006,
"paymentMethod": 1004,
"currency": 1008,
"vendorQuoteLine": [
{
"lineAmount": 150,
"itemId": 1059,
"quantity": 565,
"uomId": 1003,
"currency": 1008
}
]
})
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer token'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
import requests
import json
url = "{{BASE_URL}}/api/v1/request-for-quotation/1000"
payload = json.dumps({
"description": "one",
"documentDate": "09/28/2023",
"status": "draft",
"paymentTerms": 1006,
"paymentMethod": 1004,
"currency": 1008,
"vendorQuoteLine": [
{
"lineAmount": 150,
"itemId": 1059,
"quantity": 565,
"uomId": 1003,
"currency": 1008
}
]
})
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer token'
}
response = requests.request("PATCH", url, headers=headers, data=payload)
print(response.text)

The above command returns JSON structured like this:

{
"id": 1000,
"name": "",
"rating": 0,
"creditLimit": "2.00",
"taxRegistrationNumber": "8778",
"shippingAddress": "78",
"email": "admi78878n@kaispe.com",
"phoneNumber": "03311301868",
"paymentTermsId": null,
"paymentMethod": 1000,
"defaultContact": 1132,
"currencyCode": 1000,
"companyName": "7878",
"tradeLicenseNo": "7887",
"businessAddress": "",
"businessName": "",
"businessDirectPhone": "",
"businessEmail": "",
"businessCellPhone": "",
"authorizedName": "",
"authorizedTitle": "",
"authorizedEmail": "",
"authorizedDirectPhone": "",
"authorizedCellPhone": "",
"billingAddress": "7878",
"billingPOBox": "",
"billingZipCode": "",
"billingCity": "",
"billingCountry": "",
"billingName": "",
"billingTitle": "",
"billingEmail": "",
"billingDirectPhone": "",
"billingCellPhone": "",
"legalStatusOfCompany": "",
"auth": "",
"vendorGroupId": 1001,
"vendorStatus": "active",
"createdAt": "2024-05-02T12:12:55.000Z",
"updatedAt": "2024-05-02T12:20:04.000Z",
"paymentTerms": 1000
}

This endpoint updates a RFQ.

HTTP Request

PATCH {{BASE_URL}}/vendor/<id>

URL Parameters

ParameterData TypeRequiredRestrictionsDescription
idnumberYesN/AId of the document

Body Parameters

ParameterData TypeRequiredRestrictionsDescription
nameStringYesN/AName of the user
emailStringYesN/AEmail address of the user
passwordStringYesN/APassword for the user account
genderStringYesN/AGender of the user
roleIdIntYesN/ARole ID of the user
vendorObjectYesN/AVendor details
- nameStringYesN/AName of the vendor
- creditLimitIntYesN/ACredit limit of the vendor
- taxRegistrationNumberStringYesN/ATax registration number of the vendor
- billingAddressStringYesN/ABilling address of the vendor
- shippingAddressStringYesN/AShipping address of the vendor
- emailStringYesN/AEmail address of the vendor
- phoneNoStringYesN/APhone number of the vendor
- currencyCodeIntYesN/ACurrency code of the vendor
- paymentTermsIntYesN/APayment terms of the vendor
- paymentMethodIntYesN/APayment method of the vendor
- companyNameStringYesN/ACompany name of the vendor
- tradeLicenseNoStringYesN/ATrade license number of the vendor
- businessAddressStringYesN/ABusiness address of the vendor
- businessNameStringYesN/ABusiness name of the vendor
- businessDirectPhoneStringYesN/ABusiness direct phone number of the vendor
- businessEmailStringYesN/ABusiness email address of the vendor
- businessCellPhoneStringYesN/ABusiness cell phone number of the vendor
- authorizedNameStringYesN/AAuthorized person's name
- authorizedTitleStringYesN/AAuthorized person's title
- authorizedEmailStringYesN/AAuthorized person's email address
- authorizedDirectPhoneStringYesN/AAuthorized person's direct phone number
- authorizedCellPhoneStringYesN/AAuthorized person's cell phone number
- billingPOBoxStringYesN/ABilling PO Box
- billingZipCodeStringYesN/ABilling zip code
- billingCityStringYesN/ABilling city
- billingCountryStringYesN/ABilling country
- billingNameStringYesN/ABilling name
- billingTitleStringYesN/ABilling title
- billingEmailStringYesN/ABilling email address
- billingDirectPhoneStringYesN/ABilling direct phone number
- billingCellPhoneStringYesN/ABilling cell phone number
- legalStatusOfCompanyStringYesN/ALegal status of the company
- authStringYesN/AAuthorization code

Delete Vendor

import requests
url = "{{BASE_URL}}/api/v1/request-for-quotation"
payload = {}
headers = {
'Authorization': 'Bearer token'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
import requests
url = "{{BASE_URL}}/api/v1/request-for-quotation/1000"
payload = {}
headers = {
'Authorization': 'Bearer token'
}
response = requests.request("DELETE", url, headers=headers, data=payload)
print(response.text)

The above command returns JSON structured like this:

Successfully deleted

This endpoint deletes vendor.

HTTP Request

DELETE {{BASE_URL}}/vendor/<id>

URL Parameters

ParameterData TypeRequiredRestrictionsDescription
idnumberYesN/AId of the document

Request For Quotation

Get All RFQs

import requests
url = "{{BASE_URL}}/api/v1/purchaseOrderHeader"
payload = {}
headers = {
'Authorization': 'Bearer token'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
import requests
url = "{{BASE_URL}}/api/v1/purchaseOrderHeader/1000"
payload = {}
headers = {
'Authorization': 'Bearer token'
}
response = requests.request("DELETE", url, headers=headers, data=payload)
print(response.text)

The above command returns JSON structured like this:

{
"status": 200,
"data": {
"docs": [
{
"documentDate": "2024-05-02",
"id": 1144,
"vendorId": 1086,
"description": "comparison",
"deliveryDate": "2024-05-31T00:00:00.000Z",
"status": "draft",
"paymentTerms": null,
"paymentMethod": 1000,
"currency": 1001,
"deletedAt": null,
"rfqNumber": "RFQ-1714633280930",
"createdAt": "2024-05-02T07:01:20.000Z",
"updatedAt": "2024-05-02T07:01:20.000Z",
"vendor": {
"id": 1086,
"name": null,
"email": "nera8daqa@pelagius.net",
"currencyCode": 1000,
"paymentTerms": 1000,
"paymentMethod": 1000,
"companyName": "zeeX0"
},
"currencies": {
"name": "USD",
"currencyCode": "USD"
},
"paymentTerm": null,
"paymentMethods": {
"id": 1000,
"name": "8998"
},
"vendorQuoteLine": [
{
"id": 1394,
"itemId": 1013,
"quantity": "3.00",
"uomId": 1000,
"unitCost": "3.00",
"currency": 1001,
"lineAmount": "9.00",
"quoteNum": 1144,
"deliveryDate": "2024-05-31T00:00:00.000Z",
"rfqNumber": "RFQ-1714633280930",
"vendorId": 1086,
"deletedAt": null,
"createdAt": "2024-05-02T07:01:20.000Z",
"updatedAt": "2024-05-02T07:01:20.000Z",
"item": {
"name": "string",
"description": "string",
"imageUrl": null,
"unitCost": "3.00"
},
"currencies": {
"name": "USD",
"currencyCode": "USD"
},
"uom": {
"name": "KG",
"description": "KG"
}
},
{
"id": 1395,
"itemId": 1008,
"quantity": "3.00",
"uomId": 1000,
"unitCost": "6000.00",
"currency": 1001,
"lineAmount": "18000.00",
"quoteNum": 1144,
"deliveryDate": "2024-05-31T00:00:00.000Z",
"rfqNumber": "RFQ-1714633280930",
"vendorId": 1086,
"deletedAt": null,
"createdAt": "2024-05-02T07:01:20.000Z",
"updatedAt": "2024-05-02T07:01:20.000Z",
"item": {
"name": "Test User",
"description": null,
"imageUrl": "[]",
"unitCost": "6000.00"
},
"currencies": {
"name": "USD",
"currencyCode": "USD"
},
"uom": {
"name": "KG",
"description": "KG"
}
}
]
}
],
"totalDocs": 0,
"limit": 10,
"page": 1,
"totalPages": 1,
"pagingCounter": null,
"hasPrevPage": false,
"hasNextPage": false,
"prevPage": null,
"nextPage": null
}
}

This endpoint retrieves all rfqs.

HTTP Request

GET {{BASE_URL}}/request-for-quotation

Query Parameters

ParameterDescription
idIf value is given, it'll give the specific rfq .
documentDateA date range to give rfqs of the specific date range (MM/DD/YYYYtoMM/DD/YYYY).
statusIf value is given, it'll give the rfqs of that given status (ENUM:[draft,sent,rejected,approved]) .

Create RFQ

import requests
import json
url = "{{BASE_URL}}/api/v1/purchaseOrderHeader"
payload = json.dumps(
{
"vendorId": 1046,
"name": "",
"vendorDocumentNum": "1231",
"orderDate": "2023-12-05",
"description": "453",
"status": "open",
"taxAmount": 0,
"discountAmount": 43010,
"discountPercentage": 10,
"taxPercentage": 0,
"totalExclTax": 387090,
"totalAmount": 387090,
"paymentTermId": 1003,
"paymentMethodId": 1001,
"currencyId": 1007,
"vendorQuoteId": 1033,
"purchaseOrderLine": [
{
"itemId": 1060,
"quantity": "100",
"quantityReceived": 0,
"unitId": 1003,
"unitCost": "15.00",
"quantityInvoiced": 0,
"currencyId": 1007,
"lineAmount": 1500,
"siteId": 1009,
"warehouseId": 1007
}
],
"totalLinesAmount": "430100.00"
}
)
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer token'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
import requests
import json
url = "{{BASE_URL}}/api/v1/purchaseOrderHeader/1000"
payload = json.dumps({
"vendorId": 1046,
"name": "",
"vendorDocumentNum": "1231",
"orderDate": "2023-12-05",
"description": "453",
"status": "open",
"taxAmount": 0,
"discountAmount": 43010,
"discountPercentage": 10,
"taxPercentage": 0,
"totalExclTax": 387090,
"totalAmount": 387090,
"paymentTermId": 1003,
"paymentMethodId": 1001,
"currencyId": 1007,
"vendorQuoteId": 1033,
"purchaseOrderLine": [
{
"itemId": 1060,
"quantity": "100",
"quantityReceived": 0,
"unitId": 1003,
"unitCost": "15.00",
"quantityInvoiced": 0,
"currencyId": 1007,
"lineAmount": 1500,
"siteId": 1009,
"warehouseId": 1007
}
],
"totalLinesAmount": "430100.00"
})
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer token'
}
response = requests.request("PATCH", url, headers=headers, data=payload)
print(response.text)

The above command returns JSON structured like this:

{
"id": 1000,
"vendorIdList": [1005],
"description": "one",
"documentDate": "09/28/2023",
"status": "draft",
"paymentTerms": 1006,
"paymentMethod": 1004,
"currency": 1008,
"vendorQuoteLine": [
{
"lineAmount": 150,
"itemId": 1059,
"quantity": 565,
"uomId": 1003,
"currency": 1008
}
]
}

This endpoint creates a RFQ.

HTTP Request

POST {{BASE_URL}}/request-for-quotation

Body Parameters

ParameterData TypeRequiredRestrictionsDescription
vendorIdListArray of IntYesN/AList of vendor IDs
descriptionStringYesN/ADescription of the document
documentDateDate (String)YesN/ADate of the document
statusStringYesN/AStatus of the document
paymentTermsIntYesN/APayment terms ID
paymentMethodIntYesN/APayment method ID
currencyIntYesN/ACurrency ID
vendorQuoteLineArray of ObjectsYesN/AArray of objects containing vendor quote line details
- lineAmountIntYesN/AAmount of the line
- itemIdIntYesN/AItem ID
- quantityIntYesN/AQuantity of the item
- uomIdIntYesN/AUnit of measure ID
- currencyIntYesN/ACurrency ID

Update RFQ

import requests
import json
url = "{{BASE_URL}}/api/v1/items"
payload = json.dumps(
{
"name": "LCD4",
"unitCost": "20",
"uomId": 1000,
"imageUrl": [
{
"filename": "01ce402e-5c30-42f1-b71a-044d3cc85326.jpg",
"url": "https://blobvp.blob.core.windows.net/item-images/1708600468963-0.5385316980702044-01ce402e-5c30-42f1-b71a-044d3cc85326.jpg"
}
],
"itemGroupId": 1001
}
)
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer token'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
import requests
import json
url = "{{BASE_URL}}/api/v1/items/1000"
payload = json.dumps({
"name": "LCD4",
"unitCost": "20",
"uomId": 1000,
"imageUrl": [
{
"filename": "01ce402e-5c30-42f1-b71a-044d3cc85326.jpg",
"url": "https://blobvp.blob.core.windows.net/item-images/1708600468963-0.5385316980702044-01ce402e-5c30-42f1-b71a-044d3cc85326.jpg"
}
],
"itemGroupId": 1001
})
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer token'
}
response = requests.request("PATCH", url, headers=headers, data=payload)
print(response.text)

The above command returns JSON structured like this:

{
"id": 1000,
"vendorIdList": [1005],
"description": "one",
"documentDate": "09/28/2023",
"status": "draft",
"paymentTerms": 1006,
"paymentMethod": 1004,
"currency": 1008,
"vendorQuoteLine": [
{
"lineAmount": 150,
"itemId": 1059,
"quantity": 565,
"uomId": 1003,
"currency": 1008
}
]
}

This endpoint updates a RFQ.

HTTP Request

PATCH {{BASE_URL}}/request-for-quotation/<id>

URL Parameters

ParameterData TypeRequiredRestrictionsDescription
idnumberYesN/AId of the document

Body Parameters

ParameterData TypeRequiredRestrictionsDescription
descriptionStringYesN/ADescription of the document
documentDateDate (String)YesN/ADate of the document
statusStringYesN/AStatus of the document
paymentTermsIntYesN/APayment terms ID
paymentMethodIntYesN/APayment method ID
currencyIntYesN/ACurrency ID
vendorQuoteLineArray of ObjectsYesN/AArray of objects containing vendor quote line details
- lineAmountIntYesN/AAmount of the line
- itemIdIntYesN/AItem ID
- quantityIntYesN/AQuantity of the item
- uomIdIntYesN/AUnit of measure ID
- currencyIntYesN/ACurrency ID

Delete RFQ

import requests
url = "{{BASE_URL}}/api/v1/invoice-header"
payload = {}
headers = {
'Authorization': 'Bearer token'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
import requests
url = "{{BASE_URL}}/api/v1/items"
payload = {}
headers = {
'Authorization': 'Bearer token'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)

The above command returns JSON structured like this:

Successfully deleted

This endpoint deletes rfq.

HTTP Request

DELETE {{BASE_URL}}/request-for-quotation/<id>

URL Parameters

ParameterData TypeRequiredRestrictionsDescription
idnumberYesN/AId of the document

Purchase Order

Get All POs

import requests
url = "{{BASE_URL}}/api/v1/items/1000"
payload = {}
headers = {
'Authorization': 'Bearer token'
}
response = requests.request("DELETE", url, headers=headers, data=payload)
print(response.text)
import requests
url = "{{BASE_URL}}/api/v1/sites"
payload = {}
headers = {
'Authorization': 'Bearer token'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)

The above command returns JSON structured like this:

{
"status": 200,
"data": {
"docs": [
{
"orderDate": "2024-04-30",
"expectedDeliveryDate": "2024-05-24",
"id": 1031,
"vendorId": 1083,
"name": "Vendor Test",
"description": "test description",
"vendorDocumentNum": "21121",
"taxAmount": "0.00",
"discountAmount": "0.00",
"discountPercentage": "0.00",
"taxPercentage": "0.00",
"totalExclTax": "41703.00",
"totalAmount": "41703.00",
"status": "open",
"quoteNum": null,
"paymentTermId": 1000,
"vendorQuoteId": 1009,
"paymentMethodId": 1000,
"currencyId": 1000,
"contractHeaderId": null,
"deletedAt": null,
"createdAt": "2024-05-02T06:36:37.000Z",
"updatedAt": "2024-05-02T06:36:37.000Z",
"vendor": {
"id": 1083,
"name": "Vendor Test",
"email": "neradaqa@pelagius.net",
"currencyCode": null,
"paymentTerms": null,
"paymentMethod": null,
"companyName": "Ziptrick"
},
"paymentTerm": {
"id": 1000,
"name": "Test User",
"description": "test description"
},
"paymentMethod": {
"id": 1000,
"name": "8998",
"description": "testing purpose"
},
"currency": {
"id": 1000,
"name": "Pakistan Rupee",
"currencyCode": "PKR",
"exchangeRate": "4"
},
"purchaseOrderLine": [
{
"lineAmount": 9,
"taxAmount": 0,
"id": 1039,
"itemId": 1013,
"quantity": 3,
"quantityReceived": 0,
"quantityInvoiced": 0,
"unitId": 1000,
"unitCost": "3.00",
"currencyId": 1000,
"purchaseOrderNum": 1031,
"siteId": 1000,
"warehouseId": 1000,
"deletedAt": null,
"createdAt": "2024-05-02T06:36:39.000Z",
"updatedAt": "2024-05-02T06:36:39.000Z",
"item": {
"name": "string",
"description": "string",
"imageUrl": null,
"unitCost": "3.00"
},
"currency": {
"name": "Pakistan Rupee",
"currencyCode": "PKR"
},
"unit": {
"name": "KG",
"description": "KG"
},
"site": {
"id": 1000,
"name": "a",
"company": 1003
},
"warehouse": {
"id": 1000,
"name": "b",
"site": 1000
}
},
{
"lineAmount": 23634,
"taxAmount": 32,
"id": 1040,
"itemId": 1010,
"quantity": 3,
"quantityReceived": 0,
"quantityInvoiced": 0,
"unitId": 1000,
"unitCost": "7878.00",
"currencyId": 1000,
"purchaseOrderNum": 1031,
"siteId": 1000,
"warehouseId": 1000,
"deletedAt": null,
"createdAt": "2024-05-02T06:36:39.000Z",
"updatedAt": "2024-05-02T06:36:39.000Z",
"item": {
"name": "PRODUCT 1",
"description": null,
"imageUrl": "[{\"filename\":\"sara-cervera-ORltc33fQXw-unsplash.jpg\",\"url\":\"https://blobvp.blob.core.windows.net/item-images/1713510703437-0.19467728118649474-sara-cervera-ORltc33fQXw-unsplash.jpg\"},{\"filename\":\"kirsten-frank-SigW_qGiSEI-unsplash.jpg\",\"url\":\"https://blobvp.blob.core.windows.net/item-images/1713510727032-0.24609094207327997-kirsten-frank-SigW_qGiSEI-unsplash.jpg\"},{\"filename\":\"pexels-souvenirpixels-417074.jpg\",\"url\":\"https://blobvp.blob.core.windows.net/item-images/1713510738818-0.17526652103661844-pexels-souvenirpixels-417074.jpg\"}]",
"unitCost": "7878.00"
},
"currency": {
"name": "Pakistan Rupee",
"currencyCode": "PKR"
},
"unit": {
"name": "KG",
"description": "KG"
},
"site": {
"id": 1000,
"name": "a",
"company": 1003
},
"warehouse": {
"id": 1000,
"name": "b",
"site": 1000
}
},
{
"lineAmount": 18000,
"taxAmount": 32,
"id": 1041,
"itemId": 1007,
"quantity": 3,
"quantityReceived": 0,
"quantityInvoiced": 0,
"unitId": 1000,
"unitCost": "6000.00",
"currencyId": 1000,
"purchaseOrderNum": 1031,
"siteId": 1000,
"warehouseId": 1000,
"deletedAt": null,
"createdAt": "2024-05-02T06:36:39.000Z",
"updatedAt": "2024-05-02T06:36:39.000Z",
"item": {
"name": "Pablo",
"description": null,
"imageUrl": "[]",
"unitCost": "6000.00"
},
"currency": {
"name": "Pakistan Rupee",
"currencyCode": "PKR"
},
"unit": {
"name": "KG",
"description": "KG"
},
"site": {
"id": 1000,
"name": "a",
"company": 1003
},
"warehouse": {
"id": 1000,
"name": "b",
"site": 1000
}
},
{
"lineAmount": 60,
"taxAmount": 0,
"id": 1042,
"itemId": 1003,
"quantity": 3,
"quantityReceived": 0,
"quantityInvoiced": 0,
"unitId": 1000,
"unitCost": "20.00",
"currencyId": 1000,
"purchaseOrderNum": 1031,
"siteId": 1000,
"warehouseId": 1000,
"deletedAt": null,
"createdAt": "2024-05-02T06:36:39.000Z",
"updatedAt": "2024-05-02T06:36:39.000Z",
"item": {
"name": "LCD3",
"description": null,
"imageUrl": "[{\"filename\":\"01ce402e-5c30-42f1-b71a-044d3cc85326.jpg\",\"url\":\"https://blobvp.blob.core.windows.net/item-images/1708600468963-0.5385316980702044-01ce402e-5c30-42f1-b71a-044d3cc85326.jpg\"}]",
"unitCost": "20.00"
},
"currency": {
"name": "Pakistan Rupee",
"currencyCode": "PKR"
},
"unit": {
"name": "KG",
"description": "KG"
},
"site": {
"id": 1000,
"name": "a",
"company": 1003
},
"warehouse": {
"id": 1000,
"name": "b",
"site": 1000
}
}
]
}
],
"totalDocs": 0,
"limit": 10,
"page": 1,
"totalPages": 1,
"pagingCounter": null,
"hasPrevPage": false,
"hasNextPage": false,
"prevPage": null,
"nextPage": null
}
}

This endpoint retrieves all POs.

HTTP Request

GET {{BASE_URL}}/purchaseOrderHeader

Query Parameters

ParameterDescription
idIf value is given, it'll give the specific po .
orderDateA date range to give POs of the specific date range (MM/DD/YYYYtoMM/DD/YYYY).
statusIf value is given, it'll give the POs of that given status (ENUM:[open,received,invoiced,cancelled]) .

Create PO

import requests
import json
url = "{{BASE_URL}}/api/v1/sites"
payload = json.dumps(
{
"company": 1003,
"name": "Site name"
}
)
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer token'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
import requests
import json
url = "{{BASE_URL}}/api/v1/sites/1000"
payload = json.dumps({
"company": 1003,
"name": "Site name"
})
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer token'
}
response = requests.request("PATCH", url, headers=headers, data=payload)
print(response.text)

The above command returns JSON structured like this:

{
"id": 1000,
"vendorId": 1046,
"name": "",
"vendorDocumentNum": "1231",
"orderDate": "2023-12-05",
"description": "453",
"status": "open",
"taxAmount": 0,
"discountAmount": 43010,
"discountPercentage": 10,
"taxPercentage": 0,
"totalExclTax": 387090,
"totalAmount": 387090,
"paymentTermId": 1003,
"paymentMethodId": 1001,
"currencyId": 1007,
"vendorQuoteId": 1033,
"purchaseOrderLine": [
{
"itemId": 1060,
"quantity": "100",
"quantityReceived": 0,
"unitId": 1003,
"unitCost": "15.00",
"quantityInvoiced": 0,
"currencyId": 1007,
"lineAmount": 1500,
"siteId": 1009,
"warehouseId": 1007
}
],
"totalLinesAmount": "430100.00"
}

This endpoint creates a PO.

HTTP Request

POST {{BASE_URL}}/purchaseOrderHeader

Body Parameters

ParameterData TypeRequiredRestrictionsDescription
vendorIdIntYesN/AVendor ID
nameStringNoN/AName of the document
vendorDocumentNumStringYesN/AVendor document number
orderDateDate (String)YesN/ADate of the order
descriptionStringYesN/ADescription of the document
statusStringYesN/AStatus of the document
taxAmountIntYesN/ATax amount
discountAmountIntYesN/ADiscount amount
discountPercentageIntYesN/ADiscount percentage
taxPercentageIntYesN/ATax percentage
totalExclTaxIntYesN/ATotal amount excluding tax
totalAmountIntYesN/ATotal amount including tax
paymentTermIdIntYesN/APayment term ID
paymentMethodIdIntYesN/APayment method ID
currencyIdIntYesN/ACurrency ID
vendorQuoteIdIntYesN/AVendor quote ID
purchaseOrderLineArray of ObjectsYesN/AArray of objects containing purchase order line details
- itemIdIntYesN/AItem ID
- quantityStringYesN/AQuantity of the item
- quantityReceivedIntYesN/AQuantity received
- unitIdIntYesN/AUnit ID
- unitCostStringYesN/AUnit cost
- quantityInvoicedIntYesN/AQuantity invoiced
- currencyIdIntYesN/ACurrency ID
- lineAmountIntYesN/AAmount of the line
- siteIdIntYesN/ASite ID
- warehouseIdIntYesN/AWarehouse ID
totalLinesAmountStringYesN/ATotal amount of all lines

Update PO

import requests
import json
url = "{{BASE_URL}}/api/v1/warehouses"
payload = json.dumps(
{
"site": 1008,
"name": "first warehouse"
}
)
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer token'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
import requests
import json
url = "{{BASE_URL}}/api/v1/warehouses/1000"
payload = json.dumps({
"site": 1008,
"name": "first warehouse"
})
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer token'
}
response = requests.request("PATCH", url, headers=headers, data=payload)
print(response.text)

The above command returns JSON structured like this:

{
"id": 1000,
"vendorId": 1046,
"name": "",
"vendorDocumentNum": "1231",
"orderDate": "2023-12-05",
"description": "453",
"status": "open",
"taxAmount": 0,
"discountAmount": 43010,
"discountPercentage": 10,
"taxPercentage": 0,
"totalExclTax": 387090,
"totalAmount": 387090,
"paymentTermId": 1003,
"paymentMethodId": 1001,
"currencyId": 1007,
"vendorQuoteId": 1033,
"purchaseOrderLine": [
{
"itemId": 1060,
"quantity": "100",
"quantityReceived": 0,
"unitId": 1003,
"unitCost": "15.00",
"quantityInvoiced": 0,
"currencyId": 1007,
"lineAmount": 1500,
"siteId": 1009,
"warehouseId": 1007
}
],
"totalLinesAmount": "430100.00"
}

This endpoint updates a PO.

HTTP Request

PATCH {{BASE_URL}}/purchaseOrderHeader/<id>

URL Parameters

ParameterData TypeRequiredRestrictionsDescription
idnumberYesN/AId of the document

Body Parameters

ParameterData TypeRequiredRestrictionsDescription
vendorIdIntYesN/AVendor ID
nameStringNoN/AName of the document
vendorDocumentNumStringYesN/AVendor document number
orderDateDate (String)YesN/ADate of the order
descriptionStringYesN/ADescription of the document
statusStringYesN/AStatus of the document
taxAmountIntYesN/ATax amount
discountAmountIntYesN/ADiscount amount
discountPercentageIntYesN/ADiscount percentage
taxPercentageIntYesN/ATax percentage
totalExclTaxIntYesN/ATotal amount excluding tax
totalAmountIntYesN/ATotal amount including tax
paymentTermIdIntYesN/APayment term ID
paymentMethodIdIntYesN/APayment method ID
currencyIdIntYesN/ACurrency ID
vendorQuoteIdIntYesN/AVendor quote ID
purchaseOrderLineArray of ObjectsYesN/AArray of objects containing purchase order line details
- itemIdIntYesN/AItem ID
- quantityStringYesN/AQuantity of the item
- quantityReceivedIntYesN/AQuantity received
- unitIdIntYesN/AUnit ID
- unitCostStringYesN/AUnit cost
- quantityInvoicedIntYesN/AQuantity invoiced
- currencyIdIntYesN/ACurrency ID
- lineAmountIntYesN/AAmount of the line
- siteIdIntYesN/ASite ID
- warehouseIdIntYesN/AWarehouse ID
totalLinesAmountStringYesN/ATotal amount of all lines

Delete PO

import requests
url = "{{BASE_URL}}/api/v1/sites/1000"
payload = {}
headers = {
'Authorization': 'Bearer token'
}
response = requests.request("DELETE", url, headers=headers, data=payload)
print(response.text)
import requests
url = "{{BASE_URL}}/api/v1/warehouses"
payload = {}
headers = {
'Authorization': 'Bearer token'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)

The above command returns JSON structured like this:

Successfully deleted

This endpoint deletes PO.

HTTP Request

DELETE {{BASE_URL}}/purchaseOrderHeader/<id>

URL Parameters

ParameterData TypeRequiredRestrictionsDescription
idnumberYesN/AId of the document

Invoices

Get All Invoices

import requests
url = "{{BASE_URL}}/api/v1/warehouses/1000"
payload = {}
headers = {
'Authorization': 'Bearer token'
}
response = requests.request("DELETE", url, headers=headers, data=payload)
print(response.text)

The above command returns JSON structured like this:

{
"status": 200,
"data": {
"docs": [
{
"id": 1001,
"invoiceDate": "2024-04-29T10:03:38.000Z",
"dueDate": "2024-04-30T00:00:00.000Z",
"vendorId": 1083,
"deliveryChallanHeaderId": 1007,
"taxType": "334",
"taxRate": "3.00",
"taxAmount": "2.00",
"discountPercentage": "2.00",
"totalAmount": "0.00",
"shippingAddress": null,
"paymentInstruction": "23",
"currencyId": 1000,
"paymentTermId": 1000,
"paymentMethodId": 1000,
"paymentStatus": "unpaid",
"invoiceStatus": null,
"comment": "32",
"attachments": null,
"saveAsDraft": false,
"invoiceJournalId": null,
"deletedAt": null,
"createdAt": "2024-04-29T10:03:38.000Z",
"updatedAt": "2024-04-29T10:03:38.000Z",
"vendor": {
"name": "Vendor Test",
"email": "neradaqa@pelagius.net",
"currencyCode": null,
"paymentTerms": null,
"paymentMethod": null,
"companyName": "Ziptrick"
},
"currency": {
"currencyCode": "PKR",
"name": "Pakistan Rupee",
"ISOCode": "2121",
"exchangeRate": "4"
},
"paymentTerm": {
"name": "Test User",
"description": "test description"
},
"paymentMethod": {
"name": "8998",
"description": "testing purpose"
},
"invoiceLine": [
{
"lineAmount": 540000,
"id": 1002,
"itemId": 1008,
"quantity": "90.00",
"unitCost": "6000.00",
"uomId": 1000,
"currencyId": 1000,
"invoiceHeaderId": 1001,
"purchaseOrderLineId": null,
"invoiceStatus": null,
"deletedAt": null,
"createdAt": "2024-04-29T10:03:39.000Z",
"updatedAt": "2024-04-29T10:03:39.000Z",
"item": {
"name": "Test User",
"unitCost": "6000.00"
},
"uom": {
"name": "KG",
"description": "KG"
},
"currency": {
"currencyCode": "PKR",
"name": "Pakistan Rupee",
"ISOCode": "2121",
"exchangeRate": "4"
}
}
]
}
],
"totalDocs": 1,
"limit": 10,
"page": 1,
"totalPages": 1,
"pagingCounter": 1,
"hasPrevPage": false,
"hasNextPage": false,
"prevPage": null,
"nextPage": null
}
}

This endpoint retrieves all Invoices.

HTTP Request

GET {{BASE_URL}}/invoice-header

Products

Get All Products

The above command returns JSON structured like this:

{
"status": 200,
"data": {
"docs": [
{
"discountedunitCost": null,
"id": 1015,
"name": "76776",
"uomId": 1000,
"unitCost": "777.00",
"imageUrl": "[]",
"authorized": false,
"rating": null,
"discountItemId": null,
"taxGroupId": 1002,
"itemGroupId": 1000,
"uom": {
"name": "KG",
"description": "KG"
},
"discountItem": null,
"itemGroup": {
"id": 1000,
"groupName": "Electronics"
},
"taxGroup": {
"id": 1002,
"groupName": "Tax on PO",
"categoryName": "Real Tax",
"groupLines": [
{
"amount": 10,
"id": 1009,
"taxType": "percentage",
"depends_on": "bv",
"taxId": 1000,
"taxGroupId": 1002,
"tax": {
"id": 1000,
"code": "IT",
"description": "Income Tax"
}
},
{
"amount": 2000,
"id": 1010,
"taxType": "fixed",
"depends_on": "IT",
"taxId": 1004,
"taxGroupId": 1002,
"tax": {
"id": 1004,
"code": "FED",
"description": "Federal Exerice Duty."
}
},
{
"amount": 8,
"id": 1011,
"taxType": "percentage",
"depends_on": "FED",
"taxId": 1001,
"taxGroupId": 1002,
"tax": {
"id": 1001,
"code": "ITs",
"description": "Income Tax"
}
}
]
}
}
],
"totalDocs": 0,
"limit": 10,
"page": 1,
"totalPages": 1,
"pagingCounter": null,
"hasPrevPage": false,
"hasNextPage": false,
"prevPage": null,
"nextPage": null
}
}

This endpoint retrieves all POs.

HTTP Request

GET {{BASE_URL}}/items

Query Parameters

ParameterDescription
nameName of product.
priceRangeA price range to give products of the specific range (00to00).
idId of product.

Create Product

The above command returns JSON structured like this:

{
"id": 1000,
"name": "LCD4",
"unitCost": "20",
"uomId": 1000,
"imageUrl": [
{
"filename": "01ce402e-5c30-42f1-b71a-044d3cc85326.jpg",
"url": "https://blobvp.blob.core.windows.net/item-images/1708600468963-0.5385316980702044-01ce402e-5c30-42f1-b71a-044d3cc85326.jpg"
}
],
"itemGroupId": 1001
}

This endpoint creates a Product.

HTTP Request

POST {{BASE_URL}}/items

Body Parameters

ParameterData TypeRequiredRestrictionsDescription
nameStringYesN/AName of the item
unitCostStringYesN/ACost per unit of the item
uomIdIntYesN/AUnit of measure ID
imageUrlArray of ObjectsYesN/AArray of objects containing image details
- filenameStringYesN/AFilename of the image
- urlStringYesN/AURL of the image
itemGroupIdIntYesN/AItem group ID

Update Product

The above command returns JSON structured like this:

{
"id": 1000,
"name": "LCD4",
"unitCost": "20",
"uomId": 1000,
"imageUrl": [
{
"filename": "01ce402e-5c30-42f1-b71a-044d3cc85326.jpg",
"url": "https://blobvp.blob.core.windows.net/item-images/1708600468963-0.5385316980702044-01ce402e-5c30-42f1-b71a-044d3cc85326.jpg"
}
],
"itemGroupId": 1001
}

This endpoint updates a Product.

HTTP Request

PATCH {{BASE_URL}}/items/<id>

URL Parameters

ParameterData TypeRequiredRestrictionsDescription
idnumberYesN/AId of the document

Body Parameters

ParameterData TypeRequiredRestrictionsDescription
nameStringYesN/AName of the item
unitCostStringYesN/ACost per unit of the item
uomIdIntYesN/AUnit of measure ID
imageUrlArray of ObjectsYesN/AArray of objects containing image details
- filenameStringYesN/AFilename of the image
- urlStringYesN/AURL of the image
itemGroupIdIntYesN/AItem group ID

Delete Product

The above command returns JSON structured like this:

Successfully deleted

This endpoint deletes Product.

HTTP Request

DELETE {{BASE_URL}}/items/<id>

URL Parameters

ParameterData TypeRequiredRestrictionsDescription
idnumberYesN/AId of the document

Sites

Get All Sites

The above command returns JSON structured like this:

{
"status": 200,
"data": {
"docs": [
{
"id": 1000,
"name": "a",
"company": 1003,
"deletedAt": null,
"createdAt": "2024-03-19T10:51:54.000Z",
"updatedAt": "2024-03-19T10:51:54.000Z",
"companyId": {
"name": "bilal",
"address": "bilal",
"email": "bilal@email.com",
"phone": "123456"
}
}
],
"totalDocs": 0,
"limit": 10,
"page": 1,
"totalPages": 1,
"pagingCounter": null,
"hasPrevPage": false,
"hasNextPage": false,
"prevPage": null,
"nextPage": null
}
}

This endpoint retrieves all Sites.

HTTP Request

GET {{BASE_URL}}/sites

Create Site

The above command returns JSON structured like this:

{
"id": 1000,
"company": 1003,
"name": "Site name"
}

This endpoint creates a Site.

HTTP Request

POST {{BASE_URL}}/sites

Body Parameters

ParameterData TypeRequiredRestrictionsDescription
companyIntYesN/AId of the company (foreign key)
nameStringYesN/AName of the site

Update Site

The above command returns JSON structured like this:

{
"id": 1000,
"company": 1003,
"name": "Site name"
}

This endpoint updates a Site.

HTTP Request

PATCH {{BASE_URL}}/sites/<id>

URL Parameters

ParameterData TypeRequiredRestrictionsDescription
idnumberYesN/AId of the document

Body Parameters

ParameterData TypeRequiredRestrictionsDescription
companyIntYesN/AId of the company (foreign key)
nameStringYesN/AName of the site

Delete Site

The above command returns JSON structured like this:

Successfully deleted

This endpoint deletes Site.

HTTP Request

DELETE {{BASE_URL}}/sites/<id>

URL Parameters

ParameterData TypeRequiredRestrictionsDescription
idnumberYesN/AId of the document

Warehouses

Get All Warehouses

The above command returns JSON structured like this:

{
"status": 200,
"data": {
"docs": [
{
"id": 1000,
"name": "b",
"site": 1000,
"deletedAt": null,
"createdAt": "2024-03-19T10:52:03.000Z",
"updatedAt": "2024-03-19T10:52:03.000Z",
"siteId": {
"name": "a"
}
}
],
"totalDocs": 1,
"limit": 10,
"page": 1,
"totalPages": 1,
"pagingCounter": 1,
"hasPrevPage": false,
"hasNextPage": false,
"prevPage": null,
"nextPage": null
}
}

This endpoint retrieves all Warehouses.

HTTP Request

GET {{BASE_URL}}/warehouses

Create Warehouse

The above command returns JSON structured like this:

{
"id": 1000,
"site": 1008,
"name": "first warehouse"
}

This endpoint creates a Warehouse.

HTTP Request

POST {{BASE_URL}}/warehouses

Body Parameters

ParameterData TypeRequiredRestrictionsDescription
siteIntYesN/AId of the site (foreign key)
nameStringYesN/AName of the warehouse

Update Site

The above command returns JSON structured like this:

{
"id": 1000,
"site": 1008,
"name": "first warehouse"
}

This endpoint updates a Warehouse.

HTTP Request

PATCH {{BASE_URL}}/warehouses/<id>

URL Parameters

ParameterData TypeRequiredRestrictionsDescription
idnumberYesN/AId of the document

Body Parameters

ParameterData TypeRequiredRestrictionsDescription
siteIntYesN/AId of the site (foreign key)
nameStringYesN/AName of the warehouse

Delete Warehouse

The above command returns JSON structured like this:

Successfully deleted

This endpoint deletes Warehouse.

HTTP Request

DELETE {{BASE_URL}}/warehouses/<id>

URL Parameters

ParameterData TypeRequiredRestrictionsDescription
idnumberYesN/AId of the document