<service domain|custom domain>/app/<portal>/api/v3/purchase_orders
采购订单
采购订单帮助您跟踪组织中的采购历史。
属性
更多属性 全部展开
添加采购订单
使用此操作创建新的采购订单
必填字段:名称,requested_by,供应商,物品
URL
属性
更多属性 全部展开
$ curl <service domain|custom domain>/app/<portal>/api/v3/purchase_orders\
-X POST\
-H "Accept: application/vnd.manageengine.sdp.v3+json"\
-H "Authorization: Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"\
-H "Content-Type: application/x-www-form-urlencoded"\
-d input_data='{
"purchase_order": {
"template": {
"id": "2000000034044"
},
"attachments": [],
"itemwise_costcenter": true,
"itemwise_glcode": false,
"requested_by": {
"id": "2000000040351"
},
"custom_id": "1",
"name": "PO-Zykler",
"required_date": {
"value": 1739385000000
},
"vendor": {
"id": "2000000040455"
},
"ship_address": "No 89, Chennai",
"bill_address": "No 89, Chennai",
"discount": {
"secondary_currency": {
"value": "561.60"
},
"value": "561.60"
},
"shipping_price": {
"secondary_currency": {
"value": "0.00"
},
"value": "0.00"
},
"sales_tax": {
"secondary_currency": {
"value": "411.84"
},
"value": "411.84"
},
"additional_tax": {
"secondary_currency": {
"value": "0.00"
},
"value": "0.00"
},
"price_adjustment": {
"secondary_currency": {
"value": "0.00"
},
"value": "0.00"
},
"cost_center": null,
"gl_code": {
"id": "2000000040449"
},
"remarks": "Delivery is expected within a month. Installation instructions will be provided separately.",
"terms": "Payment is due within 30 days of the invoice date. Late payments will incur a penalty of 2% per month.",
"place": "Chennai",
"sign_authority": "SDPCloud",
"exchange_rate": "1",
"discount_rate": "12",
"sales_tax_rate": "10",
"items": [
{
"product": {
"id": "2000000040463"
},
"cost_center": {
"id": "2000000040445"
},
"price": "234",
"tax_rate": "0",
"ordered_quantity": "10"
},
{
"product": {
"id": "2000000040463"
},
"price": "234",
"tax_rate": "0",
"ordered_quantity": "10"
}
],
"sites": [
{
"id": "2000000006824",
"name": "Base Site"
}
]
}
}'
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/purchase_orders";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
input_data = {
"purchase_order": {
"template": {
"id": "2000000034044"
},
"attachments": [],
"itemwise_costcenter": true,
"itemwise_glcode": false,
"requested_by": {
"id": "2000000040351"
},
"custom_id": "1",
"name": "PO-Zykler",
"required_date": {
"value": 1739385000000
},
"vendor": {
"id": "2000000040455"
},
"ship_address": "No 89, Chennai",
"bill_address": "No 89, Chennai",
"discount": {
"secondary_currency": {
"value": "561.60"
},
"value": "561.60"
},
"shipping_price": {
"secondary_currency": {
"value": "0.00"
},
"value": "0.00"
},
"sales_tax": {
"secondary_currency": {
"value": "411.84"
},
"value": "411.84"
},
"additional_tax": {
"secondary_currency": {
"value": "0.00"
},
"value": "0.00"
},
"price_adjustment": {
"secondary_currency": {
"value": "0.00"
},
"value": "0.00"
},
"gl_code": {
"id": "2000000040449"
},
"remarks": "Delivery is expected within a month. Installation instructions will be provided separately.",
"terms": "Payment is due within 30 days of the invoice date. Late payments will incur a penalty of 2% per month.",
"place": "Chennai",
"sign_authority": "SDPCloud",
"exchange_rate": "1",
"discount_rate": "12",
"sales_tax_rate": "10",
"items": [
{
"product": {
"id": "2000000040463"
},
"cost_center": {
"id": "2000000040445"
},
"price": "234",
"tax_rate": "0",
"ordered_quantity": "10"
},
{
"product": {
"id": "2000000040463"
},
"price": "234",
"tax_rate": "0",
"ordered_quantity": "10"
}
],
"sites": [
{
"id": "2000000006824",
"name": "Base Site"
}
]
}
};
params = {"input_data": input_data};
response = invokeurl
[
url: url
type: POST
parameters: params
headers: headers
];
info response;
#Powershell version - 5.1
$url = "<service domain|custom domain>/app/<portal>/api/v3/purchase_orders"
$headers = @{ "Accept" = "application/vnd.manageengine.sdp.v3+json"
"Authorization" = "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"
"Content-Type" = "application/x-www-form-urlencoded"}
$input_data = @'
{
"purchase_order": {
"template": {
"id": "2000000034044"
},
"attachments": [],
"itemwise_costcenter": true,
"itemwise_glcode": false,
"requested_by": {
"id": "2000000040351"
},
"custom_id": "1",
"name": "PO-Zykler",
"required_date": {
"value": 1739385000000
},
"vendor": {
"id": "2000000040455"
},
"ship_address": "No 89, Chennai",
"bill_address": "No 89, Chennai",
"discount": {
"secondary_currency": {
"value": "561.60"
},
"value": "561.60"
},
"shipping_price": {
"secondary_currency": {
"value": "0.00"
},
"value": "0.00"
},
"sales_tax": {
"secondary_currency": {
"value": "411.84"
},
"value": "411.84"
},
"additional_tax": {
"secondary_currency": {
"value": "0.00"
},
"value": "0.00"
},
"price_adjustment": {
"secondary_currency": {
"value": "0.00"
},
"value": "0.00"
},
"gl_code": {
"id": "2000000040449"
},
"remarks": "Delivery is expected within a month. Installation instructions will be provided separately.",
"terms": "Payment is due within 30 days of the invoice date. Late payments will incur a penalty of 2% per month.",
"place": "Chennai",
"sign_authority": "SDPCloud",
"exchange_rate": "1",
"discount_rate": "12",
"sales_tax_rate": "10",
"items": [
{
"product": {
"id": "2000000040463"
},
"cost_center": {
"id": "2000000040445"
},
"price": "234",
"tax_rate": "0",
"ordered_quantity": "10"
},
{
"product": {
"id": "2000000040463"
},
"price": "234",
"tax_rate": "0",
"ordered_quantity": "10"
}
],
"sites": [
{
"id": "2000000006824",
"name": "Base Site"
}
]
}
}
'@
$data = @{ 'input_data' = $input_data}
$response = Invoke-RestMethod -Uri $url -Method post -Body $data -Headers $headers
$response
#Python version - 3.10
from urllib.error import HTTPError
from urllib.parse import urlencode
from urllib.request import urlopen,Request
url = "<service domain|custom domain>/app/<portal>/api/v3/purchase_orders"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"Content-Type" : "application/x-www-form-urlencoded"}
input_data = '''{
"purchase_order": {
"template": {
"id": "2000000034044"
},
"attachments": [],
"itemwise_costcenter": true,
"itemwise_glcode": false,
"requested_by": {
"id": "2000000040351"
},
"custom_id": "1",
"name": "PO-Zykler",
"required_date": {
"value": 1739385000000
},
"vendor": {
"id": "2000000040455"
},
"ship_address": "No 89, Chennai",
"bill_address": "No 89, Chennai",
"discount": {
"secondary_currency": {
"value": "561.60"
},
"value": "561.60"
},
"shipping_price": {
"secondary_currency": {
"value": "0.00"
},
"value": "0.00"
},
"sales_tax": {
"secondary_currency": {
"value": "411.84"
},
"value": "411.84"
},
"additional_tax": {
"secondary_currency": {
"value": "0.00"
},
"value": "0.00"
},
"price_adjustment": {
"secondary_currency": {
"value": "0.00"
},
"value": "0.00"
},
"gl_code": {
"id": "2000000040449"
},
"remarks": "Delivery is expected within a month. Installation instructions will be provided separately.",
"terms": "Payment is due within 30 days of the invoice date. Late payments will incur a penalty of 2% per month.",
"place": "Chennai",
"sign_authority": "SDPCloud",
"exchange_rate": "1",
"discount_rate": "12",
"sales_tax_rate": "10",
"items": [
{
"product": {
"id": "2000000040463"
},
"cost_center": {
"id": "2000000040445"
},
"price": "234",
"tax_rate": "0",
"ordered_quantity": "10"
},
{
"product": {
"id": "2000000040463"
},
"price": "234",
"tax_rate": "0",
"ordered_quantity": "10"
}
],
"sites": [
{
"id": "2000000006824",
"name": "Base Site"
}
]
}
}'''
data = urlencode({"input_data":input_data}).encode()
httprequest = Request(url, headers=headers,data=data, method="POST")
try:
with urlopen(httprequest) as response:
print(response.read().decode())
except HTTPError as e:
print(e.read().decode())
{
"response_status": {
"status_code": 2000,
"status": "success"
},
"purchase_order": {
"template": {
"inactive": false,
"name": "Purchase Order Template",
"id": "2000000034044"
},
"attachments": [],
"itemwise_costcenter": true,
"discount": {
"display_value": "561.60",
"currency_symbol": "$",
"value": 561.6
},
"additional_tax_rate": "-1",
"sites": [
{
"deleted": false,
"name": "Base Site",
"id": "2000000006824",
"is_default": true
}
],
"discount_rate": "12",
"gl_code": {
"name": "AWS-GL1",
"id": "2000000040449"
},
"is_shipping_include": false,
"sign_authority": null,
"received_date": null,
"price_adjustment": {
"display_value": "0.00",
"currency_symbol": "$",
"value": 0
},
"terms": "Payment is due within 30 days of the invoice date. Late payments will incur a penalty of 2% per month.",
"vendor": {
"name": "Zykler",
"description": "No Description",
"currency": {
"symbol": "$",
"code": "USD",
"exchange_rate": "1",
"name": "US Dollar",
"id": "2000000004427"
},
"id": "2000000040455"
},
"sales_tax_rate": "10",
"currency": {
"symbol": "$",
"code": "USD",
"exchange_rate": "1",
"name": "US Dollar",
"id": "2000000004427"
},
"id": "2000000040475",
"place": "Chennai",
"ship_address": "No 89, Chennai",
"owner": {
"email_id": "guest@zylker.com",
"is_technician": true,
"sms_mail": null,
"mobile": "9781234450",
"last_name": "T8779",
"user_scope": "internal_user",
"sms_mail_id": null,
"cost_per_hour": "0",
"site": {
"deleted": false,
"name": "Base Site",
"id": "2000000006824",
"is_default": true
},
"phone": "",
"employee_id": null,
"name": "SDPCloud",
"id": "2000000040351",
"photo_url": "https://contacts.zoho.com/file?sample",
"is_vip_user": false,
"department": null,
"first_name": "Test",
"job_title": null
},
"shipping_price": {
"display_value": "0.00",
"currency_symbol": "$",
"value": 0
},
"required_date": {
"display_value": "Feb 13, 2025",
"value": "1739385000000"
},
"exchange_rate": null,
"additional_tax": {
"display_value": "0.00",
"currency_symbol": "$",
"value": 0
},
"total_price": {
"display_value": "4530.24",
"currency_symbol": "$",
"value": 4530.24
},
"net_total": {
"display_value": "4118.4",
"currency_symbol": "$",
"value": 4118.4
},
"custom_id": "1",
"bill_address": "No 89, Chennai",
"requested_by": {
"email_id": "guest@zylker.com",
"is_technician": true,
"sms_mail": null,
"mobile": null,
"last_name": "T8779",
"user_scope": "internal_user",
"sms_mail_id": null,
"cost_per_hour": "0",
"site": {
"deleted": false,
"name": "Base Site",
"id": "2000000006824",
"is_default": true
},
"phone": "",
"employee_id": null,
"name": "SDPCloud",
"id": "2000000040351",
"photo_url": "https://contacts.zoho.com/file?sample",
"is_vip_user": false,
"department": null,
"first_name": "Test",
"job_title": null
},
"sales_tax": {
"display_value": "411.84",
"currency_symbol": "$",
"value": 411.84000000000003
},
"itemwise_glcode": false,
"cost_center": null,
"name": "PO-Zykler",
"sub_total": {
"display_value": "4680.00",
"currency_symbol": "$",
"value": 4680
},
"created_date": {
"display_value": "Jan 22, 2025",
"value": "1737522946576"
},
"items": [
{
"ordered_quantity": "10",
"purchase_lot_id": null,
"product": {
"part_no": "-",
"gl_code": null,
"product_type": {
"image": "asset_access_points",
"extension": {
"api_plural_name": "asset_access_points",
"name": "asset_access_point",
"display_name_plural": "sdp.inventory.breadcrumb.accesspoints",
"id": "2000000002635",
"display_name": "Access Point",
"category": "ASSET",
"icon_name": null
},
"entity_category": "ASSET",
"api_plural_name": "asset_access_points",
"description": "Wireless Access Point",
"display_name": "Access Point",
"type": {
"name": "Asset",
"id": "2000000002685"
},
"mandatory": true,
"parent_product_visibility": false,
"sibling_product_visibility": false,
"name": "Access Point",
"display_name_plural": "Access Points",
"child_product_visibility": true,
"id": "2000000002705",
"category": {
"name": "IT",
"description": "IT Assets and Components",
"id": "2000000002681",
"display_name": "IT"
},
"inherits": {
"extension": {
"id": "2000000002615"
},
"api_plural_name": "assets",
"name": "All Assets",
"id": "2000000002691",
"display_name": "All Assets"
}
},
"software": null,
"name": "Z-AP",
"id": "2000000040463",
"type": {
"name": "Asset",
"id": "2000000002685"
},
"category": {
"name": "IT",
"description": "IT Assets and Components",
"id": "2000000002681"
},
"manufacturer": "-"
},
"other": null,
"amount": "2340.00",
"description": null,
"warranty_expiry": null,
"product_vendor_association": {
"vendor": {
"id": "2000000040455"
},
"id": "2000000040473"
},
"tax_rate": "0",
"total_received_quantity": null,
"gl_code": {
"name": "AWS-GL1",
"id": "2000000040449"
},
"cost_center": {
"name": "PCW1",
"id": "2000000040445",
"cost_center_code": "PCW1"
},
"service": null,
"price": "234",
"name": "Z-AP",
"id": "2000000040481",
"date_received": null,
"service_vendor_association": null
},
{
"ordered_quantity": "10",
"purchase_lot_id": null,
"product": {
"part_no": "-",
"gl_code": null,
"product_type": {
"image": "asset_access_points",
"extension": {
"api_plural_name": "asset_access_points",
"name": "asset_access_point",
"display_name_plural": "sdp.inventory.breadcrumb.accesspoints",
"id": "2000000002635",
"display_name": "Access Point",
"category": "ASSET",
"icon_name": null
},
"entity_category": "ASSET",
"api_plural_name": "asset_access_points",
"description": "Wireless Access Point",
"display_name": "Access Point",
"type": {
"name": "Asset",
"id": "2000000002685"
},
"mandatory": true,
"parent_product_visibility": false,
"sibling_product_visibility": false,
"name": "Access Point",
"display_name_plural": "Access Points",
"child_product_visibility": true,
"id": "2000000002705",
"category": {
"name": "IT",
"description": "IT Assets and Components",
"id": "2000000002681",
"display_name": "IT"
},
"inherits": {
"extension": {
"id": "2000000002615"
},
"api_plural_name": "assets",
"name": "All Assets",
"id": "2000000002691",
"display_name": "All Assets"
}
},
"software": null,
"name": "Z-AP",
"id": "2000000040463",
"type": {
"name": "Asset",
"id": "2000000002685"
},
"category": {
"name": "IT",
"description": "IT Assets and Components",
"id": "2000000002681"
},
"manufacturer": "-"
},
"other": null,
"amount": "2340.00",
"description": null,
"warranty_expiry": null,
"product_vendor_association": {
"vendor": {
"id": "2000000040455"
},
"id": "2000000040473"
},
"tax_rate": "0",
"total_received_quantity": null,
"gl_code": {
"name": "AWS-GL1",
"id": "2000000040449"
},
"cost_center": null,
"service": null,
"price": "234",
"name": "Z-AP",
"id": "2000000040483",
"date_received": null,
"service_vendor_association": null
}
],
"deleted_time": null,
"remarks": "Delivery is expected within a month. Installation instructions will be provided separately.",
"notes_present": false,
"status": {
"name": "Open",
"id": "2000000002390"
}
}
}
编辑采购订单
使用此操作编辑特定采购订单
URL
<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}
属性
更多属性 全部展开
$ curl <service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}\
-X PUT\
-H "Accept: application/vnd.manageengine.sdp.v3+json"\
-H "Authorization: Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"\
-H "Content-Type: application/x-www-form-urlencoded"\
-d input_data='{
"purchase_order": {
"shipping_price": {
"secondary_currency": {
"value": "10.00"
},
"value": "10.00"
},
"price_adjustment": {
"secondary_currency": {
"value": "0.00"
},
"value": "0.00"
},
"discount": {
"secondary_currency": {
"value": "589.68"
},
"value": "589.68"
},
"sales_tax": {
"secondary_currency": {
"value": "432.43"
},
"value": "432.43"
},
"additional_tax": {
"secondary_currency": {
"value": "0.00"
},
"value": "0.00"
},
"items": [
{
"id": "2000000040481",
"product": {
"id": "2000000040463"
},
"cost_center": {
"id": "2000000040445"
},
"price": "234",
"tax_rate": "10",
"ordered_quantity": "10"
},
{
"id": "2000000040483",
"product": {
"id": "2000000040463"
},
"price": "234",
"tax_rate": "0",
"ordered_quantity": "10"
}
],
"discount_rate": "12",
"sales_tax_rate": "10",
"sites": [
{
"id": "2000000006824",
"name": "Base Site"
}
]
}
}'
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
input_data = {
"purchase_order": {
"shipping_price": {
"secondary_currency": {
"value": "10.00"
},
"value": "10.00"
},
"price_adjustment": {
"secondary_currency": {
"value": "0.00"
},
"value": "0.00"
},
"discount": {
"secondary_currency": {
"value": "589.68"
},
"value": "589.68"
},
"sales_tax": {
"secondary_currency": {
"value": "432.43"
},
"value": "432.43"
},
"additional_tax": {
"secondary_currency": {
"value": "0.00"
},
"value": "0.00"
},
"items": [
{
"id": "2000000040481",
"product": {
"id": "2000000040463"
},
"cost_center": {
"id": "2000000040445"
},
"price": "234",
"tax_rate": "10",
"ordered_quantity": "10"
},
{
"id": "2000000040483",
"product": {
"id": "2000000040463"
},
"price": "234",
"tax_rate": "0",
"ordered_quantity": "10"
}
],
"discount_rate": "12",
"sales_tax_rate": "10",
"sites": [
{
"id": "2000000006824",
"name": "Base Site"
}
]
}
};
params = {"input_data": input_data};
response = invokeurl
[
url: url
type: PUT
parameters: params
headers: headers
];
info response;
#Powershell version - 5.1
$url = "<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}"
$headers = @{"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"Content-Type" : "application/x-www-form-urlencoded"}
$input_data = @'
{
"purchase_order": {
"shipping_price": {
"secondary_currency": {
"value": "10.00"
},
"value": "10.00"
},
"price_adjustment": {
"secondary_currency": {
"value": "0.00"
},
"value": "0.00"
},
"discount": {
"secondary_currency": {
"value": "589.68"
},
"value": "589.68"
},
"sales_tax": {
"secondary_currency": {
"value": "432.43"
},
"value": "432.43"
},
"additional_tax": {
"secondary_currency": {
"value": "0.00"
},
"value": "0.00"
},
"items": [
{
"id": "2000000040481",
"product": {
"id": "2000000040463"
},
"cost_center": {
"id": "2000000040445"
},
"price": "234",
"tax_rate": "10",
"ordered_quantity": "10"
},
{
"id": "2000000040483",
"product": {
"id": "2000000040463"
},
"price": "234",
"tax_rate": "0",
"ordered_quantity": "10"
}
],
"discount_rate": "12",
"sales_tax_rate": "10",
"sites": [
{
"id": "2000000006824",
"name": "Base Site"
}
]
}
}
'@
$data = @{ 'input_data' = $input_data}
$response = Invoke-RestMethod -Uri $url -Method put -Body $data -Headers $headers
$response
#Python version - 3.10
from urllib.error import HTTPError
from urllib.parse import urlencode
from urllib.request import urlopen,Request
url = "<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"Content-Type" : "application/x-www-form-urlencoded"}
input_data = '''{
"purchase_order": {
"shipping_price": {
"secondary_currency": {
"value": "10.00"
},
"value": "10.00"
},
"price_adjustment": {
"secondary_currency": {
"value": "0.00"
},
"value": "0.00"
},
"discount": {
"secondary_currency": {
"value": "589.68"
},
"value": "589.68"
},
"sales_tax": {
"secondary_currency": {
"value": "432.43"
},
"value": "432.43"
},
"additional_tax": {
"secondary_currency": {
"value": "0.00"
},
"value": "0.00"
},
"items": [
{
"id": "2000000040481",
"product": {
"id": "2000000040463"
},
"cost_center": {
"id": "2000000040445"
},
"price": "234",
"tax_rate": "10",
"ordered_quantity": "10"
},
{
"id": "2000000040483",
"product": {
"id": "2000000040463"
},
"price": "234",
"tax_rate": "0",
"ordered_quantity": "10"
}
],
"discount_rate": "12",
"sales_tax_rate": "10",
"sites": [
{
"id": "2000000006824",
"name": "Base Site"
}
]
}
}'''
data = urlencode({"input_data":input_data}).encode()
httprequest = Request(url, headers=headers,data=data, method="PUT")
try:
with urlopen(httprequest) as response:
print(response.read().decode())
except HTTPError as e:
print(e.read().decode())
{
"response_status": {
"status_code": 2000,
"status": "success"
},
"purchase_order": {
"template": {
"inactive": false,
"name": "Purchase Order Template",
"id": "2000000034044"
},
"attachments": [],
"itemwise_costcenter": true,
"discount": {
"display_value": "589.68",
"currency_symbol": "$",
"value": 589.6800000000001
},
"additional_tax_rate": "-1",
"sites": [
{
"deleted": false,
"name": "Base Site",
"id": "2000000006824",
"is_default": true
}
],
"discount_rate": "12",
"gl_code": {
"name": "AWS-GL1",
"id": "2000000040449"
},
"is_shipping_include": false,
"sign_authority": null,
"received_date": null,
"price_adjustment": {
"display_value": "0.00",
"currency_symbol": "$",
"value": 0
},
"terms": "Payment is due within 30 days of the invoice date. Late payments will incur a penalty of 2% per month.",
"vendor": {
"name": "Zykler",
"description": "No Description",
"currency": {
"symbol": "$",
"code": "USD",
"exchange_rate": "1",
"name": "US Dollar",
"id": "2000000004427"
},
"id": "2000000040455"
},
"sales_tax_rate": "10",
"currency": {
"symbol": "$",
"code": "USD",
"exchange_rate": "1",
"name": "US Dollar",
"id": "2000000004427"
},
"id": "2000000040475",
"place": "Chennai",
"ship_address": "No 89, Chennai",
"owner": {
"email_id": "guest@zylker.com",
"is_technician": true,
"sms_mail": null,
"mobile": null,
"last_name": "T8779",
"user_scope": "internal_user",
"sms_mail_id": null,
"cost_per_hour": "0",
"site": {
"deleted": false,
"name": "Base Site",
"id": "2000000006824",
"is_default": true
},
"phone": "",
"employee_id": null,
"name": "SDPCloud",
"id": "2000000040351",
"photo_url": "https://contacts.zoho.com/file?sample",
"is_vip_user": false,
"department": null,
"first_name": "Test",
"job_title": null
},
"shipping_price": {
"display_value": "10.00",
"currency_symbol": "$",
"value": 10
},
"required_date": {
"display_value": "Feb 13, 2025",
"value": "1739385000000"
},
"exchange_rate": null,
"additional_tax": {
"display_value": "0.00",
"currency_symbol": "$",
"value": 0
},
"total_price": {
"display_value": "4766.75",
"currency_symbol": "$",
"value": 4766.7519999999995
},
"net_total": {
"display_value": "4324.32",
"currency_symbol": "$",
"value": 4324.32
},
"custom_id": "1",
"bill_address": "No 89, Chennai",
"requested_by": {
"email_id": "guest@zylker.com",
"is_technician": true,
"sms_mail": null,
"mobile": null,
"last_name": "T8779",
"user_scope": "internal_user",
"sms_mail_id": null,
"cost_per_hour": "0",
"site": {
"deleted": false,
"name": "Base Site",
"id": "2000000006824",
"is_default": true
},
"phone": "",
"employee_id": null,
"name": "SDPCloud",
"id": "2000000040351",
"photo_url": "https://contacts.zoho.com/file?sample",
"is_vip_user": false,
"department": null,
"first_name": "Test",
"job_title": null
},
"sales_tax": {
"display_value": "432.43",
"currency_symbol": "$",
"value": 432.43199999999996
},
"itemwise_glcode": false,
"cost_center": null,
"name": "PO-Zykler",
"sub_total": {
"display_value": "4914.00",
"currency_symbol": "$",
"value": 4914
},
"created_date": {
"display_value": "Jan 22, 2025",
"value": "1737522946576"
},
"items": [
{
"ordered_quantity": "10",
"purchase_lot_id": null,
"product": {
"part_no": "-",
"gl_code": null,
"product_type": {
"image": "asset_access_points",
"extension": {
"api_plural_name": "asset_access_points",
"name": "asset_access_point",
"display_name_plural": "sdp.inventory.breadcrumb.accesspoints",
"id": "2000000002635",
"display_name": "Access Point",
"category": "ASSET",
"icon_name": null
},
"entity_category": "ASSET",
"api_plural_name": "asset_access_points",
"description": "Wireless Access Point",
"display_name": "Access Point",
"type": {
"name": "Asset",
"id": "2000000002685"
},
"mandatory": true,
"parent_product_visibility": false,
"sibling_product_visibility": false,
"name": "Access Point",
"display_name_plural": "Access Points",
"child_product_visibility": true,
"id": "2000000002705",
"category": {
"name": "IT",
"description": "IT Assets and Components",
"id": "2000000002681",
"display_name": "IT"
},
"inherits": {
"extension": {
"id": "2000000002615"
},
"api_plural_name": "assets",
"name": "All Assets",
"id": "2000000002691",
"display_name": "All Assets"
}
},
"software": null,
"name": "Z-AP",
"id": "2000000040463",
"type": {
"name": "Asset",
"id": "2000000002685"
},
"category": {
"name": "IT",
"description": "IT Assets and Components",
"id": "2000000002681"
},
"manufacturer": "-"
},
"other": null,
"amount": "2574.00",
"description": null,
"warranty_expiry": null,
"product_vendor_association": {
"vendor": {
"id": "2000000040455"
},
"id": "2000000040473"
},
"tax_rate": "10",
"total_received_quantity": null,
"gl_code": {
"name": "AWS-GL1",
"id": "2000000040449"
},
"cost_center": {
"name": "PCW1",
"id": "2000000040445",
"cost_center_code": "PCW1"
},
"service": null,
"price": "234",
"name": "Z-AP",
"id": "2000000040481",
"date_received": null,
"service_vendor_association": null
},
{
"ordered_quantity": "10",
"purchase_lot_id": null,
"product": {
"part_no": "-",
"gl_code": null,
"product_type": {
"image": "asset_access_points",
"extension": {
"api_plural_name": "asset_access_points",
"name": "asset_access_point",
"display_name_plural": "sdp.inventory.breadcrumb.accesspoints",
"id": "2000000002635",
"display_name": "Access Point",
"category": "ASSET",
"icon_name": null
},
"entity_category": "ASSET",
"api_plural_name": "asset_access_points",
"description": "Wireless Access Point",
"display_name": "Access Point",
"type": {
"name": "Asset",
"id": "2000000002685"
},
"mandatory": true,
"parent_product_visibility": false,
"sibling_product_visibility": false,
"name": "Access Point",
"display_name_plural": "Access Points",
"child_product_visibility": true,
"id": "2000000002705",
"category": {
"name": "IT",
"description": "IT Assets and Components",
"id": "2000000002681",
"display_name": "IT"
},
"inherits": {
"extension": {
"id": "2000000002615"
},
"api_plural_name": "assets",
"name": "All Assets",
"id": "2000000002691",
"display_name": "All Assets"
}
},
"software": null,
"name": "Z-AP",
"id": "2000000040463",
"type": {
"name": "Asset",
"id": "2000000002685"
},
"category": {
"name": "IT",
"description": "IT Assets and Components",
"id": "2000000002681"
},
"manufacturer": "-"
},
"other": null,
"amount": "2340.00",
"description": null,
"warranty_expiry": null,
"product_vendor_association": {
"vendor": {
"id": "2000000040455"
},
"id": "2000000040473"
},
"tax_rate": "0",
"total_received_quantity": null,
"gl_code": {
"name": "AWS-GL1",
"id": "2000000040449"
},
"cost_center": null,
"service": null,
"price": "234",
"name": "Z-AP",
"id": "2000000040483",
"date_received": null,
"service_vendor_association": null
}
],
"deleted_time": null,
"remarks": "Delivery is expected within a month. Installation instructions will be provided separately.",
"notes_present": false,
"status": {
"name": "Open",
"id": "2000000002390"
}
}
}
获取采购订单
使用此操作获取特定采购订单
URL
<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}
属性
更多属性 全部展开
$ curl -G <service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}\
-X GET\
-H "Accept: application/vnd.manageengine.sdp.v3+json"\
-H "Authorization: Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"\
-H "Content-Type: application/x-www-form-urlencoded"
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
response = invokeurl
[
url: url
type: GET
headers: headers
];
info response;
#Powershell version - 5.1
$url = "<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}"
$headers = @{ "Accept" = "application/vnd.manageengine.sdp.v3+json"
"Authorization" = "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"
"Content-Type" = "application/x-www-form-urlencoded"}
$response = Invoke-RestMethod -Uri $url -Method get -Headers $headers
$response
#Python version - 3.8
#This script requires requests module installed in python.
from urllib.error import HTTPError
from urllib.parse import urlencode
from urllib.request import urlopen,Request
url = "<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"Content-Type" : "application/x-www-form-urlencoded"}
httprequest = Request(url, headers=headers)
try:
with urlopen(httprequest) as response:
print(response.read().decode())
except HTTPError as e:
print(e.read().decode())
{
"response_status": {
"status_code": 2000,
"status": "success"
},
"purchase_order": {
"template": {
"inactive": false,
"name": "Purchase Order Template",
"id": "2000000034044"
},
"attachments": [],
"itemwise_costcenter": true,
"discount": {
"display_value": "589.68",
"currency_symbol": "$",
"value": 589.6800000000001
},
"additional_tax_rate": "-1",
"sites": [
{
"deleted": false,
"name": "Base Site",
"id": "2000000006824",
"is_default": true
}
],
"discount_rate": "12",
"gl_code": {
"name": "AWS-GL1",
"id": "2000000040449"
},
"is_shipping_include": false,
"sign_authority": null,
"received_date": null,
"price_adjustment": {
"display_value": "0.00",
"currency_symbol": "$",
"value": 0
},
"terms": "Payment is due within 30 days of the invoice date. Late payments will incur a penalty of 2% per month.",
"vendor": {
"name": "Zykler",
"description": "No Description",
"currency": {
"symbol": "$",
"code": "USD",
"exchange_rate": "1",
"name": "US Dollar",
"id": "2000000004427"
},
"id": "2000000040455"
},
"sales_tax_rate": "10",
"currency": {
"symbol": "$",
"code": "USD",
"exchange_rate": "1",
"name": "US Dollar",
"id": "2000000004427"
},
"id": "2000000040475",
"place": "Chennai",
"ship_address": "No 89, Chennai",
"owner": {
"email_id": "guest@zylker.com",
"is_technician": true,
"sms_mail": null,
"mobile": null,
"last_name": "T8779",
"user_scope": "internal_user",
"sms_mail_id": null,
"cost_per_hour": "0",
"site": {
"deleted": false,
"name": "Base Site",
"id": "2000000006824",
"is_default": true
},
"phone": "",
"employee_id": null,
"name": "SDPCloud",
"id": "2000000040351",
"photo_url": "https://contacts.zoho.com/file?sample",
"is_vip_user": false,
"department": null,
"first_name": "Test",
"job_title": null
},
"shipping_price": {
"display_value": "10.00",
"currency_symbol": "$",
"value": 10
},
"required_date": {
"display_value": "Feb 13, 2025",
"value": "1739385000000"
},
"exchange_rate": null,
"additional_tax": {
"display_value": "0.00",
"currency_symbol": "$",
"value": 0
},
"total_price": {
"display_value": "4766.75",
"currency_symbol": "$",
"value": 4766.7519999999995
},
"net_total": {
"display_value": "4324.32",
"currency_symbol": "$",
"value": 4324.32
},
"custom_id": "1",
"bill_address": "No 89, Chennai",
"requested_by": {
"email_id": "guest@zylker.com",
"is_technician": true,
"sms_mail": null,
"mobile": null,
"last_name": "T8779",
"user_scope": "internal_user",
"sms_mail_id": null,
"cost_per_hour": "0",
"site": {
"deleted": false,
"name": "Base Site",
"id": "2000000006824",
"is_default": true
},
"phone": "",
"employee_id": null,
"name": "SDPCloud",
"id": "2000000040351",
"photo_url": "https://contacts.zoho.com/file?sample",
"is_vip_user": false,
"department": null,
"first_name": "Test",
"job_title": null
},
"sales_tax": {
"display_value": "432.43",
"currency_symbol": "$",
"value": 432.43199999999996
},
"itemwise_glcode": false,
"cost_center": null,
"name": "PO-Zykler",
"sub_total": {
"display_value": "4914.00",
"currency_symbol": "$",
"value": 4914
},
"created_date": {
"display_value": "Jan 22, 2025",
"value": "1737522946576"
},
"items": [
{
"ordered_quantity": "10",
"purchase_lot_id": null,
"product": {
"part_no": "-",
"gl_code": null,
"product_type": {
"image": "asset_access_points",
"extension": {
"api_plural_name": "asset_access_points",
"name": "asset_access_point",
"display_name_plural": "sdp.inventory.breadcrumb.accesspoints",
"id": "2000000002635",
"display_name": "Access Point",
"category": "ASSET",
"icon_name": null
},
"entity_category": "ASSET",
"api_plural_name": "asset_access_points",
"description": "Wireless Access Point",
"display_name": "Access Point",
"type": {
"name": "Asset",
"id": "2000000002685"
},
"mandatory": true,
"parent_product_visibility": false,
"sibling_product_visibility": false,
"name": "Access Point",
"display_name_plural": "Access Points",
"child_product_visibility": true,
"id": "2000000002705",
"category": {
"name": "IT",
"description": "IT Assets and Components",
"id": "2000000002681",
"display_name": "IT"
},
"inherits": {
"extension": {
"id": "2000000002615"
},
"api_plural_name": "assets",
"name": "All Assets",
"id": "2000000002691",
"display_name": "All Assets"
}
},
"software": null,
"name": "Z-AP",
"id": "2000000040463",
"type": {
"name": "Asset",
"id": "2000000002685"
},
"category": {
"name": "IT",
"description": "IT Assets and Components",
"id": "2000000002681"
},
"manufacturer": "-"
},
"other": null,
"amount": "2574.00",
"description": null,
"warranty_expiry": null,
"product_vendor_association": {
"vendor": {
"id": "2000000040455"
},
"id": "2000000040473"
},
"tax_rate": "10",
"total_received_quantity": null,
"gl_code": {
"name": "AWS-GL1",
"id": "2000000040449"
},
"cost_center": {
"name": "PCW1",
"id": "2000000040445",
"cost_center_code": "PCW1"
},
"service": null,
"price": "234",
"name": "Z-AP",
"id": "2000000040481",
"date_received": null,
"service_vendor_association": null
},
{
"ordered_quantity": "10",
"purchase_lot_id": null,
"product": {
"part_no": "-",
"gl_code": null,
"product_type": {
"image": "asset_access_points",
"extension": {
"api_plural_name": "asset_access_points",
"name": "asset_access_point",
"display_name_plural": "sdp.inventory.breadcrumb.accesspoints",
"id": "2000000002635",
"display_name": "Access Point",
"category": "ASSET",
"icon_name": null
},
"entity_category": "ASSET",
"api_plural_name": "asset_access_points",
"description": "Wireless Access Point",
"display_name": "Access Point",
"type": {
"name": "Asset",
"id": "2000000002685"
},
"mandatory": true,
"parent_product_visibility": false,
"sibling_product_visibility": false,
"name": "Access Point",
"display_name_plural": "Access Points",
"child_product_visibility": true,
"id": "2000000002705",
"category": {
"name": "IT",
"description": "IT Assets and Components",
"id": "2000000002681",
"display_name": "IT"
},
"inherits": {
"extension": {
"id": "2000000002615"
},
"api_plural_name": "assets",
"name": "All Assets",
"id": "2000000002691",
"display_name": "All Assets"
}
},
"software": null,
"name": "Z-AP",
"id": "2000000040463",
"type": {
"name": "Asset",
"id": "2000000002685"
},
"category": {
"name": "IT",
"description": "IT Assets and Components",
"id": "2000000002681"
},
"manufacturer": "-"
},
"other": null,
"amount": "2340.00",
"description": null,
"warranty_expiry": null,
"product_vendor_association": {
"vendor": {
"id": "2000000040455"
},
"id": "2000000040473"
},
"tax_rate": "0",
"total_received_quantity": null,
"gl_code": {
"name": "AWS-GL1",
"id": "2000000040449"
},
"cost_center": null,
"service": null,
"price": "234",
"name": "Z-AP",
"id": "2000000040483",
"date_received": null,
"service_vendor_association": null
}
],
"deleted_time": null,
"remarks": "Delivery is expected within a month. Installation instructions will be provided separately.",
"notes_present": false,
"status": {
"name": "Open",
"id": "2000000002390"
}
}
}
获取采购订单列表
使用此操作获取采购订单列表
URL
<service domain|custom domain>/app/<portal>/api/v3/purchase_orders
属性
更多属性 全部展开
$ curl -G <service domain|custom domain>/app/<portal>/api/v3/purchase_orders\
-X GET\
-H "Accept: application/vnd.manageengine.sdp.v3+json"\
-H "Authorization: Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"\
-H "Content-Type: application/x-www-form-urlencoded"\
--data-urlencode input_data='{}'
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/purchase_orders";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
input_data = {};
params = {"input_data":input_data};
response = invokeurl
[
url: url
type: GET
parameters:params
headers: headers
];
info response;
#Powershell version - 5.1
$url = "<service domain|custom domain>/app/<portal>/api/v3/purchase_orders"
$headers = @{ "Accept" = "application/vnd.manageengine.sdp.v3+json"
"Authorization" = "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"
"Content-Type" = "application/x-www-form-urlencoded"}
$input_data = @'{}'@
$data = @{ 'input_data' = $input_data}
$response = Invoke-RestMethod -Uri $url -Method get -Body $data -Headers $headers
$response
#Python version - 3.8
#This script requires requests module installed in python.
from urllib.error import HTTPError
from urllib.parse import urlencode
from urllib.request import urlopen,Request
url = "<service domain|custom domain>/app/<portal>/api/v3/purchase_orders"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"Content-Type" : "application/x-www-form-urlencoded"}
input_data = '''{}'''
url += "?" + urlencode({"input_data":input_data})
httprequest = Request(url, headers=headers)
try:
with urlopen(httprequest) as response:
print(response.read().decode())
except HTTPError as e:
print(e.read().decode())
{
"purchase_orders": [
{
"owner": {
"email_id": "guest@zylker.com",
"is_technician": true,
"sms_mail": null,
"mobile": null,
"last_name": "T8779",
"user_scope": "internal_user",
"sms_mail_id": null,
"cost_per_hour": "0",
"site": {
"deleted": false,
"name": "Base Site",
"id": "2000000006824",
"is_default": true
},
"phone": "",
"employee_id": null,
"name": "SDPCloud",
"id": "2000000040351",
"photo_url": "https://contacts.zoho.com/file?sample",
"is_vip_user": false,
"department": null,
"first_name": "Test",
"job_title": null
},
"template": {
"inactive": false,
"name": "Purchase Order Template",
"id": "2000000034044"
},
"required_date": {
"display_value": "Feb 13, 2025",
"value": "1739385000000"
},
"total_price": {
"display_value": "4766.75",
"currency_symbol": "$",
"value": 4766.7519999999995
},
"custom_id": "1",
"sites": [
{
"name": "Base Site",
"id": "2000000006824"
}
],
"requested_by": {
"email_id": "guest@zylker.com",
"is_technician": true,
"sms_mail": null,
"mobile": null,
"last_name": "T8779",
"user_scope": "internal_user",
"sms_mail_id": null,
"cost_per_hour": "0",
"site": {
"deleted": false,
"name": "Base Site",
"id": "2000000006824",
"is_default": true
},
"phone": "",
"employee_id": null,
"name": "SDPCloud",
"id": "2000000040351",
"photo_url": "https://contacts.zoho.com/file?sample",
"is_vip_user": false,
"department": null,
"first_name": "Test",
"job_title": null
},
"vendor": {
"name": "Zykler",
"description": "No Description",
"currency": {
"symbol": "$",
"code": "USD",
"exchange_rate": "1",
"name": "US Dollar",
"id": "2000000004427"
},
"id": "2000000040455"
},
"name": "PO-Zykler",
"currency": {
"symbol": "$",
"code": "USD",
"exchange_rate": "1",
"is_frequent": true,
"name": "US Dollar",
"id": "2000000004427"
},
"id": "2000000040475",
"created_date": {
"display_value": "Jan 22, 2025",
"value": "1737522946576"
},
"notes_present": false,
"status": {
"name": "Open",
"id": "2000000002390"
}
},
{
"owner": {
"email_id": "guest@zylker.com",
"is_technician": true,
"sms_mail": null,
"mobile": null,
"last_name": "T8779",
"user_scope": "internal_user",
"sms_mail_id": null,
"cost_per_hour": "0",
"site": {
"deleted": false,
"name": "Base Site",
"id": "2000000006824",
"is_default": true
},
"phone": "",
"employee_id": null,
"name": "SDPCloud",
"id": "2000000040351",
"photo_url": "https://contacts.zoho.com/file?sample",
"is_vip_user": false,
"department": null,
"first_name": "Test",
"job_title": null
},
"template": {
"inactive": false,
"name": "Purchase Order Template",
"id": "2000000034044"
},
"required_date": {
"display_value": "Feb 13, 2025",
"value": "1739385000000"
},
"total_price": {
"display_value": "46,154.56",
"currency_symbol": "$",
"value": 46154.56
},
"custom_id": "2",
"sites": [
{
"name": "Base Site",
"id": "2000000006824"
}
],
"requested_by": {
"email_id": "guest@zylker.com",
"is_technician": true,
"sms_mail": null,
"mobile": null,
"last_name": "T8779",
"user_scope": "internal_user",
"sms_mail_id": null,
"cost_per_hour": "0",
"site": {
"deleted": false,
"name": "Base Site",
"id": "2000000006824",
"is_default": true
},
"phone": "",
"employee_id": null,
"name": "SDPCloud",
"id": "2000000040351",
"photo_url": "https://contacts.zoho.com/file?sample",
"is_vip_user": false,
"department": null,
"first_name": "Test",
"job_title": null
},
"vendor": {
"name": "Zykler",
"description": "No Description",
"currency": {
"symbol": "$",
"code": "USD",
"exchange_rate": "1",
"name": "US Dollar",
"id": "2000000004427"
},
"id": "2000000040455"
},
"name": "PO-Zykler HK",
"currency": {
"symbol": "$",
"code": "USD",
"exchange_rate": "1",
"is_frequent": true,
"name": "US Dollar",
"id": "2000000004427"
},
"id": "2000000040511",
"created_date": {
"display_value": "Jan 22, 2025",
"value": "1737525667399"
},
"notes_present": false,
"status": {
"name": "Open",
"id": "2000000002390"
}
}
],
"response_status": [
{
"status_code": 2000,
"status": "success"
}
],
"list_info": {
"has_more_rows": false,
"sort_field": "name",
"row_count": 2
}
}
删除采购订单
使用此操作删除特定采购订单
URL
<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}
$ curl <service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}\
-X DELETE\
-H "Accept: application/vnd.manageengine.sdp.v3+json"\
-H "Authorization: Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"\
-H "Content-Type: application/x-www-form-urlencoded"
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
response = invokeurl
[
url: url
type: DELETE
headers: headers
];
info response;
#Powershell version - 5.1
$url = "<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}"
$headers = @{ "Accept" = "application/vnd.manageengine.sdp.v3+json"
"Authorization" = "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"
"Content-Type" = "application/x-www-form-urlencoded"}
$response = Invoke-RestMethod -Uri $url -Method delete -Headers $headers
$response
#Python version - 3.10
from urllib.error import HTTPError
from urllib.request import urlopen,Request
url = "<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"Content-Type" : "application/x-www-form-urlencoded"}
httprequest = Request(url, headers=headers,method="DELETE")
try:
with urlopen(httprequest) as response:
print(response.read().decode())
except HTTPError as e:
print(e.read().decode())
{
"response_status": {
"status_code": 2000,
"status": "success"
}
}
拒绝采购订单
使用此操作审批采购订单并发送通知
URL
<service domain|custom domain>/app/<portal>/purchase_orders/{purchaseorder_id}/_reject
$ curl <service domain|custom domain>/app/<portal>/purchase_orders/{purchaseorder_id}/_reject\
-X PUT\
-H "Accept: application/vnd.manageengine.sdp.v3+json"\
-H "Authorization: Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"\
-H "Content-Type: application/x-www-form-urlencoded"\
-d input_data='{
"notification": {
"is_notify": true,
"to": [
"guest@zylker.com"
],
"subject": "Purchase Order 5 Rejected.",
"comments": "1234567"
}
}'
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/purchase_orders/{purchaseorder_id}/_reject";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
input_data = {
"notification": {
"is_notify": true,
"to": [
"guest@zylker.com"
],
"subject": "Purchase Order 5 Rejected.",
"comments": "1234567"
}
};
params = {"input_data": input_data};
response = invokeurl
[
url: url
type: PUT
parameters: params
headers: headers
];
info response;
#Powershell version - 5.1
$url = "<service domain|custom domain>/app/<portal>/purchase_orders/{purchaseorder_id}/_reject"
$headers = @{ "Accept" = "application/vnd.manageengine.sdp.v3+json"
"Authorization" = "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"
"Content-Type" = "application/x-www-form-urlencoded"}
$input_data = @'
{
"notification": {
"is_notify": true,
"to": [
"guest@zylker.com"
],
"subject": "Purchase Order 5 Rejected.",
"comments": "1234567"
}
}
'@
$data = @{ 'input_data' = $input_data}
$response = Invoke-RestMethod -Uri $url -Method put -Body $data -Headers $headers
$response
#Python version - 3.10
from urllib.error import HTTPError
from urllib.parse import urlencode
from urllib.request import urlopen,Request
url = "<service domain|custom domain>/app/<portal>/purchase_orders/{purchaseorder_id}/_reject"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"Content-Type" : "application/x-www-form-urlencoded"}
input_data = '''{
"notification": {
"is_notify": true,
"to": [
"guest@zylker.com"
],
"subject": "Purchase Order 5 Rejected.",
"comments": "1234567"
}
}'''
data = urlencode({"input_data":input_data}).encode()
httprequest = Request(url, headers=headers,data=data, method="PUT")
try:
with urlopen(httprequest) as response:
print(response.read().decode())
except HTTPError as e:
print(e.read().decode())
{}
添加发票
使用此操作创建带通知的发票
URL
<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/invoices
$ curl <service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/invoices\
-X POST\
-H "Accept: application/vnd.manageengine.sdp.v3+json"\
-H "Authorization: Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"\
-H "Content-Type: application/x-www-form-urlencoded"\
-d input_data='{
"po_invoice": {
"is_notify": true,
"invoice_id": "Invoice 2",
"received_date": {
"value": 1669314600000
},
"payment_due_date": {
"value": 1670610600000
},
"comments": "Invoice 2",
"notify_technicians": [
{
"id": "100000000000036117"
}
],
"notify_before_days": "2"
}
}'
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/invoices";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
input_data = {
"po_invoice": {
"is_notify": true,
"invoice_id": "Invoice 2",
"received_date": {
"value": 1669314600000
},
"payment_due_date": {
"value": 1670610600000
},
"comments": "Invoice 2",
"notify_technicians": [
{
"id": "100000000000036117"
}
],
"notify_before_days": "2"
}
};
params = {"input_data": input_data};
response = invokeurl
[
url: url
type: POST
parameters: params
headers: headers
];
info response;
#Powershell version - 5.1
$url = "<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/invoices"
$headers = @{"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"Content-Type" : "application/x-www-form-urlencoded"}
$input_data = @'
{
"po_invoice": {
"is_notify": true,
"invoice_id": "Invoice 2",
"received_date": {
"value": 1669314600000
},
"payment_due_date": {
"value": 1670610600000
},
"comments": "Invoice 2",
"notify_technicians": [
{
"id": "100000000000036117"
}
],
"notify_before_days": "2"
}
}
'@
$data = @{ 'input_data' = $input_data}
$response = Invoke-RestMethod -Uri $url -Method post -Body $data -Headers $headers
$response
#Python version - 3.10
from urllib.error import HTTPError
from urllib.parse import urlencode
from urllib.request import urlopen,Request
url = "<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/invoices"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"Content-Type" : "application/x-www-form-urlencoded"}
input_data = '''{
"po_invoice": {
"is_notify": true,
"invoice_id": "Invoice 2",
"received_date": {
"value": 1669314600000
},
"payment_due_date": {
"value": 1670610600000
},
"comments": "Invoice 2",
"notify_technicians": [
{
"id": "100000000000036117"
}
],
"notify_before_days": "2"
}
}'''
data = urlencode({"input_data":input_data}).encode()
httprequest = Request(url, headers=headers,data=data, method="POST")
try:
with urlopen(httprequest) as response:
print(response.read().decode())
except HTTPError as e:
print(e.read().decode())
{
"response_status": {
"status_code": 2000,
"status": "success"
},
"po_invoice": {
"is_escalated": false,
"comments": "Invoice 2",
"received_date": {
"display_value": "Nov 25, 2022",
"value": "1669314600000"
},
"purchase_order": {
"vendor": {
"id": "100000000000037235"
},
"custom_id": "35",
"name": "PO 35",
"id": "100000000000052293"
},
"invoice_id": "Invoice 2",
"notify_technicians": [
{
"email_id": "guest@zylker.com",
"is_technician": true,
"sms_mail": null,
"mobile": "9781234450",
"last_name": "T",
"user_scope": "internal_user",
"sms_mail_id": null,
"cost_per_hour": "0",
"phone": null,
"employee_id": "56",
"name": "Test",
"id": "100000000000036117",
"photo_url": "https://contacts.zoho.com/file?sample",
"is_vip_user": false,
"department": null,
"first_name": "Test",
"job_title": null
}
],
"payment_due_date": {
"display_value": "Dec 10, 2022",
"value": "1670610600000"
},
"id": "100000000000052449",
"created_by": {
"email_id": "guest@zylker.com",
"is_technician": true,
"sms_mail": null,
"mobile": "9781234450",
"last_name": "T",
"user_scope": "internal_user",
"sms_mail_id": null,
"phone": null,
"employee_id": "56",
"name": "Test",
"id": "100000000000036117",
"photo_url": "https://contacts.zoho.com/file?sample",
"is_vip_user": false,
"department": null,
"first_name": "Test",
"job_title": null
},
"notify_before_days": "2",
"is_notify": true
}
}
采购订单中接收发票
使用此操作将发票标记为已收并发送通知
URL
<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/_receive_invoice
$ curl <service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/_receive_invoice\
-X PUT\
-H "Accept: application/vnd.manageengine.sdp.v3+json"\
-H "Authorization: Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"\
-H "Content-Type: application/x-www-form-urlencoded"\
-d input_data='{
"notification": {
"is_notify": true,
"to": [
"guest@zylker.com"
],
"subject": "Purchase Order 6 Invoice Received",
"description": "\u003cdiv\u003eHi,\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003e\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eThis mail is to notify that invoice has been received for purchase order PO# 6.\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003e\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eClick here to view the Purchase Order : \u003cbr\u003e\u003c/div\u003e\u003cdiv\u003ehttps://purchase.test.zoho.com:8650/app/itdesk/ui/purchaseOrders/100000000000047139/details?selectTab\u003dpurchaseinfo\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003e\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eRegards,\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eIT Department\u003cbr\u003e\u003c/div\u003e",
"attachments": [],
"attach_po_as_pdf": false
}
}'
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/_receive_invoice";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
input_data = {
"notification": {
"is_notify": true,
"to": [
"guest@zylker.com"
],
"subject": "Purchase Order 6 Invoice Received",
"description": "\u003cdiv\u003eHi,\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003e\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eThis mail is to notify that invoice has been received for purchase order PO# 6.\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003e\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eClick here to view the Purchase Order : \u003cbr\u003e\u003c/div\u003e\u003cdiv\u003ehttps://purchase.test.zoho.com:8650/app/itdesk/ui/purchaseOrders/100000000000047139/details?selectTab\u003dpurchaseinfo\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003e\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eRegards,\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eIT Department\u003cbr\u003e\u003c/div\u003e",
"attachments": [],
"attach_po_as_pdf": false
}
};
params = {"input_data": input_data};
response = invokeurl
[
url: url
type: PUT
parameters: params
headers: headers
];
info response;
#Powershell version - 5.1
$url = "<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/_receive_invoice"
$headers = @{ "Accept" = "application/vnd.manageengine.sdp.v3+json"
"Authorization" = "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"
"Content-Type" = "application/x-www-form-urlencoded"}
$input_data = @'
{
"notification": {
"is_notify": true,
"to": [
"guest@zylker.com"
],
"subject": "Purchase Order 6 Invoice Received",
"description": "\u003cdiv\u003eHi,\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003e\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eThis mail is to notify that invoice has been received for purchase order PO# 6.\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003e\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eClick here to view the Purchase Order : \u003cbr\u003e\u003c/div\u003e\u003cdiv\u003ehttps://purchase.test.zoho.com:8650/app/itdesk/ui/purchaseOrders/100000000000047139/details?selectTab\u003dpurchaseinfo\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003e\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eRegards,\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eIT Department\u003cbr\u003e\u003c/div\u003e",
"attachments": [],
"attach_po_as_pdf": false
}
}
'@
$data = @{ 'input_data' = $input_data}
$response = Invoke-RestMethod -Uri $url -Method put -Body $data -Headers $headers
$response
#Python version - 3.10
from urllib.error import HTTPError
from urllib.parse import urlencode
from urllib.request import urlopen,Request
url = "<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/_receive_invoice"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"Content-Type" : "application/x-www-form-urlencoded"}
input_data = '''{
"notification": {
"is_notify": true,
"to": [
"guest@zylker.com"
],
"subject": "Purchase Order 6 Invoice Received",
"description": "\u003cdiv\u003eHi,\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003e\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eThis mail is to notify that invoice has been received for purchase order PO# 6.\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003e\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eClick here to view the Purchase Order : \u003cbr\u003e\u003c/div\u003e\u003cdiv\u003ehttps://purchase.test.zoho.com:8650/app/itdesk/ui/purchaseOrders/100000000000047139/details?selectTab\u003dpurchaseinfo\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003e\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eRegards,\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eIT Department\u003cbr\u003e\u003c/div\u003e",
"attachments": [],
"attach_po_as_pdf": false
}
}'''
data = urlencode({"input_data":input_data}).encode()
httprequest = Request(url, headers=headers,data=data, method="PUT")
try:
with urlopen(httprequest) as response:
print(response.read().decode())
except HTTPError as e:
print(e.read().decode())
{
"response_status": {
"status_code": 2000,
"messages": [
{
"status_code": 2000,
"type": "success",
"message": "Notification sent"
},
{
"status_code": 2000,
"type": "success",
"message": "Invoice received Successfully."
}
],
"status": "success"
}
}
无通知接收发票
使用此操作在采购订单中标记发票已收
URL
<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/_receive_invoice
$ curl <service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/_receive_invoice\
-X PUT\
-H "Accept: application/vnd.manageengine.sdp.v3+json"\
-H "Authorization: Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"\
-H "Content-Type: application/x-www-form-urlencoded"\
-d input_data='{
"notification": {
"is_notify": false
}
}'
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/_receive_invoice";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
input_data = {
"notification": {
"is_notify": false
}
};
params = {"input_data": input_data};
response = invokeurl
[
url: url
type: PUT
parameters: params
headers: headers
];
info response;
#Powershell version - 5.1
$url = "<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/_receive_invoice"
$headers = @{ "Accept" = "application/vnd.manageengine.sdp.v3+json"
"Authorization" = "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"
"Content-Type" = "application/x-www-form-urlencoded"}
$input_data = @'
{
"notification": {
"is_notify": false
}
}
'@
$data = @{ 'input_data' = $input_data}
$response = Invoke-RestMethod -Uri $url -Method put -Body $data -Headers $headers
$response
#Python version - 3.10
from urllib.error import HTTPError
from urllib.parse import urlencode
from urllib.request import urlopen,Request
url = "<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/_receive_invoice"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"Content-Type" : "application/x-www-form-urlencoded"}
input_data = '''{
"notification": {
"is_notify": false
}
}'''
data = urlencode({"input_data":input_data}).encode()
httprequest = Request(url, headers=headers,data=data, method="PUT")
try:
with urlopen(httprequest) as response:
print(response.read().decode())
except HTTPError as e:
print(e.read().decode())
{
"response_status": {
"status_code": 2000,
"messages": [
{
"status_code": 2000,
"type": "success",
"message": "Invoice received Successfully."
}
],
"status": "success"
}
}
在采购订单中添加附件
使用此操作向采购订单添加附件
必填字段:- filename
URL
<servicedomain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/_uploads
属性
filename (文件)
上传文件的路径必须以‘@’开头。
addtoattachment (布尔值)
表示是否将文件添加为关联实体的附件。
文件 (文件集合)
此处包含文件的详细信息。
显示属性
$ curl <servicedomain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/_uploads\
-X POST\
-H "Accept: application/vnd.manageengine.sdp.v3+json"\
-H "Authorization: Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"\
-H "Content-Type: multipart/form-data"\
-F "filename=@local_file_path" -F "addtoattachment=true"\
// Deluge Sample script
url = "<servicedomain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/_uploads";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
"Content-Type": "multipart/form-data",
"Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
file_list = List();
param1 = {"paramName":"filename", "content":"local_file_path"};
file_list.add(param1);
response = invokeurl
[
url: url
type: POST
headers: headers
files: file_list
];
info response;
#Powershell version - 5.1
$url = "<servicedomain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/_uploads"
$filePath = "local_file_path"
$addtoattachment = "true"
$boundary = [System.Guid]::NewGuid().ToString()
$headers = @{
"Accept" = "application/vnd.manageengine.sdp.v3+json"
"Authorization" = "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"
"Content-Type" = "multipart/form-data; boundary=`"$boundary`""
}
$content = [System.Text.Encoding]::GetEncoding('iso-8859-1').GetString([System.IO.File]::ReadAllBytes($filePath))
$body = (
"--$boundary",
"Content-Disposition: form-data; name=`"addtoattachment`"`r`n",
"$addtoattachment",
"--$boundary",
"Content-Disposition: form-data; name=`"filename`"; filename=`"$(Split-Path $filePath -Leaf)`"",
"Content-Type: $([System.Web.MimeMapping]::GetMimeMapping($filePath))`r`n",
$content,
"--$boundary--`r`n"
) -join "`r`n"
$response = Invoke-RestMethod -Uri $url -Method post -Headers $headers -Body $body
$response
#Python version - 3.10
from urllib.error import HTTPError
from urllib.request import Request,urlopen
import mimetypes
import ntpath
import uuid
url = "<servicedomain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/_uploads"
file_path = "local_file_path"
add_to_attachments = "true"
boundary = uuid.uuid4()
headers = {
"Content-Type": f"multipart/form-data; boundary={boundary}",
"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
}
with open(file_path, "rb") as f:
content = f.read()
body = (
bytes(f'--{boundary}\r\nContent-Disposition: form-data; name="addtoattachment"\r\n\r\n{add_to_attachments}\r\n', "utf-8")
+ bytes(f'--{boundary}\r\nContent-Disposition: form-data; name="filename"; filename="{ntpath.basename(file_path)}"\r\nContent-Type: {mimetypes.guess_type(file_path)[0] or "application/octet-stream"}\r\n\r\n', "utf-8")
+ content
+ bytes(f"\r\n--{boundary}--", "utf-8")
)
httprequest = Request(url, data=body, headers=headers)
try:
with urlopen(httprequest) as response:
print(response.read().decode("utf-8"))
except HTTPError as e:
print(e.read().decode())
{
"response_status": [
{
"status_code": 2000,
"status": "success"
}
],
"files": [
{
"content_type": "text/plain",
"size": "20",
"file_id": "11040",
"name": "file",
"content_url": "/purchase_orders/_uploads/11040"
}
]
}
付款完成通知
使用此操作标记付款完成并发送通知
URL
<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/_payment_done
$ curl <service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/_payment_done\
-X PUT\
-H "Accept: application/vnd.manageengine.sdp.v3+json"\
-H "Authorization: Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"\
-H "Content-Type: application/x-www-form-urlencoded"\
-d input_data='{
"notification": {
"is_notify": true,
"to": [
"guest@zylker.com"
],
"subject": "Purchase Order PO 4 Payment Done",
"description": " This mail is to notify that payment has been done for purchase order PO# PO 4",
"attachments": [],
"attach_po_as_pdf": false
}
}'
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/_payment_done";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
input_data = {
"notification": {
"is_notify": true,
"to": [
"guest@zylker.com"
],
"subject": "Purchase Order PO 4 Payment Done",
"description": " This mail is to notify that payment has been done for purchase order PO# PO 4",
"attachments": [],
"attach_po_as_pdf": false
}
};
params = {"input_data": input_data};
response = invokeurl
[
url: url
type: PUT
parameters: params
headers: headers
];
info response;
#Powershell version - 5.1
$url = "<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/_payment_done"
$headers = @{ "Accept" = "application/vnd.manageengine.sdp.v3+json"
"Authorization" = "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"
"Content-Type" = "application/x-www-form-urlencoded"}
$input_data = @'
{
"notification": {
"is_notify": true,
"to": [
"guest@zylker.com"
],
"subject": "Purchase Order PO 4 Payment Done",
"description": " This mail is to notify that payment has been done for purchase order PO# PO 4",
"attachments": [],
"attach_po_as_pdf": false
}
}
'@
$data = @{ 'input_data' = $input_data}
$response = Invoke-RestMethod -Uri $url -Method put -Body $data -Headers $headers
$response
#Python version - 3.10
from urllib.error import HTTPError
from urllib.parse import urlencode
from urllib.request import urlopen,Request
url = "<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/_payment_done"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"Content-Type" : "application/x-www-form-urlencoded"}
input_data = '''{
"notification": {
"is_notify": true,
"to": [
"guest@zylker.com"
],
"subject": "Purchase Order PO 4 Payment Done",
"description": " This mail is to notify that payment has been done for purchase order PO# PO 4",
"attachments": [],
"attach_po_as_pdf": false
}
}'''
data = urlencode({"input_data":input_data}).encode()
httprequest = Request(url, headers=headers,data=data, method="PUT")
try:
with urlopen(httprequest) as response:
print(response.read().decode())
except HTTPError as e:
print(e.read().decode())
{
"response_status": {
"status_code": 2000,
"messages": [
{
"status_code": 2000,
"type": "success",
"message": "Notification sent"
},
{
"status_code": 2000,
"type": "success",
"message": "Payment done Successfully."
}
],
"status": "success"
}
}
采购订单中的订单
使用此操作下达带通知的采购订单
URL
<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/_order
$ curl <service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/_order\
-X PUT\
-H "Accept: application/vnd.manageengine.sdp.v3+json"\
-H "Authorization: Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"\
-H "Content-Type: application/x-www-form-urlencoded"\
-d input_data='{
"notification": {
"is_notify": true,
"to": [
"guest@zylker.com"
],
"subject": "Purchase Order PO 13 Ordered.",
"description": "\u003cdiv\u003eHi,\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003e\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eThis mail is to notify that purchase order PO# PO 7 has been Ordered.\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003e\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eClick here to view the Purchase Order : \u003cbr\u003e\u003c/div\u003e\u003cdiv\u003ehttps://purchase.test.zoho.com:8650/app/itdesk/ui/purchaseOrders/100000000000049177/details?selectTab\u003dpurchaseinfo\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003e\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eRegards,\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eIT Department\u003cbr\u003e\u003c/div\u003e",
"attachments": [],
"attach_po_as_pdf": false
}
}'
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/_order";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
input_data = {
"notification": {
"is_notify": true,
"to": [
"guest@zylker.com"
],
"subject": "Purchase Order PO 13 Ordered.",
"description": "\u003cdiv\u003eHi,\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003e\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eThis mail is to notify that purchase order PO# PO 7 has been Ordered.\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003e\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eClick here to view the Purchase Order : \u003cbr\u003e\u003c/div\u003e\u003cdiv\u003ehttps://purchase.test.zoho.com:8650/app/itdesk/ui/purchaseOrders/100000000000049177/details?selectTab\u003dpurchaseinfo\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003e\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eRegards,\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eIT Department\u003cbr\u003e\u003c/div\u003e",
"attachments": [],
"attach_po_as_pdf": false
}
};
params = {"input_data": input_data};
response = invokeurl
[
url: url
type: PUT
parameters: params
headers: headers
];
info response;
#Powershell version - 5.1
$url = "<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/_order"
$headers = @{ "Accept" = "application/vnd.manageengine.sdp.v3+json"
"Authorization" = "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"
"Content-Type" = "application/x-www-form-urlencoded"}
$input_data = @'
{
"notification": {
"is_notify": true,
"to": [
"guest@zylker.com"
],
"subject": "Purchase Order PO 13 Ordered.",
"description": "\u003cdiv\u003eHi,\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003e\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eThis mail is to notify that purchase order PO# PO 7 has been Ordered.\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003e\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eClick here to view the Purchase Order : \u003cbr\u003e\u003c/div\u003e\u003cdiv\u003ehttps://purchase.test.zoho.com:8650/app/itdesk/ui/purchaseOrders/100000000000049177/details?selectTab\u003dpurchaseinfo\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003e\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eRegards,\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eIT Department\u003cbr\u003e\u003c/div\u003e",
"attachments": [],
"attach_po_as_pdf": false
}
}
'@
$data = @{ 'input_data' = $input_data}
$response = Invoke-RestMethod -Uri $url -Method put -Body $data -Headers $headers
$response
#Python version - 3.10
from urllib.error import HTTPError
from urllib.parse import urlencode
from urllib.request import urlopen,Request
url = "<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/_order"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"Content-Type" : "application/x-www-form-urlencoded"}
input_data = '''{
"notification": {
"is_notify": true,
"to": [
"guest@zylker.com"
],
"subject": "Purchase Order PO 13 Ordered.",
"description": "\u003cdiv\u003eHi,\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003e\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eThis mail is to notify that purchase order PO# PO 7 has been Ordered.\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003e\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eClick here to view the Purchase Order : \u003cbr\u003e\u003c/div\u003e\u003cdiv\u003ehttps://purchase.test.zoho.com:8650/app/itdesk/ui/purchaseOrders/100000000000049177/details?selectTab\u003dpurchaseinfo\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003e\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eRegards,\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eIT Department\u003cbr\u003e\u003c/div\u003e",
"attachments": [],
"attach_po_as_pdf": false
}
}'''
data = urlencode({"input_data":input_data}).encode()
httprequest = Request(url, headers=headers,data=data, method="PUT")
try:
with urlopen(httprequest) as response:
print(response.read().decode())
except HTTPError as e:
print(e.read().decode())
{
"response_status": {
"status_code": 2000,
"messages": [
{
"status_code": 2000,
"type": "success",
"message": "Notification sent"
},
{
"status_code": 2000,
"type": "success",
"message": "Purchase Order ordered successfully"
}
],
"status": "success"
}
}
发送邮件给所有者
使用此操作向采购订单所有者发送电子邮件
URL
<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/_email_owner
$ curl <service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/_email_owner\
-X POST\
-H "Accept: application/vnd.manageengine.sdp.v3+json"\
-H "Authorization: Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"\
-H "Content-Type: application/x-www-form-urlencoded"\
-d input_data='{
"notification": {
"is_notify": true,
"to": [
"guest@zylker.com"
],
"cc": [
"test1@zmail.com"
],
"subject": "Assigned Purchase Order with ID : PO 80",
"description": "\u003cdiv\u003eHi Test,\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003e\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eThe Purchase Order ID: PO 80 has been assigned to you.\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003e\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003ePurchase Order Details\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eName : PO 80 \u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eStatus : Approved\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eCost : ($) 70.88\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eVendor : BB\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003e\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eFor more information, visit the following link:\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003ehttps://purchase.test.zoho.com:8650/app/itdesk/ui/purchaseOrders/100000000000049177/details?selectTab\u003dpurchaseinfo\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003e\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eRegards,\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eAdmin Team\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003e\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eThis is an automated message. Please do not reply to this email.\u003cbr\u003e\u003c/div\u003e",
"attachments": [],
"attach_po_as_pdf": true
}
}'
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/_email_owner";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
input_data = {
"notification": {
"is_notify": true,
"to": [
"guest@zylker.com"
],
"cc": [
"test1@zmail.com"
],
"subject": "Assigned Purchase Order with ID : PO 80",
"description": "\u003cdiv\u003eHi Test,\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003e\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eThe Purchase Order ID: PO 80 has been assigned to you.\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003e\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003ePurchase Order Details\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eName : PO 80 \u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eStatus : Approved\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eCost : ($) 70.88\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eVendor : BB\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003e\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eFor more information, visit the following link:\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003ehttps://purchase.test.zoho.com:8650/app/itdesk/ui/purchaseOrders/100000000000049177/details?selectTab\u003dpurchaseinfo\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003e\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eRegards,\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eAdmin Team\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003e\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eThis is an automated message. Please do not reply to this email.\u003cbr\u003e\u003c/div\u003e",
"attachments": [],
"attach_po_as_pdf": true
}
};
params = {"input_data": input_data};
response = invokeurl
[
url: url
type: POST
parameters: params
headers: headers
];
info response;
#Powershell version - 5.1
$url = "<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/_email_owner"
$headers = @{"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"Content-Type" : "application/x-www-form-urlencoded"}
$input_data = @'
{
"notification": {
"is_notify": true,
"to": [
"guest@zylker.com"
],
"cc": [
"test1@zmail.com"
],
"subject": "Assigned Purchase Order with ID : PO 80",
"description": "\u003cdiv\u003eHi Test,\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003e\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eThe Purchase Order ID: PO 80 has been assigned to you.\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003e\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003ePurchase Order Details\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eName : PO 80 \u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eStatus : Approved\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eCost : ($) 70.88\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eVendor : BB\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003e\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eFor more information, visit the following link:\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003ehttps://purchase.test.zoho.com:8650/app/itdesk/ui/purchaseOrders/100000000000049177/details?selectTab\u003dpurchaseinfo\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003e\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eRegards,\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eAdmin Team\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003e\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eThis is an automated message. Please do not reply to this email.\u003cbr\u003e\u003c/div\u003e",
"attachments": [],
"attach_po_as_pdf": true
}
}
'@
$data = @{ 'input_data' = $input_data}
$response = Invoke-RestMethod -Uri $url -Method post -Body $data -Headers $headers
$response
#Python version - 3.10
from urllib.error import HTTPError
from urllib.parse import urlencode
from urllib.request import urlopen,Request
url = "<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/_email_owner"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"Content-Type" : "application/x-www-form-urlencoded"}
input_data = '''{
"notification": {
"is_notify": true,
"to": [
"guest@zylker.com"
],
"cc": [
"test1@zmail.com"
],
"subject": "Assigned Purchase Order with ID : PO 80",
"description": "\u003cdiv\u003eHi Test,\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003e\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eThe Purchase Order ID: PO 80 has been assigned to you.\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003e\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003ePurchase Order Details\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eName : PO 80 \u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eStatus : Approved\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eCost : ($) 70.88\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eVendor : BB\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003e\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eFor more information, visit the following link:\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003ehttps://purchase.test.zoho.com:8650/app/itdesk/ui/purchaseOrders/100000000000049177/details?selectTab\u003dpurchaseinfo\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003e\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eRegards,\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eAdmin Team\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003e\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eThis is an automated message. Please do not reply to this email.\u003cbr\u003e\u003c/div\u003e",
"attachments": [],
"attach_po_as_pdf": true
}
}'''
data = urlencode({"input_data":input_data}).encode()
httprequest = Request(url, headers=headers,data=data, method="POST")
try:
with urlopen(httprequest) as response:
print(response.read().decode())
except HTTPError as e:
print(e.read().decode())
{
"response_status": {
"status_code": 2000,
"messages": [
{
"status_code": 2000,
"type": "success",
"message": "Notification sent"
}
],
"status": "success"
}
}
发送邮件给供应商
使用此操作向供应商发送电子邮件
URL
<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/_email_vendor
$ curl <service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/_email_vendor\
-X POST\
-H "Accept: application/vnd.manageengine.sdp.v3+json"\
-H "Authorization: Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"\
-H "Content-Type: application/x-www-form-urlencoded"\
-d input_data='{
"notification": {
"is_notify": true,
"to": [
"test1@zmail.com"
],
"subject": "Initiated Purchase Order.",
"description": "\u003cdiv\u003eThe Purchase Order ID : PO 70 has been initiated with you.\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003e\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003ePurchase Order Details\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003ePurchase Order Name :Purchase Order 70\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eCost :($) 57.00\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eVendor :BB\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eOwner :Test\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003e\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eFor more information, visit the following link: \u003cbr\u003e\u003c/div\u003e\u003cdiv\u003e\u003ca href\u003d\"https://purchase.test.zoho.com:8650/app/itdesk/ui/purchaseOrders/100000000000052881/details?selectTab\u003dpurchaseinfo\" rel\u003d\"noreferrer\"\u003ehttps://purchase.test.zoho.com:8650/app/itdesk/ui/purchaseOrders/100000000000052881/details?selectTab\u003dpurchaseinfo\u003c/a\u003e\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003e\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eRegards,\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eAdmin Team\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003e\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eThis is an automated message. Please do not reply to this email.\u003cbr\u003e\u003c/div\u003e",
"attachments": [],
"attach_po_as_pdf": true
}
}'
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/_email_vendor";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
input_data = {
"notification": {
"is_notify": true,
"to": [
"test1@zmail.com"
],
"subject": "Initiated Purchase Order.",
"description": "\u003cdiv\u003eThe Purchase Order ID : PO 70 has been initiated with you.\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003e\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003ePurchase Order Details\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003ePurchase Order Name :Purchase Order 70\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eCost :($) 57.00\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eVendor :BB\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eOwner :Test\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003e\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eFor more information, visit the following link: \u003cbr\u003e\u003c/div\u003e\u003cdiv\u003e\u003ca href\u003d\"https://purchase.test.zoho.com:8650/app/itdesk/ui/purchaseOrders/100000000000052881/details?selectTab\u003dpurchaseinfo\" rel\u003d\"noreferrer\"\u003ehttps://purchase.test.zoho.com:8650/app/itdesk/ui/purchaseOrders/100000000000052881/details?selectTab\u003dpurchaseinfo\u003c/a\u003e\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003e\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eRegards,\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eAdmin Team\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003e\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eThis is an automated message. Please do not reply to this email.\u003cbr\u003e\u003c/div\u003e",
"attachments": [],
"attach_po_as_pdf": true
}
};
params = {"input_data": input_data};
response = invokeurl
[
url: url
type: POST
parameters: params
headers: headers
];
info response;
#Powershell version - 5.1
$url = "<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/_email_vendor"
$headers = @{"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"Content-Type" : "application/x-www-form-urlencoded"}
$input_data = @'
{
"notification": {
"is_notify": true,
"to": [
"test1@zmail.com"
],
"subject": "Initiated Purchase Order.",
"description": "\u003cdiv\u003eThe Purchase Order ID : PO 70 has been initiated with you.\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003e\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003ePurchase Order Details\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003ePurchase Order Name :Purchase Order 70\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eCost :($) 57.00\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eVendor :BB\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eOwner :Test\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003e\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eFor more information, visit the following link: \u003cbr\u003e\u003c/div\u003e\u003cdiv\u003e\u003ca href\u003d\"https://purchase.test.zoho.com:8650/app/itdesk/ui/purchaseOrders/100000000000052881/details?selectTab\u003dpurchaseinfo\" rel\u003d\"noreferrer\"\u003ehttps://purchase.test.zoho.com:8650/app/itdesk/ui/purchaseOrders/100000000000052881/details?selectTab\u003dpurchaseinfo\u003c/a\u003e\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003e\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eRegards,\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eAdmin Team\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003e\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eThis is an automated message. Please do not reply to this email.\u003cbr\u003e\u003c/div\u003e",
"attachments": [],
"attach_po_as_pdf": true
}
}
'@
$data = @{ 'input_data' = $input_data}
$response = Invoke-RestMethod -Uri $url -Method post -Body $data -Headers $headers
$response
#Python version - 3.10
from urllib.error import HTTPError
from urllib.parse import urlencode
from urllib.request import urlopen,Request
url = "<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/_email_vendor"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"Content-Type" : "application/x-www-form-urlencoded"}
input_data = '''{
"notification": {
"is_notify": true,
"to": [
"test1@zmail.com"
],
"subject": "Initiated Purchase Order.",
"description": "\u003cdiv\u003eThe Purchase Order ID : PO 70 has been initiated with you.\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003e\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003ePurchase Order Details\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003ePurchase Order Name :Purchase Order 70\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eCost :($) 57.00\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eVendor :BB\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eOwner :Test\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003e\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eFor more information, visit the following link: \u003cbr\u003e\u003c/div\u003e\u003cdiv\u003e\u003ca href\u003d\"https://purchase.test.zoho.com:8650/app/itdesk/ui/purchaseOrders/100000000000052881/details?selectTab\u003dpurchaseinfo\" rel\u003d\"noreferrer\"\u003ehttps://purchase.test.zoho.com:8650/app/itdesk/ui/purchaseOrders/100000000000052881/details?selectTab\u003dpurchaseinfo\u003c/a\u003e\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003e\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eRegards,\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eAdmin Team\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003e\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003eThis is an automated message. Please do not reply to this email.\u003cbr\u003e\u003c/div\u003e",
"attachments": [],
"attach_po_as_pdf": true
}
}'''
data = urlencode({"input_data":input_data}).encode()
httprequest = Request(url, headers=headers,data=data, method="POST")
try:
with urlopen(httprequest) as response:
print(response.read().decode())
except HTTPError as e:
print(e.read().decode())
{
"response_status": {
"status_code": 2000,
"messages": [
{
"status_code": 2000,
"type": "success",
"message": "Notification sent"
}
],
"status": "success"
}
}
在采购订单中发送通知
使用此操作在采购订单中发送通知
URL
<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/notifications
$ curl <service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/notifications\
-X POST\
-H "Accept: application/vnd.manageengine.sdp.v3+json"\
-H "Authorization: Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"\
-H "Content-Type: application/x-www-form-urlencoded"\
-d input_data='{
"notification": {
"description": "\u003cdiv class\u003d\"personalize-wrapper\" style\u003d\"font-family: \u0027PT Sans\u0027,Arial,Helvetica,sans-serif, sans-serif;font-size: 13px;\" \u003e \u003cdiv\u003eThe description of the notification\u003c/div\u003e \u003c/div\u003e",
"to": [
"test1@zmail.com"
],
"cc": [
"test2@zmail.com"
],
"subject": "Send Notification",
"sender": {
"id": "100000000000036117"
},
"type": "Notify_PURCHASE"
}
}'
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/notifications";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
input_data = {
"notification": {
"description": "\u003cdiv class\u003d\"personalize-wrapper\" style\u003d\"font-family: \u0027PT Sans\u0027,Arial,Helvetica,sans-serif, sans-serif;font-size: 13px;\" \u003e \u003cdiv\u003eThe description of the notification\u003c/div\u003e \u003c/div\u003e",
"to": [
"test1@zmail.com"
],
"cc": [
"test2@zmail.com"
],
"subject": "Send Notification",
"sender": {
"id": "100000000000036117"
},
"type": "Notify_PURCHASE"
}
};
params = {"input_data": input_data};
response = invokeurl
[
url: url
type: POST
parameters: params
headers: headers
];
info response;
#Powershell version - 5.1
$url = "<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/notifications"
$headers = @{"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"Content-Type" : "application/x-www-form-urlencoded"}
$input_data = @'
{
"notification": {
"description": "\u003cdiv class\u003d\"personalize-wrapper\" style\u003d\"font-family: \u0027PT Sans\u0027,Arial,Helvetica,sans-serif, sans-serif;font-size: 13px;\" \u003e \u003cdiv\u003eThe description of the notification\u003c/div\u003e \u003c/div\u003e",
"to": [
"test1@zmail.com"
],
"cc": [
"test2@zmail.com"
],
"subject": "Send Notification",
"sender": {
"id": "100000000000036117"
},
"type": "Notify_PURCHASE"
}
}
'@
$data = @{ 'input_data' = $input_data}
$response = Invoke-RestMethod -Uri $url -Method post -Body $data -Headers $headers
$response
#Python version - 3.10
from urllib.error import HTTPError
from urllib.parse import urlencode
from urllib.request import urlopen,Request
url = "<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/notifications"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"Content-Type" : "application/x-www-form-urlencoded"}
input_data = '''{
"notification": {
"description": "\u003cdiv class\u003d\"personalize-wrapper\" style\u003d\"font-family: \u0027PT Sans\u0027,Arial,Helvetica,sans-serif, sans-serif;font-size: 13px;\" \u003e \u003cdiv\u003eThe description of the notification\u003c/div\u003e \u003c/div\u003e",
"to": [
"test1@zmail.com"
],
"cc": [
"test2@zmail.com"
],
"subject": "Send Notification",
"sender": {
"id": "100000000000036117"
},
"type": "Notify_PURCHASE"
}
}'''
data = urlencode({"input_data":input_data}).encode()
httprequest = Request(url, headers=headers,data=data, method="POST")
try:
with urlopen(httprequest) as response:
print(response.read().decode())
except HTTPError as e:
print(e.read().decode())
{
"notification": {
"cc": [
"guest2@zylker.com"
],
"attachments": [],
"has_attachments": false,
"recipent": null,
"sender": {
"email_id": "guest@zylker.com",
"is_technician": true,
"sms_mail": null,
"mobile": "9781234450",
"last_name": "T",
"user_scope": "internal_user",
"sms_mail_id": null,
"phone": null,
"employee_id": "56",
"name": "Test",
"id": "100000000000036117",
"photo_url": "https://contacts.zoho.com/file?sample",
"is_vip_user": false,
"department": null,
"first_name": "Test",
"job_title": null
},
"subject": "Send Notification",
"description": "<div class=\"personalize-wrapper\" style=\"font-family: "PT Sans", Arial, Helvetica, sans-serif, sans-serif; font-size: 13px\"> <div>The description of the notification</div> </div>",
"messageid": "<2004352135.14.1669013956328.JavaMail.guest@zylker.com>",
"id": "100000000000054071",
"time": {
"display_value": "Nov 21, 2022 12:29 PM",
"value": "1669013956315"
},
"to": [
"guest1@zylker.com"
],
"type": "Notify_PURCHASE"
},
"response_status": {
"status_code": 2000,
"status": "success"
}
}
获取物品列表
使用此操作获取采购订单中的物品列表
URL
<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/items
$ curl -G <service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/items\
-X GET\
-H "Accept: application/vnd.manageengine.sdp.v3+json"\
-H "Authorization: Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"\
-H "Content-Type: application/x-www-form-urlencoded"
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/items";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
response = invokeurl
[
url: url
type: GET
headers: headers
];
info response;
#Powershell version - 5.1
$url = "<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/items"
$headers = @{ "Accept" = "application/vnd.manageengine.sdp.v3+json"
"Authorization" = "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"
"Content-Type" = "application/x-www-form-urlencoded"}
$response = Invoke-RestMethod -Uri $url -Method get -Headers $headers
$response
#Python version - 3.8
#This script requires requests module installed in python.
from urllib.error import HTTPError
from urllib.parse import urlencode
from urllib.request import urlopen,Request
url = "<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/items"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"Content-Type" : "application/x-www-form-urlencoded"}
httprequest = Request(url, headers=headers)
try:
with urlopen(httprequest) as response:
print(response.read().decode())
except HTTPError as e:
print(e.read().decode())
{
"response_status": [
{
"status_code": 2000,
"status": "success"
}
],
"list_info": {
"has_more_rows": false,
"start_index": 1,
"sort_field": "name",
"filter_by": "All",
"page": 1,
"row_count": 2
},
"items": [
{
"is_batch_tracking": "false",
"ordered_quantity": "8",
"purchase_lot_id": "100000000000052247",
"product": {
"part_no": "-",
"product_type": {
"image": "Cable_Tie",
"name": "Cable Tie",
"id": "100000000000035517",
"mandatory": false
},
"software": null,
"name": "CT 1",
"id": "100000000000042349",
"type": {
"name": "Consumable",
"id": "100000000000002549"
},
"category": {
"name": "IT",
"description": "IT Assets and Components",
"id": "100000000000002985"
},
"manufacturer": "-"
},
"other": null,
"amount": "4536.00",
"description": null,
"warranty_expiry": null,
"product_vendor_association": {
"vendor": {
"id": "100000000000037235"
},
"id": "100000000000042355"
},
"tax_rate": "0",
"total_received_quantity": "8",
"service": null,
"price": "567",
"name": "CT 1",
"id": "100000000000052177",
"date_received": {
"display_value": "Nov 18, 2022",
"value": "1668767526012"
},
"service_vendor_association": null
},
{
"ordered_quantity": "10",
"purchase_lot_id": "100000000000052197",
"product": {
"part_no": "-",
"product_type": {
"image": "Tablets",
"name": "Tablet",
"id": "100000000000003024",
"mandatory": true
},
"software": null,
"name": "Tablet 1",
"id": "100000000000042825",
"type": {
"name": "Asset",
"id": "100000000000002976"
},
"category": {
"name": "IT",
"description": "IT Assets and Components",
"id": "100000000000002985"
},
"manufacturer": "-"
},
"other": null,
"amount": "4696.8",
"description": null,
"warranty_expiry": null,
"product_vendor_association": {
"vendor": {
"id": "100000000000037235"
},
"id": "100000000000042831"
},
"tax_rate": "3",
"total_received_quantity": "8",
"service": null,
"price": "456",
"name": "Tablet 1",
"id": "100000000000052175",
"date_received": {
"display_value": "Nov 18, 2022",
"value": "1668767526012"
},
"service_vendor_association": null
}
]
}
取消关联采购订单的服务请求
使用此操作解除服务请求与采购订单的关联
URL
<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/requests
$ curl <service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/requests\
-X DELETE\
-H "Accept: application/vnd.manageengine.sdp.v3+json"\
-H "Authorization: Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"\
-H "Content-Type: application/x-www-form-urlencoded"
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/requests";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
response = invokeurl
[
url: url
type: DELETE
headers: headers
];
info response;
#Powershell version - 5.1
$url = "<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/requests"
$headers = @{ "Accept" = "application/vnd.manageengine.sdp.v3+json"
"Authorization" = "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"
"Content-Type" = "application/x-www-form-urlencoded"}
$response = Invoke-RestMethod -Uri $url -Method delete -Headers $headers
$response
#Python version - 3.10
from urllib.error import HTTPError
from urllib.request import urlopen,Request
url = "<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/requests"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"Content-Type" : "application/x-www-form-urlencoded"}
httprequest = Request(url, headers=headers,method="DELETE")
try:
with urlopen(httprequest) as response:
print(response.read().decode())
except HTTPError as e:
print(e.read().decode())
{
"response_status": {
"status_code": 2000,
"status": "success"
}
}
关联采购订单的服务请求
使用此操作将服务请求关联到采购订单
URL
<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/requests
$ curl <service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/requests\
-X POST\
-H "Accept: application/vnd.manageengine.sdp.v3+json"\
-H "Authorization: Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"\
-H "Content-Type: application/x-www-form-urlencoded"\
-d input_data='{
"requests": [
{
"request": {
"id": "100000000000047948"
}
}
]
}'
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/requests";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
input_data = {
"requests": [
{
"request": {
"id": "100000000000047948"
}
}
]
};
params = {"input_data": input_data};
response = invokeurl
[
url: url
type: POST
parameters: params
headers: headers
];
info response;
#Powershell version - 5.1
$url = "<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/requests"
$headers = @{"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"Content-Type" : "application/x-www-form-urlencoded"}
$input_data = @'
{
"requests": [
{
"request": {
"id": "100000000000047948"
}
}
]
}
'@
$data = @{ 'input_data' = $input_data}
$response = Invoke-RestMethod -Uri $url -Method post -Body $data -Headers $headers
$response
#Python version - 3.10
from urllib.error import HTTPError
from urllib.parse import urlencode
from urllib.request import urlopen,Request
url = "<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/requests"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"Content-Type" : "application/x-www-form-urlencoded"}
input_data = '''{
"requests": [
{
"request": {
"id": "100000000000047948"
}
}
]
}'''
data = urlencode({"input_data":input_data}).encode()
httprequest = Request(url, headers=headers,data=data, method="POST")
try:
with urlopen(httprequest) as response:
print(response.read().decode())
except HTTPError as e:
print(e.read().decode())
{
"response_status": [
{
"status_code": 2000,
"status": "success"
}
],
"requests": {
"request": {
"id": "100000000000047948"
},
"purchase_order": {
"id": "100000000000053009"
}
}
}
从回收站恢复采购订单
使用此操作从垃圾箱恢复采购订单
URL
<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/_restore_from_trash
$ curl <service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/_restore_from_trash\
-X PUT\
-H "Accept: application/vnd.manageengine.sdp.v3+json"\
-H "Authorization: Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"\
-H "Content-Type: application/x-www-form-urlencoded"\
-d input_data=''
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/_restore_from_trash";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
input_data = ;
params = {"input_data": input_data};
response = invokeurl
[
url: url
type: PUT
parameters: params
headers: headers
];
info response;
#Powershell version - 5.1
$url = "<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/_restore_from_trash"
$headers = @{ "Accept" = "application/vnd.manageengine.sdp.v3+json"
"Authorization" = "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"
"Content-Type" = "application/x-www-form-urlencoded"}
$input_data = @'
'@
$data = @{ 'input_data' = $input_data}
$response = Invoke-RestMethod -Uri $url -Method put -Body $data -Headers $headers
$response
#Python version - 3.10
from urllib.error import HTTPError
from urllib.parse import urlencode
from urllib.request import urlopen,Request
url = "<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/_restore_from_trash"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"Content-Type" : "application/x-www-form-urlencoded"}
input_data = ''''''
data = urlencode({"input_data":input_data}).encode()
httprequest = Request(url, headers=headers,data=data, method="PUT")
try:
with urlopen(httprequest) as response:
print(response.read().decode())
except HTTPError as e:
print(e.read().decode())
{
"response_status": {
"status_code": 2000,
"status": "success"
},
"purchase_order": {
"template": {
"inactive": false,
"name": "Purchase Order Template",
"id": "100000000000030534"
},
"attachments": [],
"discount": {
"display_value": "10.00",
"currency_symbol": "$",
"value": 10
},
"additional_tax_rate": "-1",
"sites": [
{
"name": "All Sites",
"id": "-1"
}
],
"discount_rate": "-1",
"all_should_approve": false,
"custom_po_id": "19",
"gl_code": {
"name": "GL code one",
"id": "100000000000047131"
},
"is_shipping_include": false,
"sign_authority": "Test",
"received_date": null,
"price_adjustment": {
"display_value": "20.00",
"currency_symbol": "$",
"value": 20
},
"terms": null,
"vendor": {
"name": "AA",
"description": "No Description",
"currency": {
"symbol": "$",
"code": "USD",
"exchange_rate": "1",
"name": "US Dollar",
"id": "100000000000004125"
},
"id": "100000000000037003"
},
"sales_tax_rate": "0",
"currency": {
"symbol": "$",
"code": "USD",
"exchange_rate": "1",
"name": "US Dollar",
"id": "100000000000004125"
},
"id": "100000000000053009",
"place": "Chennai",
"ship_address": "-",
"owner": {
"email_id": "guest@zylker.com",
"is_technician": true,
"sms_mail": null,
"contact_info_id": "100000000000036115",
"mobile": "9781234450",
"last_name": "T",
"user_scope": "internal_user",
"sms_mail_id": null,
"phone": null,
"employee_id": "56",
"name": "Test",
"id": "100000000000036117",
"photo_url": "https://contacts.zoho.com/file?sample",
"is_vip_user": false,
"department": null,
"first_name": "Test",
"job_title": null
},
"shipping_price": {
"display_value": "10.00",
"currency_symbol": "$",
"value": 10
},
"required_date": {
"display_value": "Nov 30, 2022",
"value": "1669746600000"
},
"auto_approval_notify": false,
"exchange_rate": null,
"additional_tax": {
"display_value": "10.00",
"currency_symbol": "$",
"value": 10
},
"total_price": {
"display_value": "3480.00",
"currency_symbol": "$",
"value": 3480
},
"net_total": {
"display_value": "3440.00",
"currency_symbol": "$",
"value": 3440
},
"custom_id": "PO 99",
"bill_address": "-",
"requested_by": {
"email_id": "guest@zylker.com",
"is_technician": true,
"sms_mail": null,
"contact_info_id": "100000000000036115",
"mobile": "9781234450",
"last_name": "T",
"user_scope": "internal_user",
"sms_mail_id": null,
"phone": null,
"employee_id": "56",
"name": "Test",
"id": "100000000000036117",
"photo_url": "https://contacts.zoho.com/file?sample",
"is_vip_user": false,
"department": null,
"first_name": "Test",
"job_title": null
},
"sales_tax": {
"display_value": "0.00",
"currency_symbol": "$",
"value": 0
},
"cost_center": {
"name": "Cost Center One",
"id": "100000000000049395",
"cost_center_code": "Cost Center One"
},
"name": "Purchase Order 99",
"sub_total": {
"display_value": "3450.00",
"currency_symbol": "$",
"value": 3450
},
"created_date": {
"display_value": "Nov 18, 2022",
"value": "1668775576990"
},
"is_overdue_notified": false,
"category": {
"id": "100000000000002814"
},
"items": [
{
"ordered_quantity": "10",
"purchase_lot_id": null,
"product": {
"part_no": "-",
"product_type": {
"image": "Workstations",
"name": "Workstation",
"id": "100000000000002991",
"mandatory": true
},
"software": null,
"name": "WK 1",
"id": "100000000000047207",
"type": {
"name": "Asset",
"id": "100000000000002976"
},
"category": {
"name": "IT",
"description": "IT Assets and Components",
"id": "100000000000002985"
},
"manufacturer": "-"
},
"other": null,
"amount": "3450.00",
"description": null,
"warranty_expiry": null,
"product_vendor_association": {
"vendor": {
"id": "100000000000037003"
},
"vendor_id": "100000000000037003",
"id": "100000000000047213"
},
"tax_rate": "0",
"total_received_quantity": null,
"service": null,
"price": "345",
"name": "WK 1",
"id": "100000000000053013",
"date_received": null,
"service_vendor_association": null
}
],
"deleted_time": null,
"remarks": null,
"status": {
"name": "Open",
"id": "100000000000002390"
}
}
}
将采购订单移至回收站
使用此操作将采购订单移动到垃圾箱
URL
<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/_move_to_trash
$ curl <service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/_move_to_trash\
-X PUT\
-H "Accept: application/vnd.manageengine.sdp.v3+json"\
-H "Authorization: Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"\
-H "Content-Type: application/x-www-form-urlencoded"\
-d input_data=''
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/_move_to_trash";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
input_data = ;
params = {"input_data": input_data};
response = invokeurl
[
url: url
type: PUT
parameters: params
headers: headers
];
info response;
#Powershell version - 5.1
$url = "<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/_move_to_trash"
$headers = @{ "Accept" = "application/vnd.manageengine.sdp.v3+json"
"Authorization" = "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"
"Content-Type" = "application/x-www-form-urlencoded"}
$input_data = @'
'@
$data = @{ 'input_data' = $input_data}
$response = Invoke-RestMethod -Uri $url -Method put -Body $data -Headers $headers
$response
#Python version - 3.10
from urllib.error import HTTPError
from urllib.parse import urlencode
from urllib.request import urlopen,Request
url = "<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/_move_to_trash"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"Content-Type" : "application/x-www-form-urlencoded"}
input_data = ''''''
data = urlencode({"input_data":input_data}).encode()
httprequest = Request(url, headers=headers,data=data, method="PUT")
try:
with urlopen(httprequest) as response:
print(response.read().decode())
except HTTPError as e:
print(e.read().decode())
{
"response_status": {
"status_code": 2000,
"status": "success"
},
"purchase_order": {
"template": {
"inactive": false,
"name": "Purchase Order Template",
"id": "100000000000030534"
},
"attachments": [],
"discount": {
"display_value": "10.00",
"currency_symbol": "$",
"value": 10
},
"additional_tax_rate": "-1",
"sites": [
{
"deleted": false,
"name": "London",
"id": "100000000000041089"
},
{
"deleted": false,
"name": "Tokyo",
"id": "100000000000042787"
}
],
"discount_rate": "-1",
"all_should_approve": false,
"custom_po_id": "19",
"gl_code": {
"name": "GL code one",
"id": "100000000000047131"
},
"is_shipping_include": false,
"sign_authority": "Test",
"received_date": null,
"price_adjustment": {
"display_value": "10.00",
"currency_symbol": "$",
"value": 10
},
"terms": null,
"vendor": {
"name": "AA",
"description": "No Description",
"currency": {
"symbol": "$",
"code": "USD",
"exchange_rate": "1",
"name": "US Dollar",
"id": "100000000000004125"
},
"id": "100000000000037003"
},
"sales_tax_rate": "0",
"currency": {
"symbol": "$",
"code": "USD",
"exchange_rate": "1",
"name": "US Dollar",
"id": "100000000000004125"
},
"id": "100000000000052991",
"place": "Chennai",
"ship_address": "-",
"owner": {
"email_id": "guest@zylker.com",
"is_technician": true,
"sms_mail": null,
"contact_info_id": "100000000000036115",
"mobile": "9781234450",
"last_name": "T",
"user_scope": "internal_user",
"sms_mail_id": null,
"phone": null,
"employee_id": "56",
"name": "Test",
"id": "100000000000036117",
"photo_url": "https://contacts.zoho.com/file?sample",
"is_vip_user": false,
"department": null,
"first_name": "Test",
"job_title": null
},
"shipping_price": {
"display_value": "0.00",
"currency_symbol": "$",
"value": 0
},
"required_date": {
"display_value": "Nov 25, 2022",
"value": "1669314600000"
},
"auto_approval_notify": false,
"exchange_rate": null,
"additional_tax": {
"display_value": "10.00",
"currency_symbol": "$",
"value": 10
},
"total_price": {
"display_value": "7945.00",
"currency_symbol": "$",
"value": 7945
},
"net_total": {
"display_value": "7925.00",
"currency_symbol": "$",
"value": 7925
},
"custom_id": "po 98",
"bill_address": null,
"requested_by": {
"email_id": "guest@zylker.com",
"is_technician": true,
"sms_mail": null,
"contact_info_id": "100000000000036115",
"mobile": "9781234450",
"last_name": "T",
"user_scope": "internal_user",
"sms_mail_id": null,
"phone": null,
"employee_id": "56",
"name": "Test",
"id": "100000000000036117",
"photo_url": "https://contacts.zoho.com/file?sample",
"is_vip_user": false,
"department": null,
"first_name": "Test",
"job_title": null
},
"sales_tax": {
"display_value": "0.00",
"currency_symbol": "$",
"value": 0
},
"cost_center": {
"name": "Cost Center One",
"id": "100000000000049395",
"cost_center_code": "Cost Center One"
},
"name": "Purchase Order 98",
"sub_total": {
"display_value": "7935.00",
"currency_symbol": "$",
"value": 7935
},
"created_date": {
"display_value": "Nov 18, 2022",
"value": "1668774959698"
},
"is_overdue_notified": false,
"category": {
"id": "100000000000002814"
},
"items": [
{
"ordered_quantity": "23",
"purchase_lot_id": null,
"product": {
"part_no": "-",
"product_type": {
"image": "Workstations",
"name": "Workstation",
"id": "100000000000002991",
"mandatory": true
},
"software": null,
"name": "WK 1",
"id": "100000000000047207",
"type": {
"name": "Asset",
"id": "100000000000002976"
},
"category": {
"name": "IT",
"description": "IT Assets and Components",
"id": "100000000000002985"
},
"manufacturer": "-"
},
"other": null,
"amount": "7935.00",
"description": null,
"warranty_expiry": null,
"product_vendor_association": {
"vendor": {
"id": "100000000000037003"
},
"vendor_id": "100000000000037003",
"id": "100000000000047213"
},
"tax_rate": "0",
"total_received_quantity": null,
"service": null,
"price": "345",
"name": "WK 1",
"id": "100000000000052999",
"date_received": null,
"service_vendor_association": null
}
],
"deleted_time": {
"display_value": "Nov 18, 2022 06:06 PM",
"value": "1668774973597"
},
"remarks": null,
"status": {
"name": "Open",
"id": "100000000000002390"
}
}
}
创建付款
使用此操作创建带通知的付款
URL
<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/payments
$ curl <service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/payments\
-X POST\
-H "Accept: application/vnd.manageengine.sdp.v3+json"\
-H "Authorization: Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"\
-H "Content-Type: application/x-www-form-urlencoded"\
-d input_data='{
"po_payment": {
"is_notify": true,
"amount_paid": "2000",
"exchange_rate": "20",
"payment_date": {
"value": 1669746600000
},
"comments": "Payment done",
"notify_technicians": [
{
"id": "100000000000036117"
}
],
"payment_due_date": {
"value": 1669919400000
},
"notify_before_days": "1"
}
}'
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/payments";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
input_data = {
"po_payment": {
"is_notify": true,
"amount_paid": "2000",
"exchange_rate": "20",
"payment_date": {
"value": 1669746600000
},
"comments": "Payment done",
"notify_technicians": [
{
"id": "100000000000036117"
}
],
"payment_due_date": {
"value": 1669919400000
},
"notify_before_days": "1"
}
};
params = {"input_data": input_data};
response = invokeurl
[
url: url
type: POST
parameters: params
headers: headers
];
info response;
#Powershell version - 5.1
$url = "<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/payments"
$headers = @{"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"Content-Type" : "application/x-www-form-urlencoded"}
$input_data = @'
{
"po_payment": {
"is_notify": true,
"amount_paid": "2000",
"exchange_rate": "20",
"payment_date": {
"value": 1669746600000
},
"comments": "Payment done",
"notify_technicians": [
{
"id": "100000000000036117"
}
],
"payment_due_date": {
"value": 1669919400000
},
"notify_before_days": "1"
}
}
'@
$data = @{ 'input_data' = $input_data}
$response = Invoke-RestMethod -Uri $url -Method post -Body $data -Headers $headers
$response
#Python version - 3.10
from urllib.error import HTTPError
from urllib.parse import urlencode
from urllib.request import urlopen,Request
url = "<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/payments"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"Content-Type" : "application/x-www-form-urlencoded"}
input_data = '''{
"po_payment": {
"is_notify": true,
"amount_paid": "2000",
"exchange_rate": "20",
"payment_date": {
"value": 1669746600000
},
"comments": "Payment done",
"notify_technicians": [
{
"id": "100000000000036117"
}
],
"payment_due_date": {
"value": 1669919400000
},
"notify_before_days": "1"
}
}'''
data = urlencode({"input_data":input_data}).encode()
httprequest = Request(url, headers=headers,data=data, method="POST")
try:
with urlopen(httprequest) as response:
print(response.read().decode())
except HTTPError as e:
print(e.read().decode())
{
"response_status": {
"status_code": 2000,
"status": "success"
},
"po_payment": {
"amount_paid": "2000",
"comments": "Payment done",
"exchange_rate": "20",
"notify_technicians": [
{
"email_id": "guest@zylker.com",
"is_technician": true,
"sms_mail": null,
"mobile": "9781234450",
"last_name": "T",
"user_scope": "internal_user",
"sms_mail_id": null,
"cost_per_hour": "0",
"phone": null,
"employee_id": "56",
"name": "Test",
"id": "100000000000036117",
"photo_url": "https://contacts.zoho.com/file?sample",
"is_vip_user": false,
"department": null,
"first_name": "Test",
"job_title": null
}
],
"created_by": {
"email_id": "guest@zylker.com",
"is_technician": true,
"sms_mail": null,
"mobile": "9781234450",
"last_name": "T",
"user_scope": "internal_user",
"sms_mail_id": null,
"phone": null,
"employee_id": "56",
"name": "Test",
"id": "100000000000036117",
"photo_url": "https://contacts.zoho.com/file?sample",
"is_vip_user": false,
"department": null,
"first_name": "Test",
"job_title": null
},
"is_notify": true,
"is_escalated": false,
"purchase_order": {
"vendor": {
"id": "100000000000037235"
},
"custom_id": "6",
"name": "PO 6",
"id": "100000000000047139"
},
"payment_due_date": {
"display_value": "Dec 2, 2022",
"value": "1669919400000"
},
"amount_due": "8150.81",
"id": "100000000000052673",
"notify_before_days": "1",
"payment_date": {
"display_value": "Nov 30, 2022",
"value": "1669746600000"
}
}
}
接收物品
使用此操作接收采购订单中的物品
URL
<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/_receive_items
$ curl <service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/_receive_items\
-X PUT\
-H "Accept: application/vnd.manageengine.sdp.v3+json"\
-H "Authorization: Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"\
-H "Content-Type: application/x-www-form-urlencoded"\
-d input_data='{
"receive_items": [
{
"id": "100000000000052297",
"sites": [
{
"quantity": 2,
"id": "100000000000041089"
},
{
"quantity": 3,
"id": "100000000000042787"
}
],
"quantity": "5"
},
{
"id": "3000000046175",
"quantity": "5",
"standard_licenses": [
{
"license_type": {
"id": "3000000003939"
},
"license_option": {
"id": "3000000004200"
},
"installation_allowed": "Unlimited",
"keys": [
""
],
"no_of_license": "5",
"site": {
"quantity": 2,
"id": "3000000006976"
},
"is_organization_license": true
}
]
}
]
}'
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/_receive_items";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
input_data = {
"receive_items": [
{
"id": "100000000000052297",
"sites": [
{
"quantity": 2,
"id": "100000000000041089"
},
{
"quantity": 3,
"id": "100000000000042787"
}
],
"quantity": "5"
},
{
"id": "3000000046175",
"quantity": "5",
"standard_licenses": [
{
"license_type": {
"id": "3000000003939"
},
"license_option": {
"id": "3000000004200"
},
"installation_allowed": "Unlimited",
"keys": [
""
],
"no_of_license": "5",
"site": {
"quantity": 2,
"id": "3000000006976"
},
"is_organization_license": true
}
]
}
]
};
params = {"input_data": input_data};
response = invokeurl
[
url: url
type: PUT
parameters: params
headers: headers
];
info response;
#Powershell version - 5.1
$url = "<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/_receive_items"
$headers = @{ "Accept" = "application/vnd.manageengine.sdp.v3+json"
"Authorization" = "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"
"Content-Type" = "application/x-www-form-urlencoded"}
$input_data = @'
{
"receive_items": [
{
"id": "100000000000052297",
"sites": [
{
"quantity": 2,
"id": "100000000000041089"
},
{
"quantity": 3,
"id": "100000000000042787"
}
],
"quantity": "5"
},
{
"id": "3000000046175",
"quantity": "5",
"standard_licenses": [
{
"license_type": {
"id": "3000000003939"
},
"license_option": {
"id": "3000000004200"
},
"installation_allowed": "Unlimited",
"keys": [
""
],
"no_of_license": "5",
"site": {
"quantity": 2,
"id": "3000000006976"
},
"is_organization_license": true
}
]
}
]
}
'@
$data = @{ 'input_data' = $input_data}
$response = Invoke-RestMethod -Uri $url -Method put -Body $data -Headers $headers
$response
#Python version - 3.10
from urllib.error import HTTPError
from urllib.parse import urlencode
from urllib.request import urlopen,Request
url = "<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/_receive_items"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"Content-Type" : "application/x-www-form-urlencoded"}
input_data = '''{
"receive_items": [
{
"id": "100000000000052297",
"sites": [
{
"quantity": 2,
"id": "100000000000041089"
},
{
"quantity": 3,
"id": "100000000000042787"
}
],
"quantity": "5"
},
{
"id": "3000000046175",
"quantity": "5",
"standard_licenses": [
{
"license_type": {
"id": "3000000003939"
},
"license_option": {
"id": "3000000004200"
},
"installation_allowed": "Unlimited",
"keys": [
""
],
"no_of_license": "5",
"site": {
"quantity": 2,
"id": "3000000006976"
},
"is_organization_license": true
}
]
}
]
}'''
data = urlencode({"input_data":input_data}).encode()
httprequest = Request(url, headers=headers,data=data, method="PUT")
try:
with urlopen(httprequest) as response:
print(response.read().decode())
except HTTPError as e:
print(e.read().decode())
{
"receive_items": [
{
"total_received_quantity": 5,
"sites": [
{
"id": "100000000000041089",
"received_quantity": 2
},
{
"id": "100000000000042787",
"received_quantity": 3
}
],
"id": "100000000000052297",
"status": "Items Received"
},
{
"total_received_quantity": 5,
"sites": [
{
"id": "3000000006976",
"received_quantity": 5
}
],
"id": "3000000046175",
"status": "Items Received"
}
],
"response_status": [
{
"status_code": 2000,
"messages": [
{
"status_code": 2000,
"type": "success",
"message": "Items received"
}
],
"status": "success"
}
]
}
取消采购订单
使用此操作取消采购订单并发送通知
URL
<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/_cancel
$ curl <service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/_cancel\
-X PUT\
-H "Accept: application/vnd.manageengine.sdp.v3+json"\
-H "Authorization: Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"\
-H "Content-Type: application/x-www-form-urlencoded"\
-d input_data='{
"notification": {
"is_notify": true,
"to": [
"guest@zylker.com"
],
"subject": "Purchase Order Canceled.",
"comments": "Purchase Order Canceled"
}
}'
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/_cancel";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
input_data = {
"notification": {
"is_notify": true,
"to": [
"guest@zylker.com"
],
"subject": "Purchase Order Canceled.",
"comments": "Purchase Order Canceled"
}
};
params = {"input_data": input_data};
response = invokeurl
[
url: url
type: PUT
parameters: params
headers: headers
];
info response;
#Powershell version - 5.1
$url = "<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/_cancel"
$headers = @{ "Accept" = "application/vnd.manageengine.sdp.v3+json"
"Authorization" = "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"
"Content-Type" = "application/x-www-form-urlencoded"}
$input_data = @'
{
"notification": {
"is_notify": true,
"to": [
"guest@zylker.com"
],
"subject": "Purchase Order Canceled.",
"comments": "Purchase Order Canceled"
}
}
'@
$data = @{ 'input_data' = $input_data}
$response = Invoke-RestMethod -Uri $url -Method put -Body $data -Headers $headers
$response
#Python version - 3.10
from urllib.error import HTTPError
from urllib.parse import urlencode
from urllib.request import urlopen,Request
url = "<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/_cancel"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"Content-Type" : "application/x-www-form-urlencoded"}
input_data = '''{
"notification": {
"is_notify": true,
"to": [
"guest@zylker.com"
],
"subject": "Purchase Order Canceled.",
"comments": "Purchase Order Canceled"
}
}'''
data = urlencode({"input_data":input_data}).encode()
httprequest = Request(url, headers=headers,data=data, method="PUT")
try:
with urlopen(httprequest) as response:
print(response.read().decode())
except HTTPError as e:
print(e.read().decode())
{
"response_status": {
"status_code": 2000,
"messages": [
{
"status_code": 2000,
"type": "success",
"message": "Notification sent"
},
{
"status_code": 2000,
"type": "success",
"message": "Purchase Order canceled successfully"
}
],
"status": "success"
}
}
在不同审批级别拒绝采购订单
使用此操作在不同审批级别拒绝采购订单
URL
<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/approval_levels/{level_id}/approvals/{approval_id}/_reject
$ curl <service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/approval_levels/{level_id}/approvals/{approval_id}/_reject\
-X PUT\
-H "Accept: application/vnd.manageengine.sdp.v3+json"\
-H "Authorization: Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"\
-H "Content-Type: application/x-www-form-urlencoded"\
-d input_data=''
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/approval_levels/{level_id}/approvals/{approval_id}/_reject";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
input_data = ;
params = {"input_data": input_data};
response = invokeurl
[
url: url
type: PUT
parameters: params
headers: headers
];
info response;
#Powershell version - 5.1
$url = "<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/approval_levels/{level_id}/approvals/{approval_id}/_reject"
$headers = @{ "Accept" = "application/vnd.manageengine.sdp.v3+json"
"Authorization" = "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"
"Content-Type" = "application/x-www-form-urlencoded"}
$input_data = @'
'@
$data = @{ 'input_data' = $input_data}
$response = Invoke-RestMethod -Uri $url -Method put -Body $data -Headers $headers
$response
#Python version - 3.10
from urllib.error import HTTPError
from urllib.parse import urlencode
from urllib.request import urlopen,Request
url = "<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/approval_levels/{level_id}/approvals/{approval_id}/_reject"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"Content-Type" : "application/x-www-form-urlencoded"}
input_data = ''''''
data = urlencode({"input_data":input_data}).encode()
httprequest = Request(url, headers=headers,data=data, method="PUT")
try:
with urlopen(httprequest) as response:
print(response.read().decode())
except HTTPError as e:
print(e.read().decode())
{
"response_status": {
"status_code": 2000,
"messages": [
{
"status_code": 2000,
"type": "success",
"message": "Your decision has been recorded. Thank you for your cooperation."
}
],
"status": "success"
}
}
批准采购订单
使用此操作审批采购订单并发送通知
URL
<service domain|custom domain>/app/<portal>/purchase_orders/{purchaseorder_id}/_approve
$ curl <service domain|custom domain>/app/<portal>/purchase_orders/{purchaseorder_id}/_approve\
-X PUT\
-H "Accept: application/vnd.manageengine.sdp.v3+json"\
-H "Authorization: Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"\
-H "Content-Type: application/x-www-form-urlencoded"\
-d input_data='{
"notification": {
"is_notify": true,
"to": [
"guest@zylker.com",
"test1@zmail.com"
],
"subject": "Purchase Order Approved.",
"comments": "This Purchase Order is Approved"
}
}'
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/purchase_orders/{purchaseorder_id}/_approve";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
input_data = {
"notification": {
"is_notify": true,
"to": [
"guest@zylker.com",
"test1@zmail.com"
],
"subject": "Purchase Order Approved.",
"comments": "This Purchase Order is Approved"
}
};
params = {"input_data": input_data};
response = invokeurl
[
url: url
type: PUT
parameters: params
headers: headers
];
info response;
#Powershell version - 5.1
$url = "<service domain|custom domain>/app/<portal>/purchase_orders/{purchaseorder_id}/_approve"
$headers = @{ "Accept" = "application/vnd.manageengine.sdp.v3+json"
"Authorization" = "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"
"Content-Type" = "application/x-www-form-urlencoded"}
$input_data = @'
{
"notification": {
"is_notify": true,
"to": [
"guest@zylker.com",
"test1@zmail.com"
],
"subject": "Purchase Order Approved.",
"comments": "This Purchase Order is Approved"
}
}
'@
$data = @{ 'input_data' = $input_data}
$response = Invoke-RestMethod -Uri $url -Method put -Body $data -Headers $headers
$response
#Python version - 3.10
from urllib.error import HTTPError
from urllib.parse import urlencode
from urllib.request import urlopen,Request
url = "<service domain|custom domain>/app/<portal>/purchase_orders/{purchaseorder_id}/_approve"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"Content-Type" : "application/x-www-form-urlencoded"}
input_data = '''{
"notification": {
"is_notify": true,
"to": [
"guest@zylker.com",
"test1@zmail.com"
],
"subject": "Purchase Order Approved.",
"comments": "This Purchase Order is Approved"
}
}'''
data = urlencode({"input_data":input_data}).encode()
httprequest = Request(url, headers=headers,data=data, method="PUT")
try:
with urlopen(httprequest) as response:
print(response.read().decode())
except HTTPError as e:
print(e.read().decode())
{
"response_status": {
"status_code": 2000,
"messages": [
{
"status_code": 2000,
"type": "success",
"message": "Notification sent"
},
{
"status_code": 2000,
"type": "success",
"message": "Your decision has been recorded. Thank you for your cooperation."
}
],
"status": "success"
}
}
在多个审批级别添加多个审批人
使用此操作在多个审批级别向采购订单添加多个审批人
URL
<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/_approval
$ curl <service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/_approval\
-X POST\
-H "Accept: application/vnd.manageengine.sdp.v3+json"\
-H "Authorization: Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"\
-H "Content-Type: application/x-www-form-urlencoded"\
-d input_data='{
"approval": {
"approval_levels": [
{
"level": 1,
"approvers": [
{
"id": "100000000000036117"
},
{
"id": "100000000000050487"
}
]
},
{
"level": 2,
"approvers": [
{
"id": "100000000000050487"
}
]
},
{
"level": 3,
"approvers": [
{
"id": "100000000000036117"
}
]
}
],
"auto_approval_notify": true,
"all_should_approve": true
}
}'
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/_approval";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
input_data = {
"approval": {
"approval_levels": [
{
"level": 1,
"approvers": [
{
"id": "100000000000036117"
},
{
"id": "100000000000050487"
}
]
},
{
"level": 2,
"approvers": [
{
"id": "100000000000050487"
}
]
},
{
"level": 3,
"approvers": [
{
"id": "100000000000036117"
}
]
}
],
"auto_approval_notify": true,
"all_should_approve": true
}
};
params = {"input_data": input_data};
response = invokeurl
[
url: url
type: POST
parameters: params
headers: headers
];
info response;
#Powershell version - 5.1
$url = "<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/_approval"
$headers = @{"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"Content-Type" : "application/x-www-form-urlencoded"}
$input_data = @'
{
"approval": {
"approval_levels": [
{
"level": 1,
"approvers": [
{
"id": "100000000000036117"
},
{
"id": "100000000000050487"
}
]
},
{
"level": 2,
"approvers": [
{
"id": "100000000000050487"
}
]
},
{
"level": 3,
"approvers": [
{
"id": "100000000000036117"
}
]
}
],
"auto_approval_notify": true,
"all_should_approve": true
}
}
'@
$data = @{ 'input_data' = $input_data}
$response = Invoke-RestMethod -Uri $url -Method post -Body $data -Headers $headers
$response
#Python version - 3.10
from urllib.error import HTTPError
from urllib.parse import urlencode
from urllib.request import urlopen,Request
url = "<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/_approval"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"Content-Type" : "application/x-www-form-urlencoded"}
input_data = '''{
"approval": {
"approval_levels": [
{
"level": 1,
"approvers": [
{
"id": "100000000000036117"
},
{
"id": "100000000000050487"
}
]
},
{
"level": 2,
"approvers": [
{
"id": "100000000000050487"
}
]
},
{
"level": 3,
"approvers": [
{
"id": "100000000000036117"
}
]
}
],
"auto_approval_notify": true,
"all_should_approve": true
}
}'''
data = urlencode({"input_data":input_data}).encode()
httprequest = Request(url, headers=headers,data=data, method="POST")
try:
with urlopen(httprequest) as response:
print(response.read().decode())
except HTTPError as e:
print(e.read().decode())
{
"response_status": {
"status_code": 2000,
"messages": [
{
"status_code": 2000,
"type": "success",
"message": "Approval details successfully updated."
}
],
"status": "success"
}
}
使用条形码接收物品
此操作用于通过条形码/二维码接收采购订单中的物品
URL
<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/_receive_items
$ curl <service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/_receive_items\
-X PUT\
-H "Accept: application/vnd.manageengine.sdp.v3+json"\
-H "Authorization: Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"\
-H "Content-Type: application/x-www-form-urlencoded"\
-d input_data='{
"receive_items": [
{
"id": "100001000000064019",
"quantity": 5,
"barcode_data": {
"is_sequence": false,
"scanned_barcodes": [
"1254675776801",
"1079876545352",
"1765767657603",
"1576878787804",
"0799439112766"
],
"site": {
"id": "100001000000075607"
},
"location": "Chennai",
"comments": "Adding barcode via scanning",
"vendor_barcode": true
}
}
]
}'
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/_receive_items";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
input_data = {
"receive_items": [
{
"id": "100001000000064019",
"quantity": 5,
"barcode_data": {
"is_sequence": false,
"scanned_barcodes": [
"1254675776801",
"1079876545352",
"1765767657603",
"1576878787804",
"0799439112766"
],
"site": {
"id": "100001000000075607"
},
"location": "Chennai",
"comments": "Adding barcode via scanning",
"vendor_barcode": true
}
}
]
};
params = {"input_data": input_data};
response = invokeurl
[
url: url
type: PUT
parameters: params
headers: headers
];
info response;
#Powershell version - 5.1
$url = "<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/_receive_items"
$headers = @{ "Accept" = "application/vnd.manageengine.sdp.v3+json"
"Authorization" = "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"
"Content-Type" = "application/x-www-form-urlencoded"}
$input_data = @'
{
"receive_items": [
{
"id": "100001000000064019",
"quantity": 5,
"barcode_data": {
"is_sequence": false,
"scanned_barcodes": [
"1254675776801",
"1079876545352",
"1765767657603",
"1576878787804",
"0799439112766"
],
"site": {
"id": "100001000000075607"
},
"location": "Chennai",
"comments": "Adding barcode via scanning",
"vendor_barcode": true
}
}
]
}
'@
$data = @{ 'input_data' = $input_data}
$response = Invoke-RestMethod -Uri $url -Method put -Body $data -Headers $headers
$response
#Python version - 3.10
from urllib.error import HTTPError
from urllib.parse import urlencode
from urllib.request import urlopen,Request
url = "<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/{purchaseorder_id}/_receive_items"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"Content-Type" : "application/x-www-form-urlencoded"}
input_data = '''{
"receive_items": [
{
"id": "100001000000064019",
"quantity": 5,
"barcode_data": {
"is_sequence": false,
"scanned_barcodes": [
"1254675776801",
"1079876545352",
"1765767657603",
"1576878787804",
"0799439112766"
],
"site": {
"id": "100001000000075607"
},
"location": "Chennai",
"comments": "Adding barcode via scanning",
"vendor_barcode": true
}
}
]
}'''
data = urlencode({"input_data":input_data}).encode()
httprequest = Request(url, headers=headers,data=data, method="PUT")
try:
with urlopen(httprequest) as response:
print(response.read().decode())
except HTTPError as e:
print(e.read().decode())
{
"receive_items": [
{
"barcode_data": [
{
"id": "100001000000075779",
"status": "success"
},
{
"id": "100001000000075787",
"status": "success"
},
{
"id": "100001000000075795",
"status": "success"
},
{
"id": "100001000000075803",
"status": "success"
},
{
"id": "100001000000075811",
"status": "success"
}
],
"total_received_quantity": 5,
"sites": [
{
"id": "100001000000075607",
"received_quantity": 5
}
],
"id": "100001000000064019",
"status": "Items received"
}
],
"response_status": [
{
"status_code": 2000,
"messages": [
{
"status_code": 2000,
"type": "success",
"message": "Items received"
}
],
"status": "success"
}
]
}
将采购订单与合同关联
使用此操作将采购订单关联到合同
URL
<service domain|custom domain>/app/<portal>/api/v3/contracts/100001000000033469/rel/purchase_orders
$ curl <service domain|custom domain>/app/<portal>/api/v3/contracts/100001000000033469/rel/purchase_orders\
-X POST\
-H "Accept: application/vnd.manageengine.sdp.v3+json"\
-H "Authorization: Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"\
-H "Content-Type: application/x-www-form-urlencoded"\
-d input_data='{
"purchase_orders": [
{
"purchase_order": {
"id": "100001000000033328"
}
}
]
}'
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/contracts/100001000000033469/rel/purchase_orders";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
input_data = {
"purchase_orders": [
{
"purchase_order": {
"id": "100001000000033328"
}
}
]
};
params = {"input_data": input_data};
response = invokeurl
[
url: url
type: POST
parameters: params
headers: headers
];
info response;
#Powershell version - 5.1
$url = "<service domain|custom domain>/app/<portal>/api/v3/contracts/100001000000033469/rel/purchase_orders"
$headers = @{"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"Content-Type" : "application/x-www-form-urlencoded"}
$input_data = @'
{
"purchase_orders": [
{
"purchase_order": {
"id": "100001000000033328"
}
}
]
}
'@
$data = @{ 'input_data' = $input_data}
$response = Invoke-RestMethod -Uri $url -Method post -Body $data -Headers $headers
$response
#Python version - 3.10
from urllib.error import HTTPError
from urllib.parse import urlencode
from urllib.request import urlopen,Request
url = "<service domain|custom domain>/app/<portal>/api/v3/contracts/100001000000033469/rel/purchase_orders"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"Content-Type" : "application/x-www-form-urlencoded"}
input_data = '''{
"purchase_orders": [
{
"purchase_order": {
"id": "100001000000033328"
}
}
]
}'''
data = urlencode({"input_data":input_data}).encode()
httprequest = Request(url, headers=headers,data=data, method="POST")
try:
with urlopen(httprequest) as response:
print(response.read().decode())
except HTTPError as e:
print(e.read().decode())
{
"purchase_orders": {
"created_time": {
"display_value": "May 21, 2026 11:59 AM",
"value": "1779344983201"
},
"comments": null,
"contract": {
"cost": {
"display_value": "0.00",
"currency_symbol": "$",
"value": 0
},
"display_id": {
"display_value": "CON-1",
"value": "1"
},
"vendor": {
"id": "100001000000033314"
},
"name": "Con 123",
"active_till": null,
"id": "100001000000033469",
"created_date": {
"display_value": "May 21, 2026",
"value": "1779344350245"
},
"active_from": {
"display_value": "May 1, 2026",
"value": "1777573800000"
},
"status": {
"id": "100001000000002054"
}
},
"created_by": {
"email_id": "guest@zylker.com",
"is_technician": true,
"sms_mail": null,
"mobile": "9781234450",
"last_name": "T8779",
"user_scope": "internal_user",
"sms_mail_id": null,
"cost_per_hour": "0",
"site": {
"deleted": false,
"name": "Base Site",
"id": "100001000000004457",
"is_default": true
},
"phone": "",
"employee_id": null,
"name": "SDPCloud",
"id": "100001000000033263",
"photo_url": "https://profile.zoho.com/file?exp=10&ID=15954173&t=user&height=60&width=60",
"is_vip_user": false,
"department": null,
"first_name": "Test",
"job_title": null
},
"last_updated_by": null,
"last_updated_time": null,
"purchase_order": {
"vendor": {
"id": "100001000000033314"
},
"custom_id": "1",
"name": "PO 1",
"id": "100001000000033328"
},
"id": "100001000000033485"
},
"response_status": [
{
"status_code": 2000,
"id": "100001000000033485",
"status": "success"
}
]
}
取消关联采购订单与合同
使用此操作解除采购订单与合同的关联
URL
<service domain|custom domain>/app/<portal>/api/v3/contracts/100001000000033469/rel/purchase_orders
$ curl <service domain|custom domain>/app/<portal>/api/v3/contracts/100001000000033469/rel/purchase_orders\
-X DELETE\
-H "Accept: application/vnd.manageengine.sdp.v3+json"\
-H "Authorization: Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"\
-H "Content-Type: application/x-www-form-urlencoded"
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/contracts/100001000000033469/rel/purchase_orders";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
response = invokeurl
[
url: url
type: DELETE
headers: headers
];
info response;
#Powershell version - 5.1
$url = "<service domain|custom domain>/app/<portal>/api/v3/contracts/100001000000033469/rel/purchase_orders"
$headers = @{ "Accept" = "application/vnd.manageengine.sdp.v3+json"
"Authorization" = "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"
"Content-Type" = "application/x-www-form-urlencoded"}
$response = Invoke-RestMethod -Uri $url -Method delete -Headers $headers
$response
#Python version - 3.10
from urllib.error import HTTPError
from urllib.request import urlopen,Request
url = "<service domain|custom domain>/app/<portal>/api/v3/contracts/100001000000033469/rel/purchase_orders"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"Content-Type" : "application/x-www-form-urlencoded"}
httprequest = Request(url, headers=headers,method="DELETE")
try:
with urlopen(httprequest) as response:
print(response.read().decode())
except HTTPError as e:
print(e.read().decode())
{
"response_status": {
"status_code": 2000,
"status": "success"
}
}
将合同与采购订单关联
使用此操作将合同关联到采购订单
URL
<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/100001000000033328/rel/contracts
$ curl <service domain|custom domain>/app/<portal>/api/v3/purchase_orders/100001000000033328/rel/contracts\
-X POST\
-H "Accept: application/vnd.manageengine.sdp.v3+json"\
-H "Authorization: Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"\
-H "Content-Type: application/x-www-form-urlencoded"\
-d input_data='{
"contracts": [
{
"contract": {
"id": "100001000000033469"
}
}
]
}'
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/100001000000033328/rel/contracts";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
input_data = {
"contracts": [
{
"contract": {
"id": "100001000000033469"
}
}
]
};
params = {"input_data": input_data};
response = invokeurl
[
url: url
type: POST
parameters: params
headers: headers
];
info response;
#Powershell version - 5.1
$url = "<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/100001000000033328/rel/contracts"
$headers = @{"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"Content-Type" : "application/x-www-form-urlencoded"}
$input_data = @'
{
"contracts": [
{
"contract": {
"id": "100001000000033469"
}
}
]
}
'@
$data = @{ 'input_data' = $input_data}
$response = Invoke-RestMethod -Uri $url -Method post -Body $data -Headers $headers
$response
#Python version - 3.10
from urllib.error import HTTPError
from urllib.parse import urlencode
from urllib.request import urlopen,Request
url = "<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/100001000000033328/rel/contracts"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"Content-Type" : "application/x-www-form-urlencoded"}
input_data = '''{
"contracts": [
{
"contract": {
"id": "100001000000033469"
}
}
]
}'''
data = urlencode({"input_data":input_data}).encode()
httprequest = Request(url, headers=headers,data=data, method="POST")
try:
with urlopen(httprequest) as response:
print(response.read().decode())
except HTTPError as e:
print(e.read().decode())
{
"response_status": [
{
"status_code": 2000,
"id": "100001000000033474",
"status": "success"
}
],
"contracts": {
"created_time": {
"display_value": "May 21, 2026 11:51 AM",
"value": "1779344467278"
},
"comments": null,
"contract": {
"cost": {
"display_value": "0.00",
"currency_symbol": "$",
"value": 0
},
"display_id": {
"display_value": "CON-1",
"value": "1"
},
"vendor": {
"id": "100001000000033314"
},
"name": "Con 123",
"active_till": null,
"id": "100001000000033469",
"created_date": {
"display_value": "May 21, 2026",
"value": "1779344350245"
},
"active_from": {
"display_value": "May 1, 2026",
"value": "1777573800000"
},
"status": {
"id": "100001000000002054"
}
},
"created_by": {
"email_id": "guest@zylker.com",
"is_technician": true,
"sms_mail": null,
"mobile": "9781234450",
"last_name": "T8779",
"user_scope": "internal_user",
"sms_mail_id": null,
"cost_per_hour": "0",
"site": {
"deleted": false,
"name": "Base Site",
"id": "100001000000004457",
"is_default": true
},
"phone": "",
"employee_id": null,
"name": "SDPCloud",
"id": "100001000000033263",
"photo_url": "https://profile.zoho.com/file?exp=10&ID=15954173&t=user&height=60&width=60",
"is_vip_user": false,
"department": null,
"first_name": "Test",
"job_title": null
},
"last_updated_by": null,
"last_updated_time": null,
"purchase_order": {
"vendor": {
"id": "100001000000033314"
},
"custom_id": "1",
"name": "PO 1",
"id": "100001000000033328"
},
"id": "100001000000033474"
}
}
取消合同与采购订单关联
使用此操作解除合同与采购订单的关联
URL
<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/100001000000033328/rel/contracts
$ curl <service domain|custom domain>/app/<portal>/api/v3/purchase_orders/100001000000033328/rel/contracts\
-X DELETE\
-H "Accept: application/vnd.manageengine.sdp.v3+json"\
-H "Authorization: Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"\
-H "Content-Type: application/x-www-form-urlencoded"
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/100001000000033328/rel/contracts";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
response = invokeurl
[
url: url
type: DELETE
headers: headers
];
info response;
#Powershell version - 5.1
$url = "<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/100001000000033328/rel/contracts"
$headers = @{ "Accept" = "application/vnd.manageengine.sdp.v3+json"
"Authorization" = "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"
"Content-Type" = "application/x-www-form-urlencoded"}
$response = Invoke-RestMethod -Uri $url -Method delete -Headers $headers
$response
#Python version - 3.10
from urllib.error import HTTPError
from urllib.request import urlopen,Request
url = "<service domain|custom domain>/app/<portal>/api/v3/purchase_orders/100001000000033328/rel/contracts"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"Content-Type" : "application/x-www-form-urlencoded"}
httprequest = Request(url, headers=headers,method="DELETE")
try:
with urlopen(httprequest) as response:
print(response.read().decode())
except HTTPError as e:
print(e.read().decode())
{
"response_status": {
"status_code": 2000,
"status": "success"
}
}