openapi: 3.0.0
info:
  title: Purchase Order
  description: A purchase order is an official document that a buyer issues to a seller, indicating relevant information about what they want to buy, the quantity, the price agreed for that particular product or service.
  contact: {}
  version: 1.0.0
servers:
  - url: https://www.zohoapis.com/books/v3
    description: API Endpoint
tags:
  - name: purchase-order
    description: Purchase-Order Module
paths:
  /purchaseorders:
    post:
      tags:
        - purchase-order
      operationId: create_purchase_order
      summary: Create a purchase order
      description: Create a purchase order for your vendor.
      parameters:
        - name: attachment
          in: query
          description: 'Allowed Extensions: <code>gif</code>, <code>png</code>, <code>jpeg</code>, <code>jpg</code>, <code>bmp</code>, <code>pdf</code>, <code>xls</code>, <code>xlsx</code>, <code>doc</code> and <code>docx</code>.'
          required: false
          schema:
            type: string
            format: binary
          example: ''
        - name: ignore_auto_number_generation
          in: query
          description: Ignore auto purchase order number generation for this purchase order. This mandates the purchase order number.
          required: false
          schema:
            type: boolean
          example: false
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/create-a-purchase-order-request'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/create-a-purchase-order-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoBooks.purchaseorders.CREATE
    get:
      tags:
        - purchase-order
      operationId: list_purchase_orders
      summary: List purchase orders
      description: List all purchase orders.
      parameters:
        - name: purchaseorder_number
          in: query
          description: 'Search purchase order by purchase order number. Variants: <code>purchaseorder_number_startswith</code> and <code>purchaseorder_number_contains</code>. Example: Locate specific PO by number or partial match.'
          required: false
          schema:
            type: string
          example: PO-00001
        - name: reference_number
          in: query
          description: 'Search purchase order by reference number. Variants: <code>reference_number_startswith</code> and <code>reference_number_contains</code>. Example: Monitor external vendor order numbers.'
          required: false
          schema:
            type: string
          example: ER/0034
        - name: date
          in: query
          description: 'Search purchase order by creation date. Use YYYY-MM-DD format for exact date matching. Example: Retrieve POs created on specific date.'
          required: false
          schema:
            type: string
          example: '2014-02-10'
        - name: status
          in: query
          description: 'Search purchase order by status. Allowed values: <code>draft</code>, <code>open</code>, <code>billed</code>, <code>cancelled</code>. Example: Filter POs by current workflow state.'
          required: false
          schema:
            type: string
          example: draft
        - name: item_description
          in: query
          description: 'Search purchase order by item description. Variants: <code>item_description_startswith</code> and <code>item_description_contains</code>. Example: Discover POs containing specific items.'
          required: false
          schema:
            type: string
          example: ''
        - name: vendor_name
          in: query
          description: 'Search purchase order by vendor name. Variants: <code>vendor_name_startswith</code> and <code>vendor_name_contains</code>'
          required: false
          schema:
            type: string
          example: ''
        - name: total
          in: query
          description: 'Search purchase order by total amount. Variants: <code>total_start</code>, <code>total_end</code>, <code>total_less_than</code>, <code>total_less_equals</code>, <code>total_greater_than</code>, <code>total_greater_equals</code>. Example: Identify POs within price range.'
          required: false
          schema:
            type: number
            format: double
          example: 40
        - name: vendor_id
          in: query
          description: 'Search purchase order by vendor ID. Use the unique identifier of the vendor to filter purchase orders. Example: Group POs by specific vendor.'
          required: false
          schema:
            type: string
          example: '460000000026049'
        - name: last_modified_time
          in: query
          description: 'Search purchase order by last modified time. Use ISO 8601 format (YYYY-MM-DDTHH:MM:SS+/-HH:MM). Example: Identify recently updated POs.'
          required: false
          schema:
            type: string
          example: 2014-02-10T15:26:26+0530
        - name: item_id
          in: query
          description: 'Search purchase order by item ID. Use the unique identifier of the specific item. Example: Locate all POs containing particular item.'
          required: false
          schema:
            type: string
          example: '460000000027009'
        - name: filter_by
          in: query
          description: 'Filter purchase order by status. Allowed values: <code>Status.All</code>, <code>Status.Draft</code>, <code>Status.Open</code>, <code>Status.Billed</code>, <code>Status.Cancelled</code>. Example: Bulk status filtering for reporting.'
          required: false
          schema:
            type: string
          example: Status.All
        - name: search_text
          in: query
          description: 'Search purchase order by number, reference, or vendor name. General search across multiple fields. Example: Quick PO lookup without specific field.'
          required: false
          schema:
            type: string
          example: ''
        - name: sort_column
          in: query
          description: 'Sort purchase orders by column. Allowed values: <code>vendor_name</code>, <code>purchaseorder_number</code>, <code>date</code>, <code>delivery_date</code>, <code>total</code>, <code>created_time</code>. Example: Organize results for analysis.'
          required: false
          schema:
            type: string
          example: created_time
        - name: custom_field
          in: query
          description: 'Search purchase order by purchase order''s custom field. Variants: <code>custom_field_startswith</code>, <code>custom_field_contains</code>'
          required: false
          schema:
            type: string
          example: ''
        - name: page
          in: query
          description: Page number to be fetched. Default value is 1.
          required: false
          schema:
            type: integer
            default: 1
          example: 1
        - name: per_page
          in: query
          description: Number of records to be fetched per page. Default value is 200.
          required: false
          schema:
            type: integer
            default: 200
          example: 200
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/list-purchase-orders-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoBooks.purchaseorders.READ
    put:
      tags:
        - purchase-order
      operationId: update_purchase_order_using_custom_field
      summary: Update a purchase order using a custom field's unique value
      description: A custom field will have unique values if it's configured to not accept duplicate values. Now, you can use that custom field's value to update a purchase order by providing its API name in the X-Unique-Identifier-Key header and its value in the X-Unique-Identifier-Value header. Based on this value, the corresponding purchase order will be retrieved and updated. Additionally, there is an optional X-Upsert header. If the X-Upsert header is true and the custom field's unique value is not found in any of the existing purchase orders, a new purchase order will be created if the necessary payload details are available
      parameters:
        - name: X-Unique-Identifier-Key
          in: header
          description: Unique CustomField Api Name
          required: true
          schema:
            type: string
            example: cf_unique_cf
        - name: X-Unique-Identifier-Value
          in: header
          description: Unique CustomField Value
          required: true
          schema:
            type: string
            example: unique Value
        - name: X-Upsert
          in: header
          description: If there is no record is found unique custom field value , will create new invoice
          required: false
          schema:
            type: boolean
            example: true
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/update-a-purchase-order-request'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/update-a-purchase-order-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoBooks.purchaseorders.UPDATE
    parameters:
      - $ref: '#/components/parameters/organization_id'
  /purchaseorders/{purchase_order_id}:
    put:
      tags:
        - purchase-order
      operationId: update_purchase_order
      summary: Update a purchase order
      description: Update an existing purchase order.
      parameters:
        - name: attachment
          in: query
          description: 'Allowed Extensions: <code>gif</code>, <code>png</code>, <code>jpeg</code>, <code>jpg</code>, <code>bmp</code>, <code>pdf</code>, <code>xls</code>, <code>xlsx</code>, <code>doc</code> and <code>docx</code>.'
          required: false
          schema:
            type: string
            format: binary
          example: ''
        - name: ignore_auto_number_generation
          in: query
          description: Ignore auto purchase order number generation for this purchase order. This mandates the purchase order number.
          required: false
          schema:
            type: boolean
          example: false
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/update-a-purchase-order-request'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/update-a-purchase-order-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoBooks.purchaseorders.UPDATE
    get:
      tags:
        - purchase-order
      operationId: get_purchase_order
      summary: Get a purchase order
      description: Get the details of a purchase order.
      parameters:
        - name: print
          in: query
          description: Print the exported pdf.
          required: false
          schema:
            type: boolean
          example: false
        - name: accept
          in: query
          description: 'Get the details of a particular purchase order in formats such as json/ pdf/ html. Default format is json. Allowed Values: <code>json</code>, <code>pdf</code> and <code>html</code>.'
          required: false
          schema:
            type: string
          example: json
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/get-a-purchase-order-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoBooks.purchaseorders.READ
    delete:
      tags:
        - purchase-order
      operationId: delete_purchase_order
      summary: Delete purchase order
      description: Delete an existing purchase order.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/delete-purchase-order-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoBooks.purchaseorders.DELETE
    parameters:
      - name: purchase_order_id
        in: path
        required: true
        description: Unique identifier of the purchase order.
        schema:
          type: string
        example: '460000000062001'
      - $ref: '#/components/parameters/organization_id'
  /purchaseorder/{purchaseorder_id}/customfields:
    put:
      tags:
        - purchase-order
      operationId: update_custom_fields_in_purchase_order
      summary: Update custom field in existing purchaseorders
      description: Update the value of the custom field in existing purchaseorders.
      parameters:
        - name: purchaseorder_id
          in: path
          required: true
          description: Unique identifier of the purchase order.
          schema:
            type: string
          example: '460000000062001'
        - $ref: '#/components/parameters/organization_id'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/custom_fields'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/update-an-purchaseorder-customfield-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoBooks.purchaseorders.UPDATE
  /purchaseorders/{purchaseorder_id}/status/open:
    post:
      tags:
        - purchase-order
      operationId: mark_purchase_order_open
      summary: Mark a purchase order as open
      description: Mark a draft purchase order as open.
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/mark-a-purchase-order-as-open-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoBooks.purchaseorders.CREATE
    parameters:
      - name: purchaseorder_id
        in: path
        required: true
        description: Unique identifier of the purchase order.
        schema:
          type: string
        example: '460000000062001'
      - $ref: '#/components/parameters/organization_id'
  /purchaseorders/{purchaseorder_id}/status/billed:
    post:
      tags:
        - purchase-order
      operationId: mark_purchase_order_billed
      summary: Mark as billed
      description: Mark a purchase order as billed.
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/mark-as-billed-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoBooks.purchaseorders.CREATE
    parameters:
      - name: purchaseorder_id
        in: path
        required: true
        description: Unique identifier of the purchase order.
        schema:
          type: string
        example: '460000000062001'
      - $ref: '#/components/parameters/organization_id'
  /purchaseorders/{purchaseorder_id}/status/cancelled:
    post:
      tags:
        - purchase-order
      operationId: mark_purchase_order_cancelled
      summary: Cancel a purchase order
      description: Mark a purchase order as cancelled.
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/cancel-a-purchase-order-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoBooks.purchaseorders.CREATE
    parameters:
      - name: purchaseorder_id
        in: path
        required: true
        description: Unique identifier of the purchase order.
        schema:
          type: string
        example: '460000000062001'
      - $ref: '#/components/parameters/organization_id'
  /purchaseorders/{purchaseorder_id}/submit:
    post:
      tags:
        - purchase-order
      operationId: submit_purchase_order
      summary: Submit a purchase order for approval
      description: Submit a purchase order for approval.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/submit-a-purchase-order-for-approval-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoBooks.purchaseorders.CREATE
    parameters:
      - name: purchaseorder_id
        in: path
        required: true
        description: Unique identifier of the purchase order.
        schema:
          type: string
        example: '460000000062001'
      - $ref: '#/components/parameters/organization_id'
  /purchaseorders/{purchaseorder_id}/approve:
    post:
      tags:
        - purchase-order
      operationId: approve_purchase_order
      summary: Approve a purchase order
      description: Approve a purchase order.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/approve-a-purchase-order-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoBooks.purchaseorders.CREATE
    parameters:
      - name: purchaseorder_id
        in: path
        required: true
        description: Unique identifier of the purchase order.
        schema:
          type: string
        example: '460000000062001'
      - $ref: '#/components/parameters/organization_id'
  /purchaseorders/{purchaseorder_id}/email:
    post:
      tags:
        - purchase-order
      operationId: email_purchase_order
      summary: Email a purchase order
      description: Email a purchase order to the vendor. Input json string is not mandatory. If input json string is empty, mail will be send with default mail content.
      parameters:
        - name: attachments
          in: query
          description: The files to be attached with the email.
          required: false
          schema:
            type: string
            format: binary
          example: ''
        - name: send_attachment
          in: query
          description: Send the purchase order attachment a with the email.
          required: false
          schema:
            type: boolean
          example: false
        - name: file_name
          in: query
          description: Name of the file
          required: false
          schema:
            type: string
          example: ''
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/email-a-purchase-order-request'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/email-a-purchase-order-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoBooks.purchaseorders.CREATE
    get:
      tags:
        - purchase-order
      operationId: get_purchase_order_email
      summary: Get purchase order email content
      description: Get the email content of a purchase order.
      parameters:
        - name: email_template_id
          in: query
          description: Get the email content based on a specific email template. If this param is not inputted, then the content will be based on the email template associated with the customer. If no template is associated with the customer, then default template will be used.
          required: false
          schema:
            type: string
          example: '460000000011023'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/get-purchase-order-email-content-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoBooks.purchaseorders.READ
    parameters:
      - name: purchaseorder_id
        in: path
        required: true
        description: Unique identifier of the purchase order.
        schema:
          type: string
        example: '460000000062001'
      - $ref: '#/components/parameters/organization_id'
  /purchaseorders/{purchaseorder_id}/address/billing:
    put:
      tags:
        - purchase-order
      operationId: update_purchase_order_billing_address
      summary: Update billing address
      description: Updates the billing address for this purchase order alone.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/update-billing-address-request'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/update-billing-address-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoBooks.purchaseorders.UPDATE
    parameters:
      - name: purchaseorder_id
        in: path
        required: true
        description: Unique identifier of the purchase order.
        schema:
          type: string
        example: '460000000062001'
      - $ref: '#/components/parameters/organization_id'
  /purchaseorders/templates:
    get:
      tags:
        - purchase-order
      operationId: list_purchase_order_templates
      summary: List purchase order templates
      description: Get all purchase order pdf templates.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/list-purchase-order-templates-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoBooks.purchaseorders.READ
    parameters:
      - $ref: '#/components/parameters/organization_id'
  /purchaseorders/{purchaseorder_id}/templates/{template_id}:
    put:
      tags:
        - purchase-order
      operationId: update_purchase_order_template
      summary: Update purchase order template
      description: Update the pdf template associated with the purchase order.
      parameters:
        - name: template_id
          in: path
          required: true
          description: Unique identifier of the purchase order template.
          schema:
            type: string
          example: '460000000011003'
        - name: templates
          in: query
          required: false
          schema:
            type: array
            items:
              type: object
              properties:
                template_name:
                  $ref: '#/components/schemas/template_name'
                template_id:
                  $ref: '#/components/schemas/template_id'
                template_type:
                  $ref: '#/components/schemas/template_type'
          example: ''
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/update-purchase-order-template-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoBooks.purchaseorders.UPDATE
    parameters:
      - name: purchaseorder_id
        in: path
        required: true
        description: Unique identifier of the purchase order.
        schema:
          type: string
        example: '460000000062001'
      - $ref: '#/components/parameters/organization_id'
  /purchaseorders/{purchaseorder_id}/attachment:
    get:
      tags:
        - purchase-order
      operationId: get_purchase_order_attachment
      summary: Get a purchase order attachment
      description: Returns the file attached to the purchase order.
      parameters:
        - name: preview
          in: query
          description: Get the thumbnail of the attachment.
          required: false
          schema:
            type: boolean
          example: false
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/get-a-purchase-order-attachment-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoBooks.purchaseorders.READ
    post:
      tags:
        - purchase-order
      operationId: add_purchase_order_attachment
      summary: Add attachment to a purchase order
      description: Attach a file to a purchase order.
      parameters:
        - name: attachment
          in: query
          description: 'Allowed Extensions: <code>gif</code>, <code>png</code>, <code>jpeg</code>, <code>jpg</code>, <code>bmp</code>, <code>pdf</code>, <code>xls</code>, <code>xlsx</code>, <code>doc</code> and <code>docx</code>.'
          required: false
          schema:
            type: string
            format: binary
          example: ''
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/add-attachment-to-a-purchase-order-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoBooks.purchaseorders.CREATE
    put:
      tags:
        - purchase-order
      operationId: update_purchase_order_attachment
      summary: Update attachment preference
      description: Set whether you want to send the attached file while emailing the purchase order.
      parameters:
        - name: can_send_in_mail
          in: query
          description: Boolean to send the attachment with the purchase order when emailed.
          required: true
          schema:
            type: boolean
          example: false
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/update-attachment-preference-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoBooks.purchaseorders.UPDATE
    delete:
      tags:
        - purchase-order
      operationId: delete_purchase_order_attachment
      summary: Delete an attachment
      description: Delete the file attached to the purchase order.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/delete-an-attachment-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoBooks.purchaseorders.DELETE
    parameters:
      - name: purchaseorder_id
        in: path
        required: true
        description: Unique identifier of the purchase order.
        schema:
          type: string
        example: '460000000062001'
      - $ref: '#/components/parameters/organization_id'
  /purchaseorders/{purchaseorder_id}/comments:
    get:
      tags:
        - purchase-order
      operationId: list_purchase_order_comments
      summary: List purchase order comments & history
      description: Get the complete history and comments of purchase order.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/list-purchase-order-comments-and-history-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoBooks.purchaseorders.READ
    post:
      tags:
        - purchase-order
      operationId: add_purchase_order_comment
      summary: Add comment
      description: Add a comment for a purchase order.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/add-comment-request'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/add-comment-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoBooks.purchaseorders.CREATE
    parameters:
      - name: purchaseorder_id
        in: path
        required: true
        description: Unique identifier of the purchase order.
        schema:
          type: string
        example: '460000000062001'
      - $ref: '#/components/parameters/organization_id'
  /purchaseorders/{purchaseorder_id}/comments/{comment_id}:
    put:
      tags:
        - purchase-order
      operationId: update_purchase_order_comment
      summary: Update comment
      description: Update an existing comment of a purchase order.
      parameters:
        - name: comment_id
          in: path
          required: true
          description: Unique identifier of the comment.
          schema:
            type: string
          example: '460000000012345'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/update-comment-request'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/update-comment-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoBooks.purchaseorders.UPDATE
    delete:
      tags:
        - purchase-order
      operationId: delete_purchase_order_comment
      summary: Delete a comment
      description: Delete a purchase order comment.
      parameters:
        - name: comment_id
          in: path
          required: true
          description: Unique identifier of the comment.
          schema:
            type: string
          example: '460000000012345'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/delete-a-comment-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoBooks.purchaseorders.DELETE
    parameters:
      - name: purchaseorder_id
        in: path
        required: true
        description: Unique identifier of the purchase order.
        schema:
          type: string
        example: '460000000062001'
      - $ref: '#/components/parameters/organization_id'
  /purchaseorders/{purchaseorder_id}/reject:
    post:
      tags:
        - purchase-order
      operationId: reject_purchase_orders
      summary: Reject Purchase Order
      description: Reject a purchase order.
      parameters:
        - name: purchaseorder_id
          in: path
          required: true
          schema:
            type: string
          example: '460000000012345'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/reject_purchase_order'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoBooks.purchaseorders.UPDATE
    parameters:
      - $ref: '#/components/parameters/organization_id'
components:
  parameters:
    organization_id:
      name: organization_id
      description: ID of the organization
      in: query
      required: true
      schema:
        type: string
      example: '10234695'
  schemas:
    gendoc-attributes-schema:
      $ref: '#/components/schemas/purchaseorder'
    attachment:
      description: 'Allowed Extensions: <code>gif</code>, <code>png</code>, <code>jpeg</code>, <code>jpg</code>, <code>bmp</code>, <code>pdf</code>, <code>xls</code>, <code>xlsx</code>, <code>doc</code> and <code>docx</code>.'
      type: string
      format: binary
    ignore_auto_number_generation:
      description: Ignore auto purchase order number generation for this purchase order. This mandates the purchase order number.
      type: boolean
      example: false
    vendor_id:
      description: Unique identifier of the vendor for whom the purchase order is being created. This value is mandatory to associate the purchase order with a specific vendor in your organization. You can obtain the vendor ID by listing all vendors using the contacts API. Ensure the vendor exists before referencing their ID here.
      type: string
      example: '460000000026049'
    purchaseorder_number:
      description: Unique identifier for the purchase order. This field is mandatory when auto number generation is disabled for your organization. If auto numbering is enabled, this field can be left empty as the system will automatically generate a sequential purchase order number. When manually specifying a number, ensure it follows your organization's numbering convention and is unique across all purchase orders.
      type: string
      example: PO-00001
    gst_treatment:
      description: Choose whether the contact is GST registered/unregistered/consumer/overseas. Allowed values are <code> business_gst </code> , <code> business_none </code> , <code> overseas </code> , <code> consumer </code>.
      type: string
      example: business_gst
      x-node_available_in:
        - in
      x-node_unavailable_in: []
    tax_treatment:
      description: 'VAT treatment for the purchase order. Choose whether the vendor falls under: <code>vat_registered</code>,<code>vat_not_registered</code>,<code>gcc_vat_not_registered</code>,<code>gcc_vat_registered</code>,<code>non_gcc</code>.</br><code>dz_vat_registered</code> and <code>dz_vat_not_registered</code> are supported only for <b>UAE</b>.</b></br><code>home_country_mexico</code>,<code>border_region_mexico</code>,<code>non_mexico</code> supported only for <b>MX</b>.<br/><b>For Kenya Edition:</b> <code>vat_registered</code> ,<code>vat_not_registered</code> ,<code>non_kenya</code>(A business that is located outside Kenya).<br/><b>For SouthAfrica Edition:</b> <code>vat_registered</code>, <code>vat_not_registered</code>, <code>overseas</code>(A business that is located outside SouthAfrica).'
      example: vat_registered
      x-node_available_in:
        - gcc
        - mx
        - ke
        - za
      x-node_unavailable_in: []
    gst_no:
      description: 15 digit GST identification number of the vendor.
      type: string
      example: 22AAAAA0000A1Z5
      x-node_available_in:
        - in
      x-node_unavailable_in: []
    source_of_supply:
      description: Place from where the goods/services are supplied. (If not given, <code>place of contact</code> given for the contact will be taken)
      type: string
      example: AP
      x-node_available_in:
        - in
      x-node_unavailable_in: []
    destination_of_supply:
      description: Place where the goods/services are supplied to. (If not given, organisation's home state will be taken)
      type: string
      example: TN
      x-node_available_in:
        - in
      x-node_unavailable_in: []
    place_of_supply:
      description: 'The place of supply is where a transaction is considered to have occurred for VAT purposes. For the supply of goods, the place of supply is the location of the goods when the supply occurs. For the supply of services, the place of supply should be where the supplier is established. (If not given, <code>place of contact</code> given for the contact will be taken)<br/>Supported codes for UAE emirates are : </br>Abu Dhabi - <code>AB</code>,</br>Ajman - <code>AJ</code>,</br>Dubai - <code>DU</code>,</br>Fujairah - <code>FU</code>,</br>Ras al-Khaimah - <code>RA</code>,</br>Sharjah - <code>SH</code>,</br>Umm al-Quwain - <code>UM</code>.<br/>Supported codes for the GCC countries are : </br>United Arab Emirates - <code>AE</code>,</br>Saudi Arabia - <code>SA</code>,</br>Bahrain - <code>BH</code>,</br>Kuwait - <code>KW</code>,</br>Oman - <code>OM</code>,</br>Qatar - <code>QA</code>.'
      type: string
      example: DU
      x-node_available_in:
        - gcc
      x-node_unavailable_in: []
    location_id:
      description: Unique identifier of the business location or branch where this purchase order is being created and managed. This field is used to associate the purchase order with a specific location within your organization, enabling location-based reporting, inventory tracking, and multi-location business operations. The location information affects how the purchase order is processed and where inventory is received.
      type: string
      example: '460000000038080'
    reverse_charge_tax_id:
      description: Unique identifier of the reverse charge tax for the line item. Used when buyer is responsible for paying tax instead of vendor. Applicable for unregistered vendors or specific tax regulations. Must reference valid reverse charge tax configuration.
      type: string
      example: 460000000026068
    pricebook_id:
      description: Unique identifier of the pricebook to be used for this purchase order. The pricebook contains predefined pricing information for items and services. This field is optional and if not specified, the default pricebook will be used. You can obtain the pricebook ID by listing all available pricebooks in your organization. Ensure the pricebook exists and contains the relevant pricing information before referencing its ID here.
      type: string
      example: 460000000026089
    is_pre_gst:
      description: Applicable for transactions that fall before july 1, 2017
      type: boolean
      example: false
      x-node_available_in:
        - in
      x-node_unavailable_in: []
    pricebook_name:
      description: Enter pricebook name
      type: string
      example: ''
    is_reverse_charge_applied:
      description: Applicable for transactions where you pay reverse charge
      type: boolean
      example: false
      x-node_available_in:
        - in
      x-node_unavailable_in: []
    location_name:
      description: Name of the location
      type: string
    reverse_charge_tax_name:
      description: Enter reverse charge tax name
      type: string
      example: inter
      x-node_available_in:
        - in
      x-node_unavailable_in: []
    reverse_charge_tax_percentage:
      description: Enter reverse charge tax percentage
      type: number
      format: double
      example: 10
      x-node_available_in:
        - in
      x-node_unavailable_in: []
    reverse_charge_tax_amount:
      description: Tax amount for the reverse charge.
      type: number
      format: double
      example: 100
      x-node_available_in:
        - in
      x-node_unavailable_in: []
    reference_number:
      description: External reference number or identifier for the purchase order. This field is optional and can be used to store additional reference information such as vendor order numbers, internal tracking codes, or any other external system identifiers. This reference number will be displayed on the purchase order document and can be used for cross-referencing with external systems or internal tracking purposes.
      type: string
      example: ER/0034
    template_id:
      description: Unique identifier of the PDF template linked to the purchase order. Obtain this value from the `template_id` field in the response of the GET `/purchaseorders/templates` API for your organization. Determines which template is used for the purchase order PDF document, controlling the layout, formatting, and visual appearance of the generated purchase order.
      type: string
      example: '460000000011003'
    discount:
      description: The discount amount or percentage to be applied to the purchase order total. This can be specified as a fixed amount or percentage value. Discounts are typically offered by vendors for bulk purchases, early payments, or promotional purposes. The discount reduces the total amount payable and affects the final purchase order total.
      type: string
      example: '10'
    discount_account_id:
      description: Unique identifier of the accounting account where the discount amount will be recorded. This account is used to track and categorize discount expenses in your general ledger. The discount account should be configured as an expense or contra-revenue account to properly reflect the impact of discounts on your financial statements.
      type: string
      example: '460000000011105'
    is_discount_before_tax:
      description: Boolean flag that determines whether the discount is applied before or after tax calculations. When set to true, the discount is applied to the subtotal before tax is calculated, resulting in tax being calculated on the discounted amount. When set to false, the discount is applied after tax calculations, which may affect the final total differently depending on your tax configuration.
      type: boolean
      example: true
    date:
      description: The date when the purchase order was created or issued. This is the official date that appears on the purchase order document and is used for record-keeping, reporting, and tracking purposes. The date should be in YYYY-MM-DD format and typically represents when the purchase order was authorized and sent to the vendor.
      type: string
      example: '2014-02-10'
    due_date:
      description: The expected delivery date when the goods or services ordered in this purchase order should be received. This date is used for planning, scheduling, and tracking deliveries. It helps in managing inventory, coordinating with vendors, and ensuring timely receipt of ordered items. The date should be in YYYY-MM-DD format.
      type: string
    exchange_rate:
      description: The currency exchange rate used to convert the purchase order amounts from the vendor's currency to your organization's base currency. This rate is applied when the purchase order is created in a foreign currency. A value of 1 indicates the same currency as your base currency. This rate affects all monetary calculations and reporting for this purchase order.
      type: number
      format: double
      example: 1
    is_inclusive_tax:
      description: Boolean flag that specifies whether the line item rates include or exclude tax amounts. When set to true, the specified rates are inclusive of tax, meaning the tax amount is already included in the rate. When set to false, the rates are exclusive of tax, and tax will be calculated and added separately. This setting affects how tax calculations are performed and displayed on the purchase order.
      type: boolean
      example: false
      x-node_available_in: []
      x-node_unavailable_in:
        - us
    notes:
      description: Additional information, instructions, or comments to be displayed on the purchase order document. This field is typically used for delivery instructions, special requirements, vendor communications, or any other information relevant to the purchase order. The notes appear on the purchase order PDF and are visible to the vendor.
      type: string
      example: Please deliver as soon as possible.
    notes_default:
      description: Default notes for purchase order
      type: string
    terms:
      description: Terms and conditions text to be displayed on the purchase order document. This field is used to specify payment terms, delivery conditions, return policies, warranty information, or any other legal or business terms that apply to this transaction. The terms appear on the purchase order PDF and form part of the contractual agreement with the vendor.
      type: string
      example: Thanks for your business.
    terms_default:
      description: Default terms for Purchase Orders
      type: string
    ship_via:
      description: Shipment Preference
      type: string
    vat_treatment:
      description: (Optional) 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 <code>uk</code>. If the vendor is in an EU country & VAT registered, you are resides in Northen Ireland and purchasing Goods then his VAT treatment is <code>eu_vat_registered</code> and if he resides outside the UK then his VAT treatment is <code>overseas</code>(For Pre Brexit, this can be split as <code>eu_vat_registered</code>, <code>eu_vat_not_registered</code> and <code>non_eu</code>).
      type: string
      x-node_available_in:
        - uk
      x-node_unavailable_in: []
    acquisition_vat_id:
      description: ID of the VAT Acquistion
      type: string
      x-node_available_in:
        - uk
        - eu
      x-node_unavailable_in: []
    acquisition_vat_name:
      description: Name of the VAT Acquistion
      type: string
      x-node_available_in:
        - uk
        - eu
      x-node_unavailable_in: []
    acquisition_vat_percentage:
      description: Percentage of the VAT Acquistion
      type: string
      x-node_available_in:
        - uk
        - eu
      x-node_unavailable_in: []
    acquisition_vat_amount:
      description: Amount of the VAT Acquistion
      type: string
      x-node_available_in:
        - uk
        - eu
      x-node_unavailable_in: []
    acquisition_vat_summary:
      description: Summary of the VAT Acquistion
      type: array
      items:
        type: object
        properties:
          tax_name:
            $ref: '#/components/schemas/tax_name'
          tax_amount:
            $ref: '#/components/schemas/tax_amount'
      x-node_available_in:
        - uk
        - eu
      x-node_unavailable_in: []
    reverse_charge_vat_summary:
      description: Summary of the Reverse Charge
      type: array
      items:
        type: object
        properties:
          tax_name:
            $ref: '#/components/schemas/tax_name'
          tax_amount:
            $ref: '#/components/schemas/tax_amount'
      x-node_available_in:
        - uk
        - eu
      x-node_unavailable_in: []
    acquisition_vat_total:
      description: Total of the VAT Acquistion
      type: number
      format: double
      x-node_available_in:
        - uk
        - eu
      x-node_unavailable_in: []
    reverse_charge_vat_total:
      description: Total of the Reverse Charge
      type: number
      format: double
      x-node_available_in:
        - uk
        - eu
      x-node_unavailable_in: []
    reverse_charge_vat_id:
      description: ID of the Reverse Charge
      type: string
      x-node_available_in:
        - uk
        - eu
      x-node_unavailable_in: []
    reverse_charge_vat_name:
      description: Name of the Reverse Charge
      type: string
      x-node_available_in:
        - uk
        - eu
      x-node_unavailable_in: []
    reverse_charge_vat_percentage:
      description: Percentage of the Reverse Charge
      type: string
      x-node_available_in:
        - uk
        - eu
      x-node_unavailable_in: []
    reverse_charge_vat_amount:
      description: Percentage of the Reverse Charge
      type: string
      x-node_available_in:
        - uk
        - eu
      x-node_unavailable_in: []
    delivery_date:
      description: The expected delivery date when the goods or services ordered in this purchase order should be received. This date is used for planning, scheduling, and tracking deliveries. It helps in managing inventory, coordinating with vendors, and ensuring timely receipt of ordered items. The date should be in YYYY-MM-DD format and is typically communicated to the vendor as part of the purchase order terms.
      type: string
      example: '2014-02-10'
    project_id:
      description: ID of the project
      type: string
      example: 90300000087378
    project_name:
      description: Name of the project.
      type: string
      example: Sample Project
    tax_id:
      description: Unique identifier of the tax for the line item. Determines tax rate, name, and treatment for calculations. Used in tax amount computation and display on purchase order. Obtain from taxes API.
      type: string
    tds_tax_id:
      type: string
      example: 90300000087370
      x-node_available_in:
        - mx
      x-node_unavailable_in: []
    tax_treatment_code:
      description: Specify reason for using out of scope.</br>Supported values for <b>UAE</b> are <code>uae_same_tax_group</code>, <code>uae_reimbursed_expense</code> and <code>uae_others</code>.</br> Supported values for <b>Bahrain</b> are <code>bahrain_same_tax_group</code>, <code>bahrain_transfer_of_concern</code>, <code>bahrain_disbursement</code>, <code>bahrain_head_to_branch_transaction</code>, <code>bahrain_warranty_repair_services</code> and <code>bahrain_others</code>.</br> Supported values for <b>KSA</b> are <code>ksa_reimbursed_expense</code>.
      type: string
      example: uae_others
      x-node_available_in:
        - gcc
      x-node_unavailable_in: []
    delivery_org_address_id:
      description: Unique identifier of the organization address where the goods or services from this purchase order should be delivered. This field specifies the delivery location within your organization, such as a warehouse, office, or branch location. The address details are retrieved from your organization's address book and displayed on the purchase order for vendor reference.
      type: string
    delivery_customer_id:
      description: Unique identifier of the customer for whom the goods or services in this purchase order are being procured. This field is used when the purchase order is created on behalf of a customer, such as in drop-shipping scenarios or when procuring items for specific customer projects. The customer information may be displayed on the purchase order for vendor reference.
      type: string
    document_id:
      description: ID of the Document
      type: integer
      format: int64
    file_name:
      description: Name of the attached document file. Includes file extension and represents the original filename as uploaded. Used for display purposes and file identification in the system.
      type: string
    documents:
      description: Array of documents attached to the purchase order.
      type: array
      items:
        type: object
        properties:
          document_id:
            $ref: '#/components/schemas/document_id'
          file_name:
            $ref: '#/components/schemas/file_name'
    mail_documents:
      type: array
      items:
        type: object
        properties:
          document_id:
            $ref: '#/components/schemas/document_id'
          file_name:
            $ref: '#/components/schemas/file_name'
    line_item_id:
      description: ID of the line item. Mandatory if the existing line item has to be updated. If empty, a new line item will be created.
      type: string
      example: '460000000074009'
    item_id:
      description: Unique identifier of the item or service in the line item. Mandatory field that links to the item catalog. Determines item details, pricing, and inventory tracking. Obtain from GET /items API.
      type: string
      example: '460000000027009'
    account_id:
      description: Unique identifier of the accounting account for the line item. Mandatory for non-inventory items/services. Determines expense categorization in general ledger.
      type: string
      example: '460000000074003'
    name:
      description: Display name of the line item on the purchase order. Auto-populated from item catalog when item_id is specified. Can be customized. Used for vendor reference and documentation.
      type: string
      example: Hard Drive
    description:
      description: Additional details, specifications, or notes about the line item. Can include technical specs, requirements, delivery instructions. Appears on purchase order document for vendor reference.
      type: string
    unit:
      description: Unit of measurement for the quantity (e.g., Nos, kgs, hours, meters). Should match vendor pricing structure. Used for quantity calculations and pricing.
      type: string
      example: Nos
    rate:
      description: Unit price per item/service. Used to calculate total line item amount. Must be in purchase order currency. Tax inclusion depends on is_inclusive_tax setting. Affects pricing calculations and vendor billing.
      type: number
      format: double
      example: 112
    quantity:
      description: Number of units being ordered. Used with rate to calculate total line item amount. Must match unit of measurement. Represents actual order quantity for delivery.
      type: string
      example: 1
    item_order:
      description: Sequential order of line item within purchase order. Determines display order on documents and reports. Typically numbered sequentially from 0 or 1. Maintains consistency across related documents.
      type: integer
      example: 0
    index:
      description: Index of the Custom Field
      type: integer
      example: 1
    value:
      description: Value of the Custom Field
      type: string
      example: Normal
    organization_address_id:
      description: ID of organization address.
      type: string
    attention:
      description: The name or designation of the specific person who should be contacted or notified regarding the delivery of goods or services from this purchase order. This field is typically used to specify the primary contact person at the delivery location, such as a warehouse manager, office administrator, or project coordinator who will receive and process the delivered items.
      type: string
    address:
      description: Address associated with the Purchase Order
      type: string
    city:
      description: City involved in the Address
      type: string
    state:
      description: State Involved in the Address
      type: string
    zip:
      description: ZIP Code of the Address
      type: string
    country:
      description: Country involved in the Address
      type: string
    fax:
      description: Fax Number
      type: string
    is_verifiable:
      type: boolean
      example: true
    address1:
      type: string
    address2:
      type: string
    is_valid:
      type: string
    email:
      description: Email ID of the Vendor
      type: string
      example: peterparker@bowmanfurniture.com
    is_primary:
      type: string
    purchaseorder_id:
      type: string
      example: '460000000062001'
    expected_delivery_date:
      description: The expected delivery date when the goods or services ordered in this purchase order should be received. This date is used for planning, scheduling, and tracking deliveries. It helps in managing inventory, coordinating with vendors, and ensuring timely receipt of ordered items. The date should be in YYYY-MM-DD format.
      type: string
    status:
      description: Status of the Purchase Order
      type: string
      example: draft
    vendor_name:
      description: Name of the Vendor in Purchase Order
      type: string
    crm_owner_id:
      description: Unique identifier of the CRM owner assigned to this purchase order. This field links the purchase order to a specific CRM user who is responsible for managing the vendor relationship and overseeing the procurement process. The CRM owner can track, follow up, and manage all aspects of this purchase order within the CRM system.
      type: string
    crm_custom_reference_id:
      description: ID of CRM Custom Reference
      type: integer
      format: int64
    currency_id:
      description: Unique identifier of the currency for the purchase order. This value is mandatory to specify the currency in which the purchase order amounts will be displayed and processed. You can obtain the currency ID by listing all available currencies using the GET /settings/currencies API. Ensure the currency exists and is properly configured in your organization before referencing its ID here.
      type: string
      example: '460000000000099'
    currency_code:
      description: Code of the Currency
      type: string
      example: INR
    currency_symbol:
      description: Symbol of the Currency
      type: string
    is_emailed:
      description: Check if the purchase order is emailed
      type: boolean
      example: false
    sub_total:
      description: Sub Total of the Purchase Order
      type: number
      format: double
      example: 40
    tax_total:
      description: Total of the Tax
      type: number
      format: double
      example: 0
    total:
      description: Total of the Purchase Order
      type: number
      format: double
      example: 40
    taxes:
      type: array
      items:
        type: string
    price_precision:
      description: Price Precision for the Values
      type: integer
      example: 2
    ship_via_id:
      description: ID of the Shipment Preference
      type: string
    attachment_name:
      description: Name of the Attachment
      type: string
      example: 7.png
    can_send_in_mail:
      description: Boolean to send the attachment with the purchase order when emailed.
      type: boolean
      example: false
    template_name:
      description: Name of the template
      type: string
      example: Standard Template
    page_width:
      description: Width of the Page
      type: string
      example: 8.27in
    page_height:
      description: Height of the Page
      type: string
      example: 11.69in
    orientation:
      description: Orientation of the Page
      type: string
      example: portrait
    template_type:
      description: Type of the Template
      type: string
      example: standard
    created_time:
      description: Created Time of the Purchase Order
      type: string
      example: 2014-02-10T15:26:26+0530
    created_by_id:
      description: ID of the User who created the Purchase Order
      type: string
      example: '460000000053001'
    last_modified_time:
      description: Last Modified Time of the Purchase Order
      type: string
      example: 2014-02-10T15:26:26+0530
    can_mark_as_bill:
      type: boolean
      example: false
    can_mark_as_unbill:
      type: boolean
      example: false
    sku:
      description: SKU of the Item
      type: string
    account_name:
      description: Name of the Account
      type: string
      example: Other Expenses
    bcy_rate:
      description: Rate in Base Currency
      type: integer
      example: 40
    item_total:
      description: Total of the Item
      type: integer
      example: 40
    tax_name:
      description: Name of the Tax
      type: string
    item_total_inclusive_of_tax:
      description: Total of the Item inclusive tax
      type: integer
      example: 40
    tax_amount:
      description: Amount of Tax
      type: number
      format: double
    tax_type:
      description: Type of the Tax
      type: string
      example: tax
    product_type:
      description: 'This denotes whether the Purchase Order line item is to be treated as a goods or service purchase. This only need to be specified in case purchase order is not enabled. Allowed Values: <code>goods</code>, <code>digital_service</code> and <code>service</code>.'
      type: string
      x-node_available_in:
        - uk
      x-node_unavailable_in: []
    tax_percentage:
      description: Percentage of the Tax
      type: integer
      example: 0
    customfield_id:
      type: integer
      format: int64
      example: '46000000012845'
    label:
      description: Label of the Custom Field
      type: string
      example: Priority
    custom_fields:
      description: Custom fields for purchase order.
      type: array
      items:
        type: object
        properties:
          customfield_id:
            $ref: '#/components/schemas/customfield_id'
          value:
            $ref: '#/components/schemas/value'
    update-an-purchaseorder-customfield-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: Custom Fields Updated Successfully
          readOnly: true
    item_custom_fields:
      type: array
      items:
        type: object
        properties:
          customfield_id:
            $ref: '#/components/schemas/customfield_id'
          value:
            $ref: '#/components/schemas/value'
    phone:
      description: Phone Number of the Contact Person.
      type: string
      example: +1-925-929-7211
    is_verified:
      type: boolean
      example: false
    page:
      type: integer
      example: 1
    per_page:
      type: integer
      example: 200
    has_more_page:
      type: boolean
      example: false
    report_name:
      type: string
      example: Purchase Orders
    applied_filter:
      type: string
      example: Status.ALl
    sort_column:
      description: 'Sort purchase orders. Allowed Values: <code>vendor_name</code>, <code>purchaseorder_number</code>, <code>date</code>, <code>delivery_date</code>, <code>total</code> and <code>created_time</code>.'
      type: string
      example: created_time
    item_description:
      type: string
    sort_order:
      type: string
      example: D
    has_attachment:
      type: boolean
      example: false
    filter_by:
      description: 'Filter purchase order by any status. Allowed Values: <code>Status.All</code>, <code>Status.Draft</code>, <code>Status.Open</code>, <code>Status.Billed</code> and <code>Status.Cancelled</code>.'
      type: string
      example: Status.All
    search_text:
      description: Search purchase order by purchase order number or reference number or vendor name.
      type: string
    print:
      description: Print the exported pdf.
      type: boolean
      example: false
    accept:
      description: 'Get the details of a particular purchase order in formats such as json/ pdf/ html. Default format is json. Allowed Values: <code>json</code>, <code>pdf</code> and <code>html</code>.'
      type: string
      example: json
    attachments:
      description: The files to be attached with the email.
      type: string
      format: binary
    send_attachment:
      description: Send the purchase order attachment a with the email.
      type: boolean
      example: false
    email_template_id:
      description: Get the email content based on a specific email template. If this param is not inputted, then the content will be based on the email template associated with the customer. If no template is associated with the customer, then default template will be used.
      type: string
      example: '460000000011023'
    send_from_org_email_id:
      description: Boolean to trigger the email from the organization's email address.
      type: boolean
      example: true
    to_mail_ids:
      description: Array of email address of the recipients.
      type: array
      items:
        type: string
      example:
        - willsmith@bowmanfurniture.com
    cc_mail_ids:
      description: Array of email address of the recipients to be cced.
      type: array
      items:
        type: string
      example:
        - peterparker@bowmanfurniture.com
    subject:
      description: Subject of the mail.
      type: string
      example: 'Purchase Order from Zillium Inc (PO #: PO-00001)'
    error_list:
      type: array
      items:
        type: string
    body:
      description: Body of the mail
      type: string
      example: 'Dear Bowman and Co, <br><br>The purchase order (PO-00001) is attached with this email. <br><br>An overview of the purchase order is available below: <br>Purchase Order # : PO-00001 <br>Date : 10 Feb 2014 <br>Amount : $112.00(in USD) <br><br>Please go through it and confirm the order. We look forward to working with you again<br><br><br><br>Regards<br><br>Zillium Inc<br><br>'
    selected:
      type: boolean
      example: false
    first_name:
      description: First Name of the Contact Person.
      type: string
      example: Peter
    last_name:
      description: Last Name of the Contact Person.
      type: string
      example: Parker
    salutation:
      description: Salutation of the Contact Person.
      type: string
      example: Mr.
    contact_person_id:
      description: Unique ID of the Contact Person
      type: integer
      format: int64
      example: 460000000031001
    contact_person_name:
      description: Name of the Contact Person
      type: string
      example: Peter
    contact_person_email:
      description: Email ID of the Contact Person.
      type: string
      example: willsmith@bowmanfurniture.com
    mobile:
      description: Mobile Number of the Contact Person.
      type: string
      example: +1-4054439562
    is_email_enabled:
      description: Used to check if Email communication preference is enabled for the contact person at transaction level.
      type: boolean
      example: true
    is_sms_enabled:
      description: Used to check if SMS communication preference is enabled for the contact person.
      type: boolean
      example: true
      x-node_available_in:
        - SMS integration
    is_whatsapp_enabled:
      description: Used to check if WhatsApp communication preference is enabled for the contact person at transaction level.
      type: boolean
      example: true
      x-node_available_in:
        - WhatsApp integration
    communication_preference:
      description: Preferred modes of communication for the contact person at transaction level.
      type: object
      properties:
        is_email_enabled:
          $ref: '#/components/schemas/is_email_enabled'
        is_whatsapp_enabled:
          $ref: '#/components/schemas/is_whatsapp_enabled'
    contact_persons_associated:
      description: Contact Persons associated with the transaction.
      type: array
      items:
        type: object
        properties:
          contact_person_id:
            $ref: '#/components/schemas/contact_person_id'
          contact_person_name:
            $ref: '#/components/schemas/contact_person_name'
          first_name:
            $ref: '#/components/schemas/first_name'
          last_name:
            $ref: '#/components/schemas/last_name'
          contact_person_email:
            $ref: '#/components/schemas/contact_person_email'
          phone:
            $ref: '#/components/schemas/phone'
          mobile:
            $ref: '#/components/schemas/mobile'
          communication_preference:
            $ref: '#/components/schemas/communication_preference'
    contact_persons_associated_payload:
      description: Contact Persons associated with the transaction.
      type: array
      items:
        type: object
        properties:
          contact_person_id:
            $ref: '#/components/schemas/contact_person_id'
          communication_preference:
            $ref: '#/components/schemas/communication_preference'
    user_name:
      description: Name of the User
      type: string
      example: John David
    is_org_email_id:
      description: Check if the Email ID Belongs to the Organisation
      type: boolean
      example: false
    bcc_mails:
      type: array
      items:
        type: string
    bcc_mails_str:
      description: Mails IDs to be BCCed
      type: string
    entity_id:
      description: ID of the Entity
      type: string
      example: '460000000046005'
    cc_mails_list:
      type: array
      items:
        type: string
    organization_contact_id:
      type: string
    file_name_without_extension:
      type: string
      example: PO-00001
    to_mails_str:
      type: string
    cc_mails_str:
      type: string
    from_email:
      type: string
    from_address:
      type: string
      example: 'null'
    emailtemplate_documents:
      type: array
      items:
        type: string
    is_one_off_address:
      type: boolean
      example: true
    salesorder_id:
      description: Unique identifier of the sales order that is linked to this purchase order. This field establishes a connection between the sales order and purchase order, typically used in drop-shipping scenarios where you need to procure items to fulfill a customer's sales order. The linked sales order information may be displayed on the purchase order for vendor reference and internal tracking purposes.
      type: integer
      format: int64
      example: '460000124728314'
    is_update_customer:
      description: Check if customer should be updated
      type: string
    preview:
      description: Get the thumbnail of the attachment.
      type: boolean
      example: false
    comment_id:
      description: ID of the Comment
      type: string
      example: '460000000012345'
    commented_by_id:
      description: ID of the User who caused the Comment
      type: string
    commented_by:
      description: Name of the Customer who caused the Comment
      type: string
    comment_type:
      description: Type of the Comment
      type: string
      example: system
    date_description:
      description: Description of the Date of the Comment
      type: string
      example: 22 hours ago.
    time:
      description: Time of the Comment
      type: string
      example: 3.26PM
    operation_type:
      description: Type of the Operation that caused the comment
      type: string
      example: Updated
    transaction_id:
      description: ID of the Transaction
      type: string
    transaction_type:
      description: Type of the transaction
      type: string
      example: purchaseorder
    templates:
      type: array
      items:
        type: object
        properties:
          template_name:
            $ref: '#/components/schemas/template_name'
          template_id:
            $ref: '#/components/schemas/template_id'
          template_type:
            $ref: '#/components/schemas/template_type'
    from_emails:
      type: array
      items:
        type: object
        properties:
          organization_contact_id:
            $ref: '#/components/schemas/organization_contact_id'
          user_name:
            $ref: '#/components/schemas/user_name'
          selected:
            $ref: '#/components/schemas/selected'
          email:
            $ref: '#/components/schemas/email'
          is_org_email_id:
            $ref: '#/components/schemas/is_org_email_id'
    to_contacts:
      type: array
      items:
        type: object
        properties:
          first_name:
            $ref: '#/components/schemas/first_name'
          selected:
            $ref: '#/components/schemas/selected'
          phone:
            $ref: '#/components/schemas/phone'
          email:
            $ref: '#/components/schemas/email'
          last_name:
            $ref: '#/components/schemas/last_name'
          salutation:
            $ref: '#/components/schemas/salutation'
          contact_person_id:
            $ref: '#/components/schemas/contact_person_id'
          mobile:
            $ref: '#/components/schemas/mobile'
    emailtemplates:
      type: array
      items:
        type: object
        properties:
          selected:
            $ref: '#/components/schemas/selected'
          name:
            $ref: '#/components/schemas/name'
          email_template_id:
            $ref: '#/components/schemas/email_template_id'
    tax_exemption_code:
      description: Code of the Tax Exemption
      type: string
      x-node_available_in:
        - in
        - au
        - ca
        - mx
      x-node_unavailable_in: []
    tax_exemption_id:
      description: ID of the Tax Exemption
      type: string
      x-node_available_in:
        - in
        - au
        - ca
      x-node_unavailable_in: []
    hsn_or_sac:
      description: HSN or SAC Code for the Item
      type: string
      x-node_available_in:
        - in
        - ke
        - za
      x-node_unavailable_in: []
    line_items:
      description: Line items of purchase order.
      type: array
      items:
        type: object
        properties:
          item_id:
            $ref: '#/components/schemas/item_id'
          line_item_id:
            $ref: '#/components/schemas/line_item_id'
          sku:
            $ref: '#/components/schemas/sku'
          location_id:
            $ref: '#/components/schemas/location_id'
          location_name:
            $ref: '#/components/schemas/location_name'
          product_type:
            $ref: '#/components/schemas/product_type'
          reverse_charge_tax_id:
            $ref: '#/components/schemas/reverse_charge_tax_id'
          reverse_charge_tax_name:
            $ref: '#/components/schemas/reverse_charge_tax_name'
          reverse_charge_tax_percentage:
            $ref: '#/components/schemas/reverse_charge_tax_percentage'
          reverse_charge_tax_amount:
            $ref: '#/components/schemas/reverse_charge_tax_amount'
          account_id:
            $ref: '#/components/schemas/account_id'
          account_name:
            $ref: '#/components/schemas/account_name'
          name:
            $ref: '#/components/schemas/name'
          description:
            $ref: '#/components/schemas/description'
          item_order:
            $ref: '#/components/schemas/item_order'
          bcy_rate:
            $ref: '#/components/schemas/bcy_rate'
          unit:
            $ref: '#/components/schemas/unit'
          rate:
            $ref: '#/components/schemas/rate'
          quantity:
            $ref: '#/components/schemas/quantity'
          item_total:
            $ref: '#/components/schemas/item_total'
          item_total_inclusive_of_tax:
            $ref: '#/components/schemas/item_total_inclusive_of_tax'
          tax_exemption_id:
            $ref: '#/components/schemas/tax_exemption_id'
          tax_exemption_code:
            $ref: '#/components/schemas/tax_exemption_code'
          tax_id:
            $ref: '#/components/schemas/tax_id'
          tax_treatment_code:
            $ref: '#/components/schemas/tax_treatment_code'
          tax_name:
            $ref: '#/components/schemas/tax_name'
          tax_type:
            $ref: '#/components/schemas/tax_type'
          tax_percentage:
            $ref: '#/components/schemas/tax_percentage'
          hsn_or_sac:
            $ref: '#/components/schemas/hsn_or_sac'
          acquisition_vat_id:
            $ref: '#/components/schemas/acquisition_vat_id'
          acquisition_vat_name:
            $ref: '#/components/schemas/acquisition_vat_name'
          acquisition_vat_percentage:
            $ref: '#/components/schemas/acquisition_vat_percentage'
          acquisition_vat_amount:
            $ref: '#/components/schemas/acquisition_vat_amount'
          reverse_charge_vat_id:
            $ref: '#/components/schemas/reverse_charge_vat_id'
          reverse_charge_vat_name:
            $ref: '#/components/schemas/reverse_charge_vat_name'
          reverse_charge_vat_percentage:
            $ref: '#/components/schemas/reverse_charge_vat_percentage'
          reverse_charge_vat_amount:
            $ref: '#/components/schemas/reverse_charge_vat_amount'
          tags:
            $ref: '#/components/schemas/tags_response'
          item_custom_fields:
            $ref: '#/components/schemas/item_custom_fields'
          project_id:
            $ref: '#/components/schemas/project_id'
          project_name:
            $ref: '#/components/schemas/project_name'
    billing_address_id:
      description: Unique identifier of the billing address to be used for this purchase order. The billing address determines where invoices and related documents will be sent. This field is optional and if not specified, the default billing address from your organization settings will be used. You can obtain the billing address ID by listing all available addresses in your organization. Ensure the address exists and contains the correct billing information before referencing its ID here.
      type: integer
      format: int64
      example: '460000000017491'
    street2:
      type: string
      example: McMillan Avenue
    billing_address:
      type: object
      properties:
        address:
          $ref: '#/components/schemas/address'
        street2:
          $ref: '#/components/schemas/street2'
        city:
          $ref: '#/components/schemas/city'
        state:
          $ref: '#/components/schemas/state'
        zip:
          $ref: '#/components/schemas/zip'
        country:
          $ref: '#/components/schemas/country'
        fax:
          $ref: '#/components/schemas/fax'
        attention:
          $ref: '#/components/schemas/attention'
    delivery_address:
      type: object
      properties:
        zip:
          $ref: '#/components/schemas/zip'
        is_verifiable:
          $ref: '#/components/schemas/is_verifiable'
        state:
          $ref: '#/components/schemas/state'
        address1:
          $ref: '#/components/schemas/address1'
        address2:
          $ref: '#/components/schemas/address2'
        is_valid:
          $ref: '#/components/schemas/is_valid'
        city:
          $ref: '#/components/schemas/city'
        country:
          $ref: '#/components/schemas/country'
        address:
          $ref: '#/components/schemas/address'
        email:
          $ref: '#/components/schemas/email'
        is_primary:
          $ref: '#/components/schemas/is_primary'
        organization_address_id:
          $ref: '#/components/schemas/organization_address_id'
        phone:
          $ref: '#/components/schemas/phone'
        is_verified:
          $ref: '#/components/schemas/is_verified'
    page_context:
      type: object
      properties:
        page:
          $ref: '#/components/schemas/page'
        per_page:
          $ref: '#/components/schemas/per_page'
        has_more_page:
          $ref: '#/components/schemas/has_more_page'
        report_name:
          $ref: '#/components/schemas/report_name'
        applied_filter:
          $ref: '#/components/schemas/applied_filter'
        sort_column:
          $ref: '#/components/schemas/sort_column'
        sort_order:
          $ref: '#/components/schemas/sort_order'
    data:
      type: object
      properties:
        bcc_mails:
          $ref: '#/components/schemas/bcc_mails'
        body:
          $ref: '#/components/schemas/body'
        error_list:
          $ref: '#/components/schemas/error_list'
        bcc_mails_str:
          $ref: '#/components/schemas/bcc_mails_str'
        documents:
          $ref: '#/components/schemas/documents'
        subject:
          $ref: '#/components/schemas/subject'
        entity_id:
          $ref: '#/components/schemas/entity_id'
        vendor_id:
          $ref: '#/components/schemas/vendor_id'
        cc_mails_list:
          $ref: '#/components/schemas/cc_mails_list'
        file_name:
          $ref: '#/components/schemas/file_name'
        from_emails:
          $ref: '#/components/schemas/from_emails'
        file_name_without_extension:
          $ref: '#/components/schemas/file_name_without_extension'
        to_mails_str:
          $ref: '#/components/schemas/to_mails_str'
        cc_mails_str:
          $ref: '#/components/schemas/cc_mails_str'
        from_email:
          $ref: '#/components/schemas/from_email'
        from_address:
          $ref: '#/components/schemas/from_address'
        emailtemplates:
          $ref: '#/components/schemas/emailtemplates'
        to_contacts:
          $ref: '#/components/schemas/to_contacts'
        attachment_name:
          $ref: '#/components/schemas/attachment_name'
        emailtemplate_documents:
          $ref: '#/components/schemas/emailtemplate_documents'
        vendor_name:
          $ref: '#/components/schemas/vendor_name'
    comment:
      type: object
      properties:
        comment_id:
          $ref: '#/components/schemas/comment_id'
        purchaseorder_id:
          $ref: '#/components/schemas/purchaseorder_id'
        description:
          $ref: '#/components/schemas/description'
        commented_by_id:
          $ref: '#/components/schemas/commented_by_id'
        commented_by:
          $ref: '#/components/schemas/commented_by'
        comment_type:
          $ref: '#/components/schemas/comment_type'
        date:
          $ref: '#/components/schemas/date'
        date_description:
          $ref: '#/components/schemas/date_description'
        time:
          $ref: '#/components/schemas/time'
    purchaseorder:
      type: object
      properties:
        purchaseorder_id:
          $ref: '#/components/schemas/purchaseorder_id'
        documents:
          $ref: '#/components/schemas/documents'
        vat_treatment:
          $ref: '#/components/schemas/vat_treatment'
        gst_no:
          $ref: '#/components/schemas/gst_no'
        gst_treatment:
          $ref: '#/components/schemas/gst_treatment'
        tax_treatment:
          $ref: '#/components/schemas/tax_treatment'
        is_pre_gst:
          $ref: '#/components/schemas/is_pre_gst'
        source_of_supply:
          $ref: '#/components/schemas/source_of_supply'
        destination_of_supply:
          $ref: '#/components/schemas/destination_of_supply'
        place_of_supply:
          $ref: '#/components/schemas/place_of_supply'
        pricebook_id:
          $ref: '#/components/schemas/pricebook_id'
        pricebook_name:
          $ref: '#/components/schemas/pricebook_name'
        is_reverse_charge_applied:
          $ref: '#/components/schemas/is_reverse_charge_applied'
        purchaseorder_number:
          $ref: '#/components/schemas/purchaseorder_number'
        date:
          $ref: '#/components/schemas/date'
        expected_delivery_date:
          $ref: '#/components/schemas/expected_delivery_date'
        discount:
          $ref: '#/components/schemas/discount'
        discount_account_id:
          $ref: '#/components/schemas/discount_account_id'
        is_discount_before_tax:
          $ref: '#/components/schemas/is_discount_before_tax'
        reference_number:
          $ref: '#/components/schemas/reference_number'
        status:
          $ref: '#/components/schemas/status'
        vendor_id:
          $ref: '#/components/schemas/vendor_id'
        vendor_name:
          $ref: '#/components/schemas/vendor_name'
        crm_owner_id:
          $ref: '#/components/schemas/crm_owner_id'
        contact_persons_associated:
          $ref: '#/components/schemas/contact_persons_associated'
        currency_id:
          $ref: '#/components/schemas/currency_id'
        currency_code:
          $ref: '#/components/schemas/currency_code'
        currency_symbol:
          $ref: '#/components/schemas/currency_symbol'
        exchange_rate:
          $ref: '#/components/schemas/exchange_rate'
        delivery_date:
          $ref: '#/components/schemas/delivery_date'
        is_emailed:
          $ref: '#/components/schemas/is_emailed'
        is_inclusive_tax:
          $ref: '#/components/schemas/is_inclusive_tax'
        location_id:
          $ref: '#/components/schemas/location_id'
        location_name:
          $ref: '#/components/schemas/location_name'
        line_items:
          $ref: '#/components/schemas/line_items'
        sub_total:
          $ref: '#/components/schemas/sub_total'
        tax_total:
          $ref: '#/components/schemas/tax_total'
        total:
          $ref: '#/components/schemas/total'
        taxes:
          $ref: '#/components/schemas/taxes'
        acquisition_vat_summary:
          $ref: '#/components/schemas/acquisition_vat_summary'
        acquisition_vat_total:
          $ref: '#/components/schemas/acquisition_vat_total'
        reverse_charge_vat_summary:
          $ref: '#/components/schemas/reverse_charge_vat_summary'
        reverse_charge_vat_total:
          $ref: '#/components/schemas/reverse_charge_vat_total'
        billing_address:
          $ref: '#/components/schemas/billing_address'
        notes:
          $ref: '#/components/schemas/notes'
        terms:
          $ref: '#/components/schemas/terms'
        ship_via:
          $ref: '#/components/schemas/ship_via'
        ship_via_id:
          $ref: '#/components/schemas/ship_via_id'
        attention:
          $ref: '#/components/schemas/attention'
        delivery_org_address_id:
          $ref: '#/components/schemas/delivery_org_address_id'
        delivery_customer_id:
          $ref: '#/components/schemas/delivery_customer_id'
        delivery_address:
          $ref: '#/components/schemas/delivery_address'
        price_precision:
          $ref: '#/components/schemas/price_precision'
        custom_fields:
          $ref: '#/components/schemas/custom_fields'
        attachment_name:
          $ref: '#/components/schemas/attachment_name'
        can_send_in_mail:
          $ref: '#/components/schemas/can_send_in_mail'
        template_id:
          $ref: '#/components/schemas/template_id'
        template_name:
          $ref: '#/components/schemas/template_name'
        page_width:
          $ref: '#/components/schemas/page_width'
        page_height:
          $ref: '#/components/schemas/page_height'
        orientation:
          $ref: '#/components/schemas/orientation'
        template_type:
          $ref: '#/components/schemas/template_type'
        created_time:
          $ref: '#/components/schemas/created_time'
        created_by_id:
          $ref: '#/components/schemas/created_by_id'
        last_modified_time:
          $ref: '#/components/schemas/last_modified_time'
        can_mark_as_bill:
          $ref: '#/components/schemas/can_mark_as_bill'
        can_mark_as_unbill:
          $ref: '#/components/schemas/can_mark_as_unbill'
        tags:
          $ref: '#/components/schemas/tags_response'
    custom_field:
      description: 'Search purchase order by purchase order''s custom field. Variants: <code>custom_field_startswith</code>, <code>custom_field_contains</code>'
      type: string
    from_address_id:
      description: ID of From Address of the Email Address
      type: integer
      format: int64
      example: '460000008392548'
    bcc_mail_ids:
      description: Array of email address of the recipients to be BCC ed.
      type: array
      items:
        type: string
      example:
        - mark@safInstruments.com
    create-a-purchase-order-request:
      required:
        - vendor_id
        - line_items
      type: object
      properties:
        vendor_id:
          $ref: '#/components/schemas/vendor_id'
        currency_id:
          $ref: '#/components/schemas/currency_id'
        contact_persons_associated:
          $ref: '#/components/schemas/contact_persons_associated_payload'
        purchaseorder_number:
          $ref: '#/components/schemas/purchaseorder_number'
        gst_treatment:
          $ref: '#/components/schemas/gst_treatment'
        tax_treatment:
          $ref: '#/components/schemas/tax_treatment'
        gst_no:
          $ref: '#/components/schemas/gst_no'
        source_of_supply:
          $ref: '#/components/schemas/source_of_supply'
        destination_of_supply:
          $ref: '#/components/schemas/destination_of_supply'
        place_of_supply:
          $ref: '#/components/schemas/place_of_supply'
        pricebook_id:
          $ref: '#/components/schemas/pricebook_id'
        reference_number:
          $ref: '#/components/schemas/reference_number'
        billing_address_id:
          $ref: '#/components/schemas/billing_address_id'
        crm_owner_id:
          $ref: '#/components/schemas/crm_owner_id'
        crm_custom_reference_id:
          $ref: '#/components/schemas/crm_custom_reference_id'
        template_id:
          $ref: '#/components/schemas/template_id'
        date:
          $ref: '#/components/schemas/date'
        delivery_date:
          $ref: '#/components/schemas/delivery_date'
        due_date:
          $ref: '#/components/schemas/due_date'
        exchange_rate:
          $ref: '#/components/schemas/exchange_rate'
        discount:
          $ref: '#/components/schemas/discount'
        discount_account_id:
          $ref: '#/components/schemas/discount_account_id'
        is_discount_before_tax:
          $ref: '#/components/schemas/is_discount_before_tax'
        is_inclusive_tax:
          $ref: '#/components/schemas/is_inclusive_tax'
        notes:
          $ref: '#/components/schemas/notes'
        notes_default:
          $ref: '#/components/schemas/notes_default'
        terms:
          $ref: '#/components/schemas/terms'
        terms_default:
          $ref: '#/components/schemas/terms_default'
        ship_via:
          $ref: '#/components/schemas/ship_via'
        delivery_org_address_id:
          $ref: '#/components/schemas/delivery_org_address_id'
        delivery_customer_id:
          $ref: '#/components/schemas/delivery_customer_id'
        attention:
          $ref: '#/components/schemas/attention'
        vat_treatment:
          $ref: '#/components/schemas/vat_treatment'
        is_update_customer:
          $ref: '#/components/schemas/is_update_customer'
        salesorder_id:
          $ref: '#/components/schemas/salesorder_id'
        location_id:
          $ref: '#/components/schemas/location_id'
        line_items:
          description: Line items of purchase order.
          type: array
          items:
            type: object
            properties:
              item_id:
                $ref: '#/components/schemas/item_id'
              account_id:
                $ref: '#/components/schemas/account_id'
              name:
                $ref: '#/components/schemas/name'
              description:
                $ref: '#/components/schemas/description'
              unit:
                $ref: '#/components/schemas/unit'
              location_id:
                $ref: '#/components/schemas/location_id'
              hsn_or_sac:
                $ref: '#/components/schemas/hsn_or_sac'
              reverse_charge_tax_id:
                $ref: '#/components/schemas/reverse_charge_tax_id'
              rate:
                $ref: '#/components/schemas/rate'
              quantity:
                $ref: '#/components/schemas/quantity'
              item_order:
                $ref: '#/components/schemas/item_order'
              tax_id:
                $ref: '#/components/schemas/tax_id'
              tds_tax_id:
                $ref: '#/components/schemas/tds_tax_id'
              tax_treatment_code:
                $ref: '#/components/schemas/tax_treatment_code'
              tax_exemption_code:
                $ref: '#/components/schemas/tax_exemption_code'
              tax_exemption_id:
                $ref: '#/components/schemas/tax_exemption_id'
              acquisition_vat_id:
                $ref: '#/components/schemas/acquisition_vat_id'
              reverse_charge_vat_id:
                $ref: '#/components/schemas/reverse_charge_vat_id'
              item_custom_fields:
                type: array
                items:
                  type: object
                  properties:
                    index:
                      $ref: '#/components/schemas/index'
                    value:
                      $ref: '#/components/schemas/value'
              tags:
                $ref: '#/components/schemas/tags'
              project_id:
                $ref: '#/components/schemas/project_id'
        custom_fields:
          $ref: '#/components/schemas/custom_fields'
        documents:
          $ref: '#/components/schemas/documents'
        tags:
          $ref: '#/components/schemas/tags'
    create-a-purchase-order-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: Purchase Order has been added.
          readOnly: true
        purchaseorder:
          $ref: '#/components/schemas/purchaseorder'
    list-purchase-orders-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: success
          readOnly: true
        purchaseorders:
          type: array
          items:
            type: object
            properties:
              purchaseorder_id:
                $ref: '#/components/schemas/purchaseorder_id'
              vendor_id:
                $ref: '#/components/schemas/vendor_id'
              vendor_name:
                $ref: '#/components/schemas/vendor_name'
              status:
                $ref: '#/components/schemas/status'
              purchaseorder_number:
                $ref: '#/components/schemas/purchaseorder_number'
              reference_number:
                $ref: '#/components/schemas/reference_number'
              date:
                $ref: '#/components/schemas/date'
              delivery_date:
                $ref: '#/components/schemas/delivery_date'
              currency_id:
                $ref: '#/components/schemas/currency_id'
              currency_code:
                $ref: '#/components/schemas/currency_code'
              price_precision:
                $ref: '#/components/schemas/price_precision'
              total:
                $ref: '#/components/schemas/total'
              has_attachment:
                $ref: '#/components/schemas/has_attachment'
              created_time:
                $ref: '#/components/schemas/created_time'
              last_modified_time:
                $ref: '#/components/schemas/last_modified_time'
              custom_fields:
                $ref: '#/components/schemas/custom_fields'
    update-a-purchase-order-request:
      required:
        - vendor_id
        - line_items
      type: object
      properties:
        vendor_id:
          $ref: '#/components/schemas/vendor_id'
        currency_id:
          $ref: '#/components/schemas/currency_id'
        contact_persons_associated:
          $ref: '#/components/schemas/contact_persons_associated_payload'
        purchaseorder_number:
          $ref: '#/components/schemas/purchaseorder_number'
        gst_treatment:
          $ref: '#/components/schemas/gst_treatment'
        tax_treatment:
          $ref: '#/components/schemas/tax_treatment'
        gst_no:
          $ref: '#/components/schemas/gst_no'
        source_of_supply:
          $ref: '#/components/schemas/source_of_supply'
        destination_of_supply:
          $ref: '#/components/schemas/destination_of_supply'
        place_of_supply:
          $ref: '#/components/schemas/place_of_supply'
        pricebook_id:
          $ref: '#/components/schemas/pricebook_id'
        reference_number:
          $ref: '#/components/schemas/reference_number'
        discount:
          $ref: '#/components/schemas/discount'
        discount_account_id:
          $ref: '#/components/schemas/discount_account_id'
        is_discount_before_tax:
          $ref: '#/components/schemas/is_discount_before_tax'
        billing_address_id:
          $ref: '#/components/schemas/billing_address_id'
        crm_owner_id:
          $ref: '#/components/schemas/crm_owner_id'
        crm_custom_reference_id:
          $ref: '#/components/schemas/crm_custom_reference_id'
        template_id:
          $ref: '#/components/schemas/template_id'
        date:
          $ref: '#/components/schemas/date'
        delivery_date:
          $ref: '#/components/schemas/delivery_date'
        due_date:
          $ref: '#/components/schemas/due_date'
        exchange_rate:
          $ref: '#/components/schemas/exchange_rate'
        is_inclusive_tax:
          $ref: '#/components/schemas/is_inclusive_tax'
        notes:
          $ref: '#/components/schemas/notes'
        notes_default:
          $ref: '#/components/schemas/notes_default'
        terms:
          $ref: '#/components/schemas/terms'
        terms_default:
          $ref: '#/components/schemas/terms_default'
        ship_via:
          $ref: '#/components/schemas/ship_via'
        delivery_org_address_id:
          $ref: '#/components/schemas/delivery_org_address_id'
        delivery_customer_id:
          $ref: '#/components/schemas/delivery_customer_id'
        attention:
          $ref: '#/components/schemas/attention'
        vat_treatment:
          $ref: '#/components/schemas/vat_treatment'
        is_update_customer:
          $ref: '#/components/schemas/is_update_customer'
        salesorder_id:
          $ref: '#/components/schemas/salesorder_id'
        location_id:
          $ref: '#/components/schemas/location_id'
        line_items:
          description: Line items of purchase order.
          type: array
          items:
            type: object
            properties:
              line_item_id:
                $ref: '#/components/schemas/line_item_id'
              item_id:
                $ref: '#/components/schemas/item_id'
              account_id:
                $ref: '#/components/schemas/account_id'
              name:
                $ref: '#/components/schemas/name'
              description:
                $ref: '#/components/schemas/description'
              unit:
                $ref: '#/components/schemas/unit'
              location_id:
                $ref: '#/components/schemas/location_id'
              hsn_or_sac:
                $ref: '#/components/schemas/hsn_or_sac'
              reverse_charge_tax_id:
                $ref: '#/components/schemas/reverse_charge_tax_id'
              rate:
                $ref: '#/components/schemas/rate'
              quantity:
                $ref: '#/components/schemas/quantity'
              item_order:
                $ref: '#/components/schemas/item_order'
              tax_id:
                $ref: '#/components/schemas/tax_id'
              tds_tax_id:
                $ref: '#/components/schemas/tds_tax_id'
              tax_treatment_code:
                $ref: '#/components/schemas/tax_treatment_code'
              tax_exemption_code:
                $ref: '#/components/schemas/tax_exemption_code'
              tax_exemption_id:
                $ref: '#/components/schemas/tax_exemption_id'
              acquisition_vat_id:
                $ref: '#/components/schemas/acquisition_vat_id'
              reverse_charge_vat_id:
                $ref: '#/components/schemas/reverse_charge_vat_id'
              item_custom_fields:
                type: array
                items:
                  type: object
                  properties:
                    index:
                      $ref: '#/components/schemas/index'
                    value:
                      $ref: '#/components/schemas/value'
              tags:
                $ref: '#/components/schemas/tags'
              project_id:
                $ref: '#/components/schemas/project_id'
        custom_fields:
          $ref: '#/components/schemas/custom_fields'
        documents:
          $ref: '#/components/schemas/documents'
        tags:
          $ref: '#/components/schemas/tags'
    update-a-purchase-order-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: Purchase Order has been updated.
          readOnly: true
        purchaseorder:
          $ref: '#/components/schemas/purchaseorder'
    get-a-purchase-order-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: success
          readOnly: true
        purchaseorder:
          $ref: '#/components/schemas/purchaseorder'
    delete-purchase-order-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: The purchase order has been deleted.
          readOnly: true
    mark-a-purchase-order-as-open-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: The purchase order has been marked as open.
          readOnly: true
    mark-as-billed-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: The purchase order has been marked as billed.
          readOnly: true
    cancel-a-purchase-order-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: The purchase order has been cancelled.
          readOnly: true
    submit-a-purchase-order-for-approval-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: The purchase order has been successfully submitted for approval.
          readOnly: true
    approve-a-purchase-order-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: You have approved the Purchase Order.
          readOnly: true
    email-a-purchase-order-request:
      required:
        - to_mail_ids
        - body
      type: object
      properties:
        send_from_org_email_id:
          $ref: '#/components/schemas/send_from_org_email_id'
        from_address_id:
          $ref: '#/components/schemas/from_address_id'
        to_mail_ids:
          $ref: '#/components/schemas/to_mail_ids'
        cc_mail_ids:
          $ref: '#/components/schemas/cc_mail_ids'
        bcc_mail_ids:
          $ref: '#/components/schemas/bcc_mail_ids'
        subject:
          $ref: '#/components/schemas/subject'
        body:
          $ref: '#/components/schemas/body'
        mail_documents:
          $ref: '#/components/schemas/mail_documents'
    email-a-purchase-order-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: Your purchase order has been sent.
          readOnly: true
    get-purchase-order-email-content-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: success
          readOnly: true
    update-billing-address-request:
      type: object
      properties:
        address:
          $ref: '#/components/schemas/address'
        city:
          $ref: '#/components/schemas/city'
        state:
          $ref: '#/components/schemas/state'
        zip:
          $ref: '#/components/schemas/zip'
        country:
          $ref: '#/components/schemas/country'
        fax:
          $ref: '#/components/schemas/fax'
        attention:
          $ref: '#/components/schemas/attention'
        is_update_customer:
          $ref: '#/components/schemas/is_update_customer'
    update-billing-address-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: Billing address updated.
          readOnly: true
    list-purchase-order-templates-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: success
          readOnly: true
        templates:
          $ref: '#/components/schemas/templates'
    update-purchase-order-template-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: Purchase Order has been updated.
          readOnly: true
    get-a-purchase-order-attachment-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: success
          readOnly: true
    add-attachment-to-a-purchase-order-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: The document has been attached.
          readOnly: true
    update-attachment-preference-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: Purchase Order has been updated.
          readOnly: true
    delete-an-attachment-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: The attachment has been deleted.
          readOnly: true
    list-purchase-order-comments-and-history-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: success
          readOnly: true
        comments:
          type: array
          items:
            type: object
            properties:
              comment_id:
                $ref: '#/components/schemas/comment_id'
              description:
                $ref: '#/components/schemas/description'
              commented_by_id:
                $ref: '#/components/schemas/commented_by_id'
              commented_by:
                $ref: '#/components/schemas/commented_by'
              comment_type:
                $ref: '#/components/schemas/comment_type'
              date:
                $ref: '#/components/schemas/date'
              date_description:
                $ref: '#/components/schemas/date_description'
              time:
                $ref: '#/components/schemas/time'
              operation_type:
                $ref: '#/components/schemas/operation_type'
              transaction_id:
                $ref: '#/components/schemas/transaction_id'
              transaction_type:
                $ref: '#/components/schemas/transaction_type'
    add-comment-request:
      required:
        - description
        - expected_delivery_date
      type: object
      properties:
        description:
          description: The description of the comment.
          type: string
          example: This is a comment.
        expected_delivery_date:
          $ref: '#/components/schemas/expected_delivery_date'
    add-comment-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: Comments added.
          readOnly: true
        comment:
          $ref: '#/components/schemas/comment'
    update-comment-request:
      type: object
      properties:
        description:
          description: The description of the comment.
          type: string
          example: This is a comment.
        expected_delivery_date:
          $ref: '#/components/schemas/expected_delivery_date'
    update-comment-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: Comment has been updated.
          readOnly: true
    delete-a-comment-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: The comment has been deleted.
          readOnly: true
    reject_purchase_order:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: You have rejected the Purchase order successfully.
          readOnly: true
    tag_id:
      description: Tag's ID
      type: integer
      format: int64
      example: '460000000000567'
    tag_name:
      description: Tag's Name
      type: string
      example: Business Unit
    tag_option_id:
      description: Tag Option's ID
      type: integer
      format: int64
      example: '460000000014044'
    tag_option_name:
      description: Tag Option's Name
      type: string
      example: Sales
    is_tag_mandatory:
      description: Used to check if the tag is mandatory
      type: boolean
      example: false
    tags:
      description: Reporting tags help organize and filter data across reports and enable detailed business intelligence analysis.
      type: array
      items:
        type: object
        properties:
          tag_id:
            $ref: '#/components/schemas/tag_id'
          tag_option_id:
            $ref: '#/components/schemas/tag_option_id'
    tags_response:
      description: Reporting tags help organize and filter data across reports and enable detailed business intelligence analysis.
      type: array
      items:
        type: object
        properties:
          tag_id:
            $ref: '#/components/schemas/tag_id'
          tag_name:
            $ref: '#/components/schemas/tag_name'
          tag_option_id:
            $ref: '#/components/schemas/tag_option_id'
          tag_option_name:
            $ref: '#/components/schemas/tag_option_name'
          is_tag_mandatory:
            $ref: '#/components/schemas/is_tag_mandatory'
  securitySchemes:
    Zoho_Auth:
      type: oauth2
      flows:
        implicit:
          authorizationUrl: https://accounts.zoho.com/oauth/v2/auth
          scopes:
            ZohoBooks.purchaseorders.CREATE: Create Purchaseorders
            ZohoBooks.purchaseorders.UPDATE: Update Purchaseorders
            ZohoBooks.purchaseorders.READ: Read Purchaseorders
            ZohoBooks.purchaseorders.DELETE: Delete Purchaseorders
