Marmin

Create a Purchase Register Entry


Creates a document in the purchase register. Use entry_type PURCHASE or PURCHASE_ADJUSTMENT and document_type INVOICE or CREDIT_NOTE. Include org_id when your API requires it. A valid bearer token is required.

Rate limit

60 requests/minute per authenticated account. See Rate limiting for response headers (X-RateLimit-*) and retry guidance.

Path parameter

POST /api/document-registers/{profile_id}
Authorization: Bearer {jwt_token}
X-MARMIN-VERSION: 20260507
ParameterTypeRequiredDescription
profile_idstring
Required
Business profile ID of the customer (your company). The API uses this to fill accounting_customer_party, so you do not send it in the request body.
Document register request – all fields

Fields in the register request body. Rows are ordered RequiredConditionalOptional.

Do not send: accounting_customer_party — the API sets the customer from profile_id in the URL.

FieldTypeRequiredDescription
issue_datestring
Required
Date the document was issued. Format: YYYY-MM-DD.
transaction_datestring
Required
Date of the transaction. Format: YYYY-MM-DD.
accounting_periodstring
Required
Accounting period for the entry. Format: YYYY-MM.
document_numberstring
Required
Your unique document reference number.
document_typestring
Required
Type of document. One of: INVOICE, CREDIT_NOTE.
entry_typestring
Required
Type of register entry. For purchase use PURCHASE or PURCHASE_ADJUSTMENT.
notestring
Required
Free-text note or reason for the document.
accounting_supplier_partyobject
Required
Supplier (vendor) party. Must include tax_scheme and postal_address. See Party table below.
document_linesarray
Required
Line items. At least one item required.
document_currency_codestring
Required
ISO currency code (e.g. AED). See Get Currency Names and Codes.
payable_amountnumber
Required
Total amount payable including tax. Must be ≥ 0.
tax_amountnumber
Required
Total tax amount. Must be ≥ 0.
tax_exchange_rateobject
Conditional
Exchange rate when document_currency_code is not AED. target_currency_code must be AED.
Non-AED register entries

When document_currency_code is not AED, include tax_exchange_rate with target_currency_code = AED.

Party (accounting_supplier_party / accounting_customer_party)
FieldTypeRequiredDescription
namestring
Optional
Legal or display name of the party.
party_namestring
Optional
Trading or business name of the party.
tax_schemestring
Required
Tax scheme (for example VAT for UAE). See Get Tax Schemes.
tinstring
Optional
Tax identification number (TRN).
emailstring
Optional
Party email address.
telephonestring
Optional
Party telephone number.
gl_accountstring
Optional
GL account.
postal_addressobject
Required
Party address. See Address object below.
Address object

Party postal_address uses the address object structure.

FieldTypeRequiredDescription
street_namestring
Required
Street name and number.
additional_street_namestring
Optional
Additional street details.
city_namestring
Required
City name.
postal_zonestring
Optional
Postal or ZIP code.
country_subentitystring
Required
Emirate or region code (e.g. DXB, SHJ, AUH). See Get UAE Subdivisions.
address_linestring
Optional
Additional address line.
countrystring
Required
Country name (e.g. United Arab Emirates).
country_codestring
Required
ISO 3166-1 alpha-2 country code (e.g. AE). See Get Countries.
Document line (each item in `document_lines`)
FieldTypeRequiredDescription
namestring
Required
Line item description or product/service name.
quantitynumber
Required
Quantity. Must be ≥ 1.
net_amountnumber
Required
Net amount (before tax) for this line. Must be ≥ 0.
tax_amountnumber
Required
Tax amount for this line. Must be ≥ 0.
classified_tax_categoryobject
Required
Tax category for this line. See Tax category object below.
Tax category object

Line-item classified_tax_category uses the shared tax category structure.

FieldTypeRequiredDescription
idstring
Required
Tax category code (for example S, Z, E). See Get Tax Categories.
percentnumber
Optional
Tax rate as percentage (0–100). Should align with id.
tax_exemption_reason_codestring
Conditional
FTA exemption reason code. Required when id is E. See Get Tax Exemption Reason Codes.
tax_exemption_reasonstring
Conditional
Exemption reason description. Required when id is E; must match the selected tax_exemption_reason_code description.
tax_schemestring
Optional
Tax scheme (for example VAT). See Get Tax Schemes.
Supplier and customer from profile

For purchase and purchase adjustments:

Entry typeParty from profileIn request body
PURCHASE, PURCHASE_ADJUSTMENTCustomer (accounting_customer_party)Do not send accounting_customer_party. Send accounting_supplier_party.

Use the same request body structure for all purchase scenarios; only entry_type and document_type change.

Request body

Send a JSON object with the fields described in the request fields below. Typical combinations:

Scenarioentry_typedocument_type
Purchase invoicePURCHASEINVOICE
Purchase credit notePURCHASECREDIT_NOTE
Purchase adjustmentPURCHASE_ADJUSTMENTINVOICE or CREDIT_NOTE

Include org_id when your API requires it.

Response

Status code: 201 Created

Response body:

Returns the created register entry with request data and system‑generated fields (id, uuid, source_type, line ids, created_at, updated_at). When provided, org_id is included in the response.

Error responses

400 Bad Request

Invalid request body or validation failed. The response returns an errors object with field names as keys and error messages as values.

401 Unauthorized

Authentication required or invalid token.

500 Internal Server Error

An error occurred while processing the request.

Next