Create a purchase credit note
Creates a self-billed purchase credit note conforming to UBL 2.1 specification.
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 document 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
Request party object
The accounting_supplier_party field is a full party object with the following attributes.
Field requirements depend on whether the party is the buyer or seller. See The Customer party object and The Supplier party object.
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), document-level charges[].tax_category, and allowances[].tax_category.
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 credit note 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 credit note 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.
Non-AED credit notes
When document_currency_code is not AED, tax_currency_code must be AED and tax_exchange_rate is required. See Non-AED invoices on the purchase invoice page for full rules.
Tax point date (UAE VAT)
tax_point_date is optional on create. When omitted, stored as null and omitted from UBL XML. When provided, format yyyy-MM-dd and must be on or before issue_date (Peppol IBR-141-AE).
Implementation notes
See Implementation notes section for details.
$2
Original purchase invoice reference
Supplier party details (taxable supplier)
Buyer party details (credit note issuer)
Buyer business profile identifier
Line items being credited
Discrepancy reason
VAT information
System behavior
VAT is recalculated according to UAE VAT law
Credit note status and transmission events are tracked
Party VAT and registration validation
See The Supplier party object section for details.
Request
POST /api/purchase-credit-notes/{business_profile_id}
Authorization: Bearer {jwt_token}
X-MARMIN-VERSION: 20260507Response
Status code: 201 Created
Returns the created purchase credit note 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"
}
}