InvoicingGet a signed upload URL for an invoice attachment

Get a signed upload URL for an invoice attachment

Returns a signed URL for uploading an attachment. Upload the file with a plain HTTP PUT to the returned uploadUrl, then call POST /v2/documents/invoice-attachments/add with the returned uploadPath (and bucket) to attach the uploaded file to the e-invoice draft. The signed URL expires at expiresAt. documentId takes precedence over organizationFileId.

Example upload using the uploadUrl returned by this endpoint:

curl -X PUT --upload-file ./priloha.pdf \
  "https://storage.googleapis.com/temporary-<project>/api/XXX/organization/YYYY/uploads/ZZZ/priloha.pdf?<signed-query-parameters>"

The storage host (https://storage.googleapis.com/...), the identifiers in the path (XXX = your user id, YYYY = organization id, ZZZ = upload id) and the whole ?<signed-query-parameters> query string all come from the uploadUrl value returned by this endpoint - use the returned URL verbatim, do not build it yourself. A successful upload answers HTTP 200 with an empty body.

After the upload, call POST /v2/documents/invoice-attachments/add with fileNames: [uploadPath] and bucket to attach the uploaded file to the e-invoice draft.

curl -X POST "https://api-gateway-prod-europe-west-1-7epuecvu.ew.gateway.dev/v2/documents/invoice-attachments/upload-url" \
  -H "Content-Type: application/json" \
  -H "api_key: YOUR_API_KEY" \
  -d '{
  "data": {
    "organizationId": "example_string",
    "documentId": "example_string",
    "organizationFileId": "example_string",
    "fileName": "John Doe"
  }
}'
{
  "data": {
    "uploadUrl": "example_string",
    "uploadPath": "example_string",
    "bucket": "example_string",
    "expiresAt": "2024-12-25T10:00:00Z"
  },
  "success": true,
  "message": "example_string",
  "code": "APP_UNAUTHENTICATED"
}
POST
/v2/documents/invoice-attachments/upload-url
POST
Base URLstring

Target server for requests. Edit to use your own host.

API Key (header: api_key)
api_keystring
Required

API key (sent in header)

Content-Typestring
Required

The media type of the request body

Options: application/json
dataobject

Either documentId or organizationFileId must be provided - documentId takes precedence.

Request Preview
Response

Response will appear here after sending the request

Authentication

header
api_keystring
Required

API Key for authentication. Provide your API key in the header.

Body

application/json
dataobject

Either documentId or organizationFileId must be provided - documentId takes precedence.

Responses

dataobject
successboolean
messagestring

optional message to help user understand error code

codestring
Allowed values:APP_UNAUTHENTICATEDAPP_INCORRECT_INPUT_DATASAVE_DATA_ERROR_CODE