propose_write

Hand in a purchase document (a scan, a photo or a Peppol e-invoice) for the purchase register. Books nothing.

Changed on

Answers 201 with document_id, and for a Peppol e-invoice or credit note (Universal Business Language 2.1) also invoice_id, the deterministic check (check_status, findings: net plus tax equals gross, rate times base equals tax per line) and the validator's fatal_count. An e-invoice is read from its elements; a field it does not carry stays unreadable, never derived. The file travels as content_base64 (at most 3 megabytes) with its mime_type, and an Idempotency-Key header (8 to 200 characters): a retry with the same key and the same file answers the first result; the same key with another file is refused with idempotency_conflict. The same file under a new key answers the document already held. 403 while the entity's owner has not switched the purchase register on. Nothing is booked or paid: a person registers the entry in Books.

post/api/v1/finance/purchase-documents

Request

  • Base URL: https://app.magistry.io
  • URL: https://app.magistry.io/api/v1/finance/purchase-documents
  • Auth: one of:
    • HTTP bearer
    • OAuth 2 (authorization code, authorization URL https://app.magistry.io/api/oauth/authorize, token URL https://app.magistry.io/api/oauth/token, scopes: finance:write)

Request body

entity_idstring uuid required

The entity, one of those this app was granted (GET /api/v1/finance/entities lists them). In a GET query string entity is accepted too.

content_base64string required

The file, base64-encoded (at most 3 megabytes decoded).

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

The file's type; application/xml or text/xml for an e-invoice.

file_namestring

The original file name (kept to 300 characters).

external_refstring

Your own reference for this document (kept to 200 characters).

idempotency_keystring

Same as the Idempotency-Key header; give one of the two.

Response

Result

okboolean required
resultunknown required

Changes