This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.

Working with Purchase Orders in Zoho Books

The createPurchaseOrder operation creates a purchase order for your vendor. 

createPurchaseOrder
<zohobooks.createPurchaseOrder>
    <vendorId>{$ctx:vendorId}</vendorId>
	<lineItems>{$ctx:lineItems}</lineItems>
	<contactPersons>{$ctx:contactPersons}</contactPersons>
    <noteDefault>{$ctx:noteDefault}</noteDefault>
    <acquisitionVatId>{$ctx:acquisitionVatId}</acquisitionVatId>
    <customFields>{$ctx:customFields}</customFields>
    <exchangeRate>{$ctx:exchangeRate}</exchangeRate>
    <referenceNumber>{$ctx:referenceNumber}</referenceNumber>
    <shipVia>{$ctx:shipVia}</shipVia>
    <attachment>{$ctx:attachment}</attachment>
    <date>{$ctx:date}</date>
    <templateId>{$ctx:templateId}</templateId>
    <termDefault>{$ctx:termDefault}</termDefault>
    <purchaseOrderNumber>{$ctx:purchaseOrderNumber}</purchaseOrderNumber>
    <term>{$ctx:term}</term>
    <vatTreatment>{$ctx:vatTreatment}</vatTreatment>
    <ignoreAutoNumberGeneration>{$ctx:ignoreAutoNumberGeneration}</ignoreAutoNumberGeneration>
    <reverseChargeVatId>{$ctx:reverseChargeVatId}</reverseChargeVatId>
    <dueDate>{$ctx:dueDate}</dueDate>
    <deliveryAddress>{$ctx:deliveryAddress}</deliveryAddress>
	<note>{$ctx:note}</note>
</zohobooks.createPurchaseOrder>
Properties
  • vendorId: Required - The ID of the vendor the purchase order has to be created.
  • lineItems: Required - Line items of purchase order.
  • contactPersons: Array of contact person(s) for whom purchase order has to be sent.
  • noteDefault: Default delivery note for vendor.
  • acquisitionVatId (UK Edition only): This is the ID of the tax applied in case this is an EU - goods purchase and acquisition VAT needs to be reported.
  • customFields: Custom fields for purchase order.
  • exchangeRate: Exchange rate of the currency.
  • referenceNumber: Reference Number of the purchase order.
  • shipVia: Shipment preference.
  • attachment: Allowed extensions: gif, png, jpeg, jpg, bmp, pdf, xls, xlsx, doc and docx.
  • date: The date the purchase order was created.
  • templateId: The ID of the PDF template associated with the purchase order.
  • termDefault: Default term for vendor.
  • purchaseOrderNumber: Mandatory if auto number generation is disabled.
  • term: Term for the vendor.
  • vatTreatment (UK Edition only): VAT treatment for the purchase order. VAT treatment denotes the location of the vendor, if the vendor resides in UK then the VAT treatment is uk. If the vendor is in an EU country & if he is VAT registered then his VAT treatment is eu_vat_registered, if he resides in EU & if he is not VAT registered then his VAT treatment is eu_vat_not_registered and if he resides outside the EU then his VAT treatment is non_eu.
  • ignoreAutoNumberGeneration: Ignore auto purchase order number generation for this purchase order. This mandates the purchase order number.
  • reverseChargeVatId (UK Edition only)This is the ID of the tax applied in case this is a non UK - service purchase and reverse charge VAT needs to be reported.
  • dueDate: Delivery date of the purchase order.
  • deliveryAddress: Delivery address of purchase order.
  • note: Delivery note for vendor.

Sample Request

Following is a sample REST/JSON request that can be handled by the createPurchaseOrder operation.

Sample request for createPurchaseOrder
{
    "authToken": "40652e2f50fb0873728fddf4d27f3a10",
    "apiUrl": "https://books.zoho.com",
    "organizationId": "48221130",
    "contactPersons": [
        "111948000000038081"
    ],
    "noteDefault": "",
    "acquisitionVatId": "sd",
    "customFields": [
        {
            "index": "",
            "value": ""
        }
    ],
    "exchangeRate": "12",
    "referenceNumber": "er/12",
    "shipVia": "hello",
    "attachment": "txt",
    "vendorId": "111948000000038079",
    "date": "2015-02-16",
    "templateId": "",
    "termDefault": "",
    "purchaseOrderNumber": "",
    "term": "Thanks for your business.",
    "vatTreatment": "",
    "ignoreAutoNumberGeneration": "",
    "reverseChargeVatId": "123",
    "lineItems": [
        {
            "item_id": "111948000000038093",
            "account_id": "111948000000000424",
            "name": "Test Item",
            "description": "500GB, USB 2.0 interface 1400 rpm, protective hard case.",
            "unit": "Nos",
            "rate": 112,
            "quantity": 1,
            "item_order": 0
        }
    ],
    "dueDate": "2015-02-15",
    "note": "Deliver soon",
    "deliveryAddress": {
        "organization_address_id": "",
        "attention": ""
    }
}
Related Zoho Books Documentation

https://www.zoho.com/books/api/v3/purchaseorders/#create-a-purchase-order

Sample Configuration

Following is a sample proxy service that illustrates how to connect to Zoho Books with the init operation and use the createPurchaseOrder operation. The sample request for this proxy can be found in the createPurcahseOrder sample request. You can use this sample as a template for using other operations in this category.

Sample proxy
<?xml version="1.0" encoding="UTF-8"?>
	<proxy xmlns="http://ws.apache.org/ns/synapse" name="zohobooks_createPurchaseOrder" transports="https,http" statistics="disable" trace="disable" startOnLoad="true">
	 <target>
	 <inSequence>
      <property name="authToken" expression="json-eval($.authToken)"/>
      <property name="apiUrl" expression="json-eval($.apiUrl)"/>
      <property name="organizationId" expression="json-eval($.organizationId)"/>
      <property name="contactPersons" expression="json-eval($.contactPersons)"/>
      <property name="noteDefault" expression="json-eval($.noteDefault)"/>
      <property name="acquisitionVatId" expression="json-eval($.acquisitionVatId)"/>
      <property name="customFields" expression="json-eval($.customFields)"/>
      <property name="exchangeRate" expression="json-eval($.exchangeRate)"/>
      <property name="referenceNumber" expression="json-eval($.referenceNumber)"/>
      <property name="shipVia" expression="json-eval($.shipVia)"/>
      <property name="attachment" expression="json-eval($.attachment)"/>
      <property name="vendorId" expression="json-eval($.vendorId)"/>
      <property name="date" expression="json-eval($.date)"/>
      <property name="templateId" expression="json-eval($.templateId)"/>
      <property name="termDefault" expression="json-eval($.termDefault)"/>
      <property name="purchaseOrderNumber" expression="json-eval($.purchaseOrderNumber)"/>
      <property name="term" expression="json-eval($.term)"/>
      <property name="vatTreatment" expression="json-eval($.vatTreatment)"/>
      <property name="ignoreAutoNumberGeneration" expression="json-eval($.ignoreAutoNumberGeneration)"/>
      <property name="reverseChargeVatId" expression="json-eval($.reverseChargeVatId)"/>
      <property name="lineItems" expression="json-eval($.lineItems)"/>
      <property name="dueDate" expression="json-eval($.dueDate)"/>
      <property name="deliveryAddress" expression="json-eval($.deliveryAddress)"/>
      <property name="note" expression="json-eval($.note)"/>
      <zohobooks.init>
         <authToken>{$ctx:authToken}</authToken>
         <apiUrl>{$ctx:apiUrl}</apiUrl>
         <organizationId>{$ctx:organizationId}</organizationId>
      </zohobooks.init>
      <zohobooks.createPurchaseOrder>
         <contactPersons>{$ctx:contactPersons}</contactPersons>
         <noteDefault>{$ctx:noteDefault}</noteDefault>
         <acquisitionVatId>{$ctx:acquisitionVatId}</acquisitionVatId>
         <customFields>{$ctx:customFields}</customFields>
         <exchangeRate>{$ctx:exchangeRate}</exchangeRate>
         <referenceNumber>{$ctx:referenceNumber}</referenceNumber>
         <shipVia>{$ctx:shipVia}</shipVia>
         <attachment>{$ctx:attachment}</attachment>
         <vendorId>{$ctx:vendorId}</vendorId>
         <date>{$ctx:date}</date>
         <templateId>{$ctx:templateId}</templateId>
         <termDefault>{$ctx:termDefault}</termDefault>
         <purchaseOrderNumber>{$ctx:purchaseOrderNumber}</purchaseOrderNumber>
         <term>{$ctx:term}</term>
         <vatTreatment>{$ctx:vatTreatment}</vatTreatment>
         <ignoreAutoNumberGeneration>{$ctx:ignoreAutoNumberGeneration}</ignoreAutoNumberGeneration>
         <reverseChargeVatId>{$ctx:reverseChargeVatId}</reverseChargeVatId>
         <lineItems>{$ctx:lineItems}</lineItems>
         <dueDate>{$ctx:dueDate}</dueDate>
         <deliveryAddress>{$ctx:deliveryAddress}</deliveryAddress>
         <note>{$ctx:note}</note>
      </zohobooks.createPurchaseOrder>
	   <respond/>
	 </inSequence>
	  <outSequence>
	   <send/>
	  </outSequence>
	 </target>
   <description/>
  </proxy>