openapi: 3.0.0
info:
  title: Packages
  description: 'Zoho Inventory brings to you, the feature ‘Packages’ with which you can create and assign package slip numbers to the line items in your sales orders and keep track of your packages when they are shipped.'
  contact: {}
  version: 1.0.0
servers:
  -
    url: 'https://www.zohoapis.com/inventory/v1'
    description: 'API Endpoint'
tags:
  -
    name: packages
    description: 'Packages Module'
paths:
  /packages:
    post:
      tags:
        - packages
      operationId: 'create_package'
      summary: 'Creating a package'
      description: 'A new package can be created. To create package, URL parameter salesorder_id also needed.'
      parameters:
        -
          name: salesorder_id
          in: query
          description: 'Unique ID generated by the server for sales order'
          required: true
          schema:
            type: integer
            format: int64
          example: 504366000000062000
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/creating-a-package-request'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/creating-a-package-response'
      deprecated: false
      security:
        -
          Zoho_Auth:
            - ZohoInventory.packages.CREATE
    get:
      tags:
        - packages
      operationId: 'list_packages'
      summary: 'List all packages'
      description: 'List all existing packages.'
      parameters:
        -
          name: sort_column
          in: query
          description: 'sorting column. it can have values as <code>tracking_number|salesorder_number|package_number|date|created_time|last_modified_time|customer_name|customer_id|shipment_date|quantity|delivery_method</code>'
          required: false
          schema:
            type: string
          example: created_by
        -
          name: search_text
          in: query
          description: 'search the packages by text'
          required: false
          schema:
            type: string
          example: PK-00001
        -
          name: filter_by
          in: query
          description: 'filter the packages by status. Status can be <code>All|NotShipped|Shipped|Delivered</code> For example: Status.All'
          required: false
          schema:
            type: string
          example: Status.All
        -
          name: packing_number_startswith
          in: query
          description: 'Used for searching package_id which starts with given number in advanced search option'
          required: false
          schema:
            type: integer
            format: int64
          example: 504366
        -
          name: packing_number_contains
          in: query
          description: 'Used for searching package_id which contains given number in advanced search option'
          required: false
          schema:
            type: integer
            format: int64
          example: 66000
        -
          name: salesorder_number_startswith
          in: query
          description: 'Used for searching salesorder_id which starts with given number in advanced search option'
          required: false
          schema:
            type: integer
            format: int64
          example: 504366
        -
          name: salesorder_number_contains
          in: query
          description: 'Used for searching salesorder_id which contains given number in advanced search option'
          required: false
          schema:
            type: integer
            format: int64
          example: 66000
        -
          name: date_start
          in: query
          description: 'Used for searching packages from specified date <code>Use the node as date_after if specified date is not to be considered</code>'
          required: false
          schema:
            type: string
            format: date
          example: 2017-01-10T00:00:00.000Z
        -
          name: date_end
          in: query
          description: 'Used for searching packages till specified date <code>Use the node as date_before if specified date is not to be considered</code>'
          required: false
          schema:
            type: string
            format: date
          example: 2017-01-14T00:00:00.000Z
        -
          name: shipment_date_start
          in: query
          description: 'Used for searching shipments from specified date <code>Use the node as shipment_date_after if specified date is not to be considered</code>'
          required: false
          schema:
            type: string
            format: date
          example: 2017-01-10T00:00:00.000Z
        -
          name: shipment_date_end
          in: query
          description: 'Used for searching shipments till specified date <code>Use the node as shipment_date_before if specified date is not to be considered</code>'
          required: false
          schema:
            type: string
            format: date
          example: 2017-01-14T00:00:00.000Z
        -
          name: customer_name_startswith
          in: query
          description: 'Used for searching salesorder_id which starts with given number in advanced search option'
          required: false
          schema:
            type: string
          example: sam
        -
          name: customer_name_contains
          in: query
          description: 'Used for searching salesorder_id which contains given number in advanced search option'
          required: false
          schema:
            type: string
          example: ethan
        -
          name: delivery_method_startswith
          in: query
          description: 'Used for searching delivery_method which starts with given string in advanced search option'
          required: false
          schema:
            type: string
          example: sam
        -
          name: delivery_method_contains
          in: query
          description: 'Used for searching delivery_method which contains given string in advanced search option'
          required: false
          schema:
            type: string
          example: ethan
        -
          name: status
          in: query
          description: 'status of the shipment order'
          required: false
          schema:
            type: string
          example: shipped
        -
          name: customer_id
          in: query
          description: 'Unique ID generated by the for the customer'
          required: false
          schema:
            type: integer
            format: int64
          example: 504366000000062000
        - 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-all-packages-response'
      deprecated: false
      security:
        -
          Zoho_Auth:
            - ZohoInventory.packages.READ
    parameters:
      -
        $ref: '#/components/parameters/organization_id'
  '/packages/{package_id}':
    get:
      tags:
        - packages
      operationId: 'get_package'
      summary: 'Retrieving a package'
      description: 'Retrieving details of existing package.'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/retrieving-a-package-response'
      deprecated: false
      security:
        -
          Zoho_Auth:
            - ZohoInventory.packages.READ
    put:
      tags:
        - packages
      operationId: 'update_package'
      summary: 'Updating a package'
      description: 'Updating details of existing package.'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/updating-a-package-request'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/updating-a-package-response'
      deprecated: false
      security:
        -
          Zoho_Auth:
            - ZohoInventory.packages.UPDATE
    delete:
      tags:
        - packages
      operationId: 'delete_package'
      summary: 'Deleting a package'
      description: 'Deleting an existing package.'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/deleting-a-package-response'
      deprecated: false
      security:
        -
          Zoho_Auth:
            - ZohoInventory.packages.DELETE
    parameters:
      -
        name: package_id
        in: path
        required: true
        description: 'Unique identifier of the package.'
        schema:
          type: string
        example: 504366000000062100
      -
        $ref: '#/components/parameters/organization_id'
  /packages/print:
    get:
      tags:
        - packages
      operationId: 'bulk_print_packages'
      summary: 'Bulk print packages'
      description: 'Print package slips.'
      parameters:
        -
          name: package_ids
          in: query
          description: 'Export packages as pdf and print them. <code>List of package ids separated by comma</code>'
          required: true
          schema:
            type: string
          example: 5.0436600000006205e+35
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bulk-print-packages-response'
      deprecated: false
      security:
        -
          Zoho_Auth:
            - ZohoInventory.packages.READ
    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/package-response'
    package-response:
      type: object
      properties:
        billing_address:
          $ref: '#/components/schemas/billing_address'
        contact_persons:
          $ref: '#/components/schemas/contact_persons'
        created_time:
          $ref: '#/components/schemas/created_time'
        customer_id:
          $ref: '#/components/schemas/customer_id'
        customer_name:
          $ref: '#/components/schemas/customer_name'
        date:
          $ref: '#/components/schemas/date'
        email:
          $ref: '#/components/schemas/email'
        is_emailed:
          $ref: '#/components/schemas/is_emailed'
        last_modified_time:
          $ref: '#/components/schemas/last_modified_time'
        line_items:
          $ref: '#/components/schemas/line_items'
        mobile:
          $ref: '#/components/schemas/mobile'
        notes:
          $ref: '#/components/schemas/notes'
        package_id:
          $ref: '#/components/schemas/package_id'
        package_number:
          $ref: '#/components/schemas/package_number'
        phone:
          $ref: '#/components/schemas/phone'
        salesorder_id:
          $ref: '#/components/schemas/salesorder_id'
        salesorder_number:
          $ref: '#/components/schemas/salesorder_number'
        shipping_address:
          $ref: '#/components/schemas/shipping_address'
        template_id:
          $ref: '#/components/schemas/template_id'
        template_name:
          $ref: '#/components/schemas/template_name'
        template_type:
          $ref: '#/components/schemas/template_type'
        total_quantity:
          $ref: '#/components/schemas/total_quantity'
        custom_fields:
          $ref: '#/components/schemas/custom_fields'
    salesorder_id:
      description: 'Unique ID generated by the server for sales order'
      type: integer
      format: int64
      example: 504366000000062000
    package_number:
      description: 'Name of the package'
      type: string
      example: PA-00001
    date:
      description: 'Date on which package is prepared'
      type: string
      example: '2017-01-11'
    so_line_item_id:
      description: 'Unique ID generated by the server for items in sales order'
      type: integer
      format: int64
      example: 504366000000062000
    quantity:
      description: 'Number of quantity of line items in sales order'
      type: number
      format: float
      example: 2
    address:
      description: 'Name of the street of the customer address'
      type: string
      example: '432, Bayside, Queens'
    city:
      description: 'Name of the city of the customer address'
      type: string
      example: 'New York City'
    state:
      description: 'Name of the state of the customer address'
      type: string
      example: 'New York'
    country:
      description: 'Name of the country of the customer address'
      type: string
      example: U.S.A
    zip:
      description: 'Zipcode of the customer address'
      type: string
      example: 11364
    phone:
      description: 'Phone number of the customer'
      type: string
      example: '+1 (999)999-9999'
    fax:
      description: 'Fax number of the customer address'
      type: string
      example: 416-765-9871
    billing_address:
      description: 'Customer billing address'
      type: object
      properties:
        address:
          $ref: '#/components/schemas/address'
        city:
          $ref: '#/components/schemas/city'
        state:
          $ref: '#/components/schemas/state'
        country:
          $ref: '#/components/schemas/country'
        zip:
          $ref: '#/components/schemas/zip'
        phone:
          $ref: '#/components/schemas/phone'
        fax:
          $ref: '#/components/schemas/fax'
    shipping_address:
      description: 'Customer shipping address'
      type: object
      properties:
        address:
          $ref: '#/components/schemas/address'
        city:
          $ref: '#/components/schemas/city'
        state:
          $ref: '#/components/schemas/state'
        country:
          $ref: '#/components/schemas/country'
        zip:
          $ref: '#/components/schemas/zip'
        phone:
          $ref: '#/components/schemas/phone'
        fax:
          $ref: '#/components/schemas/fax'
    carrier:
      description: 'Carrier used for shipment of package'
      type: string
      example: FedEx
    contact_person_id:
      description: 'Unique ID generated by the server for contact person'
      type: integer
      format: int64
      example: 504366000000062000
    contact_persons:
      description: 'Array of contact persons for the customers'
      type: array
      items:
        type: object
        properties:
          contact_person_id:
            $ref: '#/components/schemas/contact_person_id'
    created_time:
      description: 'Time at which the package was created'
      type: string
      format: date
      example: 2017-01-11T00:00:00.000Z
    customer_id:
      description: 'Unique ID generated by the for the customer'
      type: integer
      format: int64
      example: 504366000000062000
    customer_name:
      description: 'Name of the customer'
      type: string
      example: 'Peter James'
    delivery_days:
      description: 'Number of days taken by the courier for delivering in package'
      type: integer
      example: 2
    delivery_guarantee:
      description: 'guarantee assured by the courier. <code> For guaranteed on-time deliveries, it is true else it is false</code>'
      type: boolean
      example: true
    delivery_method:
      description: 'Custom delivery option created for the manual shipment'
      type: string
      example: LocalCourier
    delivery_method_id:
      description: 'Unique ID generated by the server for delivery method'
      type: integer
      format: int64
      example: 14954000000086028
    detailed_status:
      description: 'Detailed shipment details received from the courier'
      type: string
      example: 'Reached a courier facility near Toronto'
    email:
      description: 'Email of contact person'
      type: string
      example: jamespeter@pete.com
    is_emailed:
      description: 'Package is emailed to the customer or not'
      type: boolean
      example: false
    last_modified_time:
      description: 'Time at which the package details were last modified.'
      type: string
      format: date
      example: 2017-01-11T00:00:00.000Z
    description:
      description: 'Description of the item in package'
      type: string
      example: 'Mobile Sales description'
    is_invoiced:
      description: 'Sales order item is invoiced to the customer or not'
      type: boolean
      example: false
    customfield_id:
      description: 'Unique ID generated by the server for the custom field'
      type: integer
      format: int64
      example: 504366000000053100
    data_type:
      description: 'Data type of the custom field'
      type: string
      example: check_box
    index:
      description: 'Index of the custom field. It can hold any value from 1 to 10.'
      type: integer
      example: 1
    is_active:
      example: null
    label:
      description: 'Label of the custom field'
      type: string
      example: 'VAT ID'
    placeholder:
      description: 'Placeholder for the custom field'
      type: string
      example: cf-504366000000053126
    show_in_all_pdf:
      example: null
    show_on_pdf:
      example: null
    value:
      description: 'Value of the custom field'
      type: string
      example: GBGD078
    item_custom_fields:
      description: 'Custom field of the item in package'
      type: array
      items:
        type: object
        properties:
          customfield_id:
            $ref: '#/components/schemas/customfield_id'
          data_type:
            $ref: '#/components/schemas/data_type'
          index:
            $ref: '#/components/schemas/index'
          is_active:
            $ref: '#/components/schemas/is_active'
          label:
            $ref: '#/components/schemas/label'
          placeholder:
            $ref: '#/components/schemas/placeholder'
          show_in_all_pdf:
            $ref: '#/components/schemas/show_in_all_pdf'
          show_on_pdf:
            $ref: '#/components/schemas/show_on_pdf'
          value:
            $ref: '#/components/schemas/value'
    item_id:
      description: 'Unique ID generated by the server of the item in package'
      type: integer
      format: int64
      example: 504366000000053200
    item_order:
      example: null
    line_item_id:
      description: 'Unique value generated by the server for an item of sales order in package'
      type: integer
      format: int64
      example: 504366000000062100
    name:
      description: 'Name of the packaged item'
      type: string
      example: 'Apple Iphone'
    sku:
      description: 'Stock keeping unit of the item in package'
      type: string
      example: SKUM
    unit:
      description: 'Unit of the item in package'
      type: string
      example: units
    line_items:
      description: 'Details of the items in this package'
      type: array
      items:
        type: object
        properties:
          description:
            $ref: '#/components/schemas/description'
          is_invoiced:
            $ref: '#/components/schemas/is_invoiced'
          item_custom_fields:
            $ref: '#/components/schemas/item_custom_fields'
          item_id:
            $ref: '#/components/schemas/item_id'
          item_order:
            $ref: '#/components/schemas/item_order'
          line_item_id:
            $ref: '#/components/schemas/line_item_id'
          name:
            $ref: '#/components/schemas/name'
          quantity:
            $ref: '#/components/schemas/quantity'
          so_line_item_id:
            $ref: '#/components/schemas/so_line_item_id'
          sku:
            $ref: '#/components/schemas/sku'
          unit:
            $ref: '#/components/schemas/unit'
    mobile:
      description: 'Mobile number of the customer'
      type: string
      example: '+1 (999)999-9999'
    notes:
      description: 'Notes for package'
      type: string
      example: notes
    package_id:
      description: 'Unique ID generated by the server for the package'
      type: integer
      format: int64
      example: 504366000000062100
    salesorder_number:
      description: 'Name of the sales order for which package is created'
      type: string
      example: SO-00001
    service:
      description: 'Type of service selected for shipment'
      type: string
      example: FEDEX_2_DAY
    shipment_id:
      description: 'Unique ID generated by the server for the shipment'
      type: integer
      format: int64
      example: 14954000000086344
    shipment_number:
      description: 'shipment number for the package'
      type: string
      example: SN-00001
    shipment_rate:
      description: 'Costs involved for shipment'
      type: number
      format: float
      example: 52
    shipping_date:
      description: 'Date on which package is shipped'
      type: string
      format: date
      example: '2017-01-13'
    status:
      description: 'status of the shipment order'
      type: string
      example: shipped
    tracking_number:
      description: 'Tracking number of the shipment'
      type: string
      example: '794656855217'
    template_id:
      description: 'Unique ID generated by the server for the template used for package'
      type: integer
      format: int64
      example: 14954000000072020
    template_name:
      description: 'Name of the template'
      type: string
      example: 'Standard Template'
    template_type:
      description: 'Type of template'
      type: string
      example: standard
    total_quantity:
      description: 'Total quantity in the package'
      type: string
      example: 1
    custom_fields:
      description: 'Custom fields for a package.'
      type: array
      items:
        type: object
        properties:
          customfield_id:
            $ref: '#/components/schemas/customfield_id'
          value:
            $ref: '#/components/schemas/value'
    shipment_order:
      description: 'Shipment details of the package'
      type: object
      properties:
        carrier:
          $ref: '#/components/schemas/carrier'
        delivery_days:
          $ref: '#/components/schemas/delivery_days'
        delivery_guarantee:
          $ref: '#/components/schemas/delivery_guarantee'
        delivery_method:
          $ref: '#/components/schemas/delivery_method'
        delivery_method_id:
          $ref: '#/components/schemas/delivery_method_id'
        detailed_status:
          $ref: '#/components/schemas/detailed_status'
        notes:
          $ref: '#/components/schemas/notes'
        service:
          $ref: '#/components/schemas/service'
        shipment_id:
          $ref: '#/components/schemas/shipment_id'
        shipment_number:
          $ref: '#/components/schemas/shipment_number'
        shipment_rate:
          $ref: '#/components/schemas/shipment_rate'
        shipping_date:
          $ref: '#/components/schemas/shipping_date'
        status:
          $ref: '#/components/schemas/status'
        tracking_number:
          $ref: '#/components/schemas/tracking_number'
    package:
      type: array
      items:
        $ref: '#/components/schemas/package-response'
    sort_column:
      description: 'sorting column. it can have values as <code>tracking_number|salesorder_number|package_number|date|created_time|last_modified_time|customer_name|customer_id|shipment_date|quantity|delivery_method</code>'
      type: string
      example: created_by
    filter_by:
      description: 'filter the packages by status. Status can be <code>All|NotShipped|Shipped|Delivered</code> For example: Status.All'
      type: string
      example: Status.All
    search_text:
      description: 'search the packages by text'
      type: string
      example: PK-00001
    packing_number_startswith:
      description: 'Used for searching package_id which starts with given number in advanced search option'
      type: integer
      format: int64
      example: 504366
    packing_number_contains:
      description: 'Used for searching package_id which contains given number in advanced search option'
      type: integer
      format: int64
      example: 66000
    salesorder_number_startswith:
      description: 'Used for searching salesorder_id which starts with given number in advanced search option'
      type: integer
      format: int64
      example: 504366
    salesorder_number_contains:
      description: 'Used for searching salesorder_id which contains given number in advanced search option'
      type: integer
      format: int64
      example: 66000
    customer_name_startswith:
      description: 'Used for searching salesorder_id which starts with given number in advanced search option'
      type: string
      example: sam
    customer_name_contains:
      description: 'Used for searching salesorder_id which contains given number in advanced search option'
      type: string
      example: ethan
    delivery_method_startswith:
      description: 'Used for searching delivery_method which starts with given string in advanced search option'
      type: string
      example: sam
    delivery_method_contains:
      description: 'Used for searching delivery_method which contains given string in advanced search option'
      type: string
      example: ethan
    shipment_date_start:
      description: 'Used for searching shipments from specified date <code>Use the node as shipment_date_after if specified date is not to be considered</code>'
      type: string
      format: date
      example: 2017-01-10T00:00:00.000Z
    shipment_date_end:
      description: 'Used for searching shipments till specified date <code>Use the node as shipment_date_before if specified date is not to be considered</code>'
      type: string
      format: date
      example: 2017-01-14T00:00:00.000Z
    date_start:
      description: 'Used for searching packages from specified date <code>Use the node as date_after if specified date is not to be considered</code>'
      type: string
      format: date
      example: 2017-01-10T00:00:00.000Z
    date_end:
      description: 'Used for searching packages till specified date <code>Use the node as date_before if specified date is not to be considered</code>'
      type: string
      format: date
      example: 2017-01-14T00:00:00.000Z
    package_ids:
      description: 'Export packages as pdf and print them. <code>List of package ids separated by comma</code>'
      type: string
      example: 5.0436600000006205e+35
    creating-a-package-request:
      type: object
      required:
        - date
        - line_items
      properties:
        package_number:
          $ref: '#/components/schemas/package_number'
        date:
          $ref: '#/components/schemas/date'
        custom_fields:
          $ref: '#/components/schemas/custom_fields'
        line_items:
          description: 'Details of the items in this package'
          type: array
          items:
            type: object
            properties:
              so_line_item_id:
                $ref: '#/components/schemas/so_line_item_id'
              quantity:
                $ref: '#/components/schemas/quantity'
        notes:
          $ref: '#/components/schemas/notes'
    creating-a-package-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: 'Package created successfully. It''s now time to ship!'
          readOnly: true
        package:
          $ref: '#/components/schemas/package'
    list-all-packages-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: success
          readOnly: true
        packagea:
          type: array
          items:
            type: object
            properties:
              created_time:
                $ref: '#/components/schemas/created_time'
              customer_id:
                $ref: '#/components/schemas/customer_id'
              customer_name:
                $ref: '#/components/schemas/customer_name'
              date:
                $ref: '#/components/schemas/date'
              email:
                $ref: '#/components/schemas/email'
              is_emailed:
                $ref: '#/components/schemas/is_emailed'
              last_modified_time:
                $ref: '#/components/schemas/last_modified_time'
              mobile:
                $ref: '#/components/schemas/mobile'
              notes:
                $ref: '#/components/schemas/notes'
              package_id:
                $ref: '#/components/schemas/package_id'
              package_number:
                $ref: '#/components/schemas/package_number'
              phone:
                $ref: '#/components/schemas/phone'
              salesorder_id:
                $ref: '#/components/schemas/salesorder_id'
              salesorder_number:
                $ref: '#/components/schemas/salesorder_number'
              template_id:
                $ref: '#/components/schemas/template_id'
              template_name:
                $ref: '#/components/schemas/template_name'
              template_type:
                $ref: '#/components/schemas/template_type'
              total_quantity:
                $ref: '#/components/schemas/total_quantity'
              custom_fields:
                $ref: '#/components/schemas/custom_fields'
    retrieving-a-package-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: success
          readOnly: true
        package:
          type: array
          items:
            type: object
            properties:
              billing_address:
                $ref: '#/components/schemas/billing_address'
              contact_persons:
                $ref: '#/components/schemas/contact_persons'
              created_time:
                $ref: '#/components/schemas/created_time'
              customer_id:
                $ref: '#/components/schemas/customer_id'
              customer_name:
                $ref: '#/components/schemas/customer_name'
              date:
                $ref: '#/components/schemas/date'
              email:
                $ref: '#/components/schemas/email'
              is_emailed:
                $ref: '#/components/schemas/is_emailed'
              last_modified_time:
                $ref: '#/components/schemas/last_modified_time'
              line_items:
                $ref: '#/components/schemas/line_items'
              mobile:
                $ref: '#/components/schemas/mobile'
              notes:
                $ref: '#/components/schemas/notes'
              package_id:
                $ref: '#/components/schemas/package_id'
              package_number:
                $ref: '#/components/schemas/package_number'
              phone:
                $ref: '#/components/schemas/phone'
              salesorder_id:
                $ref: '#/components/schemas/salesorder_id'
              salesorder_number:
                $ref: '#/components/schemas/salesorder_number'
              shipment_order:
                $ref: '#/components/schemas/shipment_order'
              shipping_address:
                $ref: '#/components/schemas/shipping_address'
              template_id:
                $ref: '#/components/schemas/template_id'
              template_name:
                $ref: '#/components/schemas/template_name'
              template_type:
                $ref: '#/components/schemas/template_type'
              total_quantity:
                $ref: '#/components/schemas/total_quantity'
              custom_fields:
                $ref: '#/components/schemas/custom_fields'
    updating-a-package-request:
      type: object
      required:
        - date
        - line_items
      properties:
        package_number:
          $ref: '#/components/schemas/package_number'
        date:
          $ref: '#/components/schemas/date'
        custom_fields:
          $ref: '#/components/schemas/custom_fields'
        line_items:
          description: 'Details of the items in this package'
          type: array
          items:
            type: object
            properties:
              line_item_id:
                $ref: '#/components/schemas/line_item_id'
              so_line_item_id:
                $ref: '#/components/schemas/so_line_item_id'
              quantity:
                $ref: '#/components/schemas/quantity'
        notes:
          $ref: '#/components/schemas/notes'
    updating-a-package-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: 'Package Updated Successfully.'
          readOnly: true
        package:
          $ref: '#/components/schemas/package'
    deleting-a-package-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: 'Whooooosh! Package Deleted Successfully.'
          readOnly: true
    bulk-print-packages-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: success
          readOnly: true
  securitySchemes:
    Zoho_Auth:
      type: oauth2
      flows:
        implicit:
          authorizationUrl: 'https://accounts.zoho.com/oauth/v2/auth'
          scopes:
            ZohoInventory.packages.CREATE: 'Create Packages'
            ZohoInventory.packages.READ: 'Read Packages'
            ZohoInventory.packages.UPDATE: 'Update Packages'
            ZohoInventory.packages.DELETE: 'Delete Packages'
