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

# Create a puchase order

> Create a puchase order

```jsonc Body raw (json) wrap expandable theme={null}
{
  "vendor_type",// required | string | acceptable_values: third_party,integrated
  "vendor_id",// nullable | required, if vendor_type is third_party | existing vendor id
  "vendor_name",// required if vendor_type is integrated | string | acceptable_values: reece
  "tax_rate",// optional | string
  "title",// required | string | max:255
  "status",// optional | string | acceptable_values: compose,draft,ordered,pending,route,ready_for_pickup,partially_received,received,completed,canceled,issue
  "payment_status",// optional | string | acceptable_values: unpaid,partially_paid,paid
  "comment",// optional | string | max:5000
  "order_at",// required | timestamp
  "expected_delivery_at",// required | timestamp
  "received_at",// optional | timestamp
  "customer_id",// nullable | integer | existing customer id
  "job_id",// nullable | integer | existing job id
  "project_id",// nullable | integer | existing project id
  "invoice_id",// nullable | integer | existing invoice id
  "assigned_id",// required | integer | existing user id
  "order_email",// required | email | max:255
  "delivery_method",// required | string | acceptable_values: delivery,pickup
  "delivery_address",// string | required, if vendor_type is integrated,vendor_name is reece,delivery_method is delivery
  "delivery_flat",// optional | string
  "delivery_city",// string | required, if vendor_type is integrated,vendor_name is reece,delivery_method is delivery
  "delivery_state",// string | required, if vendor_type is integrated,vendor_name is reece,delivery_method is delivery
  "delivery_postcode",// string | required, if vendor_type is integrated,vendor_name is reece,delivery_method is delivery
  "delivery_instruction",// optional | string
  "pickup_branch_id",// required, if vendor_type is integrated,vendor_name is reece,delivery_method is pickup
  "order_number",// required, if vendor_type is integrated,vendor_name is reece or reece-us | string | max:255
  "order_phone",// optional | string | description: valid phone number
  "items": [// optional | array
    {
      "id",// nullable | integer
      "item_id",// required | integer
      "title",// required | string | max:400
      "type",// required | string | acceptable_values: reece,fieldpulse
      "unit_measure",// required, if type is reece | string | max:10
      "unit_cost",// required | string | max:10
      "is_taxed",// optional | boolean
      "tax_rate",// optional | string
      "quantity",// required | string | max:10
      "payment_status"// required | string | acceptable_values: unpaid,paid
    }
  ],
  "customfields": [ // optional | array | description: array of custom fleds
        {
            "id", // optional | nullable | required if field_instance_id is not set | integer | custom field id
            "field_instance_id", // optional | nullable | required if id is not set | integer | custom field instance id
            "value" // required | string | custom value
        },
        {
            "id", // optional | nullable | required if field_instance_id is not set | integer | custom field id
            "field_instance_id", // optional | nullable | required if id is not set | integer | custom field instance id
            "value" // required | string | custom value
        }
    ]
}
```


## OpenAPI

````yaml post /purchase-orders
openapi: 3.0.0
info:
  title: FieldPulse API
  description: >-
    REST API for the FieldPulse field service management platform.


    **Authentication:** All requests require an `x-api-key` header. Contact
    support@fieldpulse.com to obtain your API key.


    **Important:** The API Playground below makes live requests against your
    production data. Use caution when testing write operations (POST, PUT,
    DELETE).
  version: 1.0.0
servers:
  - url: https://ywe3crmpll.execute-api.us-east-2.amazonaws.com/stage
    description: Production
security:
  - apiKeyAuth: []
tags:
  - name: Assets
    description: Endpoints related to assets
  - name: Assets Category
    description: Endpoints related to assets category
  - name: Comments
    description: Endpoints related to comments
  - name: Company Profile
    description: Endpoints related to contracts
  - name: Contracts
    description: Endpoints related to contracts
  - name: Customers
    description: Endpoints related to customers
  - name: Custom Fields
    description: Endpoints related to custom fields
  - name: Estimates
    description: Endpoints related to estimates
  - name: Invoices
  - name: Items
  - name: Jobs
  - name: Lead Source
  - name: Locations
  - name: Material Lists
  - name: Payments
  - name: Pipeline Status
  - name: Projects
  - name: Purchase Orders
  - name: Subtasks
  - name: Tags
  - name: Teams
  - name: Timesheets
  - name: Users
  - name: Vendors
  - name: Version
paths:
  /purchase-orders:
    post:
      tags:
        - Purchase Orders
      summary: Create a puchase order
      description: Create a puchase order
      operationId: postPurchaseOrders
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                vendor_type:
                  type: string
                  enum:
                    - third_party
                    - integrated
                vendor_id:
                  type: string
                  nullable: true
                  description: Required if vendor_type is third_party. Existing vendor id.
                vendor_name:
                  type: string
                  enum:
                    - reece
                  description: Required if vendor_type is integrated.
                tax_rate:
                  type: string
                title:
                  type: string
                  maxLength: 255
                status:
                  type: string
                  enum:
                    - compose
                    - draft
                    - ordered
                    - pending
                    - route
                    - ready_for_pickup
                    - partially_received
                    - received
                    - completed
                    - canceled
                    - issue
                payment_status:
                  type: string
                  enum:
                    - unpaid
                    - partially_paid
                    - paid
                comment:
                  type: string
                  maxLength: 5000
                order_at:
                  type: integer
                  description: Unix timestamp.
                expected_delivery_at:
                  type: integer
                  description: Unix timestamp.
                received_at:
                  type: integer
                  description: Unix timestamp.
                customer_id:
                  type: integer
                  nullable: true
                  description: Existing customer id.
                job_id:
                  type: integer
                  nullable: true
                  description: Existing job id.
                project_id:
                  type: integer
                  nullable: true
                  description: Existing project id.
                invoice_id:
                  type: integer
                  nullable: true
                  description: Existing invoice id.
                assigned_id:
                  type: integer
                  description: Existing user id.
                order_email:
                  type: string
                  format: email
                  maxLength: 255
                delivery_method:
                  type: string
                  enum:
                    - delivery
                    - pickup
                delivery_address:
                  type: string
                  description: >-
                    Required if vendor_type is integrated,vendor_name is
                    reece,delivery_method is delivery.
                delivery_flat:
                  type: string
                delivery_city:
                  type: string
                  description: >-
                    Required if vendor_type is integrated,vendor_name is
                    reece,delivery_method is delivery.
                delivery_state:
                  type: string
                  description: >-
                    Required if vendor_type is integrated,vendor_name is
                    reece,delivery_method is delivery.
                delivery_postcode:
                  type: string
                  description: >-
                    Required if vendor_type is integrated,vendor_name is
                    reece,delivery_method is delivery.
                delivery_instruction:
                  type: string
                pickup_branch_id:
                  type: string
                  description: >-
                    Required if vendor_type is integrated,vendor_name is
                    reece,delivery_method is pickup.
                order_number:
                  type: string
                  maxLength: 255
                  description: >-
                    Required if vendor_type is integrated,vendor_name is reece
                    or reece-us.
                order_phone:
                  type: string
                  description: Valid phone number.
                items:
                  type: array
                  items:
                    type: object
                    properties:
                      id:
                        type: integer
                        nullable: true
                      item_id:
                        type: integer
                      title:
                        type: string
                        maxLength: 400
                      type:
                        type: string
                        enum:
                          - reece
                          - fieldpulse
                      unit_measure:
                        type: string
                        maxLength: 10
                        description: Required if type is reece.
                      unit_cost:
                        type: string
                        maxLength: 10
                      is_taxed:
                        type: boolean
                      tax_rate:
                        type: string
                      quantity:
                        type: string
                        maxLength: 10
                      payment_status:
                        type: string
                        enum:
                          - unpaid
                          - paid
                    required:
                      - item_id
                      - title
                      - type
                      - unit_cost
                      - quantity
                      - payment_status
                customfields:
                  type: array
                  items:
                    type: object
                    properties:
                      id:
                        type: integer
                        nullable: true
                        description: >-
                          Required if field_instance_id is not set. Custom field
                          id.
                      field_instance_id:
                        type: integer
                        nullable: true
                        description: Required if id is not set. Custom field instance id.
                      value:
                        type: string
                        description: Custom value.
                    required:
                      - value
                  description: Array of custom fields.
              required:
                - vendor_type
                - title
                - order_at
                - expected_delivery_at
                - assigned_id
                - order_email
                - delivery_method
            example:
              vendor_type: third_party
              vendor_id: some string
              vendor_name: reece
              tax_rate: some string
              title: some string
              status: compose
              payment_status: unpaid
              comment: some string
              order_at: 1234567890
              expected_delivery_at: 1234567890
              received_at: 1234567890
              customer_id: 1
              job_id: 1
              project_id: 1
              invoice_id: 1
              assigned_id: 1
              order_email: user@example.com
              delivery_method: delivery
              delivery_address: some string
              delivery_flat: some string
              delivery_city: some string
              delivery_state: some string
              delivery_postcode: some string
              delivery_instruction: some string
              pickup_branch_id: some string
              order_number: some string
              order_phone: '+12345678'
              items:
                - id: 1
                  item_id: 1
                  title: some string
                  type: reece
                  unit_measure: some string
                  unit_cost: some string
                  is_taxed: true
                  tax_rate: some string
                  quantity: some string
                  payment_status: unpaid
              customfields:
                - id: 1
                  field_instance_id: 1
                  value: some string
                - id: 1
                  field_instance_id: 1
                  value: some string
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: boolean
                    description: false when the request succeeds.
                    example: false
                  response:
                    type: object
                    description: The created record.
        '400':
          description: Bad Request
          content:
            application/json:
              example:
                error: true
                errors:
                  - error message
                  - error message
        '401':
          description: Unauthorized
          content:
            application/json:
              example:
                message: Unauthorized
        '404':
          description: Not Found
          content:
            application/json:
              example:
                message: Request URL not found
        '500':
          description: Internal Server Error
          content:
            application/json:
              example:
                message: Internal Server Error
components:
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````

## Related topics

- [How to Manage Purchase Orders](/inventory-materials/purchase-orders/managing.md)
- [How to Create a Reece Purchase Order](/integrations/suppliers/reece-max/purchase-orders.md)
- [How to Create Purchase Order Reports](/reporting/raw-data/purchase-order-reports.md)
- [How to Create a Job](/jobs/jobs-tasks/creating-a-job.md)
- [How to Create an Invoice](/estimates-invoices/creating/invoice.md)


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