Marmin

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

ParameterTypeRequiredDescription
business_profile_idstring
Required
The business profile ID of the buyer issuing the self-billed invoice.
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.

FieldTypeRequiredDescriptionValidation
issue_datestring
Required
The date when the invoice was issued.Format yyyy-MM-dd; must be a valid calendar date.
invoice_type_codestring
Required
The type of invoice.Must be 389 (Self-billed Invoice). The API overrides any other value to 389.
due_datestring
Required
The date when payment is due.Format yyyy-MM-dd.
profile_execution_idstring
Required
Invoice transaction type code.Exactly 8 characters; each character 0 or 1. See Profile execution ID section for details.
document_currency_codestring
Required
ISO 4217 alpha-3 currency code for all monetary amounts (e.g. AED).Must be a valid ISO 4217 code. See Get Currency Names and Codes section for details. For non-AED documents, see Non-AED invoices.
accounting_supplier_partyobject
Required
The supplier party for the invoice.Must be a valid party object. See Supplier party object section for details.
document_linesarray
Required
Invoice line items.At least one line required. See Document line object section for details.
document_numberstring
Conditional
The invoice number as displayed on the document.Required when auto-numbering is disabled; auto-generated when auto-numbering is enabled and omitted. Must be unique when provided. Recommendation: provide explicitly for ERP reconciliation.
tax_point_datestring
Conditional
Tax point date per UAE VAT Law.If present: format yyyy-MM-dd; must be on or before issue_date. See Tax point date (UAE VAT) section for details.
tax_currency_codestring
Conditional
ISO 4217 currency code for tax amounts.Required when document_currency_code is not AED—must be AED. See Non-AED invoices section for details.
tax_exchange_rateobject
Conditional
Exchange rate for tax calculation in AED.Required when document_currency_code is not AED. See Tax exchange rate object section for details.
buyer_customer_partyobject
Conditional
Beneficiary ID (UBL BTAE-01).Required for Free Trade Zone (FTZ).
seller_supplier_partyobject
Conditional
Principle ID (UBL BTAE-14).Required for Disclosed Agent Billing.
deliveryobject
Conditional
Delivery details.Required for Exports.
payment_meansarray
Conditional
Payment method.Required unless Deemed supply applies.
invoice_periodobject
Conditional
Billing period.Required for Summary invoice. See Invoice period object section for details.
issue_timestring
Optional
The time when the invoice was issued.Format HH:mm:ss. Gulf Standard Time (GST, UTC+4). Default when omitted: 00:00:00.
accounting_coststring
Optional
Accounting cost center identifier.Free text.
buyer_referencestring
Optional
Buyer reference for the invoice.Free text.
notestring
Optional
Additional notes on the invoice.Free text.
payee_partyobject
Optional
Party to whom payment should be made.See Payee party object section for details.
tax_representative_partyobject
Optional
Tax representative party.See Tax representative party object section for details.
order_referenceobject
Optional
Purchase order reference.See Order reference object section for details.
billing_referencearray
Optional
References to other billing documents.See Billing reference object section for details.
despatch_document_referenceobject
Optional
Despatch document reference.See Despatch document reference object section for details.
receipt_document_referenceobject
Optional
Receipt document reference.See Receipt document reference object section for details.
statement_document_referenceobject
Optional
Statement document reference.If present: id required.
originator_document_referenceobject
Optional
Originating document reference.If present: id required.
contract_document_referenceobject
Optional
Contract reference.See Contract document reference object section for details.
project_referenceobject
Optional
Project reference.See Project reference object section for details.
chargesarray
Optional
Document-level charges.See Charge object section for details.
allowancesarray
Optional
Document-level allowances.See Allowance object section for details.
payment_termsobject
Optional
Payment terms.See Payment terms object section for details.
prepaid_amountnumber
Optional
Prepaid amount applied.Typically non-negative.
payable_rounding_amountnumber
Optional
Rounding adjustment.May be positive or negative.
document_sourcestring
Optional
Origin system identifier.Defaults to API when omitted.
attachmentsarray
Optional
Supporting documents.See Attachment object (request) section for details. Max 8 MB body.
Conditional field rules
ConditionAffected fieldsRule
Free Trade Zone (FTZ)buyer_customer_party.idRequired
Summary invoiceinvoice_periodstart_date, end_date, description required
Disclosed Agent Billingseller_supplier_party.idRequired
ExportsdeliveryRequired with delivery_location.address
Not deemed supplypayment_meansAt least one required
document_currency_code ≠ AEDtax_currency_code, tax_exchange_rateSee Non-AED invoices
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.

FieldTypeRequiredDescriptionValidation
namestring
Required
Party name or display name.Must be non-empty text.
postal_addressobject
Required
Postal address. See Address object section for details.Required; must satisfy address object validation.
emailstring
Required
Party email address.Required for customer and supplier parties.
party_namestring
Conditional
Legal name of the party.Required for business parties. Do not send for individual customers.
tinstring
Conditional
Taxpayer Identification Number (TIN).Required for UAE business customers and UAE suppliers. Exactly 10 characters, must start with 1. Do not send for non-UAE B2B parties.
telephonestring
Conditional
Party telephone number.Required for UAE suppliers. Optional for customers.
scheme_agency_idstring
Optional
Registration type identifier, if you choose to include registration details.Optional for customer and supplier parties. If sent, must match allowed values for the party type — see The Customer party object or The Supplier party object. See Get Registration Types section for details.
company_idstring
Optional
Registration or identity number when registration details are included.Optional. Distinct from VAT TRN in party_tax_scheme.company_id. Required only when scheme_agency_id is provided.
authority_namestring
Optional
Issuing authority for the trade license.Optional. Required only when scheme_agency_id is TL and registration details are included.
passport_issuing_country_codestring
Optional
Country that issued the passport.Optional. Required only when scheme_agency_id is PAS and registration details are included.
party_tax_schemeobject
Optional
Tax scheme with UAE VAT/TRN. Contains company_id, tax_scheme.Optional for UAE parties. If either company_id or tax_scheme is provided, both are required. When company_id is set: 15 digits; starts with 1 and ends with 03.
endpoint_idstring
Optional
Peppol endpoint identifier.If present, must be a valid Peppol endpoint for Phase 2 documents.
endpoint_scheme_idstring
Optional
Peppol endpoint scheme identifier. Typically 0235 for UAE.If present, must be a valid Peppol scheme id. See Get Electronic Address Schemes section for details.
Response party fields
FieldTypeSourceDescription
profile_idstringSystem ProvidedBusiness profile identifier on the party object.
Request address object

Postal and delivery addresses use the shared address object structure.

FieldTypeRequiredDescriptionValidation
street_namestring
Required
Street name or primary address line (UBL address line 1).Must not be blank.
city_namestring
Required
City or town name.Must not be blank.
country_subentitystring
Required
Country subdivision—emirate, state, or region code.Must not be blank. When country_code is AE, use an approved emirate code from Get UAE Subdivisions.
countrystring
Required
Country name (e.g. United Arab Emirates).Must not be blank.
country_codestring
Required
ISO 3166-1 alpha-2 country code (e.g. AE).Must not be blank. See Get Countries section for details.
additional_street_namestring
Optional
Additional street name or address line 2.Free text when provided.
postal_zonestring
Optional
Postal or ZIP code.Free text when provided.
address_linestring
Optional
Additional unstructured address line.Free text when provided.
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.

FieldTypeRequiredDescriptionValidation
idstring
Required
Tax category code (UBL classified tax category ID).Must not be blank. Valid codes include S, Z, E, O, AE, N. See Get Tax Categories section for details.
tax_exemption_reason_codestring
Conditional
FTA tax exemption reason code.Required when id is E (exempt). See Get Tax Exemption Reason Codes section for details.
tax_exemption_reasonstring
Conditional
Tax exemption reason description.Required when id is E (exempt). Must match the selected tax_exemption_reason_code description.
percentnumber
Optional
VAT rate as a percentage (e.g. 5 for 5%).Should align with the selected id.
tax_schemestring
Optional
Tax scheme identifier (typically VAT for UAE).See Get Tax Schemes section for details.
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.

FieldTypeRequiredDescriptionValidation
idstring
Conditional
Beneficiary ID (TIN). Mapped to BTAE-01 in the generated XML.Required when Free Trade Zone applies (profile_execution_id first character is 1). Must be a valid TIN; do not use accounting_customer_party TRN here.
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.

FieldTypeRequiredDescriptionValidation
idstring
Conditional
Principle ID TRN. Mapped to BTAE-14 in the generated XML.Required when Disclosed Agent Billing applies (profile_execution_id sixth character is 1). Must be a valid TRN; must differ from the seller VAT identifier (accounting_supplier_party.party_tax_scheme.company_id).
Payee party object

The payee_party field is an object with the following attributes:

FieldTypeRequiredDescriptionValidation
party_identificationobject
Optional
Payee identification.Optional; structure depends on your implementation.
party_namestring
Optional
Name of the payee.If provided, must be non-empty text.
financial_accountobject
Optional
Financial account details for payment.If present, must contain valid account identifiers as required by your bank.
Tax representative party object

The tax_representative_party field is an object with the following attributes:

FieldTypeRequiredDescriptionValidation
party_identificationobject
Optional
Tax representative identification.Optional; should uniquely identify the tax representative where used.
party_namestring
Optional
Name of the tax representative.If provided, must be non-empty.
postal_addressobject
Optional
Address of the tax representative.If present, see Address object.
Delivery object

The delivery field is an object with the following attributes. JSON property names use snake_case as shown.

FieldTypeRequiredDescriptionValidation
actual_delivery_datestring
Optional
Actual date of delivery.If present, format yyyy-MM-dd.
delivery_locationobjectRequired when delivery is sentWhere goods or services are delivered. See Delivery location object below.Must be present whenever the delivery object is included.
party_namestring
Optional
Name of the delivery-related party.Free text when provided.
party_idstring
Optional
Identifier of the delivery-related party.Free text when provided.
termsstring
Optional
Delivery terms.Free text when provided.
Delivery location object

The delivery_location object has the following attributes.

FieldTypeRequiredDescriptionValidation
addressobject
Required
Postal address of the delivery location.Required when delivery_location is present. See Address object section for details.
idstring
Optional
Delivery location identifier.Free text when provided.
Order reference object

The order_reference field is an object with the following attributes:

FieldTypeRequiredDescriptionValidation
idstring
Required
Order number or identifier.Must be non-empty when the object is present.
issue_datestring
Optional
Order date.If present, format yyyy-MM-dd.
sales_order_idstring
Optional
Sales order identifier.Free-form identifier.
Billing reference object

Each element of the billing_reference array is an object with the following attributes:

FieldTypeRequiredDescriptionValidation
idstring
Required
Referenced document number.Must be non-empty when the entry is present.
issue_datestring
Optional
Referenced document date.If present, format yyyy-MM-dd.
Despatch document reference object

The despatch_document_reference field is an object with the following attributes:

FieldTypeRequiredDescriptionValidation
idstring
Required
Despatch document number.Must be non-empty when the object is present.
issue_datestring
Optional
Despatch document date.If present, format yyyy-MM-dd.
Receipt document reference object

The receipt_document_reference field is an object with the following attributes:

FieldTypeRequiredDescriptionValidation
idstring
Required
Receipt document number.Must be non-empty when the object is present.
issue_datestring
Optional
Receipt document date.If present, format yyyy-MM-dd.
Statement document reference object

The statement_document_reference field is an object with the following attributes:

FieldTypeRequiredDescriptionValidation
idstring
Required
Statement document number.Must be non-empty when the object is present.
issue_datestring
Optional
Statement document date.If present, format yyyy-MM-dd.
Originator document reference object

The originator_document_reference field is an object with the following attributes:

FieldTypeRequiredDescriptionValidation
idstring
Required
Originating document number or identifier.Must be non-empty when the object is present.
issue_datestring
Optional
Originating document date.If present, format yyyy-MM-dd.
Contract document reference object

The contract_document_reference field is an object with the following attributes:

FieldTypeRequiredDescriptionValidation
idstring
Required
Contract number or identifier.Must be non-empty when the object is present.
issue_datestring
Optional
Contract date.If present, format yyyy-MM-dd.
Project reference object

The project_reference field is an object with the following attributes:

FieldTypeRequiredDescriptionValidation
idstring
Required
Project identifier.Must be non-empty when the object is present.
namestring
Optional
Project name.Free text.
Price object

The price object on each document_lines[] entry carries the item net price and price base quantity.

FieldTypeRequiredSourceDescriptionValidation
base_amountnumber
Required
Client-providedItem net price (ibt-146).Must not be negative.
base_quantitynumber
Required
Client-providedItem price base quantity (ibt-149).Must be a positive number above zero. Must use the same unit code as document_lines[].unit_code (ibt-150).
allowanceobject
Optional
Client-providedPrice-level allowance (discount on the item net price).If present, see price allowance below.
allowance.amountnumber
Optional
Client-providedPrice-level discount amount.Must not be negative when provided.
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).

FieldTypeRequiredSourceDescriptionValidation
namestring
Required
Client-providedItem name (ibt-153): a name for the item.Must be non-empty.
descriptionstring
Required
Client-providedItem description (ibt-154): a description for the item.Must be non-empty.
quantitynumber
Required
Client-providedInvoiced quantity (ibt-129).Must be a positive number.
unit_codestring
Required
Client-providedInvoiced quantity unit of measure code (ibt-130).Must be a valid UN/ECE Rec 20/21 code (e.g. EA, KGM, LTR). See Get Unit of Measure Codes section for details.
priceobject
Required
Client-providedItem net price details. See Price object section for details.Must satisfy Price object validation.
classified_tax_categoryobject
Required
Client-providedLine VAT information: VAT applicable for the goods and services invoiced on this line. See Tax category object section for details.Must satisfy Tax category object validation; tax_exemption_reason_code and tax_exemption_reason are required when id is E.
additional_item_identificationarray
Conditional
Client-providedService Accounting Code (SAC) for service lines. Required when Item Type is Services (S) or Both (B). See Additional item identification object and Line item classification (UI to API).When required: include at least one entry with id (SAC value) and scheme_id: "SAC" (IBR-189-AE).
commodity_classificationobject
Conditional
Client-providedItem type, HSN, and reverse-charge metadata for the line. Maps UI Item Type and Item Classification Identifier fields. See Commodity classification object and Line item classification (UI to API).When Item Type is Goods (G) or Both (B): require commodity_code, item_classification_code, and item_classification_list_id: "HS". When Services only (S): send commodity_code; use additional_item_identification for SAC.
notestring
Optional
Client-providedFree-text note for the line.Free text.
accounting_coststring
Optional
Client-providedAccounting cost center for this line.Free text.
invoice_periodobject
Optional
Client-providedLine invoicing period (ibt-134, ibt-135). See Invoice period object section for details.If present: dates in yyyy-MM-dd, with start_date ≤ end_date; line period must fall within document-level invoice_period when both are sent.
order_line_referenceobject
Optional
Client-providedInvoice line identifier (ibt-126). See Order line reference object section for details.Required for compliance (IBR-021): must include line_id when sent.
despatch_line_referenceobject
Optional
Client-providedReference to a despatch document line. See Despatch line reference object section for details.If present, must be valid.
document_referenceobject
Optional
Client-providedReference to a related document for this line. See Line document reference object section for details.If present: id required.
chargesarray
Optional
Client-providedLine-level charges that increase the line amount. See Charge object section for details.If present: each item must include reason or reason_code. tax_category is optional at line level.
allowancesarray
Optional
Client-providedLine-level allowances (discounts) on the line. See Allowance object section for details.If present: each item must include reason or reason_code. tax_category is optional at line level.
buyer_item_identificationobject
Optional
Client-providedBuyer's item identification: an identifier assigned by the buyer for the item. See Buyer item identification object section for details.If present: must include id.
seller_item_identificationobject
Optional
Client-providedSeller's item identification: an identifier assigned by the seller for the item. See Seller item identification object section for details.If present: must include id.
standard_item_identificationobject
Optional
Client-providedStandard item identification (ibt-157): an item identifier based on a registered scheme. See Standard item identification object section for details.If present: must include id and scheme_id (IBR-064).
origin_countryobject
Optional
Client-providedOrigin country: country of origin for the item. See Origin country object section for details.If present: must include a valid country identification code.
additional_item_propertyarray
Optional
Client-providedItem attributes: properties of the goods and services invoiced on this line. See Additional item property object section for details.If present: each item must include name and value.
lot_number_idstring
Optional
Client-providedBatch number: an identifier for the production batch or lot that the items come from.Free text.
line_object_identifierstring
Optional
Client-providedInternal line object identifier used by your integration.Free text.
Invoice period object

Used on document lines (document_lines[].invoice_period) and at document level (invoice_period).

FieldTypeRequiredSourceDescriptionValidation
start_datestring
Conditional
Client-providedInvoicing period start date (ibt-134 on lines, ibt-073 at document level).Format yyyy-MM-dd; if both dates are sent, must be ≤ end_date.
end_datestring
Conditional
Client-providedInvoicing period end date (ibt-135 on lines, ibt-074 at document level).Format yyyy-MM-dd; if both dates are sent, must be ≥ start_date.
descriptionstring
Optional
Client-providedDescription or billing frequency (e.g. monthly).Free text.
Order line reference object
FieldTypeRequiredSourceDescriptionValidation
line_idstring
Required
Client-providedInvoice line identifier (ibt-126).Must be non-empty when the object is present.
order_reference_idstring
Optional
Client-providedRelated order reference identifier for this line.Free text.
Despatch line reference object
FieldTypeRequiredSourceDescriptionValidation
line_idstring
Required
Client-providedDespatch document line identifier.Must be non-empty when the object is present.
Line document reference object
FieldTypeRequiredSourceDescriptionValidation
idstring
Required
Client-providedReferenced document identifier.Must be non-empty when the object is present.
issue_datestring
Optional
Client-providedReferenced document issue date.If present, format yyyy-MM-dd.
Buyer item identification object

The buyer_item_identification field is an object with the following attributes:

FieldTypeRequiredSourceDescriptionValidation
idstring
Required
Client-providedItem buyer's identifier: an identifier, assigned by the buyer, for the item.Must be non-empty when the object is present.
Seller item identification object

The seller_item_identification field is an object with the following attributes:

FieldTypeRequiredSourceDescriptionValidation
idstring
Required
Client-providedItem seller's identifier: an identifier, assigned by the seller, for the item.Must be non-empty when the object is present.
Standard item identification object

The standard_item_identification field is an object with the following attributes:

FieldTypeRequiredSourceDescriptionValidation
idstring
Required
Client-providedItem standard identifier: an item identifier based on a registered scheme.Must be non-empty when the object is present.
scheme_idstring
Required
Client-providedScheme identifier: the identification scheme identifier of the item standard identifier.Must be a valid ISO 6523 ICD scheme (IBR-CL-21).
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:

FieldTypeRequiredSourceDescriptionValidation
idstring
Required
Client-providedService Accounting Code (SAC): classifies the service by type or nature.Must be non-empty when the object is present.
scheme_idstring
Required
Client-providedSAC scheme identifier.Must be "SAC" when SAC is provided (IBR-189-AE).
scheme_version_idstring
Optional
Client-providedSAC scheme version identifier.Free text when provided.
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

LayerName / value
UI labelItem Type
Form fieldcommodity_code
UI valuesG = Goods, S = Services, B = Both
API (per line)commodity_classification.commodity_code

#### Item classification identifier (HSN)

Applies when Item Type is Goods (`G`) or Both (`B`).

LayerName / value
UI labelItem Classification Identifier
Form fielditem_classification_identifier.code (optional description)
API (per line)commodity_classification.item_classification_code — HSN code string

#### Service accounting code (SAC)

Applies when Item Type is Services (`S`) or Both (`B`).

LayerName / value
UI labelService Accounting Code
API (per line)additional_item_identification[].id with scheme_id: "SAC"

#### Related fields

UI / formAPIPurpose
Item Type (commodity_code)commodity_classification.commodity_codeGoods / Services / Both
Item Classification Identifiercommodity_classification.item_classification_code + item_classification_list_id: "HS"HSN for goods
Service Accounting Code (Services / Both)additional_item_identification[].id with scheme_id: "SAC"SAC for services
nature_code (separate; reverse charge)commodity_classification.nature_codeNot the Item Type dropdown
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.

FieldTypeRequiredSourceDescriptionValidation
commodity_codestring
Conditional
Client-providedItem type (UI: Item Type). Whether the line is Goods, Services, or Both.Required when classifying the line. Must be G, S, or B. Maps from UI/form field commodity_code.
item_classification_codestring
Conditional
Client-providedItem classification identifier (UI: HSN). Harmonized System code for the goods on this line.Required when commodity_code is G or B (IBR-184-AE). Must be non-empty. Maps from UI item_classification_identifier.code.
item_classification_list_idstring
Conditional
Client-providedHSN scheme identifier (UNTDID 7143).Required when item_classification_code is sent. Always "HS" for UAE (IBR-188-AE).
item_classification_list_version_idstring
Optional
Client-providedHSN scheme version.Send null (do not omit if your serializer requires the key).
nature_codestring
Optional
Client-providedType of goods or services subject to reverse charge (RCM). Separate from Item Type.If present, must be a valid RCM nature code (IBR-166-AE). Not the Item Type dropdown.
Origin country object
FieldTypeRequiredSourceDescriptionValidation
identification_codestring
Required
Client-providedISO 3166-1 alpha-2 country code for country of origin.Must be a valid country code. See Get Countries section for details.
Additional item property object
FieldTypeRequiredSourceDescriptionValidation
namestring
Required
Client-providedAttribute name (e.g. color, size, material).Must be non-empty when the object is present.
valuestring
Required
Client-providedAttribute value.Must be non-empty when the object is present.
Charge object

Each element of the charges array is an object with the following attributes:

FieldTypeRequiredDescriptionValidation
reasonstring
Conditional
Free-text charge reason. Use this for a custom charge reason when no code applies.At least one of reason or reason_code must be provided.
reason_codestring
Conditional
UN/ECE Recommendation 20 charge reason code.At least one of reason or reason_code must be provided. Must be a valid charge reason code (e.g. FC). See Get Charge Reason Codes section for details.
tax_categoryobject
Conditional
Tax category applied to the charge.Required for document-level charges. Optional for line-level charges. If present, see Tax category object. tax_exemption_reason_code and tax_exemption_reason are required when id is E.
amountnumber
Optional
Charge amount.Numeric amount for the charge.
multiplier_factor_numericnumber
Optional
Percentage or multiplier used to calculate the charge.If sent, base_amount must also be sent.
base_amountnumber
Optional
Base amount for the charge.If sent, multiplier_factor_numeric must also be sent.
Allowance object

Each element of the allowances array is an object with the following attributes:

FieldTypeRequiredDescriptionValidation
reasonstring
Conditional
Free-text allowance or discount reason. Use this for a custom reason when no code applies.At least one of reason or reason_code must be provided.
reason_codestring
Conditional
UN/ECE Recommendation 20 allowance reason code.At least one of reason or reason_code must be provided. Must be a valid code (e.g. 95). See Get Discount Reason Codes section for details.
tax_categoryobject
Conditional
Tax category for allowance adjustment.Required for document-level allowances. Optional for line-level allowances. If present, see Tax category object. tax_exemption_reason_code and tax_exemption_reason are required when id is E.
amountnumber
Optional
Allowance amount.Numeric amount for the allowance.
multiplier_factor_numericnumber
Optional
Percentage or multiplier used to calculate the allowance.If sent, base_amount must also be sent.
base_amountnumber
Optional
Base amount for the allowance.If sent, multiplier_factor_numeric must also be sent.
Attachment object (request)

Use these fields when sending attachments on create or update requests.

FieldTypeRequiredDescriptionValidation
file_namestring
Required
Name of the attached file, including extension.Must be non-blank.
file_typestring
Required
MIME type of the attachment.Must be one of: text/csv, application/pdf, image/png, image/jpeg, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.oasis.opendocument.spreadsheet.
file_contentstring
Required
Base64-encoded file bytes.Must be valid Base64. Leading and trailing whitespace is trimmed before decode.
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.

FieldTypeRequiredDescription
idstring
Required
Unique attachment identifier. Use as {attachmentId} on the download endpoint.
file_namestring
Required
Stored file name.
file_typestring
Required
Stored MIME type.

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:

FieldTypeRequiredDescriptionValidation
payment_means_codestring
Required
Payment means code (e.g. 54 for credit card).Required when a payment_means item is sent. Must not be blank. Must be one of: 1, 10, 20, 21, 30, 49, 54, 55, 68. See Get Payment Means Modes section for details.
card_accountobject
Conditional
Card account details.Mandatory when payment_means_code is 54 or 55.
payee_financial_accountobject
Conditional
Payee bank/financial account details.Mandatory when payment_means_code is 30.
payment_mandateobject
Conditional
Payment mandate details.Mandatory when payment_means_code is 49.
idstring
Optional
Payment means identifier.Optional identifier for the payment instruction.
payment_idarray of strings
Optional
Payment reference identifiers.Used for payment reconciliation.
Card account object

The card_account field is an object with the following attributes:

FieldTypeRequiredDescriptionValidation
primary_account_number_idstring
Required
Primary account number identifier. UI label: PAN.Mandatory when payment_means_code is 54 or 55; must not be blank.
network_idstring
Required
Card network identifier. UI label: Network ID.Mandatory when payment_means_code is 54 or 55; must not be blank.
holder_namestring
Optional
Card holder name.Free text.
Payee financial account object

The payee_financial_account field is an object with the following attributes:

FieldTypeRequiredDescriptionValidation
idstring
Optional
Payee financial account identifier. UI label: Payment account identifier.Mandatory when payment_means_code is 30.
namestring
Optional
Payee financial account name.Free text.
financial_institution_branch_idstring
Optional
Financial institution branch identifier.Free text.
addressobject
Optional
Payee financial account address.If present, see Address object.
Payment mandate object

The payment_mandate field is an object with the following attributes:

FieldTypeRequiredDescriptionValidation
idstring
Optional
Payment mandate identifier. UI label: Mandate reference Identifier.Mandatory when payment_means_code is 49.
payer_financial_account_idstring
Optional
Payer financial account identifier. UI label: Payer Financial Account Identifier.Mandatory when payment_means_code is 49.
Payment terms object

The payment_terms field is an object with the following attributes:

FieldTypeRequiredDescriptionValidation
notestring
Optional
Payment terms description.Free text.
due_datestring
Optional
Payment due date.If present, format yyyy-MM-dd.
installment_due_datestring
Optional
Installment due date.If present, format yyyy-MM-dd.
amountnumber
Optional
Amount due.Must be numeric if provided.
Tax exchange rate object

The tax_exchange_rate field is an object with the following attributes:

FieldTypeRequiredDescriptionValidation
source_currency_codestring
Required
Source currency (ISO 4217).Must be a valid ISO 4217 code. See Get Currency Names and Codes section for details.
target_currency_codestring
Required
Target currency (ISO 4217).Must be a valid ISO 4217 code and usually match tax_currency_code. See Get Currency Names and Codes section for details.
calculation_ratenumber
Required
Exchange rate for tax calculation.Must be a positive numeric rate.
Response meta_info object

The meta_info field is an object with the following attributes:

FieldTypeRequiredDescriptionValidation
peppol_statusobject
Optional
Peppol participant/FTA processing status.Response-only; see Peppol status object below.
Peppol status object

The meta_info.peppol_status field is an object with the following attributes:

FieldTypeRequiredDescriptionValidation
participant_statusstring
Optional
Participant-level processing status.Must be one of the status values listed below.
fta_statusstring
Optional
FTA submission/processing status.Must be one of the status values listed below.
overall_statusstring
Optional
Overall Peppol processing status.Must be one of the status values listed below.
validation_resultsarray
Optional
Validation details/errors returned during processing.Response-only list; empty when there are no validation issues.
Status values
ValueMeaning
VALIDATION_FAILEDThe received document failed validation checks.
PENDINGProcessing is in progress.
APPROVEDThe document is accepted.
REJECTEDThe document is processed but rejected.
Client processing guidance:
  1. Treat overall_status as the primary state for workflow decisions.

  2. Use participant_status and fta_status as stage-specific diagnostics for UI and support logs.

  3. If overall_status is PENDING, keep the invoice in a processing state and poll/re-fetch later.

  4. If overall_status is APPROVED, mark the Peppol flow as successful and continue normal downstream actions.

  5. If overall_status is REJECTED or VALIDATION_FAILED, stop submission-dependent actions and surface the failure to users.

  6. When validation_results is not empty, display user-friendly error summaries from text, and retain flag, reasonCode, location, and test for troubleshooting.

  7. participant_status or fta_status can be null in early/failed validation stages; do not treat null alone as success or failure.

Invoice type codes

Purchase invoices created via API use self-billing per PINT AE Self-Billing v1.0.4.

CodeNameWhen to use
389Self-billed invoiceRequired for all purchase invoices via API. The API overrides any other value to 389.
Non-AED invoices

When document_currency_code is not AED:

RuleDetail
tax_currency_codeRequired; must be AED.
tax_exchange_rateRequired; source_currency_code = document_currency_code; target_currency_code = 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.

ScenarioTypical profile_execution_idExamples page
Standard invoice00000000Minimal purchase invoice
Free Trade Zone (FTZ)10000000Free Trade Zone
Summary invoice00010000Summary invoice
Disclosed Agent Billing00001000Disclosed agent billing
Export delivery00000001Export transaction
Implementation notes

TopicAPI layerPeppol / FTA
invoice_type_codeAlways stored as 389Self-billed per PINT AE
accounting_customer_partyAlways overwritten from {profileId}Customer from business profile
Profile-flag rulesPartial at APIFull at transmission
$2

  • VAT rules are applied according to UAE VAT law

  • Invoice status and transmission events are tracked

Party VAT and registration validation

RuleDescription
Time fieldsWhen sending issue_time or delivery_time, use Gulf Standard Time (GST, UTC+4). Format HH:mm:ss.
Party VAT (party_tax_scheme)Optional for UAE supplier parties. If either company_id or tax_scheme is provided, both are required with UAE VAT format
VAT/TRN format15 digits; starts with 1 and ends with 03
Supplier registrationOptional. If scheme_agency_id is provided, company_id is required and type-specific rules apply. See The Supplier party object section for details.
UAE supplier TINRequired for UAE suppliers. Exactly 10 characters, must start with 1
UAE supplier telephoneRequired for UAE suppliers

See The Supplier party object section for details.

Request

POST /api/purchase-invoices/{business_profile_id}
Authorization: Bearer {jwt_token}
X-MARMIN-VERSION: 20260507
Response

Status code: 201 Created

Returns the created purchase invoice with all request fields echoed plus system-generated and calculated fields.

Response body fields
FieldTypeSourceDescription
idstringSystem ProvidedPrimary identifier for the document (UUID). Automatically generated when the invoice is created.
org_idstringSystem ProvidedUnique identifier of the organization that owns this invoice.
document_sequencelongSystem ProvidedSequential number for the invoice within your organization. Used for compliance and tracking.
allowance_total_amountnumberCalculatedTotal of all document-level allowances.
charge_total_amountnumberCalculatedTotal of all document-level charges.
line_extension_amountnumberCalculatedSum of all line amounts before charges, allowances, and taxes. UBL 2.1 LineExtensionAmount.
tax_exclusive_amountnumberCalculatedLine extension plus charges minus allowances, before tax. UBL 2.1 TaxExclusiveAmount.
tax_amountnumberCalculatedAggregated VAT amount in document currency. UBL 2.1 TaxTotal.
tax_amount_in_aednumberCalculatedTotal tax amount converted to AED.
tax_inclusive_amountnumberCalculatedTax exclusive amount plus total tax. UBL 2.1 TaxInclusiveAmount.
payable_amountnumberCalculatedFinal amount due. UBL 2.1 PayableAmount.
payable_amount_in_aednumberCalculatedFinal amount payable in AED.
total_item_allowancesnumberCalculatedTotal of all line-level allowances.
total_item_chargesnumberCalculatedTotal of all line-level charges.
total_taxable_amountnumberCalculatedTotal taxable amount.
total_non_taxable_amountnumberCalculatedTotal non-taxable amount.
tax_breakdownarrayCalculatedTax amounts by tax category (S, Z, E, O, AE, N) and rate. UBL 2.1 TaxSubtotal.
is_phase2_documentbooleanSystem ProvidedWhether the document is Peppol-enabled (Phase 2).
meta_infoobjectSystem ProvidedAdditional metadata. See Meta info object below.
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_category for 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.

ConcernBehavior
Payload sizeEntire POST body must not exceed 8MB (see 413 below).
Create responseEach attachment in the 201 body includes id, file_name, and file_type only.
System PDFOn successful create, the API adds invoice.pdf (application/pdf) for the rendered document in addition to any attachments you send.
DownloadUse Download attachment with the id from the response to fetch file bytes.
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"
  }
}
Next