AR/AP

Create a DRAFT invoice from an uploaded invoice document's extraction

DARK — 404s unless ar_ap_items_enabled. Body {documentId}. Turns the document's latest extraction (documents pipeline evidence) into a draft through the composer aggregate; the draft references the source document (document_id + sourceMetadata.documentId). Fields are never guessed: a missing/incomplete extraction (wrong document type, unassigned document, no extraction row, failed extraction, missing amount/customer/issue date, or a document already linked to a receivable) is a 422 whose error.extensions.reasons lists every applicable gap. Extraction line items become composer lines only when they reconcile exactly to the invoice total; otherwise a single line carries the known total. Never auto-posts — issue/send stay explicit.

post/companies/{companyId}/ar/drafts/from-document

Request

  • Base URL: https://api.medianfi.com/api/v1
  • URL: https://api.medianfi.com/api/v1/companies/{companyId}/ar/drafts/from-document
  • Auth: HTTP bearer

Request body

documentIdstring uuid required

Response

Draft created: { success, data: { draftInvoiceId } }

Changes

No recorded changes to this operation across all 1 revision of this API.