Attach file to a prepared invoice (API key)
curl --request POST \
--url https://api.trysnapit.com/api/v1/invoices/upload/{invoiceId}/file \
--header 'Authorization: <api-key>' \
--header 'Content-Type: multipart/form-data' \
--form file='@example-file'const form = new FormData();
form.append('file', '<string>');
const options = {method: 'POST', headers: {Authorization: '<api-key>'}};
options.body = form;
fetch('https://api.trysnapit.com/api/v1/invoices/upload/{invoiceId}/file', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.trysnapit.com/api/v1/invoices/upload/{invoiceId}/file"
files = { "file": ("example-file", open("example-file", "rb")) }
headers = {"Authorization": "<api-key>"}
response = requests.post(url, files=files, headers=headers)
print(response.text){
"invoice": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "pending",
"processingStatus": "queued",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"tenantId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"vendorId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"invoiceNumber": "<string>"
},
"fileId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"statusUrl": "/api/v1/invoices/a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}{
"statusCode": 401,
"message": "Invalid or missing API key",
"error": "Unauthorized"
}{
"statusCode": 401,
"message": "Invalid or missing API key",
"error": "Unauthorized"
}{
"statusCode": 401,
"message": "Invalid or missing API key",
"error": "Unauthorized"
}{
"statusCode": 401,
"message": "Invalid or missing API key",
"error": "Unauthorized"
}{
"statusCode": 401,
"message": "Invalid or missing API key",
"error": "Unauthorized"
}Programmatic API
Attach file to a prepared invoice (API key)
Persists the file, debits credits, and enqueues extraction. Returns before OCR/LLM completes. Poll statusUrl (GET /api/v1/invoices/:id) until ready is true, then read data. If the extraction queue is down, credits are refunded and the call returns 503.
POST
/
api
/
v1
/
invoices
/
upload
/
{invoiceId}
/
file
Attach file to a prepared invoice (API key)
curl --request POST \
--url https://api.trysnapit.com/api/v1/invoices/upload/{invoiceId}/file \
--header 'Authorization: <api-key>' \
--header 'Content-Type: multipart/form-data' \
--form file='@example-file'const form = new FormData();
form.append('file', '<string>');
const options = {method: 'POST', headers: {Authorization: '<api-key>'}};
options.body = form;
fetch('https://api.trysnapit.com/api/v1/invoices/upload/{invoiceId}/file', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.trysnapit.com/api/v1/invoices/upload/{invoiceId}/file"
files = { "file": ("example-file", open("example-file", "rb")) }
headers = {"Authorization": "<api-key>"}
response = requests.post(url, files=files, headers=headers)
print(response.text){
"invoice": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "pending",
"processingStatus": "queued",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"tenantId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"vendorId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"invoiceNumber": "<string>"
},
"fileId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"statusUrl": "/api/v1/invoices/a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}{
"statusCode": 401,
"message": "Invalid or missing API key",
"error": "Unauthorized"
}{
"statusCode": 401,
"message": "Invalid or missing API key",
"error": "Unauthorized"
}{
"statusCode": 401,
"message": "Invalid or missing API key",
"error": "Unauthorized"
}{
"statusCode": 401,
"message": "Invalid or missing API key",
"error": "Unauthorized"
}{
"statusCode": 401,
"message": "Invalid or missing API key",
"error": "Unauthorized"
}Authorizations
Bearer sk_live_… (include the Bearer prefix)
Path Parameters
Query Parameters
Optional vendor UUID (alternative to form field)
Body
multipart/form-data
Response
File stored and extraction queued
Show child attributes
Show child attributes
Stored file id; download via JWT /api/files/:fileId in the web app
Relative path — prepend your API host (e.g. https://api.trysnapit.com). Poll until ready is true, then read data for extracted JSON.
Example:
"/api/v1/invoices/a1b2c3d4-e5f6-7890-abcd-ef1234567890"

