Developers
Recipes

Files

Upload a file, then attach it to a document with a separate call.

Uploading a file does not attach it to a voucher. Those are two calls.

Files - Upload is POST /v1/business/{business_slug}/file_upload/. The description allows multipart form data or a JSON body with base64-encoded content. The JSON schema requires file and name. file is the base64 payload. type, folder_id, and notes are optional on that schema.

Files - List returns files already stored. Keep file_id from the upload response or from that list.

Attaching is Document - Attach files on POST /v1/business/{business_slug}/document/{document_id}/action/attach_files/. document_id comes from Documents - List or from document create. Detach is the matching detach_files operation. Read both schemas for the body. Do not send the file bytes again on the attach call.

Send Idempotency-Key on the upload POST. See Idempotency.