Skip to content

Purchase Order

Purchase order helps you to keep a track of purchase history in your organization.

Attributes

id (long)
Unique identifier to identify the purchase order

id (long)
Numerical digits which are considered to have larger values.

Example

234759602834500

name (string)
Unique name to identify purchase order

name (string)
A text in a plain format. No rich text or new line characters allowed.

Example

SampleContent

requested_by (user)
Indicates the user who requires the order

requested_by (user)
Indicates the user who wants the product

Example

{
  "requested_by": {
    "email_id": "test@zmail.com",
    "is_technician": true,
    "sms_mail": "",
    "mobile": "",
    "last_name": "",
    "user_scope": "internal_user",
    "sms_mail_id": "",
    "phone": "",
    "name": "tech1",
    "id": "100000000000034309",
    "photo_url": "test-photo_url",
    "is_vip_user": false,
    "first_name": "tech1",
    "job_title": ""
  }
}

vendor (vendor)
Indicates the vendor of the purchase order

vendor (vendor)
Contains the details of the vendor

Example

{
  "vendor": {
    "name": "dell1",
    "description": "No Description",
    "currency": {
      "symbol": "$",
      "code": "USD",
      "exchange_rate": "1",
      "name": "US Dollar",
      "id": "100000000000004105"
    },
    "id": "100000000000036005"
  }
}

items (po_item)
Indicates the items that are requested in purchase order

items (po_item)
Indicates the items that are requested in purchase order

Example

{
  "items": [
    {
      "ordered_quantity": "9",
      "product": {
        "name": "Tablet 1",
        "id": "100000000000042825"
      },
      "price": "678",
      "description": "CS+1+Type",
      "tax_rate": "3"
    },
    {
      "ordered_quantity": "8",
      "product": {
        "name": "CS 1",
        "id": "100000000000042419"
      },
      "price": "456",
      "description": "Tablet+1",
      "tax_rate": "5"
    }
  ]
}

custom_id (string)
unique sequence number to identify the purchase order

custom_id (string)
A text in a plain format. No rich text or new line characters allowed.

Example

SampleContent

More Attributes Expand all

ship_address (string)

The shipping address of the purchase order

ship_address (string)
A text in a plain format. No rich text or new line characters allowed.

Example

SampleContent

bill_address (string)

The billing address of the purchase order

bill_address (string)
A text in a plain format. No rich text or new line characters allowed.

Example

SampleContent

required_date (date)

It indicates the date when purchase order is required

required_date (date)
Represents a date as a JSON Object. Would contain the value and the display_value attributes.

value : The time in long format (No. of milliseconds from Jan 1, 1970 ).

display_value : The time in a readable form in a format as personalized by the user. If not personalized, default format would be used.

exchange_rate (double)

Currency exchange rate

exchange_rate (double)
These are numbers that can include contains decimals.

Example

 

discount_rate (double)

Specifies the discount rate of the purchase order

discount_rate (double)
These are numbers that can include contains decimals.

Example

23.08

sales_tax_rate (double)

Specifies the sales tax rate of the purchase order

sales_tax_rate (double)
These are numbers that can include contains decimals.

Example

23.08

additional_tax_rate (double)

Specifies additional tax rate of the purchase order

additional_tax_rate (double)
These are numbers that can include contains decimals.

Example

23.08

remarks (string)

It contains remarks of purchase order

remarks (string)
A text in a plain format. No rich text or new line characters allowed.

Example

SampleContent

terms (string)

It contains terms of purchase order

terms (string)
A text in a plain format. No rich text or new line characters allowed.

Example

SampleContent

sign_authority (string)

Specifies Signing authority of purchase order

sign_authority (string)
A text in a plain format. No rich text or new line characters allowed.

Example

SampleContent

place (string)

Indicates the place of creating the purchase order

place (string)
A text in a plain format. No rich text or new line characters allowed.

Example

SampleContent

cost_center (cost_center)

Indicates Cost Center used in purchase order

cost_center (cost_center)
Indicates Cost Center used in purchase order

Example

{
  "cost_center": {
    "name": "Cost Centre 1",
    "id": "100000000000047123",
    "cost_center_code": "CCC"
  }
}

gl_code (gl_code)

Indicates the GL Code used in purchase order

gl_code (gl_code)
Indicates the GL Code used in purchase order

Example

{
  "gl_code": {
    "name": "GL code two",
    "id": "100000000000047135"
  }
}

udf_fields (udf_fields)

Holds user defined fields values associated with the purchase order

udf_fields (udf_fields)
Holds user defined fields values associated with the purchase order

Example

{
  "udf_fields": {
    "udf_cost2": {
      "value": "5.67",
      "secondary_currency": {
        "value": "567"
      }
    },
    "udf_char1": "purchase order",
    "udf_char2": "single line",
    "udf_char3": "test@zmail.com"
  }
}

attachments (po_attachment)

Files that are attached to the purchase order. A maximum of 50 files can be attached to a purchase order

attachments (po_attachment)
Files that are attached to the purchase order

Example

{
  "attachments": [
    {
      "attached_by": {
        "email_id": "test@zmail.com",
        "is_technician": true,
        "last_name": "test2",
        "user_scope": "internal_user",
        "name": "test1",
        "id": "100000000000034239",
        "photo_url": "test-photo_url",
        "is_vip_user": false,
        "first_name": "test1"
      },
      "size": "248455",
      "content_type": "image/png",
      "module": "PurchaseOrder",
      "file_id": "22",
      "attached_on": {
        "display_value": "Sep 2, 2022 01:21 PM",
        "value": "1662105093560"
      },
      "name": "Screenshot from 2022-08-30 18-47-06.png",
      "content_url": "/purchase_orders/100000000000035003/_uploads/22",
      "id": "100000000000035343",
      "title": "-"
    }
  ]
}

approval_levels (approval_level)

Specifies approval levels of the purchase order

approval_levels (approval_level)
Specifies approval levels of the purchase order

Example

{
  "approval_levels": [
    {
      "level": 1,
      "approvers": [
        {
          "id": "100000000000036117"
        }
      ]
    },
    {
      "level": 2,
      "approvers": [
        {
          "id": "100000000000036117"
        }
      ]
    }
  ]
}

invoices (po_invoice)

Indicates the invoices added to the purchase order

invoices (po_invoice)
Indicates invoices of purchase order

Example

{
  "po_invoice": {
    "comments": "Invoice Received",
    "received_date": {
      "value": 1668537000000
    },
    "invoice_id": "Invoice 2",
    "payment_due_date": {
      "value": 1669919400000
    },
    "notify_technicians": [
      {
        "name": "Test1",
        "id": "100000000000036117"
      }
    ],
    "notify_before_days": "2",
    "is_notify": true
  }
}

payments (po_payment)

Payment details of purchase order

payments (po_payment)
Payment details of purchase order

Example

{
  "po_payment": {
    "amount_paid": "100",
    "comments": "Payment done",
    "exchange_rate": "30",
    "notify_technicians": [
      {
        "name": "test",
        "id": "100000000000036117"
      }
    ],
    "payment_due_date": {
      "value": 1669228200000
    },
    "notify_before_days": "5",
    "is_notify": true,
    "payment_date": {
      "value": 1668537000000
    }
  }
}

requests (request_po_association)

Associate a service request to the purchase order

requests (request_po_association)
Associate a service request to the purchase order

Example

{
  "requests": [
    {
      "request": {
        "id": "100000000000047948"
      }
    }
  ]
}

notifications (notification)

Indicates the details of notification

notifications (notification)
Indicates the details of notification

Example

{
  "notification": {
    "cc": "",
    "attachments": [],
    "sender": {
      "id": "100000000000036117"
    },
    "subject": "subject",
    "description": "",
    "to": [
      "tests@mmail.com"
    ],
    "type": "Notify_PURCHASE"
  }
}

po_approval (po_approval)

No Description

po_approval (po_approval)

sites (site)

Indicates the list of sites for which the purchase order is associated

sites (site)
Indicates the list of sites for which the purchase order is associated

Example

{
  "sites": [
    {
      "id": "100000000000035025"
    }
  ]
}

template (purchase_template)

Indicates the template which is used to create the purchase order

template (purchase_template)
Indicates the template which is used to create the purchase order

Example

{
  "template": {
    "name": "Purchase Order Template",
    "id": "100000000000030534"
  }
}

is_shipping_include (boolean)read only

No Description

is_shipping_include (boolean)
Boolean value which can have two possible values. The values are true and false.

status (purchase_status)read only

Indicate the status of purchase order Eg:- closed,open,rejected

status (purchase_status)
Indicates the current status of purchase order

Example

{
  "status": {
    "name": "Open",
    "id": "100000000000002390"
  }
}

created_date (date)read only

It indicates the date when the purchase order is created

created_date (date)
Represents a date as a JSON Object. Would contain the value and the display_value attributes.

value : The time in long format (No. of milliseconds from Jan 1, 1970 ).

display_value : The time in a readable form in a format as personalized by the user. If not personalized, default format would be used.

received_date (date)read only

Indicates the date when invoices received

received_date (date)
Represents a date as a JSON Object. Would contain the value and the display_value attributes.

value : The time in long format (No. of milliseconds from Jan 1, 1970 ).

display_value : The time in a readable form in a format as personalized by the user. If not personalized, default format would be used.

Example

 

currency (currency)read only

Indicates the currency used in purchase order

currency (currency)

Example

{
  "currency": {
    "symbol": "$",
    "code": "USD",
    "exchange_rate": "1",
    "is_frequent": true,
    "name": "US Dollar",
    "id": "100000000000004105"
  }
}

sub_total (cost)read only

Specifies sub total cost of purchase order

sub_total (cost)

net_total (cost)read only

Specifies the net total cost of purchase order

net_total (cost)

owner (user)read only

Indicates the purchase order owner name 

owner (user)

Example

{
  "owner": {
    "email_id": "test@zmail.com",
    "is_technician": true,
    "last_name": "test2",
    "user_scope": "internal_user",
    "name": "test1",
    "id": "100000000000034239",
    "photo_url": "test-photo_url",
    "is_vip_user": false,
    "first_name": "test1"
  }
}

summary (purchase_summary)read only

Contains the summary of the purchase order. Eg:- payments,attachments,invoices,approvals,requests,received items

summary (purchase_summary)

deleted_time (datetime)read only

Indicates when the purchase was sent to trash 

deleted_time (datetime)
Represents a date/time as a JSON Object. Would contain the value and the display_value attributes.

value : The time in long format (No. of milliseconds from Jan 1, 1970 ).

display_value : The time in a readable form in a format as personalized by the user. If not personalized, default format would be used.

status_comment_message (string)read only

indicates the message given in the comment

status_comment_message (string)
A text in a plain format. No rich text or new line characters allowed.

Example

Sample Content

status_comment_time (string)read only

Specifies the time when the status comment is added

status_comment_time (string)
A text in a plain format. No rich text or new line characters allowed.

Example

Sample Content

status_comment_by (string)read only

Specifies a user who commented

status_comment_by (string)
A text in a plain format. No rich text or new line characters allowed.

Example

Sample Content

discount (cost)

Specifies the discount value in the purchase order

discount (cost)
Specifies the discount value in the purchase order

Example

{
  "discount": {
    "value": "8.75",
    "secondary_currency": {
      "value": "800"
    }
  }
}

shipping_price (cost)

Indicates shipping price of the purchase order

shipping_price (cost)
Indicates shipping price of the purchase order

Example

{
  "shipping_price": {
    "value": "0.33",
    "secondary_currency": {
      "value": "110"
    }
  }
}

sales_tax (cost)

Specifies the sales tax of the purchase order

sales_tax (cost)
Specifies the sales tax of the purchase order

Example

{
  "sales_tax": {
    "value": "0.75",
    "secondary_currency": {
      "value": "60.00"
    }
  }
}

additional_tax (cost)

Specifies addition tax of purchase order

additional_tax (cost)
Specifies addition tax of purchase order

Example

{
  "additional_tax": {
    "value": "30.00",
    "secondary_currency": {
      "value": "30.00"
    }
  }
}

price_adjustment (cost)

Specifies the price adjustment value in the purchase order

price_adjustment (cost)
Specifies the price adjustment value in the purchase order

Example

{
  "price_adjustment": {
    "value": "-8.75",
    "secondary_currency": {
      "value": "-700.00"
    }
  }
}

total_price (cost)

Specifies the total cost of purchase order

total_price (cost)
Specifies the total cost of purchase order

Example

{
  "total_price": {
    "display_value": "30.41",
    "currency_symbol": "$",
    "value": 30.4125,
    "secondary_currency": {
      "display_value": 2433,
      "currency_symbol": "Rs.",
      "value": 2433
    }
  }
}

Add Purchase Order

Use this operation to create a new purchase order

Mandatory Fields :- name, requested_by, vendor, items

Url

api/v3/purchase_orders

Attributes

id (long)
Unique identifier to identify the purchase order

id (long)
Numerical digits which are considered to have larger values.

Example

234759602834500

name (string)
Unique name to identify purchase order

name (string)
A text in a plain format. No rich text or new line characters allowed.

Example

SampleContent

requested_by (user)
Indicates the user who requires the order

requested_by (user)
Indicates the user who wants the product

Example

{
  "requested_by": {
    "email_id": "test@zmail.com",
    "is_technician": true,
    "sms_mail": "",
    "mobile": "",
    "last_name": "",
    "user_scope": "internal_user",
    "sms_mail_id": "",
    "phone": "",
    "name": "tech1",
    "id": "100000000000034309",
    "photo_url": "test-photo_url",
    "is_vip_user": false,
    "first_name": "tech1",
    "job_title": ""
  }
}

vendor (vendor)
Indicates the vendor of the purchase order

vendor (vendor)
Contains the details of the vendor

Example

{
  "vendor": {
    "name": "dell1",
    "description": "No Description",
    "currency": {
      "symbol": "$",
      "code": "USD",
      "exchange_rate": "1",
      "name": "US Dollar",
      "id": "100000000000004105"
    },
    "id": "100000000000036005"
  }
}

items (po_item)
Indicates the items that are requested in purchase order

items (po_item)
Indicates the items that are requested in purchase order

Example

{
  "items": [
    {
      "ordered_quantity": "9",
      "product": {
        "name": "Tablet 1",
        "id": "100000000000042825"
      },
      "price": "678",
      "description": "CS+1+Type",
      "tax_rate": "3"
    },
    {
      "ordered_quantity": "8",
      "product": {
        "name": "CS 1",
        "id": "100000000000042419"
      },
      "price": "456",
      "description": "Tablet+1",
      "tax_rate": "5"
    }
  ]
}

custom_id (string)
unique sequence number to identify the purchase order

custom_id (string)
A text in a plain format. No rich text or new line characters allowed.

Example

SampleContent

More Attributes Expand all

ship_address (string)

The shipping address of the purchase order

ship_address (string)
A text in a plain format. No rich text or new line characters allowed.

Example

SampleContent

bill_address (string)

The billing address of the purchase order

bill_address (string)
A text in a plain format. No rich text or new line characters allowed.

Example

SampleContent

required_date (date)

It indicates the date when purchase order is required

required_date (date)
Represents a date as a JSON Object. Would contain the value and the display_value attributes.

value : The time in long format (No. of milliseconds from Jan 1, 1970 ).

display_value : The time in a readable form in a format as personalized by the user. If not personalized, default format would be used.

exchange_rate (double)

Currency exchange rate

exchange_rate (double)
These are numbers that can include contains decimals.

Example

 

discount_rate (double)

Specifies the discount rate of the purchase order

discount_rate (double)
These are numbers that can include contains decimals.

Example

23.08

sales_tax_rate (double)

Specifies the sales tax rate of the purchase order

sales_tax_rate (double)
These are numbers that can include contains decimals.

Example

23.08

additional_tax_rate (double)

Specifies additional tax rate of the purchase order

additional_tax_rate (double)
These are numbers that can include contains decimals.

Example

23.08

remarks (string)

It contains remarks of purchase order

remarks (string)
A text in a plain format. No rich text or new line characters allowed.

Example

SampleContent

terms (string)

It contains terms of purchase order

terms (string)
A text in a plain format. No rich text or new line characters allowed.

Example

SampleContent

sign_authority (string)

Specifies Signing authority of purchase order

sign_authority (string)
A text in a plain format. No rich text or new line characters allowed.

Example

SampleContent

place (string)

Indicates the place of creating the purchase order

place (string)
A text in a plain format. No rich text or new line characters allowed.

Example

SampleContent

cost_center (cost_center)

Indicates Cost Center used in purchase order

cost_center (cost_center)
Indicates Cost Center used in purchase order

Example

{
  "cost_center": {
    "name": "Cost Centre 1",
    "id": "100000000000047123",
    "cost_center_code": "CCC"
  }
}

gl_code (gl_code)

Indicates the GL Code used in purchase order

gl_code (gl_code)
Indicates the GL Code used in purchase order

Example

{
  "gl_code": {
    "name": "GL code two",
    "id": "100000000000047135"
  }
}

udf_fields (udf_fields)

Holds user defined fields values associated with the purchase order

udf_fields (udf_fields)
Holds user defined fields values associated with the purchase order

Example

{
  "udf_fields": {
    "udf_cost2": {
      "value": "5.67",
      "secondary_currency": {
        "value": "567"
      }
    },
    "udf_char1": "purchase order",
    "udf_char2": "single line",
    "udf_char3": "test@zmail.com"
  }
}

attachments (po_attachment)

Files that are attached to the purchase order. A maximum of 50 files can be attached to a purchase order

attachments (po_attachment)
Files that are attached to the purchase order

Example

{
  "attachments": [
    {
      "attached_by": {
        "email_id": "test@zmail.com",
        "is_technician": true,
        "last_name": "test2",
        "user_scope": "internal_user",
        "name": "test1",
        "id": "100000000000034239",
        "photo_url": "test-photo_url",
        "is_vip_user": false,
        "first_name": "test1"
      },
      "size": "248455",
      "content_type": "image/png",
      "module": "PurchaseOrder",
      "file_id": "22",
      "attached_on": {
        "display_value": "Sep 2, 2022 01:21 PM",
        "value": "1662105093560"
      },
      "name": "Screenshot from 2022-08-30 18-47-06.png",
      "content_url": "/purchase_orders/100000000000035003/_uploads/22",
      "id": "100000000000035343",
      "title": "-"
    }
  ]
}

approval_levels (approval_level)

Specifies approval levels of the purchase order

approval_levels (approval_level)
Specifies approval levels of the purchase order

Example

{
  "approval_levels": [
    {
      "level": 1,
      "approvers": [
        {
          "id": "100000000000036117"
        }
      ]
    },
    {
      "level": 2,
      "approvers": [
        {
          "id": "100000000000036117"
        }
      ]
    }
  ]
}

conversations (conversation)

No Description

conversations (conversation)

invoices (po_invoice)

Indicates the invoices added to the purchase order

invoices (po_invoice)
Indicates invoices of purchase order

Example

{
  "po_invoice": {
    "comments": "Invoice Received",
    "received_date": {
      "value": 1668537000000
    },
    "invoice_id": "Invoice 2",
    "payment_due_date": {
      "value": 1669919400000
    },
    "notify_technicians": [
      {
        "name": "Test1",
        "id": "100000000000036117"
      }
    ],
    "notify_before_days": "2",
    "is_notify": true
  }
}

payments (po_payment)

Payment details of purchase order

payments (po_payment)
Payment details of purchase order

Example

{
  "po_payment": {
    "amount_paid": "100",
    "comments": "Payment done",
    "exchange_rate": "30",
    "notify_technicians": [
      {
        "name": "test",
        "id": "100000000000036117"
      }
    ],
    "payment_due_date": {
      "value": 1669228200000
    },
    "notify_before_days": "5",
    "is_notify": true,
    "payment_date": {
      "value": 1668537000000
    }
  }
}

requests (request_po_association)

Associate a service request to the purchase order

requests (request_po_association)
Associate a service request to the purchase order

Example

{
  "requests": [
    {
      "request": {
        "id": "100000000000047948"
      }
    }
  ]
}

archive_requests (arc_request_po_association)

No Description

archive_requests (arc_request_po_association)

recent_item (recent_item)

No Description

recent_item (recent_item)

notifications (notification)

Indicates the details of notification

notifications (notification)
Indicates the details of notification

Example

{
  "notification": {
    "cc": "",
    "attachments": [],
    "sender": {
      "id": "100000000000036117"
    },
    "subject": "subject",
    "description": "",
    "to": [
      "tests@mmail.com"
    ],
    "type": "Notify_PURCHASE"
  }
}

po_approval (po_approval)

No Description

po_approval (po_approval)

sites (site)

Indicates the list of sites for which the purchase order is associated

sites (site)
Indicates the list of sites for which the purchase order is associated

Example

{
  "sites": [
    {
      "id": "100000000000035025"
    }
  ]
}

template (purchase_template)

Indicates the template which is used to create the purchase order

template (purchase_template)
Indicates the template which is used to create the purchase order

Example

{
  "template": {
    "name": "Purchase Order Template",
    "id": "100000000000030534"
  }
}

is_shipping_include (boolean)read only

No Description

is_shipping_include (boolean)
Boolean value which can have two possible values. The values are true and false.

status (purchase_status)read only

Indicate the status of purchase order Eg:- closed,open,rejected

status (purchase_status)
Indicates the current status of purchase order

Example

{
  "status": {
    "name": "Open",
    "id": "100000000000002390"
  }
}

created_date (date)read only

It indicates the date when the purchase order is created

created_date (date)
Represents a date as a JSON Object. Would contain the value and the display_value attributes.

value : The time in long format (No. of milliseconds from Jan 1, 1970 ).

display_value : The time in a readable form in a format as personalized by the user. If not personalized, default format would be used.

received_date (date)read only

Indicates the date when invoices received

received_date (date)
Represents a date as a JSON Object. Would contain the value and the display_value attributes.

value : The time in long format (No. of milliseconds from Jan 1, 1970 ).

display_value : The time in a readable form in a format as personalized by the user. If not personalized, default format would be used.

Example

 

currency (currency)read only

Indicates the currency used in purchase order

currency (currency)

Example

{
  "currency": {
    "symbol": "$",
    "code": "USD",
    "exchange_rate": "1",
    "is_frequent": true,
    "name": "US Dollar",
    "id": "100000000000004105"
  }
}

sub_total (cost)read only

Specifies sub total cost of purchase order

sub_total (cost)

net_total (cost)read only

Specifies the net total cost of purchase order

net_total (cost)

owner (user)read only

Indicates the purchase order owner name 

owner (user)

Example

{
  "owner": {
    "email_id": "test@zmail.com",
    "is_technician": true,
    "last_name": "test2",
    "user_scope": "internal_user",
    "name": "test1",
    "id": "100000000000034239",
    "photo_url": "test-photo_url",
    "is_vip_user": false,
    "first_name": "test1"
  }
}

summary (purchase_summary)read only

Contains the summary of the purchase order. Eg:- payments,attachments,invoices,approvals,requests,received items

summary (purchase_summary)

deleted_time (datetime)read only

Indicates when the purchase was sent to trash 

deleted_time (datetime)
Represents a date/time as a JSON Object. Would contain the value and the display_value attributes.

value : The time in long format (No. of milliseconds from Jan 1, 1970 ).

display_value : The time in a readable form in a format as personalized by the user. If not personalized, default format would be used.

status_comment_message (string)read only

indicates the message given in the comment

status_comment_message (string)
A text in a plain format. No rich text or new line characters allowed.

Example

Sample Content

status_comment_time (string)read only

Specifies the time when the status comment is added

status_comment_time (string)
A text in a plain format. No rich text or new line characters allowed.

Example

Sample Content

status_comment_by (string)read only

Specifies a user who commented

status_comment_by (string)
A text in a plain format. No rich text or new line characters allowed.

Example

Sample Content

discount (cost)

Specifies the discount value in the purchase order

discount (cost)
Specifies the discount value in the purchase order

Example

{
  "discount": {
    "value": "8.75",
    "secondary_currency": {
      "value": "800"
    }
  }
}

shipping_price (cost)

Indicates shipping price of the purchase order

shipping_price (cost)
Indicates shipping price of the purchase order

Example

{
  "shipping_price": {
    "value": "0.33",
    "secondary_currency": {
      "value": "110"
    }
  }
}

sales_tax (cost)

Specifies the sales tax of the purchase order

sales_tax (cost)
Specifies the sales tax of the purchase order

Example

{
  "sales_tax": {
    "value": "0.75",
    "secondary_currency": {
      "value": "60.00"
    }
  }
}

additional_tax (cost)

Specifies addition tax of purchase order

additional_tax (cost)
Specifies addition tax of purchase order

Example

{
  "additional_tax": {
    "value": "30.00",
    "secondary_currency": {
      "value": "30.00"
    }
  }
}

price_adjustment (cost)

Specifies the price adjustment value in the purchase order

price_adjustment (cost)
Specifies the price adjustment value in the purchase order

Example

{
  "price_adjustment": {
    "value": "-8.75",
    "secondary_currency": {
      "value": "-700.00"
    }
  }
}

total_price (cost)

Specifies the total cost of purchase order

total_price (cost)
Specifies the total cost of purchase order

Example

{
  "total_price": {
    "display_value": "30.41",
    "currency_symbol": "$",
    "value": 30.4125,
    "secondary_currency": {
      "display_value": 2433,
      "currency_symbol": "Rs.",
      "value": 2433
    }
  }
}

$ curl <url>/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": "100000000000030534"
        },
        "requested_by": {
            "id": "100000000000036117"
        },
        "custom_id": "26",
        "name": "PO 26",
        "required_date": {
            "value": 1668709800000
        },
        "sites": [
            {
                "id": "-1"
            }
        ],
        "vendor": {
            "id": "100000000000037235"
        },
        "ship_address": "No 89, Chennai",
        "bill_address": "No 56, Tokyo",
        "discount": {
            "secondary_currency": {
                "value": "500.00"
            },
            "value": "6.25"
        },
        "shipping_price": {
            "secondary_currency": {
                "value": "100.00"
            },
            "value": "1.25"
        },
        "sales_tax": {
            "secondary_currency": {
                "value": "424.24"
            },
            "value": "5.30"
        },
        "additional_tax": {
            "secondary_currency": {
                "value": "200.00"
            },
            "value": "2.50"
        },
        "price_adjustment": {
            "secondary_currency": {
                "value": "-50.00"
            },
            "value": "-0.62"
        },
        "cost_center": {
            "id": "100000000000049395"
        },
        "gl_code": {
            "id": "100000000000047131"
        },
        "remarks": "Remarks of Purchase Order 26",
        "terms": "Terms of Purchase Order 26",
        "place": "Chennai",
        "sign_authority": "Test",
        "exchange_rate": "80",
        "discount_rate": null,
        "sales_tax_rate": "10",
        "additional_tax_rate": null,
        "items": [
            {
                "product": {
                    "id": "100000000000042825"
                },
                "description": "Tablet Product Description",
                "price": "456",
                "tax_rate": "4",
                "ordered_quantity": "10"
            }
        ]
    }
}'
// Deluge Sample script
url = "<url>/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": "100000000000030534"
        },
        "requested_by": {
            "id": "100000000000036117"
        },
        "custom_id": "26",
        "name": "PO 26",
        "required_date": {
            "value": 1668709800000
        },
        "sites": [
            {
                "id": "-1"
            }
        ],
        "vendor": {
            "id": "100000000000037235"
        },
        "ship_address": "No 89, Chennai",
        "bill_address": "No 56, Tokyo",
        "discount": {
            "secondary_currency": {
                "value": "500.00"
            },
            "value": "6.25"
        },
        "shipping_price": {
            "secondary_currency": {
                "value": "100.00"
            },
            "value": "1.25"
        },
        "sales_tax": {
            "secondary_currency": {
                "value": "424.24"
            },
            "value": "5.30"
        },
        "additional_tax": {
            "secondary_currency": {
                "value": "200.00"
            },
            "value": "2.50"
        },
        "price_adjustment": {
            "secondary_currency": {
                "value": "-50.00"
            },
            "value": "-0.62"
        },
        "cost_center": {
            "id": "100000000000049395"
        },
        "gl_code": {
            "id": "100000000000047131"
        },
        "remarks": "Remarks of Purchase Order 26",
        "terms": "Terms of Purchase Order 26",
        "place": "Chennai",
        "sign_authority": "Test",
        "exchange_rate": "80",
        "discount_rate": null,
        "sales_tax_rate": "10",
        "additional_tax_rate": null,
        "items": [
            {
                "product": {
                    "id": "100000000000042825"
                },
                "description": "Tablet Product Description",
                "price": "456",
                "tax_rate": "4",
                "ordered_quantity": "10"
            }
        ]
    }
};
params = {"input_data": input_data};
response = invokeurl
[
    url: url
    type: POST
    parameters: params
    headers: headers
];
info response;
#Powershell version - 5.1
$url = "<url>/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": "100000000000030534"
        },
        "requested_by": {
            "id": "100000000000036117"
        },
        "custom_id": "26",
        "name": "PO 26",
        "required_date": {
            "value": 1668709800000
        },
        "sites": [
            {
                "id": "-1"
            }
        ],
        "vendor": {
            "id": "100000000000037235"
        },
        "ship_address": "No 89, Chennai",
        "bill_address": "No 56, Tokyo",
        "discount": {
            "secondary_currency": {
                "value": "500.00"
            },
            "value": "6.25"
        },
        "shipping_price": {
            "secondary_currency": {
                "value": "100.00"
            },
            "value": "1.25"
        },
        "sales_tax": {
            "secondary_currency": {
                "value": "424.24"
            },
            "value": "5.30"
        },
        "additional_tax": {
            "secondary_currency": {
                "value": "200.00"
            },
            "value": "2.50"
        },
        "price_adjustment": {
            "secondary_currency": {
                "value": "-50.00"
            },
            "value": "-0.62"
        },
        "cost_center": {
            "id": "100000000000049395"
        },
        "gl_code": {
            "id": "100000000000047131"
        },
        "remarks": "Remarks of Purchase Order 26",
        "terms": "Terms of Purchase Order 26",
        "place": "Chennai",
        "sign_authority": "Test",
        "exchange_rate": "80",
        "discount_rate": null,
        "sales_tax_rate": "10",
        "additional_tax_rate": null,
        "items": [
            {
                "product": {
                    "id": "100000000000042825"
                },
                "description": "Tablet Product Description",
                "price": "456",
                "tax_rate": "4",
                "ordered_quantity": "10"
            }
        ]
    }
}
'@
$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 = "<url>/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": "100000000000030534"
        },
        "requested_by": {
            "id": "100000000000036117"
        },
        "custom_id": "26",
        "name": "PO 26",
        "required_date": {
            "value": 1668709800000
        },
        "sites": [
            {
                "id": "-1"
            }
        ],
        "vendor": {
            "id": "100000000000037235"
        },
        "ship_address": "No 89, Chennai",
        "bill_address": "No 56, Tokyo",
        "discount": {
            "secondary_currency": {
                "value": "500.00"
            },
            "value": "6.25"
        },
        "shipping_price": {
            "secondary_currency": {
                "value": "100.00"
            },
            "value": "1.25"
        },
        "sales_tax": {
            "secondary_currency": {
                "value": "424.24"
            },
            "value": "5.30"
        },
        "additional_tax": {
            "secondary_currency": {
                "value": "200.00"
            },
            "value": "2.50"
        },
        "price_adjustment": {
            "secondary_currency": {
                "value": "-50.00"
            },
            "value": "-0.62"
        },
        "cost_center": {
            "id": "100000000000049395"
        },
        "gl_code": {
            "id": "100000000000047131"
        },
        "remarks": "Remarks of Purchase Order 26",
        "terms": "Terms of Purchase Order 26",
        "place": "Chennai",
        "sign_authority": "Test",
        "exchange_rate": "80",
        "discount_rate": null,
        "sales_tax_rate": "10",
        "additional_tax_rate": null,
        "items": [
            {
                "product": {
                    "id": "100000000000042825"
                },
                "description": "Tablet Product Description",
                "price": "456",
                "tax_rate": "4",
                "ordered_quantity": "10"
            }
        ]
    }
}'''
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": "100000000000030534"
        },
        "attachments": [],
        "discount": {
            "display_value": "6.25",
            "currency_symbol": "$",
            "value": 6.25,
            "secondary_currency": {
                "display_value": 500,
                "currency_symbol": "Rs.",
                "value": 500
            }
        },
        "additional_tax_rate": "-1",
        "sites": [
            {
                "name": "All Sites",
                "id": "-1"
            }
        ],
        "discount_rate": "-1",
        "gl_code": {
            "name": "GL code one",
            "id": "100000000000047131"
        },
        "is_shipping_include": false,
        "sign_authority": "Test",
        "received_date": null,
        "price_adjustment": {
            "display_value": "-0.62",
            "currency_symbol": "$",
            "value": -0.625,
            "secondary_currency": {
                "display_value": -50,
                "currency_symbol": "Rs.",
                "value": -50
            }
        },
        "terms": "Terms of Purchase Order 26",
        "vendor": {
            "name": "BB",
            "description": "No Description",
            "currency": {
                "symbol": "Rs.",
                "code": "INR",
                "exchange_rate": "80",
                "name": "Indian Rupee",
                "id": "100000000000004131"
            },
            "id": "100000000000037235"
        },
        "sales_tax_rate": "10",
        "currency": {
            "symbol": "Rs.",
            "code": "INR",
            "exchange_rate": "80",
            "name": "Indian Rupee",
            "id": "100000000000004131"
        },
        "id": "100000000000049427",
        "place": "Chennai",
        "ship_address": "No 89, Chennai",
        "owner": {
            "email_id": "test@zmail.com",
            "is_technician": true,
            "sms_mail": null,
            "mobile": null,
            "last_name": "T",
            "user_scope": "internal_user",
            "sms_mail_id": null,
            "phone": null,
            "employee_id": null,
            "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": "1.25",
            "currency_symbol": "$",
            "value": 1.25,
            "secondary_currency": {
                "display_value": 100,
                "currency_symbol": "Rs.",
                "value": 100
            }
        },
        "required_date": {
            "display_value": "Nov 18, 2022",
            "value": "1668709800000"
        },
        "exchange_rate": "80.0",
        "additional_tax": {
            "display_value": "2.50",
            "currency_symbol": "$",
            "value": 2.5,
            "secondary_currency": {
                "display_value": 200,
                "currency_symbol": "Rs.",
                "value": 200
            }
        },
        "total_price": {
            "display_value": "61.46",
            "currency_symbol": "$",
            "value": 61.45799999999999,
            "secondary_currency": {
                "display_value": 4916.64,
                "currency_symbol": "Rs.",
                "value": 4916.639999999999
            }
        },
        "net_total": {
            "display_value": "53.03",
            "currency_symbol": "$",
            "value": 53.029999999999994,
            "secondary_currency": {
                "display_value": "4242.4",
                "currency_symbol": "Rs.",
                "value": 4242.4
            }
        },
        "custom_id": "26",
        "bill_address": "No 56, Tokyo",
        "requested_by": {
            "email_id": "test@zmail.com",
            "is_technician": true,
            "sms_mail": null,
            "mobile": null,
            "last_name": "T",
            "user_scope": "internal_user",
            "sms_mail_id": null,
            "phone": null,
            "employee_id": null,
            "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": "5.30",
            "currency_symbol": "$",
            "value": 5.303,
            "secondary_currency": {
                "display_value": 424.24,
                "currency_symbol": "Rs.",
                "value": 424.24
            }
        },
        "cost_center": {
            "name": "Cost Center One",
            "id": "100000000000049395",
            "cost_center_code": "Cost Center One"
        },
        "name": "PO 26",
        "sub_total": {
            "display_value": "59.28",
            "currency_symbol": "$",
            "value": 59.279999999999994,
            "secondary_currency": {
                "display_value": "4742.4",
                "currency_symbol": "Rs.",
                "value": 4742.4
            }
        },
        "created_date": {
            "display_value": "Nov 16, 2022",
            "value": "1668601443224"
        },
        "items": [
            {
                "ordered_quantity": "10",
                "purchase_lot_id": null,
                "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": "4742.4",
                "description": "Tablet Product Description",
                "warranty_expiry": null,
                "product_vendor_association": {
                    "vendor": {
                        "id": "100000000000037235"
                    },
                    "id": "100000000000042831"
                },
                "tax_rate": "4",
                "total_received_quantity": null,
                "service": null,
                "price": "456",
                "name": "Tablet 1",
                "id": "100000000000049431",
                "date_received": null,
                "service_vendor_association": null
            }
        ],
        "deleted_time": null,
        "remarks": "Remarks of Purchase Order 26",
        "status": {
            "name": "Open",
            "id": "100000000000002390"
        }
    }
}

Edit Purchase Order

Use this operation to edit a specific purchase order

Url

api/v3/purchase_orders/{purchaseorder_id}

Attributes

id (long)
Unique identifier to identify the purchase order

id (long)
Numerical digits which are considered to have larger values.

Example

234759602834500

name (string)
Unique name to identify purchase order

name (string)
A text in a plain format. No rich text or new line characters allowed.

Example

SampleContent

requested_by (user)
Indicates the user who requires the order

requested_by (user)
Indicates the user who wants the product

Example

{
  "requested_by": {
    "email_id": "test@zmail.com",
    "is_technician": true,
    "sms_mail": "",
    "mobile": "",
    "last_name": "",
    "user_scope": "internal_user",
    "sms_mail_id": "",
    "phone": "",
    "name": "tech1",
    "id": "100000000000034309",
    "photo_url": "test-photo_url",
    "is_vip_user": false,
    "first_name": "tech1",
    "job_title": ""
  }
}

vendor (vendor)
Indicates the vendor of the purchase order

vendor (vendor)
Contains the details of the vendor

Example

{
  "vendor": {
    "name": "dell1",
    "description": "No Description",
    "currency": {
      "symbol": "$",
      "code": "USD",
      "exchange_rate": "1",
      "name": "US Dollar",
      "id": "100000000000004105"
    },
    "id": "100000000000036005"
  }
}

items (po_item)
Indicates the items that are requested in purchase order

items (po_item)
Indicates the items that are requested in purchase order

Example

{
  "items": [
    {
      "ordered_quantity": "9",
      "product": {
        "name": "Tablet 1",
        "id": "100000000000042825"
      },
      "price": "678",
      "description": "CS+1+Type",
      "tax_rate": "3"
    },
    {
      "ordered_quantity": "8",
      "product": {
        "name": "CS 1",
        "id": "100000000000042419"
      },
      "price": "456",
      "description": "Tablet+1",
      "tax_rate": "5"
    }
  ]
}

custom_id (string)
unique sequence number to identify the purchase order

custom_id (string)
A text in a plain format. No rich text or new line characters allowed.

Example

SampleContent

More Attributes Expand all

ship_address (string)

The shipping address of the purchase order

ship_address (string)
A text in a plain format. No rich text or new line characters allowed.

Example

SampleContent

bill_address (string)

The billing address of the purchase order

bill_address (string)
A text in a plain format. No rich text or new line characters allowed.

Example

SampleContent

required_date (date)

It indicates the date when purchase order is required

required_date (date)
Represents a date as a JSON Object. Would contain the value and the display_value attributes.

value : The time in long format (No. of milliseconds from Jan 1, 1970 ).

display_value : The time in a readable form in a format as personalized by the user. If not personalized, default format would be used.

exchange_rate (double)

Currency exchange rate

exchange_rate (double)
These are numbers that can include contains decimals.

Example

 

discount_rate (double)

Specifies the discount rate of the purchase order

discount_rate (double)
These are numbers that can include contains decimals.

Example

23.08

sales_tax_rate (double)

Specifies the sales tax rate of the purchase order

sales_tax_rate (double)
These are numbers that can include contains decimals.

Example

23.08

additional_tax_rate (double)

Specifies additional tax rate of the purchase order

additional_tax_rate (double)
These are numbers that can include contains decimals.

Example

23.08

remarks (string)

It contains remarks of purchase order

remarks (string)
A text in a plain format. No rich text or new line characters allowed.

Example

SampleContent

terms (string)

It contains terms of purchase order

terms (string)
A text in a plain format. No rich text or new line characters allowed.

Example

SampleContent

sign_authority (string)

Specifies Signing authority of purchase order

sign_authority (string)
A text in a plain format. No rich text or new line characters allowed.

Example

SampleContent

place (string)

Indicates the place of creating the purchase order

place (string)
A text in a plain format. No rich text or new line characters allowed.

Example

SampleContent

cost_center (cost_center)

Indicates Cost Center used in purchase order

cost_center (cost_center)
Indicates Cost Center used in purchase order

Example

{
  "cost_center": {
    "name": "Cost Centre 1",
    "id": "100000000000047123",
    "cost_center_code": "CCC"
  }
}

gl_code (gl_code)

Indicates the GL Code used in purchase order

gl_code (gl_code)
Indicates the GL Code used in purchase order

Example

{
  "gl_code": {
    "name": "GL code two",
    "id": "100000000000047135"
  }
}

udf_fields (udf_fields)

Holds user defined fields values associated with the purchase order

udf_fields (udf_fields)
Holds user defined fields values associated with the purchase order

Example

{
  "udf_fields": {
    "udf_cost2": {
      "value": "5.67",
      "secondary_currency": {
        "value": "567"
      }
    },
    "udf_char1": "purchase order",
    "udf_char2": "single line",
    "udf_char3": "test@zmail.com"
  }
}

attachments (po_attachment)

Files that are attached to the purchase order. A maximum of 50 files can be attached to a purchase order

attachments (po_attachment)
Files that are attached to the purchase order

Example

{
  "attachments": [
    {
      "attached_by": {
        "email_id": "test@zmail.com",
        "is_technician": true,
        "last_name": "test2",
        "user_scope": "internal_user",
        "name": "test1",
        "id": "100000000000034239",
        "photo_url": "test-photo_url",
        "is_vip_user": false,
        "first_name": "test1"
      },
      "size": "248455",
      "content_type": "image/png",
      "module": "PurchaseOrder",
      "file_id": "22",
      "attached_on": {
        "display_value": "Sep 2, 2022 01:21 PM",
        "value": "1662105093560"
      },
      "name": "Screenshot from 2022-08-30 18-47-06.png",
      "content_url": "/purchase_orders/100000000000035003/_uploads/22",
      "id": "100000000000035343",
      "title": "-"
    }
  ]
}

approval_levels (approval_level)

Specifies approval levels of the purchase order

approval_levels (approval_level)
Specifies approval levels of the purchase order

Example

{
  "approval_levels": [
    {
      "level": 1,
      "approvers": [
        {
          "id": "100000000000036117"
        }
      ]
    },
    {
      "level": 2,
      "approvers": [
        {
          "id": "100000000000036117"
        }
      ]
    }
  ]
}

conversations (conversation)

No Description

conversations (conversation)

invoices (po_invoice)

Indicates the invoices added to the purchase order

invoices (po_invoice)
Indicates invoices of purchase order

Example

{
  "po_invoice": {
    "comments": "Invoice Received",
    "received_date": {
      "value": 1668537000000
    },
    "invoice_id": "Invoice 2",
    "payment_due_date": {
      "value": 1669919400000
    },
    "notify_technicians": [
      {
        "name": "Test1",
        "id": "100000000000036117"
      }
    ],
    "notify_before_days": "2",
    "is_notify": true
  }
}

payments (po_payment)

Payment details of purchase order

payments (po_payment)
Payment details of purchase order

Example

{
  "po_payment": {
    "amount_paid": "100",
    "comments": "Payment done",
    "exchange_rate": "30",
    "notify_technicians": [
      {
        "name": "test",
        "id": "100000000000036117"
      }
    ],
    "payment_due_date": {
      "value": 1669228200000
    },
    "notify_before_days": "5",
    "is_notify": true,
    "payment_date": {
      "value": 1668537000000
    }
  }
}

requests (request_po_association)

Associate a service request to the purchase order

requests (request_po_association)
Associate a service request to the purchase order

Example

{
  "requests": [
    {
      "request": {
        "id": "100000000000047948"
      }
    }
  ]
}

archive_requests (arc_request_po_association)

No Description

archive_requests (arc_request_po_association)

recent_item (recent_item)

No Description

recent_item (recent_item)

notifications (notification)

Indicates the details of notification

notifications (notification)
Indicates the details of notification

Example

{
  "notification": {
    "cc": "",
    "attachments": [],
    "sender": {
      "id": "100000000000036117"
    },
    "subject": "subject",
    "description": "",
    "to": [
      "tests@mmail.com"
    ],
    "type": "Notify_PURCHASE"
  }
}

po_approval (po_approval)

No Description

po_approval (po_approval)

sites (site)

Indicates the list of sites for which the purchase order is associated

sites (site)
Indicates the list of sites for which the purchase order is associated

Example

{
  "sites": [
    {
      "id": "100000000000035025"
    }
  ]
}

template (purchase_template)

Indicates the template which is used to create the purchase order

template (purchase_template)
Indicates the template which is used to create the purchase order

Example

{
  "template": {
    "name": "Purchase Order Template",
    "id": "100000000000030534"
  }
}

is_shipping_include (boolean)read only

No Description

is_shipping_include (boolean)
Boolean value which can have two possible values. The values are true and false.

status (purchase_status)read only

Indicate the status of purchase order Eg:- closed,open,rejected

status (purchase_status)
Indicates the current status of purchase order

Example

{
  "status": {
    "name": "Open",
    "id": "100000000000002390"
  }
}

created_date (date)read only

It indicates the date when the purchase order is created

created_date (date)
Represents a date as a JSON Object. Would contain the value and the display_value attributes.

value : The time in long format (No. of milliseconds from Jan 1, 1970 ).

display_value : The time in a readable form in a format as personalized by the user. If not personalized, default format would be used.

received_date (date)read only

Indicates the date when invoices received

received_date (date)
Represents a date as a JSON Object. Would contain the value and the display_value attributes.

value : The time in long format (No. of milliseconds from Jan 1, 1970 ).

display_value : The time in a readable form in a format as personalized by the user. If not personalized, default format would be used.

Example

 

currency (currency)read only

Indicates the currency used in purchase order

currency (currency)

Example

{
  "currency": {
    "symbol": "$",
    "code": "USD",
    "exchange_rate": "1",
    "is_frequent": true,
    "name": "US Dollar",
    "id": "100000000000004105"
  }
}

sub_total (cost)read only

Specifies sub total cost of purchase order

sub_total (cost)

net_total (cost)read only

Specifies the net total cost of purchase order

net_total (cost)

owner (user)read only

Indicates the purchase order owner name 

owner (user)

Example

{
  "owner": {
    "email_id": "test@zmail.com",
    "is_technician": true,
    "last_name": "test2",
    "user_scope": "internal_user",
    "name": "test1",
    "id": "100000000000034239",
    "photo_url": "test-photo_url",
    "is_vip_user": false,
    "first_name": "test1"
  }
}

summary (purchase_summary)read only

Contains the summary of the purchase order. Eg:- payments,attachments,invoices,approvals,requests,received items

summary (purchase_summary)

deleted_time (datetime)read only

Indicates when the purchase was sent to trash 

deleted_time (datetime)
Represents a date/time as a JSON Object. Would contain the value and the display_value attributes.

value : The time in long format (No. of milliseconds from Jan 1, 1970 ).

display_value : The time in a readable form in a format as personalized by the user. If not personalized, default format would be used.

status_comment_message (string)read only

indicates the message given in the comment

status_comment_message (string)
A text in a plain format. No rich text or new line characters allowed.

Example

Sample Content

status_comment_time (string)read only

Specifies the time when the status comment is added

status_comment_time (string)
A text in a plain format. No rich text or new line characters allowed.

Example

Sample Content

status_comment_by (string)read only

Specifies a user who commented

status_comment_by (string)
A text in a plain format. No rich text or new line characters allowed.

Example

Sample Content

discount (cost)

Specifies the discount value in the purchase order

discount (cost)
Specifies the discount value in the purchase order

Example

{
  "discount": {
    "value": "8.75",
    "secondary_currency": {
      "value": "800"
    }
  }
}

shipping_price (cost)

Indicates shipping price of the purchase order

shipping_price (cost)
Indicates shipping price of the purchase order

Example

{
  "shipping_price": {
    "value": "0.33",
    "secondary_currency": {
      "value": "110"
    }
  }
}

sales_tax (cost)

Specifies the sales tax of the purchase order

sales_tax (cost)
Specifies the sales tax of the purchase order

Example

{
  "sales_tax": {
    "value": "0.75",
    "secondary_currency": {
      "value": "60.00"
    }
  }
}

additional_tax (cost)

Specifies addition tax of purchase order

additional_tax (cost)
Specifies addition tax of purchase order

Example

{
  "additional_tax": {
    "value": "30.00",
    "secondary_currency": {
      "value": "30.00"
    }
  }
}

price_adjustment (cost)

Specifies the price adjustment value in the purchase order

price_adjustment (cost)
Specifies the price adjustment value in the purchase order

Example

{
  "price_adjustment": {
    "value": "-8.75",
    "secondary_currency": {
      "value": "-700.00"
    }
  }
}

total_price (cost)

Specifies the total cost of purchase order

total_price (cost)
Specifies the total cost of purchase order

Example

{
  "total_price": {
    "display_value": "30.41",
    "currency_symbol": "$",
    "value": 30.4125,
    "secondary_currency": {
      "display_value": 2433,
      "currency_symbol": "Rs.",
      "value": 2433
    }
  }
}

$ curl <url>/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": {

        "required_date": {
            "value": 1668709800000
        },

        "ship_address": "abc, Chennai",
        "bill_address": "78c , Tokyo",
        "discount": {
            "secondary_currency": {
                "value": "400.00"
            },
            "value": "40"
        },
        "sales_tax": {
            "secondary_currency": {
                "value": "40"
            },
            "value": "4"
        },
        "additional_tax": {
            "secondary_currency": {
                "value": "100.00"
            },
            "value": "10"
        },
        "cost_center": {
            "cost_center_code": "CCC"
        },
        "gl_code": {
            "name": "GL code one"
        },
        "remarks": "Remarks of Purchase Order 30",
        "terms": "Terms of Purchase Order 30",
        "place": "Mumbai",
        "exchange_rate": "10"
    }
}'
// Deluge Sample script
url = "<url>/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": {

        "required_date": {
            "value": 1668709800000
        },

        "ship_address": "abc, Chennai",
        "bill_address": "78c , Tokyo",
        "discount": {
            "secondary_currency": {
                "value": "400.00"
            },
            "value": "40"
        },
        "sales_tax": {
            "secondary_currency": {
                "value": "40"
            },
            "value": "4"
        },
        "additional_tax": {
            "secondary_currency": {
                "value": "100.00"
            },
            "value": "10"
        },
        "cost_center": {
            "cost_center_code": "CCC"
        },
        "gl_code": {
            "name": "GL code one"
        },
        "remarks": "Remarks of Purchase Order 30",
        "terms": "Terms of Purchase Order 30",
        "place": "Mumbai",
        "exchange_rate": "10"
    }
};
params = {"input_data": input_data};
response = invokeurl
[
    url: url
    type: PUT
    parameters: params
    headers: headers
];
info response;
#Powershell version - 5.1
$url = "<url>/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": {

        "required_date": {
            "value": 1668709800000
        },

        "ship_address": "abc, Chennai",
        "bill_address": "78c , Tokyo",
        "discount": {
            "secondary_currency": {
                "value": "400.00"
            },
            "value": "40"
        },
        "sales_tax": {
            "secondary_currency": {
                "value": "40"
            },
            "value": "4"
        },
        "additional_tax": {
            "secondary_currency": {
                "value": "100.00"
            },
            "value": "10"
        },
        "cost_center": {
            "cost_center_code": "CCC"
        },
        "gl_code": {
            "name": "GL code one"
        },
        "remarks": "Remarks of Purchase Order 30",
        "terms": "Terms of Purchase Order 30",
        "place": "Mumbai",
        "exchange_rate": "10"
    }
}
'@
$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 = "<url>/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": {

        "required_date": {
            "value": 1668709800000
        },

        "ship_address": "abc, Chennai",
        "bill_address": "78c , Tokyo",
        "discount": {
            "secondary_currency": {
                "value": "400.00"
            },
            "value": "40"
        },
        "sales_tax": {
            "secondary_currency": {
                "value": "40"
            },
            "value": "4"
        },
        "additional_tax": {
            "secondary_currency": {
                "value": "100.00"
            },
            "value": "10"
        },
        "cost_center": {
            "cost_center_code": "CCC"
        },
        "gl_code": {
            "name": "GL code one"
        },
        "remarks": "Remarks of Purchase Order 30",
        "terms": "Terms of Purchase Order 30",
        "place": "Mumbai",
        "exchange_rate": "10"
    }
}'''
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": "40.00",
            "currency_symbol": "$",
            "value": 40,
            "secondary_currency": {
                "display_value": 400,
                "currency_symbol": "Rs.",
                "value": 400
            }
        },
        "additional_tax_rate": "-1",
        "sites": [
            {
                "name": "Not in any site",
                "id": null
            }
        ],
        "discount_rate": "-1",
        "gl_code": {
            "name": "GL code one",
            "id": "100000000000047131"
        },
        "is_shipping_include": false,
        "sign_authority": null,
        "received_date": null,
        "price_adjustment": {
            "display_value": "0.00",
            "currency_symbol": "$",
            "value": 0,
            "secondary_currency": {
                "display_value": 0,
                "currency_symbol": "Rs.",
                "value": 0
            }
        },
        "terms": "Terms of Purchase Order 30",
        "vendor": {
            "name": "BB",
            "description": "No Description",
            "currency": {
                "symbol": "Rs.",
                "code": "INR",
                "exchange_rate": "80",
                "name": "Indian Rupee",
                "id": "100000000000004131"
            },
            "id": "100000000000037235"
        },
        "sales_tax_rate": "-1",
        "currency": {
            "symbol": "Rs.",
            "code": "INR",
            "exchange_rate": "80",
            "name": "Indian Rupee",
            "id": "100000000000004131"
        },
        "id": "100000000000049459",
        "place": "Mumbai",
        "ship_address": "abc, Chennai",
        "owner": {
            "email_id": "test@zmail.com",
            "is_technician": true,
            "sms_mail": null,
            "mobile": null,
            "last_name": "T",
            "user_scope": "internal_user",
            "sms_mail_id": null,
            "phone": null,
            "employee_id": null,
            "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,
            "secondary_currency": {
                "display_value": 0,
                "currency_symbol": "Rs.",
                "value": 0
            }
        },
        "required_date": {
            "display_value": "Nov 18, 2022",
            "value": "1668709800000"
        },
        "exchange_rate": "10.0",
        "additional_tax": {
            "display_value": "10.00",
            "currency_symbol": "$",
            "value": 10,
            "secondary_currency": {
                "display_value": 100,
                "currency_symbol": "Rs.",
                "value": 100
            }
        },
        "total_price": {
            "display_value": "308.43",
            "currency_symbol": "$",
            "value": 308.425,
            "secondary_currency": {
                "display_value": 3084.25,
                "currency_symbol": "Rs.",
                "value": 3084.25
            }
        },
        "net_total": {
            "display_value": "294.43",
            "currency_symbol": "$",
            "value": 294.425,
            "secondary_currency": {
                "display_value": "2944.25",
                "currency_symbol": "Rs.",
                "value": 2944.25
            }
        },
        "custom_id": "30",
        "bill_address": "78c , Tokyo",
        "requested_by": {
            "email_id": "test@zmail.com",
            "is_technician": true,
            "sms_mail": null,
            "mobile": null,
            "last_name": "T",
            "user_scope": "internal_user",
            "sms_mail_id": null,
            "phone": null,
            "employee_id": null,
            "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": "4.00",
            "currency_symbol": "$",
            "value": 4,
            "secondary_currency": {
                "display_value": 40,
                "currency_symbol": "Rs.",
                "value": 40
            }
        },
        "cost_center": {
            "name": "Cost Centre 1",
            "id": "100000000000047123",
            "cost_center_code": "CCC"
        },
        "name": "Purchase Order 30",
        "sub_total": {
            "display_value": "334.43",
            "currency_symbol": "$",
            "value": 334.425,
            "secondary_currency": {
                "display_value": "3344.25",
                "currency_symbol": "Rs.",
                "value": 3344.25
            }
        },
        "created_date": {
            "display_value": "Nov 16, 2022",
            "value": "1668605230475"
        },
        "items": [
            {
                "ordered_quantity": "7",
                "purchase_lot_id": null,
                "product": {
                    "part_no": "-",
                    "product_type": {
                        "image": "Workstations",
                        "name": "Workstation",
                        "id": "100000000000002991",
                        "mandatory": true
                    },
                    "software": null,
                    "name": "WorkStation 1",
                    "id": "100000000000042541",
                    "type": {
                        "name": "Asset",
                        "id": "100000000000002976"
                    },
                    "category": {
                        "name": "IT",
                        "description": "IT Assets and Components",
                        "id": "100000000000002985"
                    },
                    "manufacturer": "-"
                },
                "other": null,
                "amount": "3344.25",
                "description": null,
                "warranty_expiry": null,
                "product_vendor_association": {
                    "vendor": {
                        "id": "100000000000037235"
                    },
                    "id": "100000000000042547"
                },
                "tax_rate": "5",
                "total_received_quantity": null,
                "service": null,
                "price": "455",
                "name": "WorkStation 1",
                "id": "100000000000049465",
                "date_received": null,
                "service_vendor_association": null
            }
        ],
        "deleted_time": null,
        "remarks": "Remarks of Purchase Order 30",
        "status": {
            "name": "Open",
            "id": "100000000000002390"
        }
    }
}

Get Purchase Order

Use this operation to get a specific purchase order

Url

api/v3/purchase_orders/{purchaseorder_id}

Attributes

id (long)
Unique identifier to identify the purchase order

id (long)
Numerical digits which are considered to have larger values.

Example

234759602834500

name (string)
Unique name to identify purchase order

name (string)
A text in a plain format. No rich text or new line characters allowed.

Example

SampleContent

requested_by (user)
Indicates the user who requires the order

requested_by (user)
Indicates the user who wants the product

Example

{
  "requested_by": {
    "email_id": "test@zmail.com",
    "is_technician": true,
    "sms_mail": "",
    "mobile": "",
    "last_name": "",
    "user_scope": "internal_user",
    "sms_mail_id": "",
    "phone": "",
    "name": "tech1",
    "id": "100000000000034309",
    "photo_url": "test-photo_url",
    "is_vip_user": false,
    "first_name": "tech1",
    "job_title": ""
  }
}

vendor (vendor)
Indicates the vendor of the purchase order

vendor (vendor)
Contains the details of the vendor

Example

{
  "vendor": {
    "name": "dell1",
    "description": "No Description",
    "currency": {
      "symbol": "$",
      "code": "USD",
      "exchange_rate": "1",
      "name": "US Dollar",
      "id": "100000000000004105"
    },
    "id": "100000000000036005"
  }
}

items (po_item)
Indicates the items that are requested in purchase order

items (po_item)
Indicates the items that are requested in purchase order

Example

{
  "items": [
    {
      "ordered_quantity": "9",
      "product": {
        "name": "Tablet 1",
        "id": "100000000000042825"
      },
      "price": "678",
      "description": "CS+1+Type",
      "tax_rate": "3"
    },
    {
      "ordered_quantity": "8",
      "product": {
        "name": "CS 1",
        "id": "100000000000042419"
      },
      "price": "456",
      "description": "Tablet+1",
      "tax_rate": "5"
    }
  ]
}

custom_id (string)
unique sequence number to identify the purchase order

custom_id (string)
A text in a plain format. No rich text or new line characters allowed.

Example

SampleContent

More Attributes Expand all

ship_address (string)

The shipping address of the purchase order

ship_address (string)
A text in a plain format. No rich text or new line characters allowed.

Example

SampleContent

bill_address (string)

The billing address of the purchase order

bill_address (string)
A text in a plain format. No rich text or new line characters allowed.

Example

SampleContent

required_date (date)

It indicates the date when purchase order is required

required_date (date)
Represents a date as a JSON Object. Would contain the value and the display_value attributes.

value : The time in long format (No. of milliseconds from Jan 1, 1970 ).

display_value : The time in a readable form in a format as personalized by the user. If not personalized, default format would be used.

exchange_rate (double)

Currency exchange rate

exchange_rate (double)
These are numbers that can include contains decimals.

Example

 

discount_rate (double)

Specifies the discount rate of the purchase order

discount_rate (double)
These are numbers that can include contains decimals.

Example

23.08

sales_tax_rate (double)

Specifies the sales tax rate of the purchase order

sales_tax_rate (double)
These are numbers that can include contains decimals.

Example

23.08

additional_tax_rate (double)

Specifies additional tax rate of the purchase order

additional_tax_rate (double)
These are numbers that can include contains decimals.

Example

23.08

remarks (string)

It contains remarks of purchase order

remarks (string)
A text in a plain format. No rich text or new line characters allowed.

Example

SampleContent

terms (string)

It contains terms of purchase order

terms (string)
A text in a plain format. No rich text or new line characters allowed.

Example

SampleContent

sign_authority (string)

Specifies Signing authority of purchase order

sign_authority (string)
A text in a plain format. No rich text or new line characters allowed.

Example

SampleContent

place (string)

Indicates the place of creating the purchase order

place (string)
A text in a plain format. No rich text or new line characters allowed.

Example

SampleContent

cost_center (cost_center)

Indicates Cost Center used in purchase order

cost_center (cost_center)
Indicates Cost Center used in purchase order

Example

{
  "cost_center": {
    "name": "Cost Centre 1",
    "id": "100000000000047123",
    "cost_center_code": "CCC"
  }
}

gl_code (gl_code)

Indicates the GL Code used in purchase order

gl_code (gl_code)
Indicates the GL Code used in purchase order

Example

{
  "gl_code": {
    "name": "GL code two",
    "id": "100000000000047135"
  }
}

udf_fields (udf_fields)

Holds user defined fields values associated with the purchase order

udf_fields (udf_fields)
Holds user defined fields values associated with the purchase order

Example

{
  "udf_fields": {
    "udf_cost2": {
      "value": "5.67",
      "secondary_currency": {
        "value": "567"
      }
    },
    "udf_char1": "purchase order",
    "udf_char2": "single line",
    "udf_char3": "test@zmail.com"
  }
}

attachments (po_attachment)

Files that are attached to the purchase order. A maximum of 50 files can be attached to a purchase order

attachments (po_attachment)
Files that are attached to the purchase order

Example

{
  "attachments": [
    {
      "attached_by": {
        "email_id": "test@zmail.com",
        "is_technician": true,
        "last_name": "test2",
        "user_scope": "internal_user",
        "name": "test1",
        "id": "100000000000034239",
        "photo_url": "test-photo_url",
        "is_vip_user": false,
        "first_name": "test1"
      },
      "size": "248455",
      "content_type": "image/png",
      "module": "PurchaseOrder",
      "file_id": "22",
      "attached_on": {
        "display_value": "Sep 2, 2022 01:21 PM",
        "value": "1662105093560"
      },
      "name": "Screenshot from 2022-08-30 18-47-06.png",
      "content_url": "/purchase_orders/100000000000035003/_uploads/22",
      "id": "100000000000035343",
      "title": "-"
    }
  ]
}

approval_levels (approval_level)

Specifies approval levels of the purchase order

approval_levels (approval_level)
Specifies approval levels of the purchase order

Example

{
  "approval_levels": [
    {
      "level": 1,
      "approvers": [
        {
          "id": "100000000000036117"
        }
      ]
    },
    {
      "level": 2,
      "approvers": [
        {
          "id": "100000000000036117"
        }
      ]
    }
  ]
}

conversations (conversation)

No Description

conversations (conversation)

invoices (po_invoice)

Indicates the invoices added to the purchase order

invoices (po_invoice)
Indicates invoices of purchase order

Example

{
  "po_invoice": {
    "comments": "Invoice Received",
    "received_date": {
      "value": 1668537000000
    },
    "invoice_id": "Invoice 2",
    "payment_due_date": {
      "value": 1669919400000
    },
    "notify_technicians": [
      {
        "name": "Test1",
        "id": "100000000000036117"
      }
    ],
    "notify_before_days": "2",
    "is_notify": true
  }
}

payments (po_payment)

Payment details of purchase order

payments (po_payment)
Payment details of purchase order

Example

{
  "po_payment": {
    "amount_paid": "100",
    "comments": "Payment done",
    "exchange_rate": "30",
    "notify_technicians": [
      {
        "name": "test",
        "id": "100000000000036117"
      }
    ],
    "payment_due_date": {
      "value": 1669228200000
    },
    "notify_before_days": "5",
    "is_notify": true,
    "payment_date": {
      "value": 1668537000000
    }
  }
}

requests (request_po_association)

Associate a service request to the purchase order

requests (request_po_association)
Associate a service request to the purchase order

Example

{
  "requests": [
    {
      "request": {
        "id": "100000000000047948"
      }
    }
  ]
}

archive_requests (arc_request_po_association)

No Description

archive_requests (arc_request_po_association)

recent_item (recent_item)

No Description

recent_item (recent_item)

notifications (notification)

Indicates the details of notification

notifications (notification)
Indicates the details of notification

Example

{
  "notification": {
    "cc": "",
    "attachments": [],
    "sender": {
      "id": "100000000000036117"
    },
    "subject": "subject",
    "description": "",
    "to": [
      "tests@mmail.com"
    ],
    "type": "Notify_PURCHASE"
  }
}

po_approval (po_approval)

No Description

po_approval (po_approval)

sites (site)

Indicates the list of sites for which the purchase order is associated

sites (site)
Indicates the list of sites for which the purchase order is associated

Example

{
  "sites": [
    {
      "id": "100000000000035025"
    }
  ]
}

template (purchase_template)

Indicates the template which is used to create the purchase order

template (purchase_template)
Indicates the template which is used to create the purchase order

Example

{
  "template": {
    "name": "Purchase Order Template",
    "id": "100000000000030534"
  }
}

is_shipping_include (boolean)read only

No Description

is_shipping_include (boolean)
Boolean value which can have two possible values. The values are true and false.

status (purchase_status)read only

Indicate the status of purchase order Eg:- closed,open,rejected

status (purchase_status)
Indicates the current status of purchase order

Example

{
  "status": {
    "name": "Open",
    "id": "100000000000002390"
  }
}

created_date (date)read only

It indicates the date when the purchase order is created

created_date (date)
Represents a date as a JSON Object. Would contain the value and the display_value attributes.

value : The time in long format (No. of milliseconds from Jan 1, 1970 ).

display_value : The time in a readable form in a format as personalized by the user. If not personalized, default format would be used.

received_date (date)read only

Indicates the date when invoices received

received_date (date)
Represents a date as a JSON Object. Would contain the value and the display_value attributes.

value : The time in long format (No. of milliseconds from Jan 1, 1970 ).

display_value : The time in a readable form in a format as personalized by the user. If not personalized, default format would be used.

Example

 

currency (currency)read only

Indicates the currency used in purchase order

currency (currency)

Example

{
  "currency": {
    "symbol": "$",
    "code": "USD",
    "exchange_rate": "1",
    "is_frequent": true,
    "name": "US Dollar",
    "id": "100000000000004105"
  }
}

sub_total (cost)read only

Specifies sub total cost of purchase order

sub_total (cost)

net_total (cost)read only

Specifies the net total cost of purchase order

net_total (cost)

owner (user)read only

Indicates the purchase order owner name 

owner (user)

Example

{
  "owner": {
    "email_id": "test@zmail.com",
    "is_technician": true,
    "last_name": "test2",
    "user_scope": "internal_user",
    "name": "test1",
    "id": "100000000000034239",
    "photo_url": "test-photo_url",
    "is_vip_user": false,
    "first_name": "test1"
  }
}

summary (purchase_summary)read only

Contains the summary of the purchase order. Eg:- payments,attachments,invoices,approvals,requests,received items

summary (purchase_summary)

deleted_time (datetime)read only

Indicates when the purchase was sent to trash 

deleted_time (datetime)
Represents a date/time as a JSON Object. Would contain the value and the display_value attributes.

value : The time in long format (No. of milliseconds from Jan 1, 1970 ).

display_value : The time in a readable form in a format as personalized by the user. If not personalized, default format would be used.

status_comment_message (string)read only

indicates the message given in the comment

status_comment_message (string)
A text in a plain format. No rich text or new line characters allowed.

Example

Sample Content

status_comment_time (string)read only

Specifies the time when the status comment is added

status_comment_time (string)
A text in a plain format. No rich text or new line characters allowed.

Example

Sample Content

status_comment_by (string)read only

Specifies a user who commented

status_comment_by (string)
A text in a plain format. No rich text or new line characters allowed.

Example

Sample Content

discount (cost)

Specifies the discount value in the purchase order

discount (cost)
Specifies the discount value in the purchase order

Example

{
  "discount": {
    "value": "8.75",
    "secondary_currency": {
      "value": "800"
    }
  }
}

shipping_price (cost)

Indicates shipping price of the purchase order

shipping_price (cost)
Indicates shipping price of the purchase order

Example

{
  "shipping_price": {
    "value": "0.33",
    "secondary_currency": {
      "value": "110"
    }
  }
}

sales_tax (cost)

Specifies the sales tax of the purchase order

sales_tax (cost)
Specifies the sales tax of the purchase order

Example

{
  "sales_tax": {
    "value": "0.75",
    "secondary_currency": {
      "value": "60.00"
    }
  }
}

additional_tax (cost)

Specifies addition tax of purchase order

additional_tax (cost)
Specifies addition tax of purchase order

Example

{
  "additional_tax": {
    "value": "30.00",
    "secondary_currency": {
      "value": "30.00"
    }
  }
}

price_adjustment (cost)

Specifies the price adjustment value in the purchase order

price_adjustment (cost)
Specifies the price adjustment value in the purchase order

Example

{
  "price_adjustment": {
    "value": "-8.75",
    "secondary_currency": {
      "value": "-700.00"
    }
  }
}

total_price (cost)

Specifies the total cost of purchase order

total_price (cost)
Specifies the total cost of purchase order

Example

{
  "total_price": {
    "display_value": "30.41",
    "currency_symbol": "$",
    "value": 30.4125,
    "secondary_currency": {
      "display_value": 2433,
      "currency_symbol": "Rs.",
      "value": 2433
    }
  }
}

$ curl -G <url>/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 = "<url>/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 = "<url>/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 = "<url>/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": "100000000000030534"
        },
        "attachments": [
            {
                "attached_by": {
                    "email_id": "test@zmail.com",
                    "is_technician": true,
                    "sms_mail": null,
                    "mobile": null,
                    "last_name": "T",
                    "user_scope": "internal_user",
                    "sms_mail_id": null,
                    "phone": null,
                    "employee_id": null,
                    "name": "Test",
                    "id": "100000000000036117",
                    "photo_url": "https://contacts.zoho.com/file?sample",
                    "is_vip_user": false,
                    "department": null,
                    "first_name": "Test",
                    "job_title": null
                },
                "size": "20",
                "content_type": "text/plain",
                "module": "PurchaseOrder",
                "file_id": "6002",
                "attached_on": {
                    "display_value": "Nov 15, 2022 01:34 PM",
                    "value": "1668499471462"
                },
                "name": "Att",
                "content_url": "/purchase_orders/100000000000047111/_uploads/6002",
                "id": "100000000000047119",
                "title": "-"
            }
        ],
        "discount": {
            "display_value": "4.22",
            "currency_symbol": "$",
            "value": 4.21575,
            "secondary_currency": {
                "display_value": 337.26,
                "currency_symbol": "Rs.",
                "value": 337.26
            }
        },
        "additional_tax_rate": "-1",
        "sites": [
            {
                "name": "All Sites",
                "id": "-1"
            }
        ],
        "discount_rate": "3",
        "gl_code": null,
        "is_shipping_include": false,
        "sign_authority": "Test",
        "received_date": null,
        "price_adjustment": {
            "display_value": "0.38",
            "currency_symbol": "$",
            "value": 0.375,
            "secondary_currency": {
                "display_value": 30,
                "currency_symbol": "Rs.",
                "value": 30
            }
        },
        "terms": "terms of purchase order PO 5",
        "vendor": {
            "name": "BB",
            "description": "No Description",
            "currency": {
                "symbol": "Rs.",
                "code": "INR",
                "exchange_rate": "80",
                "name": "Indian Rupee",
                "id": "100000000000004131"
            },
            "id": "100000000000037235"
        },
        "sales_tax_rate": "0",
        "currency": {
            "symbol": "Rs.",
            "code": "INR",
            "exchange_rate": "80",
            "name": "Indian Rupee",
            "id": "100000000000004131"
        },
        "id": "100000000000047111",
        "place": "Chennai",
        "ship_address": "No 90 chennai",
        "owner": {
            "email_id": "test@zmail.com",
            "is_technician": true,
            "sms_mail": null,
            "mobile": null,
            "last_name": "T",
            "user_scope": "internal_user",
            "sms_mail_id": null,
            "phone": null,
            "employee_id": null,
            "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.38",
            "currency_symbol": "$",
            "value": 0.375,
            "secondary_currency": {
                "display_value": 30,
                "currency_symbol": "Rs.",
                "value": 30
            }
        },
        "required_date": {
            "display_value": "Nov 17, 2022",
            "value": "1668623400000"
        },
        "exchange_rate": "80.0",
        "additional_tax": {
            "display_value": "0.38",
            "currency_symbol": "$",
            "value": 0.375,
            "secondary_currency": {
                "display_value": 30,
                "currency_symbol": "Rs.",
                "value": 30
            }
        },
        "total_price": {
            "display_value": "137.43",
            "currency_symbol": "$",
            "value": 137.43425,
            "secondary_currency": {
                "display_value": 10994.74,
                "currency_symbol": "Rs.",
                "value": 10994.74
            }
        },
        "net_total": {
            "display_value": "136.31",
            "currency_symbol": "$",
            "value": 136.30925,
            "secondary_currency": {
                "display_value": "10904.74",
                "currency_symbol": "Rs.",
                "value": 10904.74
            }
        },
        "custom_id": "5",
        "bill_address": "No 89 Mumbai",
        "requested_by": {
            "email_id": "test@zmail.com",
            "is_technician": true,
            "sms_mail": null,
            "mobile": null,
            "last_name": "T",
            "user_scope": "internal_user",
            "sms_mail_id": null,
            "phone": null,
            "employee_id": null,
            "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,
            "secondary_currency": {
                "display_value": 0,
                "currency_symbol": "Rs.",
                "value": 0
            }
        },
        "cost_center": null,
        "name": "PO 5",
        "sub_total": {
            "display_value": "140.53",
            "currency_symbol": "$",
            "value": 140.525,
            "secondary_currency": {
                "display_value": "11242.00",
                "currency_symbol": "Rs.",
                "value": 11242
            }
        },
        "created_date": {
            "display_value": "Nov 15, 2022",
            "value": "1668499471296"
        },
        "items": [
            {
                "is_batch_tracking": "false",
                "ordered_quantity": "10",
                "purchase_lot_id": null,
                "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": "6237.00",
                "description": "CT1 description",
                "warranty_expiry": null,
                "product_vendor_association": {
                    "vendor": {
                        "id": "100000000000037235"
                    },
                    "id": "100000000000042355"
                },
                "tax_rate": "10",
                "total_received_quantity": null,
                "service": null,
                "price": "567",
                "name": "CT 1",
                "id": "100000000000047115",
                "date_received": null,
                "service_vendor_association": null
            },
            {
                "ordered_quantity": "10",
                "purchase_lot_id": null,
                "product": {
                    "part_no": "-",
                    "product_type": {
                        "image": "Workstations",
                        "name": "Workstation",
                        "id": "100000000000002991",
                        "mandatory": true
                    },
                    "software": null,
                    "name": "WorkStation 1",
                    "id": "100000000000042541",
                    "type": {
                        "name": "Asset",
                        "id": "100000000000002976"
                    },
                    "category": {
                        "name": "IT",
                        "description": "IT Assets and Components",
                        "id": "100000000000002985"
                    },
                    "manufacturer": "-"
                },
                "other": null,
                "amount": "5005.00",
                "description": "WK description",
                "warranty_expiry": null,
                "product_vendor_association": {
                    "vendor": {
                        "id": "100000000000037235"
                    },
                    "id": "100000000000042547"
                },
                "tax_rate": "10",
                "total_received_quantity": null,
                "service": null,
                "price": "455",
                "name": "WorkStation 1",
                "id": "100000000000047117",
                "date_received": null,
                "service_vendor_association": null
            }
        ],
        "deleted_time": null,
        "remarks": "Remarks of purchase order PO 5",
        "status": {
            "name": "Pending Approval",
            "id": "100000000000002375"
        }
    }
}

Get List Purchase Order

Use this operation to get a list of purchase orders

Url

api/v3/purchase_orders

Attributes

id (long)
Unique identifier to identify the purchase order

id (long)
Numerical digits which are considered to have larger values.

Example

234759602834500

name (string)
Unique name to identify purchase order

name (string)
A text in a plain format. No rich text or new line characters allowed.

Example

SampleContent

requested_by (user)
Indicates the user who requires the order

requested_by (user)
Indicates the user who wants the product

Example

{
  "requested_by": {
    "email_id": "test@zmail.com",
    "is_technician": true,
    "sms_mail": "",
    "mobile": "",
    "last_name": "",
    "user_scope": "internal_user",
    "sms_mail_id": "",
    "phone": "",
    "name": "tech1",
    "id": "100000000000034309",
    "photo_url": "test-photo_url",
    "is_vip_user": false,
    "first_name": "tech1",
    "job_title": ""
  }
}

vendor (vendor)
Indicates the vendor of the purchase order

vendor (vendor)
Contains the details of the vendor

Example

{
  "vendor": {
    "name": "dell1",
    "description": "No Description",
    "currency": {
      "symbol": "$",
      "code": "USD",
      "exchange_rate": "1",
      "name": "US Dollar",
      "id": "100000000000004105"
    },
    "id": "100000000000036005"
  }
}

items (po_item)
Indicates the items that are requested in purchase order

items (po_item)
Indicates the items that are requested in purchase order

Example

{
  "items": [
    {
      "ordered_quantity": "9",
      "product": {
        "name": "Tablet 1",
        "id": "100000000000042825"
      },
      "price": "678",
      "description": "CS+1+Type",
      "tax_rate": "3"
    },
    {
      "ordered_quantity": "8",
      "product": {
        "name": "CS 1",
        "id": "100000000000042419"
      },
      "price": "456",
      "description": "Tablet+1",
      "tax_rate": "5"
    }
  ]
}

custom_id (string)
unique sequence number to identify the purchase order

custom_id (string)
A text in a plain format. No rich text or new line characters allowed.

Example

SampleContent

More Attributes Expand all

required_date (date)

It indicates the date when purchase order is required

required_date (date)
Represents a date as a JSON Object. Would contain the value and the display_value attributes.

value : The time in long format (No. of milliseconds from Jan 1, 1970 ).

display_value : The time in a readable form in a format as personalized by the user. If not personalized, default format would be used.

udf_fields (udf_fields)

Holds user defined fields values associated with the purchase order

udf_fields (udf_fields)
Holds user defined fields values associated with the purchase order

Example

{
  "udf_fields": {
    "udf_cost2": {
      "value": "5.67",
      "secondary_currency": {
        "value": "567"
      }
    },
    "udf_char1": "purchase order",
    "udf_char2": "single line",
    "udf_char3": "test@zmail.com"
  }
}

attachments (po_attachment)

Files that are attached to the purchase order. A maximum of 50 files can be attached to a purchase order

attachments (po_attachment)
Files that are attached to the purchase order

Example

{
  "attachments": [
    {
      "attached_by": {
        "email_id": "test@zmail.com",
        "is_technician": true,
        "last_name": "test2",
        "user_scope": "internal_user",
        "name": "test1",
        "id": "100000000000034239",
        "photo_url": "test-photo_url",
        "is_vip_user": false,
        "first_name": "test1"
      },
      "size": "248455",
      "content_type": "image/png",
      "module": "PurchaseOrder",
      "file_id": "22",
      "attached_on": {
        "display_value": "Sep 2, 2022 01:21 PM",
        "value": "1662105093560"
      },
      "name": "Screenshot from 2022-08-30 18-47-06.png",
      "content_url": "/purchase_orders/100000000000035003/_uploads/22",
      "id": "100000000000035343",
      "title": "-"
    }
  ]
}

approval_levels (approval_level)

Specifies approval levels of the purchase order

approval_levels (approval_level)
Specifies approval levels of the purchase order

Example

{
  "approval_levels": [
    {
      "level": 1,
      "approvers": [
        {
          "id": "100000000000036117"
        }
      ]
    },
    {
      "level": 2,
      "approvers": [
        {
          "id": "100000000000036117"
        }
      ]
    }
  ]
}

conversations (conversation)

No Description

conversations (conversation)

invoices (po_invoice)

Indicates the invoices added to the purchase order

invoices (po_invoice)
Indicates invoices of purchase order

Example

{
  "po_invoice": {
    "comments": "Invoice Received",
    "received_date": {
      "value": 1668537000000
    },
    "invoice_id": "Invoice 2",
    "payment_due_date": {
      "value": 1669919400000
    },
    "notify_technicians": [
      {
        "name": "Test1",
        "id": "100000000000036117"
      }
    ],
    "notify_before_days": "2",
    "is_notify": true
  }
}

payments (po_payment)

Payment details of purchase order

payments (po_payment)
Payment details of purchase order

Example

{
  "po_payment": {
    "amount_paid": "100",
    "comments": "Payment done",
    "exchange_rate": "30",
    "notify_technicians": [
      {
        "name": "test",
        "id": "100000000000036117"
      }
    ],
    "payment_due_date": {
      "value": 1669228200000
    },
    "notify_before_days": "5",
    "is_notify": true,
    "payment_date": {
      "value": 1668537000000
    }
  }
}

archive_requests (arc_request_po_association)

No Description

archive_requests (arc_request_po_association)

recent_item (recent_item)

No Description

recent_item (recent_item)

sites (site)

Indicates the list of sites for which the purchase order is associated

sites (site)
Indicates the list of sites for which the purchase order is associated

Example

{
  "sites": [
    {
      "id": "100000000000035025"
    }
  ]
}

template (purchase_template)

Indicates the template which is used to create the purchase order

template (purchase_template)
Indicates the template which is used to create the purchase order

Example

{
  "template": {
    "name": "Purchase Order Template",
    "id": "100000000000030534"
  }
}

status (purchase_status)read only

Indicate the status of purchase order Eg:- closed,open,rejected

status (purchase_status)
Indicates the current status of purchase order

Example

{
  "status": {
    "name": "Open",
    "id": "100000000000002390"
  }
}

created_date (date)read only

It indicates the date when the purchase order is created

created_date (date)
Represents a date as a JSON Object. Would contain the value and the display_value attributes.

value : The time in long format (No. of milliseconds from Jan 1, 1970 ).

display_value : The time in a readable form in a format as personalized by the user. If not personalized, default format would be used.

currency (currency)read only

Indicates the currency used in purchase order

currency (currency)

Example

{
  "currency": {
    "symbol": "$",
    "code": "USD",
    "exchange_rate": "1",
    "is_frequent": true,
    "name": "US Dollar",
    "id": "100000000000004105"
  }
}

owner (user)read only

Indicates the purchase order owner name 

owner (user)

Example

{
  "owner": {
    "email_id": "test@zmail.com",
    "is_technician": true,
    "last_name": "test2",
    "user_scope": "internal_user",
    "name": "test1",
    "id": "100000000000034239",
    "photo_url": "test-photo_url",
    "is_vip_user": false,
    "first_name": "test1"
  }
}

summary (purchase_summary)read only

Contains the summary of the purchase order. Eg:- payments,attachments,invoices,approvals,requests,received items

summary (purchase_summary)

total_price (cost)

Specifies the total cost of purchase order

total_price (cost)
Specifies the total cost of purchase order

Example

{
  "total_price": {
    "display_value": "30.41",
    "currency_symbol": "$",
    "value": 30.4125,
    "secondary_currency": {
      "display_value": 2433,
      "currency_symbol": "Rs.",
      "value": 2433
    }
  }
}

$ curl -G <url>/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 = "<url>/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 = "<url>/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 = "<url>/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": "test@zmail.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
            },
            "template": {
                "inactive": false,
                "name": "Purchase Order Template",
                "id": "100000000000030534"
            },
            "required_date": {
                "display_value": "Nov 25, 2022",
                "value": "1669314600000"
            },
            "total_price": {
                "display_value": "79.25",
                "currency_symbol": "$",
                "value": 79.24674999999999,
                "secondary_currency": {
                    "display_value": 79.25,
                    "currency_symbol": "Rs.",
                    "value": 79.24674999999999
                }
            },
            "custom_id": "1",
            "sites": [
                {
                    "name": "London",
                    "id": "100000000000041089"
                }
            ],
            "requested_by": {
                "email_id": "test@zmail.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
            },
            "vendor": {
                "name": "BB",
                "description": "No Description",
                "currency": {
                    "symbol": "Rs.",
                    "code": "INR",
                    "exchange_rate": "80",
                    "name": "Indian Rupee",
                    "id": "100000000000004131"
                },
                "id": "100000000000037235"
            },
            "name": "PO 1",
            "currency": {
                "symbol": "Rs.",
                "code": "INR",
                "exchange_rate": "80",
                "name": "Indian Rupee",
                "id": "100000000000004131"
            },
            "id": "100000000000042357",
            "created_date": {
                "display_value": "Nov 10, 2022",
                "value": "1668081067432"
            },
            "status": {
                "name": "Items Received",
                "id": "100000000000026568"
            }
        },
        {
            "owner": {
                "email_id": "test@zmail.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
            },
            "template": {
                "inactive": false,
                "name": "Purchase Order Template",
                "id": "100000000000030534"
            },
            "required_date": null,
            "total_price": {
                "display_value": "58.38",
                "currency_symbol": "$",
                "value": 58.375,
                "secondary_currency": {
                    "display_value": 58.38,
                    "currency_symbol": "Rs.",
                    "value": 58.375
                }
            },
            "custom_id": "3",
            "sites": [
                {
                    "name": "London",
                    "id": "100000000000041089"
                }
            ],
            "requested_by": {
                "email_id": "test@zmail.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
            },
            "vendor": {
                "name": "BB",
                "description": "No Description",
                "currency": {
                    "symbol": "Rs.",
                    "code": "INR",
                    "exchange_rate": "80",
                    "name": "Indian Rupee",
                    "id": "100000000000004131"
                },
                "id": "100000000000037235"
            },
            "name": "PO 3",
            "currency": {
                "symbol": "Rs.",
                "code": "INR",
                "exchange_rate": "80",
                "name": "Indian Rupee",
                "id": "100000000000004131"
            },
            "id": "100000000000042549",
            "created_date": {
                "display_value": "Nov 10, 2022",
                "value": "1668082417458"
            },
            "status": {
                "name": "Pending Approval",
                "id": "100000000000002375"
            }
        },
        {
            "owner": {
                "email_id": "test@zmail.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
            },
            "template": {
                "inactive": false,
                "name": "Purchase Order Template",
                "id": "100000000000030534"
            },
            "required_date": {
                "display_value": "Nov 30, 2022",
                "value": "1669746600000"
            },
            "total_price": {
                "display_value": "248.73",
                "currency_symbol": "$",
                "value": 248.72727272727272,
                "secondary_currency": {
                    "display_value": 248.73,
                    "currency_symbol": "Rs.",
                    "value": 248.72727272727272
                }
            },
            "custom_id": "4",
            "sites": [
                {
                    "name": "Tokyo",
                    "id": "100000000000042787"
                }
            ],
            "requested_by": {
                "email_id": "test@zmail.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
            },
            "vendor": {
                "name": "BB",
                "description": "No Description",
                "currency": {
                    "symbol": "Rs.",
                    "code": "INR",
                    "exchange_rate": "80",
                    "name": "Indian Rupee",
                    "id": "100000000000004131"
                },
                "id": "100000000000037235"
            },
            "name": "PO 4",
            "currency": {
                "symbol": "Rs.",
                "code": "INR",
                "exchange_rate": "80",
                "name": "Indian Rupee",
                "id": "100000000000004131"
            },
            "id": "100000000000042833",
            "created_date": {
                "display_value": "Nov 10, 2022",
                "value": "1668083468034"
            },
            "status": {
                "name": "Items Received",
                "id": "100000000000026568"
            }
        },
        {
            "owner": {
                "email_id": "test@zmail.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
            },
            "template": {
                "inactive": false,
                "name": "Purchase Order Template",
                "id": "100000000000030534"
            },
            "required_date": {
                "display_value": "Nov 17, 2022",
                "value": "1668623400000"
            },
            "total_price": {
                "display_value": "137.43",
                "currency_symbol": "$",
                "value": 137.43425,
                "secondary_currency": {
                    "display_value": 137.43,
                    "currency_symbol": "Rs.",
                    "value": 137.43425
                }
            },
            "custom_id": "5",
            "sites": [
                {
                    "name": "All Sites",
                    "id": "-1"
                }
            ],
            "requested_by": {
                "email_id": "test@zmail.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
            },
            "vendor": {
                "name": "BB",
                "description": "No Description",
                "currency": {
                    "symbol": "Rs.",
                    "code": "INR",
                    "exchange_rate": "80",
                    "name": "Indian Rupee",
                    "id": "100000000000004131"
                },
                "id": "100000000000037235"
            },
            "name": "PO 5",
            "currency": {
                "symbol": "Rs.",
                "code": "INR",
                "exchange_rate": "80",
                "name": "Indian Rupee",
                "id": "100000000000004131"
            },
            "id": "100000000000047111",
            "created_date": {
                "display_value": "Nov 15, 2022",
                "value": "1668499471296"
            },
            "status": {
                "name": "Pending Approval",
                "id": "100000000000002375"
            }
        }
    ],
    "response_status": [
        {
            "status_code": 2000,
            "status": "success"
        }
    ],
    "list_info": {
        "has_more_rows": false,
        "sort_field": "name",
        "row_count": 4
    }
}

Delete Purchase Order

Use this operation to delete a specific purchase order

Url

api/v3/purchase_orders/{purchaseorder_id}

$ curl <url>/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 = "<url>/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 = "<url>/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 = "<url>/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"
  }
}

Reject A Purchase Order

Use this operation to approve a purchase order with notification

Url

purchase_orders/{purchaseorder_id}/_reject

$ curl <url>/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": [
      "pritish.singh@zohotest.com"
    ],
    "subject": "Purchase Order 5 Rejected.",
    "comments": "1234567"
  }
}'
// Deluge Sample script
url = "<url>/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": [
      "pritish.singh@zohotest.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 = "<url>/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": [
      "pritish.singh@zohotest.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 = "<url>/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": [
      "pritish.singh@zohotest.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())
{}

Add An Invoice

Use this operation to create an invoice with notification

Url

api/v3/purchase_orders/{purchaseorder_id}/invoices

$ curl <url>/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 = "<url>/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 = "<url>/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 = "<url>/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": "test@zmail.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": "test@zmail.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
    }
}

Received Invoice In Purchase Order

Use this operation to mark invoice received with notification

Url

api/v3/purchase_orders/{purchaseorder_id}/_receive_invoice

$ curl <url>/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": [
            "test@zmail.com"
        ],
        "subject": "Purchase Order 6 Invoice Received",
        "description": "<div>Hi,<br></div><div><br></div><div>This mail is to notify that invoice has been received for purchase order PO# 6.<br></div><div><br></div><div>Click here to view the Purchase Order : <br></div><div>https://purchase.test.csez.zohocorpin.com:8650/app/itdesk/ui/purchaseOrders/100000000000047139/details?selectTab=purchaseinfo<br></div><div><br></div><div>Regards,<br></div><div>IT Department<br></div>",
        "attachments": [],
        "attach_po_as_pdf": false
    }
}'
// Deluge Sample script
url = "<url>/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": [
            "test@zmail.com"
        ],
        "subject": "Purchase Order 6 Invoice Received",
        "description": "<div>Hi,<br></div><div><br></div><div>This mail is to notify that invoice has been received for purchase order PO# 6.<br></div><div><br></div><div>Click here to view the Purchase Order : <br></div><div>https://purchase.test.csez.zohocorpin.com:8650/app/itdesk/ui/purchaseOrders/100000000000047139/details?selectTab=purchaseinfo<br></div><div><br></div><div>Regards,<br></div><div>IT Department<br></div>",
        "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 = "<url>/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": [
            "test@zmail.com"
        ],
        "subject": "Purchase Order 6 Invoice Received",
        "description": "<div>Hi,<br></div><div><br></div><div>This mail is to notify that invoice has been received for purchase order PO# 6.<br></div><div><br></div><div>Click here to view the Purchase Order : <br></div><div>https://purchase.test.csez.zohocorpin.com:8650/app/itdesk/ui/purchaseOrders/100000000000047139/details?selectTab=purchaseinfo<br></div><div><br></div><div>Regards,<br></div><div>IT Department<br></div>",
        "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 = "<url>/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": [
            "test@zmail.com"
        ],
        "subject": "Purchase Order 6 Invoice Received",
        "description": "<div>Hi,<br></div><div><br></div><div>This mail is to notify that invoice has been received for purchase order PO# 6.<br></div><div><br></div><div>Click here to view the Purchase Order : <br></div><div>https://purchase.test.csez.zohocorpin.com:8650/app/itdesk/ui/purchaseOrders/100000000000047139/details?selectTab=purchaseinfo<br></div><div><br></div><div>Regards,<br></div><div>IT Department<br></div>",
        "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"
    }
}

Received Invoice Without Notification

Use this operation to mark invoice received in a purchase order

Url

api/v3/purchase_orders/{purchaseorder_id}/_receive_invoice

$ curl <url>/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 = "<url>/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 = "<url>/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 = "<url>/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"
    }
}

Add Attachments In Purchase Order

Use this operation to add attachments to a purchase order

Mandatory Fields :- filename

Url

api/v3/purchase_orders/{purchaseorder_id}/_uploads

Attributes

filename (FILE)
The path of the file to be uploaded must be given with ’@’ at the beginning of the path.

filename (FILE)
The name of the file that is upload.

Example

test-document.txt

addtoattachment (BOOLEAN)
Denotes whether to add the file as an attachment to the associated entity.

addtoattachment (BOOLEAN)
Boolean value which can have two possible values.

Example

True or False

files (FILES)
The details of the file is contained here.
show attribute

files (FILES)
Contains the information about the file that has been uploaded.

Example

{
  "size": "601",
  "content_type": "application/unknown-mime-type",
  "file_id": "6003",
  "name": "test-document.txt",
  "content_url": "<file path>"
  "id": "17322245500049868"
}

size (LONG)
The size of the file that is uploaded.

size (LONG)
Numerical digits which are considered to have larger values

Example

234759602834500

content_type (STRING)
The type of the content of the file.

content_type (STRING)
A text in a plain format. No rich text or new line characters allowed.

Example

Sample Content

file_id (LONG)
The file_id is used to add that file as an attachment to the entity

file_id (LONG)
Numerical digits which are considered to have larger values

Example

234759602834500

name (STRING)
The name of the file.

name (STRING)
A text in a plain format. No rich text or new line characters allowed.

Example

Sample Content

content_url (STRING)
The url of the file that is uploaded.

content_url (STRING)
A text in a plain format. No rich text or new line characters allowed.

Example

Sample Content

$ curl <url>/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 = "<url>/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 = "<url>/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 = "<url>/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"
        }
    ]
}

Payment Done Notifications

Use this operation to mark payment done with notification

Url

api/v3/purchase_orders/{purchaseorder_id}/_payment_done

$ curl <url>/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": [
            "test@zmail.com"
        ],
        "subject": "Purchase Order PO 4 Payment Done",
        "description": "<div>Hi,<br></div><div><br></div><div>This mail is to notify that payment has been done for purchase order PO# PO 4 .<br></div><div><br></div><div>Click here to view the Purchase Order : <br></div><div>https://purchase.test.csez.zohocorpin.com:8650/app/itdesk/ui/purchaseOrders/100000000000052947/details?selectTab=purchaseinfo<br></div><div><br></div><div>Regards,<br></div><div>IT Department<br></div>",
        "attachments": [],
        "attach_po_as_pdf": false
    }
}'
// Deluge Sample script
url = "<url>/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": [
            "test@zmail.com"
        ],
        "subject": "Purchase Order PO 4 Payment Done",
        "description": "<div>Hi,<br></div><div><br></div><div>This mail is to notify that payment has been done for purchase order PO# PO 4 .<br></div><div><br></div><div>Click here to view the Purchase Order : <br></div><div>https://purchase.test.csez.zohocorpin.com:8650/app/itdesk/ui/purchaseOrders/100000000000052947/details?selectTab=purchaseinfo<br></div><div><br></div><div>Regards,<br></div><div>IT Department<br></div>",
        "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 = "<url>/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": [
            "test@zmail.com"
        ],
        "subject": "Purchase Order PO 4 Payment Done",
        "description": "<div>Hi,<br></div><div><br></div><div>This mail is to notify that payment has been done for purchase order PO# PO 4 .<br></div><div><br></div><div>Click here to view the Purchase Order : <br></div><div>https://purchase.test.csez.zohocorpin.com:8650/app/itdesk/ui/purchaseOrders/100000000000052947/details?selectTab=purchaseinfo<br></div><div><br></div><div>Regards,<br></div><div>IT Department<br></div>",
        "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 = "<url>/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": [
            "test@zmail.com"
        ],
        "subject": "Purchase Order PO 4 Payment Done",
        "description": "<div>Hi,<br></div><div><br></div><div>This mail is to notify that payment has been done for purchase order PO# PO 4 .<br></div><div><br></div><div>Click here to view the Purchase Order : <br></div><div>https://purchase.test.csez.zohocorpin.com:8650/app/itdesk/ui/purchaseOrders/100000000000052947/details?selectTab=purchaseinfo<br></div><div><br></div><div>Regards,<br></div><div>IT Department<br></div>",
        "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"
    }
}

Order From A Purchase Order

Use this operation to order the purchase order with notification

Url

api/v3/purchase_orders/{purchaseorder_id}/_order

$ curl <url>/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": [
            "test@zmail.com"
        ],
        "subject": "Purchase Order PO 13 Ordered.",
        "description": "<div>Hi,<br></div><div><br></div><div>This mail is to notify that purchase order PO# PO 7 has been Ordered.<br></div><div><br></div><div>Click here to view the Purchase Order : <br></div><div>https://purchase.test.csez.zohocorpin.com:8650/app/itdesk/ui/purchaseOrders/100000000000049177/details?selectTab=purchaseinfo<br></div><div><br></div><div>Regards,<br></div><div>IT Department<br></div>",
        "attachments": [],
        "attach_po_as_pdf": false
    }
}'
// Deluge Sample script
url = "<url>/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": [
            "test@zmail.com"
        ],
        "subject": "Purchase Order PO 13 Ordered.",
        "description": "<div>Hi,<br></div><div><br></div><div>This mail is to notify that purchase order PO# PO 7 has been Ordered.<br></div><div><br></div><div>Click here to view the Purchase Order : <br></div><div>https://purchase.test.csez.zohocorpin.com:8650/app/itdesk/ui/purchaseOrders/100000000000049177/details?selectTab=purchaseinfo<br></div><div><br></div><div>Regards,<br></div><div>IT Department<br></div>",
        "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 = "<url>/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": [
            "test@zmail.com"
        ],
        "subject": "Purchase Order PO 13 Ordered.",
        "description": "<div>Hi,<br></div><div><br></div><div>This mail is to notify that purchase order PO# PO 7 has been Ordered.<br></div><div><br></div><div>Click here to view the Purchase Order : <br></div><div>https://purchase.test.csez.zohocorpin.com:8650/app/itdesk/ui/purchaseOrders/100000000000049177/details?selectTab=purchaseinfo<br></div><div><br></div><div>Regards,<br></div><div>IT Department<br></div>",
        "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 = "<url>/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": [
            "test@zmail.com"
        ],
        "subject": "Purchase Order PO 13 Ordered.",
        "description": "<div>Hi,<br></div><div><br></div><div>This mail is to notify that purchase order PO# PO 7 has been Ordered.<br></div><div><br></div><div>Click here to view the Purchase Order : <br></div><div>https://purchase.test.csez.zohocorpin.com:8650/app/itdesk/ui/purchaseOrders/100000000000049177/details?selectTab=purchaseinfo<br></div><div><br></div><div>Regards,<br></div><div>IT Department<br></div>",
        "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"
    }
}

Send Email To Owner

Use this operation to send an email to owner of the purchase order

Url

api/v3/purchase_orders/{purchaseorder_id}/_email_owner

$ curl <url>/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": [
            "test@zmail.com"
        ],
        "cc": [
            "test1@zmail.com"
        ],
        "subject": "Assigned Purchase Order with ID : PO 80",
        "description": "<div>Hi Test,<br></div><div><br></div><div>The Purchase Order ID: PO 80 has been assigned to you.<br></div><div><br></div><div>Purchase Order Details<br></div><div>Name : PO 80 <br></div><div>Status : Approved<br></div><div>Cost : ($) 70.88<br></div><div>Vendor : BB<br></div><div><br></div><div>For more information, visit the following link:<br></div><div>https://purchase.test.csez.zohocorpin.com:8650/app/itdesk/ui/purchaseOrders/100000000000049177/details?selectTab=purchaseinfo<br></div><div><br></div><div>Regards,<br></div><div>Admin Team<br></div><div><br></div><div>This is an automated message. Please do not reply to this email.<br></div>",
        "attachments": [],
        "attach_po_as_pdf": true
    }
}'
// Deluge Sample script
url = "<url>/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": [
            "test@zmail.com"
        ],
        "cc": [
            "test1@zmail.com"
        ],
        "subject": "Assigned Purchase Order with ID : PO 80",
        "description": "<div>Hi Test,<br></div><div><br></div><div>The Purchase Order ID: PO 80 has been assigned to you.<br></div><div><br></div><div>Purchase Order Details<br></div><div>Name : PO 80 <br></div><div>Status : Approved<br></div><div>Cost : ($) 70.88<br></div><div>Vendor : BB<br></div><div><br></div><div>For more information, visit the following link:<br></div><div>https://purchase.test.csez.zohocorpin.com:8650/app/itdesk/ui/purchaseOrders/100000000000049177/details?selectTab=purchaseinfo<br></div><div><br></div><div>Regards,<br></div><div>Admin Team<br></div><div><br></div><div>This is an automated message. Please do not reply to this email.<br></div>",
        "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 = "<url>/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": [
            "test@zmail.com"
        ],
        "cc": [
            "test1@zmail.com"
        ],
        "subject": "Assigned Purchase Order with ID : PO 80",
        "description": "<div>Hi Test,<br></div><div><br></div><div>The Purchase Order ID: PO 80 has been assigned to you.<br></div><div><br></div><div>Purchase Order Details<br></div><div>Name : PO 80 <br></div><div>Status : Approved<br></div><div>Cost : ($) 70.88<br></div><div>Vendor : BB<br></div><div><br></div><div>For more information, visit the following link:<br></div><div>https://purchase.test.csez.zohocorpin.com:8650/app/itdesk/ui/purchaseOrders/100000000000049177/details?selectTab=purchaseinfo<br></div><div><br></div><div>Regards,<br></div><div>Admin Team<br></div><div><br></div><div>This is an automated message. Please do not reply to this email.<br></div>",
        "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 = "<url>/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": [
            "test@zmail.com"
        ],
        "cc": [
            "test1@zmail.com"
        ],
        "subject": "Assigned Purchase Order with ID : PO 80",
        "description": "<div>Hi Test,<br></div><div><br></div><div>The Purchase Order ID: PO 80 has been assigned to you.<br></div><div><br></div><div>Purchase Order Details<br></div><div>Name : PO 80 <br></div><div>Status : Approved<br></div><div>Cost : ($) 70.88<br></div><div>Vendor : BB<br></div><div><br></div><div>For more information, visit the following link:<br></div><div>https://purchase.test.csez.zohocorpin.com:8650/app/itdesk/ui/purchaseOrders/100000000000049177/details?selectTab=purchaseinfo<br></div><div><br></div><div>Regards,<br></div><div>Admin Team<br></div><div><br></div><div>This is an automated message. Please do not reply to this email.<br></div>",
        "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"
    }
}

Send Email To Vendor

Use this operation to send an email to a vendor

Url

api/v3/purchase_orders/{purchaseorder_id}/_email_vendor

$ curl <url>/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": "<div>The Purchase Order ID : PO 70 has been initiated with you.<br></div><div><br></div><div>Purchase Order Details<br></div><div>Purchase Order  Name :Purchase Order 70<br></div><div>Cost :($) 57.00<br></div><div>Vendor :BB<br></div><div>Owner :Test<br></div><div><br></div><div>For more information, visit the following link: <br></div><div><a href=\"https://purchase.test.csez.zohocorpin.com:8650/app/itdesk/ui/purchaseOrders/100000000000052881/details?selectTab=purchaseinfo\" rel=\"noreferrer\">https://purchase.test.csez.zohocorpin.com:8650/app/itdesk/ui/purchaseOrders/100000000000052881/details?selectTab=purchaseinfo</a><br></div><div><br></div><div>Regards,<br></div><div>Admin Team<br></div><div><br></div><div>This is an automated message. Please do not reply to this email.<br></div>",
        "attachments": [],
        "attach_po_as_pdf": true
    }
}'
// Deluge Sample script
url = "<url>/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": "<div>The Purchase Order ID : PO 70 has been initiated with you.<br></div><div><br></div><div>Purchase Order Details<br></div><div>Purchase Order  Name :Purchase Order 70<br></div><div>Cost :($) 57.00<br></div><div>Vendor :BB<br></div><div>Owner :Test<br></div><div><br></div><div>For more information, visit the following link: <br></div><div><a href=\"https://purchase.test.csez.zohocorpin.com:8650/app/itdesk/ui/purchaseOrders/100000000000052881/details?selectTab=purchaseinfo\" rel=\"noreferrer\">https://purchase.test.csez.zohocorpin.com:8650/app/itdesk/ui/purchaseOrders/100000000000052881/details?selectTab=purchaseinfo</a><br></div><div><br></div><div>Regards,<br></div><div>Admin Team<br></div><div><br></div><div>This is an automated message. Please do not reply to this email.<br></div>",
        "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 = "<url>/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": "<div>The Purchase Order ID : PO 70 has been initiated with you.<br></div><div><br></div><div>Purchase Order Details<br></div><div>Purchase Order  Name :Purchase Order 70<br></div><div>Cost :($) 57.00<br></div><div>Vendor :BB<br></div><div>Owner :Test<br></div><div><br></div><div>For more information, visit the following link: <br></div><div><a href=\"https://purchase.test.csez.zohocorpin.com:8650/app/itdesk/ui/purchaseOrders/100000000000052881/details?selectTab=purchaseinfo\" rel=\"noreferrer\">https://purchase.test.csez.zohocorpin.com:8650/app/itdesk/ui/purchaseOrders/100000000000052881/details?selectTab=purchaseinfo</a><br></div><div><br></div><div>Regards,<br></div><div>Admin Team<br></div><div><br></div><div>This is an automated message. Please do not reply to this email.<br></div>",
        "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 = "<url>/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": "<div>The Purchase Order ID : PO 70 has been initiated with you.<br></div><div><br></div><div>Purchase Order Details<br></div><div>Purchase Order  Name :Purchase Order 70<br></div><div>Cost :($) 57.00<br></div><div>Vendor :BB<br></div><div>Owner :Test<br></div><div><br></div><div>For more information, visit the following link: <br></div><div><a href=\"https://purchase.test.csez.zohocorpin.com:8650/app/itdesk/ui/purchaseOrders/100000000000052881/details?selectTab=purchaseinfo\" rel=\"noreferrer\">https://purchase.test.csez.zohocorpin.com:8650/app/itdesk/ui/purchaseOrders/100000000000052881/details?selectTab=purchaseinfo</a><br></div><div><br></div><div>Regards,<br></div><div>Admin Team<br></div><div><br></div><div>This is an automated message. Please do not reply to this email.<br></div>",
        "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"
    }
}

Send A Notification In Purchase Order

Use this operation to send a notification in a purchase order

Url

api/v3/purchase_orders/{purchaseorder_id}/notifications

$ curl <url>/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": "<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>",
        "to": [
            "test1@zmail.com"
        ],
        "cc": [
            "test2@zmail.com"
        ],
        "subject": "Send Notification",
        "sender": {
            "id": "100000000000036117"
        },
        "type": "Notify_PURCHASE"
    }
}'
// Deluge Sample script
url = "<url>/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": "<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>",
        "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 = "<url>/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": "<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>",
        "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 = "<url>/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": "<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>",
        "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": [
            "test2@zmail.com"
        ],
        "attachments": [],
        "has_attachments": false,
        "recipent": null,
        "sender": {
            "email_id": "test@zmail.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: &quot;PT Sans&quot;, Arial, Helvetica, sans-serif, sans-serif; font-size: 13px\"> <div>The description of the notification</div> </div>",
        "messageid": "<2004352135.14.1669013956328.JavaMail.test@zmail.com>",
        "id": "100000000000054071",
        "time": {
            "display_value": "Nov 21, 2022 12:29 PM",
            "value": "1669013956315"
        },
        "to": [
            "test1@zmail.com"
        ],
        "type": "Notify_PURCHASE"
    },
    "response_status": {
        "status_code": 2000,
        "status": "success"
    }
}

Get List Of Items

Use this operation to get a list of items in a purchase order

Url

api/v3/purchase_orders/{purchaseorder_id}/items

$ curl -G <url>/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 = "<url>/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 = "<url>/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 = "<url>/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
        }
    ]
}

Dissociate Service Request For Purchase Order

Use this operation to dissociate a service request from a purchase order

Url

api/v3/purchase_orders/{purchaseorder_id}/requests

$ curl <url>/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 = "<url>/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 = "<url>/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 = "<url>/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"
  }
}

Associate Service Request For Purchase Order

Use this operation to associate a service request to a purchase order

Url

api/v3/purchase_orders/{purchaseorder_id}/requests

$ curl <url>/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 = "<url>/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 = "<url>/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 = "<url>/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"
        }
    }
}

Restore A Purchase Order From Trash

Use this operation to restore a purchase order from trash

Url

api/v3/purchase_orders/{purchaseorder_id}/_restore_from_trash

$ curl <url>/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 = "<url>/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 = "<url>/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 = "<url>/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": "test@zmail.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": "test@zmail.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"
        }
    }
}

Move A Purchase Order To Trash

Use this operation to move a purchase order to trash

Url

api/v3/purchase_orders/{purchaseorder_id}/_move_to_trash

$ curl <url>/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 = "<url>/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 = "<url>/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 = "<url>/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": "test@zmail.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": "test@zmail.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"
        }
    }
}

Create A Payment

Use this operation to create payment with notification

Url

api/v3/purchase_orders/{purchaseorder_id}/payments

$ curl <url>/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 = "<url>/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 = "<url>/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 = "<url>/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": "test@zmail.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": "test@zmail.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"
        }
    }
}

Receive Items

Use this operation to receive items in purchase order

Url

api/v3/purchase_orders/{purchaseorder_id}/_receive_items

$ curl <url>/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"
        }
    ]
}'
// Deluge Sample script
url = "<url>/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"
        }
    ]
};
params = {"input_data": input_data};
response = invokeurl
[
    url: url
    type: PUT
    parameters: params
    headers: headers
];
info response;
#Powershell version - 5.1
$url = "<url>/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"
        }
    ]
}
'@
$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 = "<url>/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"
        }
    ]
}'''
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"
        }
    ],
    "response_status": [
        {
            "status_code": 2000,
            "messages": [
                {
                    "status_code": 2000,
                    "type": "success",
                    "message": "Items received"
                }
            ],
            "status": "success"
        }
    ]
}

Cancel Purchase Order

Use this operation to cancel a purchase order with notification

Url

api/v3/purchase_orders/{purchaseorder_id}/_cancel

$ curl <url>/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": [
            "test@zmail.com"
        ],
        "subject": "Purchase Order Canceled.",
        "comments": "Purchase Order Canceled"
    }
}'
// Deluge Sample script
url = "<url>/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": [
            "test@zmail.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 = "<url>/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": [
            "test@zmail.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 = "<url>/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": [
            "test@zmail.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"
    }
}

Reject A Purchase Order At Different Approval Level

Use this operation to reject a purchase order on different approval level

Url

api/v3/purchase_orders/{purchaseorder_id}/approval_levels/{level_id}/approvals/{approval_id}/_reject

$ curl <url>/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 = "<url>/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 = "<url>/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 = "<url>/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"
    }
}

Approve A Purchase Order

Use this operation to approve a purchase order with notification

Url

purchase_orders/{purchaseorder_id}/_approve

$ curl <url>/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": [
            "test@zmail.com",
            "test1@zmail.com"
        ],
        "subject": "Purchase Order Approved.",
        "comments": "This Purchase Order is Approved"
    }
}'
// Deluge Sample script
url = "<url>/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": [
            "test@zmail.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 = "<url>/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": [
            "test@zmail.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 = "<url>/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": [
            "test@zmail.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"
    }
}

Add Multiple Approvers At Multiple Approval Level

Use this operation to add multiple approvers to a purchase order at multiple approval levels

Url

api/v3/purchase_orders/{purchaseorder_id}/_approval

$ curl <url>/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 = "<url>/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 = "<url>/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 = "<url>/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"
    }
}