Beta APIs

[beta] Create a purchase order

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.

post/maintenance/purchase-orders

Request

  • Base URL
    https://api.samsara.com
  • Auth
    HTTP bearer

Request body

glCodestring

General ledger code associated with this purchase order.

invoiceNumberstring

Vendor invoice number associated with this purchase order.

notesstring

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

poNumberPrefixstring

Optional prefix included in the purchase order number.

poNumberSuffixstring

Optional suffix included in the purchase order number.

trackingNumberstring

Shipment tracking number for the purchase order.

vendorIdstring required

ID of the vendor supplying this purchase order.

Example request

{
  "glCode": "GL-4000",
  "invoiceNumber": "INV-12345",
  "notes": "Deliver to maintenance shop.",
  "orderStatus": "Draft",
  "otherCost": {
    "amount": "24.50",
    "currency": "usd"
  },
  "parts": [
    {
      "batchNumber": "LOT-42",
      "coreCharge": {
        "coreChargeStatus": "Unknown",
        "corePartSamsaraId": "281474976710656",
        "recoverabilityPolicy": {
          "fixedRecoverableUntilTime": "2019-06-13T19:08:25Z",
          "policyType": "Unknown",
          "relativeWindowDuration": 12345
        },
        "returnRecipientVendorId": "281474976710656",
        "unitCoreAmount": {
          "amount": "12345",
          "currency": "12345"
        }
      },
      "description": "Oil filter",
      "lineItemId": "12345",
      "partSamsaraId": "281474976710656",
      "placeId": "281474976710656",
      "quantityOrdered": 10,
      "quantityReceived": 123.45,
      "tax": {
        "basisPoints": 12345,
        "money": {
          "amount": "12345",
          "currency": "12345"
        }
      },
      "unitCost": {
        "amount": "24.50",
        "currency": "usd"
      },
      "unitOfMeasureType": "Each"
    }
  ],
  "poNumberPrefix": "PO",
  "poNumberSuffix": "A",
  "tax": {
    "basisPoints": 12345,
    "money": {
      "amount": "12345",
      "currency": "12345"
    }
  },
  "trackingNumber": "1Z999AA10123456784",
  "vendorId": "281474976710656"
}

Response

Created response.

Example response

{
  "data": {
    "createdAtTime": "2019-06-13T19:08:25Z",
    "creationSource": "Unknown",
    "deliveryAtTime": "2019-06-13T19:08:25Z",
    "firstReceivedAtTime": "2019-06-13T19:08:25Z",
    "fullyReceivedAtTime": "2019-06-13T19:08:25Z",
    "glCode": "GL-4000",
    "id": "12345",
    "invoiceNumber": "INV-12345",
    "mediaItemIds": [
      "12345",
      "12345",
      "12345",
      "12345"
    ],
    "notes": "Deliver to maintenance shop.",
    "orderStatus": "Draft",
    "otherCost": {
      "amount": "24.50",
      "currency": "usd"
    },
    "parts": [
      {
        "batchNumber": "LOT-42",
        "coreCharge": {
          "coreChargeStatus": "Unknown",
          "corePartSamsara": {
            "id": "281474976710656"
          },
          "recoverabilityPolicy": {
            "fixedRecoverableUntilTime": "2019-06-13T19:08:25Z",
            "policyType": "Unknown",
            "relativeWindowDuration": 12345
          },
          "returnRecipientVendor": {
            "id": "281474976710656"
          },
          "unitCoreAmount": {
            "amount": "12345",
            "currency": "12345"
          }
        },
        "description": "Oil filter",
        "lineItemId": "12345",
        "partSamsara": {
          "id": "281474976710656"
        },
        "place": {
          "id": "281474976710656"
        },
        "quantityOrdered": 10,
        "quantityReceived": 123.45,
        "tax": {
          "basisPoints": 12345,
          "money": {
            "amount": "12345",
            "currency": "12345"
          }
        },
        "unitCost": {
          "amount": "24.50",
          "currency": "usd"
        },
        "unitOfMeasureType": "Each"
      }
    ],
    "poNumber": "12345",
    "poNumberPrefix": "PO",
    "poNumberSuffix": "A",
    "sentAtTime": "2019-06-13T19:08:25Z",
    "tax": {
      "basisPoints": 12345,
      "money": {
        "amount": "12345",
        "currency": "12345"
      }
    },
    "taxTotal": {
      "amount": "12345",
      "currency": "12345"
    },
    "trackingNumber": "1Z999AA10123456784",
    "updatedAtTime": "2019-06-13T19:08:25Z",
    "vendor": {
      "id": "281474976710656"
    }
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.