Skip to main content

Create Purchase Orders

POST 

https://secure.fleetio.com/api/v1/purchase_orders

Creates a new Purchase Order

Request

Body

    descriptionstringnullable
    label_listLabelListParameters (string)

    A comma separated list of tags associated with this record. The only delimiter allowed is a comma (,). Please remove any commas from your labels before saving the record.

    Possible values: <= 255 characters

    Example: High Priority
    vendor_idId (integer)

    Possible values: >= 1

    part_location_idinteger

    The Fleetio ID of the Part Location for the Part being purchased.

    Possible values: >= 1

    numberPurchaseOrderNumber (integer)required

    Must be unique within the scope of your Account. You can either generate your own number or leave it blank and Fleetio will generate one for you. Fleetio will use the next number in the sequence based on your existing Purchase Orders. This becomes the unique identifier, even in endpoints. Id is never used.

    Example: 1207
    discount_typeDiscountType (string)nullable

    The type of discount applied to this record.

    Possible values: [fixed, percentage]

    Default value: percentage
    discount_percentagefloat

    The discount percentage. This field should be present when discount_type is set to percentage.

    discountnumber

    The actual value of the discount

    shippingnumber

    The cost of shipping

    tax_1_percentagenumber

    The primary tax percentage amount. This field should be present when tax_1_type is set to percentage.

    tax_1float

    The primary tax amount.

    tax_1_typeTaxType (string)nullable

    The type of tax to apply to this record.

    Possible values: [fixed, percentage]

    Default value: percentage
    tax_2_percentagenumber

    The secondary tax percentage amount. This field should be present when tax_2_type is set to percentage. Note that this secondary tax must be configured in your Account Settings.

    tax_2float

    The secondary tax amount. Note that this secondary tax must be configured in your Account Settings.

    tax_2_typeTaxType (string)nullable

    The type of tax to apply to this record.

    Possible values: [fixed, percentage]

    Default value: percentage
    custom_fieldsobjectnullable

    *Full details on working with Custom Fields here.

    purchase_order_line_items_attributes object[]
  • Array [
  • part_idinteger

    The Fleetio ID of the Part being purchased.

    Possible values: >= 1

    quantityinteger

    How many of this Part to be purchased.

    Possible values: >= 0

    unit_costfloat

    The cost of this Part (per unit).

  • ]

Responses

OK

Response Headers
    Schema
      idId (integer)required

      Possible values: >= 1

      created_atdate-time

      The date and time at which this record was created.

      Example: 2023-03-14T13:46:27-06:00
      updated_atdate-time

      The date and time at which this record was most recently updated.

      Example: 2023-03-14T13:46:27-06:00
      discount_typeDiscountType (string)nullablerequired

      The type of discount applied to this record.

      Possible values: [fixed, percentage]

      Default value: percentage
      discount_percentagefloatnullablerequired

      The discount percentage. This field should be present when discount_type

      is set to percentage.

      Example: 1.23
      discount_centsintegernullable

      The discount amount in cents.

      tax_1_typeTaxType (string)nullablerequired

      The type of tax to apply to this record.

      Possible values: [fixed, percentage]

      Default value: percentage
      tax_1_percentagefloatnullablerequired

      The primary tax percentage amount. This field should be present when tax_1_type is set to percentage.

      Example: 1.23
      tax_1_centsintegernullable

      The primary tax amount in cents.

      Example: 123
      tax_2_typeTaxType (string)nullablerequired

      The type of tax to apply to this record.

      Possible values: [fixed, percentage]

      Default value: percentage
      tax_2_percentagefloatnullablerequired

      The secondary tax percentage amount. This field should be present when tax_2_type is set to percentage. Note that this secondary tax must be configured in your Account Settings.

      Example: 1.23
      tax_2_centsintegernullable

      The secondary tax amount in cents.

      shipping_centsintegernullable

      The shipping amount in cents.

      account_idId (integer)required

      Possible values: >= 1

      numberPurchaseOrderNumber (integer)required

      Must be unique within the scope of your Account. You can either generate your own number or leave it blank and Fleetio will generate one for you. Fleetio will use the next number in the sequence based on your existing Purchase Orders. This becomes the unique identifier, even in endpoints. Id is never used.

      Example: 1207
      descriptionstringnullablerequired

      Open text field for Purchase Order description.

      label_liststring[]required

      A list of tags associated with this record.

      Possible values: <= 255 characters

      submitted_for_approval_atdate-timenullablerequired

      The date and time at which this Purchase Order was submitted for approval.

      Example: 2023-03-14T13:46:27-06:00
      rejected_atdate-timenullablerequired

      The date and time at which this Purchase Order was rejected.

      Example: 2023-03-14T13:46:27-06:00
      approved_atdate-timenullablerequired

      The date and time at which this Purchase Order was approved.

      Example: 2023-03-14T13:46:27-06:00
      purchased_atdate-timenullablerequired

      The date and time at which this Purchase Order was purchased.

      Example: 2023-03-14T13:46:27-06:00
      received_partial_atdate-timenullablerequired

      The date and time at which this Purchase Order was partially received.

      Example: 2023-03-14T13:46:27-06:00
      received_full_atdate-timenullablerequired

      The date and time at which this Purchase Order was fully received.

      Example: 2023-03-14T13:46:27-06:00
      closed_atdate-timenullablerequired

      The date and time at which this Purchase Order was closed.

      Example: 2023-03-14T13:46:27-06:00
      statePurchaseOrderState (string)nullablerequired

      See the Purchase Order Lifecycle Guide for more information about Purchase Order states and how to transition between them.

      Possible values: [draft, submitted_for_approval, rejected, approved, purchased, received_partial, received_full, closed]

      custom_fieldsobjectnullablerequired

      *Full details on working with Custom Fields here.

      part_location_idintegernullablerequired

      The ID of the Part Location associated with this Purchase Order. Optional in the draft state.

      Possible values: >= 1

      vendor_idintegernullablerequired

      The ID of the Vendor associated with this Purchase Order.

      Possible values: >= 1

      purchase_order_status_idNullableId (integer)nullable

      Possible values: >= 1

      created_by_idintegernullable

      The ID of the Vendor associated with the User who created this Purchase Order.

      Possible values: >= 1

      rejected_by_idintegernullable

      The ID of the Vendor associated with the User who closed this Purchase Order.

      Possible values: >= 1

      submitted_for_approval_by_idintegernullable

      The ID of the Vendor associated with the User who submitted this Purchase Order for approval.

      Possible values: >= 1

      approved_by_idintegernullable

      The ID of the Vendor associated with the User who approved this Purchase Order.

      Possible values: >= 1

      purchased_by_idintegernullable

      The ID of the Vendor associated with the User who purchased this Purchase Order.

      Possible values: >= 1

      received_partial_by_idintegernullable

      The ID of the Vendor associated with the User who partially received this Purchase Order.

      Possible values: >= 1

      received_full_by_idintegernullable

      The ID of the Vendor associated with the User who fully received this Purchase Order.

      Possible values: >= 1

      closed_by_idintegernullable

      The ID of the Vendor associated with the User who closed this Purchase Order.

      Possible values: >= 1

      documents_countintegernullablerequired

      The number of documents attached to this Purchase Order.

      comments_countintegernullablerequired

      The number of Comments on this Purchase Order.

      subtotal_centsintegernullable

      The subtotal amount in cents.

      total_amount_centsintegernullable

      The total amount in cents.

      watchers_countinteger

      The count of watchers associated with the record.

      watchable_optionsobject

      Options related to watching the record.

      bulk_watch_recordboolean

      Indicates if a bulk watch record is created.

      skip_automatic_watchers_callbacksboolean

      Indicates if automatic watchers callbacks are skipped.

    Authorization: Authorization

    name: Authorizationtype: apiKeyin: headerdescription: Prefix the value with "Token", for example: "Token 76cbe06c49a64".
    You can generate a new API key [here](https://secure.fleetio.com/api_keys).
    name: Account-Tokentype: apiKeyin: headerdescription: You can find your Account-Token [here](https://secure.fleetio.com/api_keys)
    curl -L 'https://secure.fleetio.com/api/v1/purchase_orders' \
    -H 'Content-Type: application/json' \
    -H 'Accept: application/json' \
    -H 'Authorization: Token <Authorization>' \
    -H 'Account-Token: <Authorization>' \
    -d '{
    "description": "string",
    "label_list": "High Priority",
    "vendor_id": 0,
    "part_location_id": 0,
    "number": 1207,
    "discount_type": "percentage",
    "discount_percentage": 0,
    "discount": 0,
    "shipping": 0,
    "tax_1_percentage": 0,
    "tax_1": 0,
    "tax_1_type": "percentage",
    "tax_2_percentage": 0,
    "tax_2": 0,
    "tax_2_type": "percentage",
    "custom_fields": {},
    "purchase_order_line_items_attributes": [
    {
    "part_id": 0,
    "quantity": 0,
    "unit_cost": 0
    }
    ]
    }'
    Request Collapse all
    Base URL
    https://secure.fleetio.com/api
    Auth
    Body
    {
      "description": "string",
      "label_list": "High Priority",
      "vendor_id": 0,
      "part_location_id": 0,
      "number": 1207,
      "discount_type": "percentage",
      "discount_percentage": 0,
      "discount": 0,
      "shipping": 0,
      "tax_1_percentage": 0,
      "tax_1": 0,
      "tax_1_type": "percentage",
      "tax_2_percentage": 0,
      "tax_2": 0,
      "tax_2_type": "percentage",
      "custom_fields": {},
      "purchase_order_line_items_attributes": [
        {
          "part_id": 0,
          "quantity": 0,
          "unit_cost": 0
        }
      ]
    }
    
    ResponseClear

    Click the Send API Request button above and see the response here!