Light APIv1.0.0

API / Reference / Invoice Payables

Generate document upload URL

POST https://api.light.inc/v1/invoice-payables/{invoicePayableId}/document/upload-url

Generates a secure upload URL for invoice payable documents

The URL is valid for five minutes. PUT the bytes to it with every returned header set on the request — they carry the signed metadata that ties the file to the bill (see Files). Nothing else to call: Light attaches the file in the background, so poll GET /v1/invoice-payables/{invoicePayableId} until documentName is set. What happens next depends on state: a bill in CREATED (created with AI_PARSE_AND_MERGE) is parsed and moves to IN_DRAFT; a bill already in IN_DRAFT just gets the file, with nothing parsed or overwritten. A document is required before submit-for-approval and before converting to a credit note.

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

Path parameters

  • invoicePayableId string · uuidrequired

Request body

application/json;charset=UTF-8

  • documentName string

    Original file name of the document.

  • contentType string

    MIME type of the uploaded document (e.g. application/pdf).

Response

  • uploadUrl string · url

    Pre-signed URL to which the invoice payable document can be uploaded.

  • headers object

    HTTP headers required when uploading the document to the pre-signed URL.