Receivables

Upsert a receivable document and get a presigned upload URL

Changed on
post/receivables/{id}/documents

Request

Path parameters

idstring required

An object ID assigned and owned by the originator

Example:acct-123

Headers

Idempotency-Keystring

A unique key per operation, could be V4 UUID or other high‑entropy random string. Keys can be up to 256 bytes. See Idempotent Requests.

Example:978771af-77de-4e24-ba39-f602502ceb78

Request body

idstring required

The receivable document ID assigned by the originator

file_namestring

File name of the document, used when the file is downloaded. Required at creation, optional for updates.

content_type'application/pdf' | 'image/png' | 'image/jpeg' | 'image/webp' | 'application/xml' | 'text/xml'

MIME type of the document file. Required at creation, optional for updates.

size_bytesinteger

Size of the file in bytes, at most 25 MB. Required at creation, optional for updates.

type'invoice' | 'contract' | 'proof_of_delivery' | 'other' | 'null' nullable

Kind of document attached to the receivable

metadataobject nullable

Additional custom data associated with this document

Example request

{
  "id": "acct-123",
  "metadata": {
    "key": "value"
  }
}

Response

Successful operation

file_namestring required

File name of the document, used when the file is downloaded

content_type'application/pdf' | 'image/png' | 'image/jpeg' | 'image/webp' | 'application/xml' | 'text/xml' required

MIME type of the document file

size_bytesinteger required

Size of the file in bytes, at most 25 MB

type'invoice' | 'contract' | 'proof_of_delivery' | 'other'

Kind of document attached to the receivable

metadataobject

Additional custom data associated with this document

idstring required

The receivable document ID assigned by the originator

created_atstring date-time required

Creation date and time

created_bystring required

ID of the user that created this object

updated_atstring date-time required

Last update date and time

updated_bystring required

ID of the user that last updated this object

status'pending_upload' | 'uploaded' | 'quarantined' required

Lifecycle status of the document: pending_upload until the file upload is confirmed, quarantined when the file failed malware scanning (upload a replacement file to clear it)

etagstring

Entity tag of the stored file, set once the upload is confirmed

Example response

{
  "metadata": {
    "key": "value"
  },
  "id": "acct-123",
  "created_at": "2024-01-15T10:30:00Z",
  "created_by": "user_0123456789ABCDEFGHIJKLMNOPq",
  "updated_at": "2024-01-15T10:30:00Z",
  "updated_by": "user_0123456789ABCDEFGHIJKLMNOPq",
  "upload": {
    "url": "https://www.acme.com",
    "expires_at": "2024-01-15T10:30:00Z"
  }
}

Changes