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.
Rate limit: 100 requests/min (learn more about rate limits here).
To use this endpoint, select Write Work Orders under the Work Orders category when creating or editing an API token. Learn More.
Submit Feedback: Likes, dislikes, and API feature requests should be filed as feedback in our API feedback form. If you encountered an issue or noticed inaccuracies in the API documentation, please submit a case to our support team.
curl --request POST \
--url https://api.samsara.com/maintenance/invoice-scans \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"file": {
"base64Content": "JVBERi0xLjQKJeLjz9MKMyAwIG9iago8P...",
"contentType": "application/pdf"
},
"assetId": "281474993384538",
"workOrderId": "123456"
}
'{
"data": {
"workOrderId": "123456"
}
}Documentation Index
Fetch the complete documentation index at: https://samsara-showcase.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Invoice scan request
Invoice file object
Show child attributes
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.
"281474993384538"
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.
"123456"
OK response.
Invoice scan response data
Show child attributes
curl --request POST \
--url https://api.samsara.com/maintenance/invoice-scans \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"file": {
"base64Content": "JVBERi0xLjQKJeLjz9MKMyAwIG9iago8P...",
"contentType": "application/pdf"
},
"assetId": "281474993384538",
"workOrderId": "123456"
}
'{
"data": {
"workOrderId": "123456"
}
}