Create upload URL
POST
https://api.light.inc/v1/expenses/upload-url
Creates a pre-signed URL for uploading an expense receipt document
Authorization
Send one of these on every request. See Authentication for how to get credentials.
- API key
Basic authentication header of the form Basic <api_key>, where <api_key> is your api key.
- Bearer token
Request body
application/json;charset=UTF-8
-
filenamestringrequiredName of the file being uploaded; kept as the receipt's file name
-
contentTypestringrequiredMIME type of the file: application/pdf, image/jpeg, image/png, image/heic, image/heif or image/tiff
-
shouldAutoCreateExpensebooleanWhen true (default), the uploaded receipt is converted to PDF, an expense is created automatically and its fields are extracted by OCR. When false, the receipt is only stored: no expense is created and nothing is parsed; the caller creates the expense itself from the returned key.
Response
-
uploadUrlstring · url -
keystring -
metadataobject