Start a vendor bill file upload
Asks for a pre-signed upload target for one file. Upload the bytes to it yourself, then attach the session to the bill. Requires the vendor_bills:write permission.
Authorization
AuthorizationstringrequiredPath parameters
vendorBillIdstringrequiredSnowflake id of the vendor bill.
Body
application/json
fileNamestringrequiredThe file's name, kept as metadata.
contentTypestringrequiredThe file's MIME type. Vendor bill files must be a PDF or an image, so application/pdf or image/*.
fileSizeintegerrequiredThe file's size in bytes. Vendor bill files are capped at 20 MB.
Response
200 · A pre-signed upload target. It is single-use and expires.
sessionIdstringSnowflake id of the session. Pass this as uploadSessionId when attaching the file.
endpointstringThe URL to upload the bytes to. It belongs to the storage provider, not to the MagicDoor API.
methodstringThe HTTP method to use against endpoint, for example POST or PUT.
fieldsobjectForm fields the storage provider requires alongside the file. Send them exactly as given; the names and values are provider-specific.
expiresstring · date-timeWhen the session stops accepting an upload, in the company's timezone.
401 · The access token is missing, expired, or not for this company.
403 · The caller does not hold the `vendor_bills:write` permission.
404 · No vendor bill with this id belongs to the caller's company, or it has been deleted.
- Ask for a session
Call this endpoint. You get back an
endpoint, an HTTPmethod, and a map of formfields. - Upload the bytes yourself
Send the file to
endpointusingmethod, including every entry offieldsin the form. This request does not go to the MagicDoor API and does not take your access token. - Attach it to the bill
Call Attach files to a vendor bill with the
sessionId. The file only becomes part of the bill at that point.