---
title: "[beta] Create a purchase order"
method: POST
path: "/maintenance/purchase-orders"
tags: ["Beta APIs"]
---

# \[beta\] Create a purchase order

`POST /maintenance/purchase-orders`

## Request

- Base URL: `https://api.samsara.com`
- URL: `https://api.samsara.com/maintenance/purchase-orders`
- Auth: HTTP bearer

Creates a purchase order for the organization.

 <b>Rate limit:</b> 5 requests/sec (learn more about rate limits <a href="https://developers.samsara.com/docs/rate-limits" target="_blank">here</a>).

To use this endpoint, select **Write Purchase Orders** under the Work Orders category when creating or editing an API token. <a href="https://developers.samsara.com/docs/authentication#scopes-for-api-tokens" target="_blank">Learn More.</a>
 

 **Submit Feedback**: Likes, dislikes, and API feature requests should be filed as feedback in our <a href="https://forms.gle/zkD4NCH7HjKb7mm69" target="_blank">API feedback form</a>. If you encountered an issue or noticed inaccuracies in the API documentation, please <a href="https://www.samsara.com/help" target="_blank">submit a case</a> to our support team.

## Request body

- EntityPurchaseOrdersServiceCreatePurchaseOrderRequestBody: Request body for creating a PurchaseOrder
  - `glCode` string: General ledger code associated with this purchase order.
  - `invoiceNumber` string: Vendor invoice number associated with this purchase order.
  - `notes` string: Free-text notes for the purchase order.
  - `orderStatus` 'Unknown' | 'Draft' | 'Open' | 'InReview' | 'Approved' | 'Rejected' | 'SentToVendor' | 'PartiallyReceived' | 'FullyReceived' | 'Returned' | 'Cancelled' | 'Closed', required: Current customer-visible status of the purchase order. Valid values: `Unknown`, `Draft`, `Open`, `InReview`, `Approved`, `Rejected`, `SentToVendor`, `PartiallyReceived`, `FullyReceived`, `Returned`, `Cancelled`, `Closed`
  - `otherCost` CreatePurchaseOrderEntityPurchaseOrderMoneyInputPublicVariantc9366b66e6fcTypeRequestBody: Money object
    - `amount` string, required: Monetary amount as a decimal string in major currency units (e.g. "24.50").
    - `currency` string, required: ISO 4217 currency code, lowercased (e.g. "usd").
  - `parts` CreatePurchaseOrderEntityPurchaseOrderPurchaseOrderPartInputPublicVariantfe4658938a0fTypeRequestBody[]: Parts ordered on the purchase order.
    - `batchNumber` string: Batch or lot number for the ordered part.
    - `coreCharge` CreatePurchaseOrderEntityPurchaseOrderPurchaseOrderCoreChargeInputTypeRequestBody: PurchaseOrderCoreCharge object
      - `coreChargeStatus` 'Unknown' | 'Active' | 'RemovedOrDisabled', required: Whether the core charge is active or removed or disabled. Valid values: `Unknown`, `Active`, `RemovedOrDisabled`
      - `corePartSamsaraId` string: ID of the returnable core part.
      - `recoverabilityPolicy` CreatePurchaseOrderEntityPurchaseOrderCoreRecoverabilityPolicyInputTypeRequestBody: CoreRecoverabilityPolicy object
        - `fixedRecoverableUntilTime` string: Absolute deadline for core return.
        - `policyType` 'Unknown' | 'RelativeToReceipt' | 'FixedDate' | 'NoDeadline', required: Recoverability policy type. Valid values: `Unknown`, `RelativeToReceipt`, `FixedDate`, `NoDeadline`
        - `relativeWindowDuration` integer: Duration after receipt when the core must be returned. Measured in milliseconds.
      - `returnRecipientVendorId` string: ID of the vendor that receives returned cores.
      - `unitCoreAmount` CreatePurchaseOrderEntityPurchaseOrderMoneyInputTypeRequestBody: Money object
        - `amount` string, required: Monetary amount as a decimal string in major currency units (e.g. "24.50").
        - `currency` string, required: ISO 4217 currency code, lowercased (e.g. "usd").
    - `description` string: Description of the ordered part.
    - `lineItemId` string: Stable identifier for the purchase order line.
    - `partSamsaraId` string, required: ID of the part definition ordered on this line.
    - `placeId` string: Place linked to the maintenance site holding this line's inventory. The internal location identifier is never exposed.
    - `quantityOrdered` number, double, required: Quantity ordered on this line.
    - `quantityReceived` number, double, required: Quantity received on this line.
    - `tax` CreatePurchaseOrderEntityPurchaseOrderTaxAdjustmentInputTypeRequestBody: TaxAdjustment object
      - `basisPoints` integer: Tax rate in basis points. Set exactly one of money or basisPoints.
      - `money` CreatePurchaseOrderEntityPurchaseOrderMoneyInputTypeRequestBody: Money object
        - `amount` string, required: Monetary amount as a decimal string in major currency units (e.g. "24.50").
        - `currency` string, required: ISO 4217 currency code, lowercased (e.g. "usd").
    - `unitCost` CreatePurchaseOrderEntityPurchaseOrderMoneyInputPublicVariantc9366b66e6fcTypeRequestBody: Money object
      - `amount` string, required: Monetary amount as a decimal string in major currency units (e.g. "24.50").
      - `currency` string, required: ISO 4217 currency code, lowercased (e.g. "usd").
    - `unitOfMeasureType` 'Unknown' | 'Each' | 'Set' | 'Pack' | 'Box' | 'Pound' | 'Kilogram' | 'Ounce' | 'Liter' | 'Milliliter' | 'Gallon' | 'Quart' | 'FluidOunce' | 'Inch' | 'Foot' | 'Meter' | 'Yard' | 'SquareFoot' | 'SquareMeter' | 'Pint' | 'Hundred' | 'Roll', required: Unit of measure for quantities on this line. Read-only: derived from the line's part definition, and ignored if supplied on create or update. Valid values: `Unknown`, `Each`, `Set`, `Pack`, `Box`, `Pound`, `Kilogram`, `Ounce`, `Liter`, `Milliliter`, `Gallon`, `Quart`, `FluidOunce`, `Inch`, `Foot`, `Meter`, `Yard`, `SquareFoot`, `SquareMeter`, `Pint`, `Hundred`, `Roll`
  - `poNumberPrefix` string: Optional prefix included in the purchase order number.
  - `poNumberSuffix` string: Optional suffix included in the purchase order number.
  - `tax` CreatePurchaseOrderEntityPurchaseOrderTaxAdjustmentInputTypeRequestBody: TaxAdjustment object
    - `basisPoints` integer: Tax rate in basis points. Set exactly one of money or basisPoints.
    - `money` CreatePurchaseOrderEntityPurchaseOrderMoneyInputTypeRequestBody: Money object
      - `amount` string, required: Monetary amount as a decimal string in major currency units (e.g. "24.50").
      - `currency` string, required: ISO 4217 currency code, lowercased (e.g. "usd").
  - `trackingNumber` string: Shipment tracking number for the purchase order.
  - `vendorId` string, required: ID of the vendor supplying this purchase order.

## Response `201`

Created response.

- EntityPurchaseOrdersServiceCreatePurchaseOrderResponseBody
  - `data` EntityCreatePurchaseOrderTypeResponseBody, required: PurchaseOrder object
    - `createdAtTime` string: RFC3339 time when the purchase order was created.
    - `creationSource` 'Unknown' | 'User' | 'ScanPackingList': Source that created the purchase order. Valid values: `Unknown`, `User`, `ScanPackingList`
    - `deliveryAtTime` string: RFC3339 expected delivery time.
    - `firstReceivedAtTime` string: RFC3339 time when the first item was received.
    - `fullyReceivedAtTime` string: RFC3339 time when all items were received.
    - `glCode` string: General ledger code associated with this purchase order.
    - `id` string: Stable Samsara ID for the purchase order.
    - `invoiceNumber` string: Vendor invoice number associated with this purchase order.
    - `mediaItemIds` string[]: IDs of media items attached to the purchase order.
    - `notes` string: Free-text notes for the purchase order.
    - `orderStatus` 'Unknown' | 'Draft' | 'Open' | 'InReview' | 'Approved' | 'Rejected' | 'SentToVendor' | 'PartiallyReceived' | 'FullyReceived' | 'Returned' | 'Cancelled' | 'Closed': Current customer-visible status of the purchase order. Valid values: `Unknown`, `Draft`, `Open`, `InReview`, `Approved`, `Rejected`, `SentToVendor`, `PartiallyReceived`, `FullyReceived`, `Returned`, `Cancelled`, `Closed`
    - `otherCost` CreatePurchaseOrderEntityPurchaseOrderMoneyPublicVariantf6994a15f796TypeResponseBody: Money object
      - `amount` string: Monetary amount as a decimal string in major currency units (e.g. "24.50").
      - `currency` string: ISO 4217 currency code, lowercased (e.g. "usd").
    - `parts` CreatePurchaseOrderEntityPurchaseOrderPurchaseOrderPartPublicVarianteee5df5b52beTypeResponseBody[]: Parts ordered on the purchase order.
      - `batchNumber` string: Batch or lot number for the ordered part.
      - `coreCharge` CreatePurchaseOrderEntityPurchaseOrderPurchaseOrderCoreChargeTypeResponseBody: PurchaseOrderCoreCharge object
        - `coreChargeStatus` 'Unknown' | 'Active' | 'RemovedOrDisabled': Whether the core charge is active or removed or disabled. Valid values: `Unknown`, `Active`, `RemovedOrDisabled`
        - `corePartSamsara` EntityCreatePurchaseOrderPartDefinitionRefTypeResponseBody: Reference to a PartDefinition
          - `id` string, required: The ID of the referenced PartDefinition.
        - `recoverabilityPolicy` CreatePurchaseOrderEntityPurchaseOrderCoreRecoverabilityPolicyTypeResponseBody: CoreRecoverabilityPolicy object
          - `fixedRecoverableUntilTime` string: Absolute deadline for core return.
          - `policyType` 'Unknown' | 'RelativeToReceipt' | 'FixedDate' | 'NoDeadline': Recoverability policy type. Valid values: `Unknown`, `RelativeToReceipt`, `FixedDate`, `NoDeadline`
          - `relativeWindowDuration` integer: Duration after receipt when the core must be returned. Measured in milliseconds.
        - `returnRecipientVendor` EntityCreatePurchaseOrderVendorRefTypeResponseBody: Reference to a Vendor
          - `id` string, required: The ID of the referenced Vendor.
        - `unitCoreAmount` CreatePurchaseOrderEntityPurchaseOrderMoneyTypeResponseBody: Money object
          - `amount` string: Monetary amount as a decimal string in major currency units (e.g. "24.50").
          - `currency` string: ISO 4217 currency code, lowercased (e.g. "usd").
      - `description` string: Description of the ordered part.
      - `lineItemId` string: Stable identifier for the purchase order line.
      - `partSamsara` EntityCreatePurchaseOrderPartDefinitionRefTypeResponseBody: Reference to a PartDefinition
        - `id` string, required: The ID of the referenced PartDefinition.
      - `place` EntityCreatePurchaseOrderPlaceRefTypeResponseBody: Reference to a Place
        - `id` string, required: The ID of the referenced Place.
      - `quantityOrdered` number, double: Quantity ordered on this line.
      - `quantityReceived` number, double: Quantity received on this line.
      - `tax` CreatePurchaseOrderEntityPurchaseOrderTaxAdjustmentTypeResponseBody: TaxAdjustment object
        - `basisPoints` integer: Tax rate in basis points. Set exactly one of money or basisPoints.
        - `money` CreatePurchaseOrderEntityPurchaseOrderMoneyTypeResponseBody: Money object
          - `amount` string: Monetary amount as a decimal string in major currency units (e.g. "24.50").
          - `currency` string: ISO 4217 currency code, lowercased (e.g. "usd").
      - `unitCost` CreatePurchaseOrderEntityPurchaseOrderMoneyPublicVariantf6994a15f796TypeResponseBody: Money object
        - `amount` string: Monetary amount as a decimal string in major currency units (e.g. "24.50").
        - `currency` string: ISO 4217 currency code, lowercased (e.g. "usd").
      - `unitOfMeasureType` 'Unknown' | 'Each' | 'Set' | 'Pack' | 'Box' | 'Pound' | 'Kilogram' | 'Ounce' | 'Liter' | 'Milliliter' | 'Gallon' | 'Quart' | 'FluidOunce' | 'Inch' | 'Foot' | 'Meter' | 'Yard' | 'SquareFoot' | 'SquareMeter' | 'Pint' | 'Hundred' | 'Roll': Unit of measure for quantities on this line. Read-only: derived from the line's part definition, and ignored if supplied on create or update. Valid values: `Unknown`, `Each`, `Set`, `Pack`, `Box`, `Pound`, `Kilogram`, `Ounce`, `Liter`, `Milliliter`, `Gallon`, `Quart`, `FluidOunce`, `Inch`, `Foot`, `Meter`, `Yard`, `SquareFoot`, `SquareMeter`, `Pint`, `Hundred`, `Roll`
    - `poNumber` string: Customer-visible purchase order number.
    - `poNumberPrefix` string: Optional prefix included in the purchase order number.
    - `poNumberSuffix` string: Optional suffix included in the purchase order number.
    - `sentAtTime` string: RFC3339 time when the purchase order was sent to its vendor.
    - `tax` CreatePurchaseOrderEntityPurchaseOrderTaxAdjustmentTypeResponseBody: TaxAdjustment object
      - `basisPoints` integer: Tax rate in basis points. Set exactly one of money or basisPoints.
      - `money` CreatePurchaseOrderEntityPurchaseOrderMoneyTypeResponseBody: Money object
        - `amount` string: Monetary amount as a decimal string in major currency units (e.g. "24.50").
        - `currency` string: ISO 4217 currency code, lowercased (e.g. "usd").
    - `taxTotal` CreatePurchaseOrderEntityPurchaseOrderMoneyTypeResponseBody: Money object
      - `amount` string: Monetary amount as a decimal string in major currency units (e.g. "24.50").
      - `currency` string: ISO 4217 currency code, lowercased (e.g. "usd").
    - `trackingNumber` string: Shipment tracking number for the purchase order.
    - `updatedAtTime` string: RFC3339 time when the purchase order was last updated.
    - `vendor` EntityCreatePurchaseOrderVendorRefPublicVariant07ae4b76c2baTypeResponseBody: Reference to a Vendor
      - `id` string, required: The ID of the referenced Vendor.

## Other responses

- `401`: Unauthorized response.
- `404`: Not Found response.
- `405`: Method Not Allowed response.
- `413`: Content Too Large response.
- `429`: Too Many Requests response.
- `500`: Internal Server Error response.
- `501`: Not Implemented response.
- `502`: Bad Gateway response.
- `503`: Service Unavailable response.
- `504`: Gateway Timeout response.
- `default`: Bad Request response.

---

[API](https://skmtc.dev/samsara/apis/samsara-api.md) - [All operations](https://skmtc.dev/samsara/apis/samsara-api/llms.txt) - [OpenAPI document](https://skmtc.dev/samsara/apis/samsara-api/revisions/a9e35d4999be?raw)
