---
title: "Process an invoice scan."
method: POST
path: "/maintenance/invoice-scans"
tags: ["Work Orders"]
---

# Process an invoice scan.

`POST /maintenance/invoice-scans`

## Request

- Base URL: `https://api.samsara.com`
- URL: `https://api.samsara.com/maintenance/invoice-scans`
- Auth: HTTP bearer

Process an invoice scan to create or update a work order with AI-extracted data. Accepts base64 encoded invoice files (PDF, JPEG, PNG) up to 10MB.

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

To use this endpoint, select **Write Work 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

- WorkOrdersPostInvoiceScanRequestBody: Invoice scan request
  - `assetId` string: Asset ID to create a new work order for the invoice. Provide either workOrderId OR assetId, but not both. If assetId is provided, a new work order will be created for that asset. If workOrderId is provided instead, the invoice will be attached to the existing work order.
  - `file` InvoiceScanFileRequestBody, required: Invoice file object
    - `base64Content` string, required: Base64 encoded file content. Maximum decoded size: 10MB.
    - `contentType` string, required: MIME type of the file. Supported types: application/pdf, image/jpeg, image/png.
  - `workOrderId` string: Work order ID to attach the invoice to an existing work order. Provide either workOrderId OR assetId, but not both. If workOrderId is provided, the invoice will be attached to the existing work order. If assetId is provided instead, a new work order will be created for that asset.

## Response `200`

OK response.

- WorkOrdersPostInvoiceScanResponseBody
  - `data` PostInvoiceScanResponseDataResponseBody, required: Invoice scan response data
    - `workOrderId` string, required: The work order ID that the invoice was attached to or created.

## 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)
