Create a purchase invoice
Creates a self-billed purchase invoice conforming to UBL 2.1 with PINT AE Self-Billing customization.
Rate limit
60 requests/minute per authenticated account. See Rate limiting for response headers (X-RateLimit-*) and retry guidance.
Path parameters
Request body
Send the full purchase invoice JSON in the request body. See the right panel for a complete request example.
Request fields
Fields in the request JSON. Rows are ordered Required → Conditional → Optional. The Required column shows whether each field is always needed, sometimes needed, or optional. Object fields have dedicated sections further down this page.
Do not send: accounting_customer_party — the API sets the customer from {profileId}. Do not send calculated or system fields (id, org_id, document_sequence, totals, meta_info, etc.) — those appear in the response only.
Conditional field rules
Supplier party object
The accounting_supplier_party field on create and resubmit requests. The customer (accounting_customer_party) is set automatically from the {profileId} business profile—do not send it.
See The Supplier party object section for details.
Response party fields
Request address object
Postal and delivery addresses use the shared address object structure.
Tax category object
Tax categories share the same structure on line items (classified_tax_category) and charge/allowance tax_category fields. classified_tax_category is required on each line. Document-level charge and allowance tax categories are required; line-level charge and allowance tax categories are optional.
Buyer customer party object
The buyer_customer_party field carries the Beneficiary ID (UBL BTAE-01). It is not a full party reference—only the beneficiary identifier is sent in the API.
Seller supplier party object
The seller_supplier_party field carries the Principle ID (UBL BTAE-14). It is not a full party reference—only the Principle ID TRN is sent in the API.
Payee party object
The payee_party field is an object with the following attributes:
Tax representative party object
The tax_representative_party field is an object with the following attributes:
Delivery object
The delivery field is an object with the following attributes. JSON property names use snake_case as shown.
Delivery location object
The delivery_location object has the following attributes.
Order reference object
The order_reference field is an object with the following attributes:
Billing reference object
Each element of the billing_reference array is an object with the following attributes:
Despatch document reference object
The despatch_document_reference field is an object with the following attributes:
Receipt document reference object
The receipt_document_reference field is an object with the following attributes:
Statement document reference object
The statement_document_reference field is an object with the following attributes:
Originator document reference object
The originator_document_reference field is an object with the following attributes:
Contract document reference object
The contract_document_reference field is an object with the following attributes:
Project reference object
The project_reference field is an object with the following attributes:
Price object
The price object on each document_lines[] entry carries the item net price and price base quantity.
Document line object
Each element of the document_lines array represents one invoice line (UBL InvoiceLine). Nested item fields map to the UBL Item group. For Item Type, HSN, and SAC mappings from your ERP or Marmin UI, see Line item classification (UI to API).
Invoice period object
Used on document lines (document_lines[].invoice_period) and at document level (invoice_period).
Order line reference object
Despatch line reference object
Line document reference object
Buyer item identification object
The buyer_item_identification field is an object with the following attributes:
Seller item identification object
The seller_item_identification field is an object with the following attributes:
Standard item identification object
The standard_item_identification field is an object with the following attributes:
Additional item identification object
Use this array for Service Accounting Code (SAC) when the line Item Type is Services (S) or Both (B). In Marmin UI this is the Service Accounting Code field—not the Item Type dropdown.
Each element of the additional_item_identification array is an object with the following attributes:
Line item classification (UI to API)
The tables below map common ERP/UI labels on a document line to the API fields on document_lines[]. Use them when building create payloads from your source system.
#### Item type
#### Item classification identifier (HSN)
Applies when Item Type is Goods (`G`) or Both (`B`).
#### Service accounting code (SAC)
Applies when Item Type is Services (`S`) or Both (`B`).
#### Related fields
Commodity classification object
The commodity_classification object carries Item Type, HSN (for goods), and reverse-charge metadata. See Line item classification (UI to API) for UI mappings.
Origin country object
Additional item property object
Charge object
Each element of the charges array is an object with the following attributes:
Allowance object
Each element of the allowances array is an object with the following attributes:
Attachment object (request)
Use these fields when sending attachments on create or update requests.
Attachment object (response)
Each element of attachments in document JSON responses (create, retrieve, list) includes metadata only. File bytes are not returned; use the Download attachment endpoint with attachments[].id.
file_content is request-only and is never included in responses.
Payment means array
The payment_means field is an array; each element is an object with the following attributes:
Card account object
The card_account field is an object with the following attributes:
Payee financial account object
The payee_financial_account field is an object with the following attributes:
Payment mandate object
The payment_mandate field is an object with the following attributes:
Payment terms object
The payment_terms field is an object with the following attributes:
Tax exchange rate object
The tax_exchange_rate field is an object with the following attributes:
Response meta_info object
The meta_info field is an object with the following attributes:
Peppol status object
The meta_info.peppol_status field is an object with the following attributes:
Status values
Client processing guidance:
Treat
overall_statusas the primary state for workflow decisions.Use
participant_statusandfta_statusas stage-specific diagnostics for UI and support logs.If
overall_statusisPENDING, keep the invoice in a processing state and poll/re-fetch later.If
overall_statusisAPPROVED, mark the Peppol flow as successful and continue normal downstream actions.If
overall_statusisREJECTEDorVALIDATION_FAILED, stop submission-dependent actions and surface the failure to users.When
validation_resultsis not empty, display user-friendly error summaries fromtext, and retainflag,reasonCode,location, andtestfor troubleshooting.participant_statusorfta_statuscan benullin early/failed validation stages; do not treatnullalone as success or failure.
Invoice type codes
Purchase invoices created via API use self-billing per PINT AE Self-Billing v1.0.4.
Non-AED invoices
When document_currency_code is not AED:
Tax point date (UAE VAT)
Optional on create. When omitted, stored as null and omitted from UBL XML. When provided: yyyy-MM-dd, on or before issue_date. See Tax point date (UAE VAT) on the sales invoice page for full guidance.
Profile execution ID
profile_execution_id is an 8-character binary flag string per PINT AE. Use 00000000 for a standard purchase invoice.
Free Trade Zone (FTZ) — position 1 (`1XXXXXXX`)
When 1, set buyer_customer_party.id. Example: Free Trade Zone.
Deemed supply — position 2 (`X1XXXXXX`)
When 1, payment_means may be omitted.
Profit Margin Scheme — position 3 (`XX1XXXXX`)
No additional mandatory fields.
Summary invoice — position 4 (`XXX1XXXX`)
When 1, invoice_period with start_date, end_date, and description required. Example: Summary invoice.
Continuous Supply — position 5 (`XXXX1XXX`)
No additional mandatory fields.
Disclosed Agent Billing — position 6 (`XXXXX1XX`)
When 1, set seller_supplier_party.id. Example: Disclosed agent billing.
Supply through e-commerce — position 7 (`XXXXXX1X`)
Include delivery when required by scenario.
Exports — position 8 (`XXXXXXX1`)
When 1, delivery with delivery_location.address required. Example: Export transaction.
Related examples
Implementation notes
$2
VAT rules are applied according to UAE VAT law
Invoice status and transmission events are tracked
Party VAT and registration validation
See The Supplier party object section for details.
Request
POST /api/purchase-invoices/{business_profile_id}
Authorization: Bearer {jwt_token}
X-MARMIN-VERSION: 20260507Response
Status code: 201 Created
Returns the created purchase invoice with all request fields echoed plus system-generated and calculated fields.
Response body fields
Document lines in response
Each line includes calculated fields: base_amount, net_amount, total_amount, tax_amount. The price object in the response contains price_amount (instead of base_amount in the request).
Charges and allowances
Document-level charges and allowances are applied after line item totals
Line-level charges and allowances are applied per line item
All charges and allowances require a
tax_categoryfor proper VAT calculation
See the right panel for complete response JSON.
Attachments
You may include an optional attachments array in the create request. Each item must include file_name, file_type, and Base64-encoded file_content. Allowed MIME types and validation rules are documented under Attachment object (request) above.
Error responses
400 Bad Request
Invalid request parameters or validation failed.
{
"errors": {
"message": "Business profile not found with id: {business_profile_id}"
}
}For validation errors, the response includes field-specific errors:
{
"errors": {
"profile_execution_id": "Profile execution ID is mandatory",
"issue_date": "Issue date is mandatory"
}
}401 Unauthorized
Authentication required or invalid token.
{
"errors": {
"message": "Authentication required or invalid token"
}
}413 Request Entity Too Large
The request payload size exceeds the allowed limit of 8MB.
{
"errors": {
"message": "Payload size should not exceed 8MB"
}
}500 Internal Server Error
An error occurred while processing the request.
{
"errors": {
"message": "An error occurred"
}
}