PurchaseOrders
Stores purchase orders issued to vendors, tracking delivery status, billing terms, and related inventory; unavailable in free or standard editions.
Table-Specific Information
The PurchaseOrders table is only accessible when connected to a ZohoCRM Enterprise Edition account. If using a different edition, this table may not be available.Select
This table supports the COQL and BULK APIs for filtering, meaning that most filters comparing columns to values are submitted server-side.
Insert
The following example demonstrates a basic insert operation with line item details:
-- Insert a new purchase order with a subject and product line items
INSERT INTO PurchaseOrders (Subject, VendorName_Id, PurchaseItems) VALUES (
-- This is the value for the Subject column
'Purchase Order',
-- This is the value for the VendorName_Id column
'1021046000000513014',
-- This is the JSON string for PurchaseItems
'[
{
"Product_Name": {
"id": "1021046000000414457"
},
"Quantity": 1024,
"Discount": 99,
"Tax": 13,
"List_Price": 176.21,
"Description": "test description 1"
}
]'
)
Required fields for REST API: Subject and PurchaseItems are required. These provide the order summary and line item data needed to create a purchase order.
Required fields for BULK API: Subject, VendorName_Id and PurchaseItems are required. These provide the order summary, the vendor's identifier and line item data needed to create a purchase order.
Any field which is not read-only (ReadOnly = false in the table schema) can be inserted.
Please note that the REST API honors only the 'id' field of the 'Product_Name' aggregate in the PurchaseItems column. The BULK API does not accept any other field in this aggregate.
Delete
You must specify the Id column in the WHERE clause to delete a record. The following example demonstrates a delete operation:
-- Delete a purchase order by its unique ID
DELETE FROM PurchaseOrders WHERE Id = '3152079000000153079'
Update
You must specify the Id column in the WHERE clause to update a record. The following example demonstrates an update operation:
-- Update the description for a specific purchase order using its ID
UPDATE PurchaseOrders SET Description = 'Changed from the API.' WHERE Id = '3152079000000492001'
Required fields: Id is required. The update must target a specific record.
Any field which is not read-only (ReadOnly = false in the table schema) can be updated.
Columns
| Name | Type | ReadOnly | Description |
| Id [KEY] | String | True |
Unique identifier for the purchase order record. |
| Billing_Latitude | Double | False |
Latitude coordinate of the purchase order's billing address. |
| Billing_Longitude | Double | False |
Longitude coordinate of the purchase order's billing address. |
| Shipping_Latitude | Double | False |
Latitude coordinate of the purchase order's shipping address. |
| Shipping_Longitude | Double | False |
Longitude coordinate of the purchase order's shipping address. |
| Requisition_No | String | False |
Requisition number associated with the purchase order. |
| Tracking_Number | String | False |
Tracking number for the shipment related to the purchase order. |
| PO_Number | String | False |
Unique purchase order number. |
| Subject | String | False |
Subject or title of the purchase order. |
| Vendor_Name_Id | String | False |
Unique identifier of the associated vendor. |
| Contact_Name_Id | String | False |
Unique identifier of the associated contact. |
| PO_Date | Date | False |
Date when the purchase order was issued. |
| Due_Date | Date | False |
Date by which the goods or services should be delivered. |
| Carrier | String | False |
Name of the shipping carrier handling the order. |
| Excise_Duty | Decimal | False |
Excise duty applied to the order. |
| Sales_Commission | Decimal | False |
Sales commission associated with the order. |
| Status | String | False |
Current status of the purchase order. |
| Owner_Id | String | False |
Unique identifier of the purchase order owner. |
| Owner_FirstName | String | True |
First name of the purchase order owner. |
| Owner_LastName | String | True |
Last name of the purchase order owner. |
| Owner_Email | String | True |
Email address of the purchase order owner. |
| Created_By_Id | String | False |
Unique identifier of the user who created the purchase order. |
| Modified_By_Id | String | False |
Unique identifier of the user who last modified the purchase order. |
| Modified_By_FirstName | String | True |
First name of the user who last modified the purchase order. |
| Modified_By_LastName | String | True |
Last name of the user who last modified the purchase order. |
| Modified_By_Email | String | True |
Email address of the user who last modified the purchase order. |
| Created_Time | Datetime | False |
Date and time when the purchase order was created. |
| Modified_Time | Datetime | False |
Date and time when the purchase order was last modified. |
| Tag | String | False |
Tags associated with the purchase order. |
| Sub_Total | String | True |
Subtotal amount before discounts and taxes. |
| Discount | Decimal | False |
Discount applied to the purchase order. |
| Tax | Decimal | False |
Tax applied to the purchase order. |
| Adjustment | Decimal | False |
Manual adjustments made to the total. |
| Grand_Total | String | True |
Total amount after discounts, taxes, and adjustments. |
| Terms_and_Conditions | String | False |
Terms and conditions related to the purchase order. |
| Description | String | False |
Description or additional details of the purchase order. |
| Id_CustomModule | Long | True |
Internal record identifier. |
| Locked__s | Bool | True |
Indicates whether the record is locked from editing. |
| Last_Activity_Time | Datetime | False |
Date and time of the last activity associated with the record. |
| Billing_Country | String | False |
Billing country for the order. |
| Billing_Flat_House_No_Building_Apartment_Name | String | False |
Flat/house number, building, or apartment name portion of the billing address. |
| Billing_Street | String | False |
Billing street address for the order. |
| Billing_City | String | False |
Billing city for the order. |
| Billing_State | String | False |
Billing state for the order. |
| Billing_Code | String | False |
Billing postal code for the order. |
| Shipping_Country | String | False |
Shipping country for the order. |
| Shipping_Flat_House_No_Building_Apartment_Name | String | False |
Flat/house number, building, or apartment name portion of the shipping address. |
| Shipping_Street | String | False |
Shipping street address for the order. |
| Shipping_City | String | False |
Shipping city for the order. |
| Shipping_State | String | False |
Shipping state for the order. |
| Shipping_Code | String | False |
Shipping postal code for the order. |
Pseudo-Columns
Pseudo column fields are used in the WHERE clause of SELECT statements and offer more granular control over the data returned from the data source.
| Name | Type | Description |
| Purchase_Items | String |
List of items associated with the purchase order. |
| DuplicateCheckFields | String |
The field(s) to be used for checking duplicate records in an upsert. The REST API allows for more than one field in the duplicate check but the BULK API only allows one field. |
| Trigger | String |
To trigger the rule while inserting record into CRM account. |