> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getspecs.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Get purchase orders report field schema

> Merge fields for purchase orders pdf templates. Fixed per report kind, not per workspace.



## OpenAPI

````yaml /openapi.yaml get /reports/purchase_orders_list/schema
openapi: 3.0.1
info:
  title: GetSpecs REST API
  description: REST API documentation for GetSpecs.
  version: 1.0.0
servers:
  - url: /v1
  - url: https://demo-api.getspecs.io/v1
security: []
paths:
  /reports/purchase_orders_list/schema:
    get:
      tags:
        - Report
      summary: Get purchase orders report field schema
      description: >-
        Merge fields for purchase orders pdf templates. Fixed per report kind,
        not per workspace.
      operationId: reports/purchase_orders_list#schema
      parameters:
        - name: X-Workspace-ID
          in: header
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/report_purchase_orders_list_schema'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
      security:
        - apiKey: []
          workspaceId: []
components:
  schemas:
    report_purchase_orders_list_schema:
      type: object
      description: >-
        Available merge fields for purchase orders report templates. Fixed per
        report kind: the `workspace` and `project` records (`project` resolves
        to nulls unless the report is generated with a `project_id`) plus the
        `purchase_orders` collection: one row per order, in list order, with the
        list totals. `status` is its label (Draft, Open, ...); `projects` the
        item projects' names joined with ", "; amounts (`format: currency`) are
        "USD 1,234.50" strings in the order's currency, plain numbers without
        one. Plus `purchase_order_items`: each row's items, nested in the rows.
      properties:
        workspace:
          $ref: '#/components/schemas/report_schema_record'
        project:
          $ref: '#/components/schemas/report_schema_record'
        purchase_orders:
          type: object
          properties:
            name:
              type: string
            type:
              type: string
              enum:
                - collection
            fields:
              type: object
              additionalProperties:
                type: object
                properties:
                  type:
                    type: string
                    enum:
                      - string
                      - strings
                      - number
                      - date
                      - boolean
                  name:
                    type: string
                  whitelist_values:
                    type: array
                    items:
                      type: string
                  format:
                    type: string
                    enum:
                      - currency
                required:
                  - type
                  - name
          required:
            - name
            - type
            - fields
        purchase_order_items:
          description: >-
            Each row's items, the same collection as in the single purchase
            order pdf. Never a list of its own: each row of `purchase_orders`
            nests its items under `purchase_order_items` (`{{#each
            purchase_order_items}}` inside `{{#each purchase_orders}}`) when
            `used_fields.collections` names `purchase_order_items`.
          type: object
          properties:
            name:
              type: string
            type:
              type: string
              enum:
                - collection
            fields:
              type: object
              additionalProperties:
                type: object
                properties:
                  type:
                    type: string
                    enum:
                      - string
                      - strings
                      - number
                      - date
                      - boolean
                  name:
                    type: string
                  whitelist_values:
                    type: array
                    items:
                      type: string
                  format:
                    type: string
                    enum:
                      - currency
                required:
                  - type
                  - name
          required:
            - name
            - type
            - fields
      required:
        - workspace
        - project
        - purchase_orders
        - purchase_order_items
    error:
      type: object
      properties:
        error:
          type: string
        errors:
          type: array
          items:
            type: object
            properties:
              field:
                type: string
                nullable: true
              code:
                type: string
                nullable: true
              message:
                type: string
            required:
              - message
    report_schema_record:
      type: object
      properties:
        name:
          type: string
        type:
          type: string
          enum:
            - record
        fields:
          type: object
          additionalProperties:
            type: object
            properties:
              type:
                type: string
                enum:
                  - string
                  - image
                  - date
              name:
                type: string
            required:
              - type
              - name
      required:
        - name
        - type
        - fields
  securitySchemes:
    apiKey:
      type: apiKey
      name: authorization
      in: header
    workspaceId:
      type: apiKey
      name: X-Workspace-ID
      in: header

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.