Upload a single invoice (API key, one-step)
curl --request POST \
--url https://api.trysnapit.com/api/v1/invoices/upload \
--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', 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"
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
Upload a single invoice (API key, one-step)
Creates the invoice, stores the file, debits credits, and enqueues extraction in one call. Prefer init + attach for clearer client progress when uploading large files. Poll statusUrl until ready is true, then read data for extracted JSON. If the extraction queue is down, credits are refunded and the call returns 503.
POST
/
api
/
v1
/
invoices
/
upload
Upload a single invoice (API key, one-step)
curl --request POST \
--url https://api.trysnapit.com/api/v1/invoices/upload \
--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', 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"
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)
Query Parameters
Optional vendor UUID (alternative to form field)
Body
multipart/form-data
Response
Upload accepted; 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"

