Marmin

Edit and resubmit a purchase credit note


Updates and resubmits a specific purchase credit note after fixing validation issues.

Rate limit

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

Path parameters

Request body

Resubmit requires the complete purchase credit note JSON — send the full document payload again, not a partial patch. Include every root-level field you would send on create; corrected values replace the stored document. Omitting fields may clear or reset them.

Request fields

Fields in the request JSON. Rows are ordered RequiredConditionalOptional. 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
profile_execution_idstring
Required
Credit note transaction type code.Exactly 8 characters; each character 0 or 1. See Profile execution ID section for details.
issue_datestring
Required
The date when the credit note was issued.Format yyyy-MM-dd; must be a valid calendar date.
credit_note_type_codestring
Required
The type of credit note.For purchase credit notes this code must be 261 (Self-billed Credit Note).
discrepancy_responsestring
Required
Reason for issuing the credit note per UAE FTA DL8.61.1.Must be one of the allowed discrepancy codes.
document_currency_codestring
Required
ISO 4217 alpha-3 currency code for all monetary amounts.Must be a valid ISO 4217 code. For non-AED documents, see Non-AED credit notes.
accounting_supplier_partyobject
Required
The supplier party for the credit note.Must be a valid party object. See Supplier party object section for details.
document_linesarray
Required
Credit note line items.At least one line required.
billing_referencearray
Required
Billing references to the original invoice being credited.At least one reference required on create; each item requires id.
document_numberstring
Conditional
The credit note number as displayed on the document.Required when auto-numbering is disabled; auto-generated when enabled and omitted. 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 credit notes section for details.
tax_exchange_rateobject
Conditional
Exchange rate for tax calculation in AED.Required when document_currency_code is not AED.
buyer_customer_partyobject
Conditional
Beneficiary ID (UBL BTAE-01).Required for Free Trade Zone (FTZ). See Buyer customer party object section for details.
seller_supplier_partyobject
Conditional
Principle ID (UBL BTAE-14).Required for Disclosed Agent Billing. See Seller supplier party object section for details.
deliveryobject
Conditional
Delivery details.Required for Exports. See Delivery object section for details.
invoice_periodobject
Conditional
Period covered by the credited supply.Required for Summary invoice.
issue_timestring
Optional
The time when the credit note was issued.Format HH:mm:ss. GST (UTC+4). Defaults to 00:00:00 when omitted.
reasonstring
Optional
Free-text explanation for the credit note.Free text.
notestring
Optional
Additional notes on the credit note.Free text.
accounting_coststring
Optional
Accounting cost center identifier.Free text.
buyer_referencestring
Optional
Buyer reference for the credit note.Free text.
order_referenceobject
Optional
Reference to the original order.If present: id required.
despatch_document_referenceobject
Optional
Reference to despatch document.If present: id required.
receipt_document_referenceobject
Optional
Reference to receipt document.If present: id required.
statement_document_referenceobject
Optional
Reference to statement document.If present: id required.
originator_document_referenceobject
Optional
Reference to originating document.If present: id required.
contract_document_referenceobject
Optional
Reference to contract.If present: id required.
payee_partyobject
Optional
Party to whom payment/refund should be made.If present, see Payee party object.
tax_representative_partyobject
Optional
Tax representative party.If present, see Tax representative party object.
payment_termsobject
Optional
Payment terms and conditions.If present, see Payment terms object.
chargesarray
Optional
Document-level charges.If present, see Charge object.
allowancesarray
Optional
Document-level discounts/allowances.If present, see Allowance object.
prepaid_amountnumber
Optional
Total prepaid amount applied.Typically non-negative.
payable_rounding_amountnumber
Optional
Rounding adjustment.May be positive or negative.
document_sourcestring
Optional
Origin of the e-invoice document.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 — valid Beneficiary TIN.
Summary invoiceinvoice_periodstart_date, end_date, and description required.
Disclosed Agent Billingseller_supplier_party.idRequired — valid Principle ID TRN.
ExportsdeliveryRequired with delivery_location.address.
document_currency_codeAEDtax_currency_code, tax_exchange_rateSee Non-AED credit notes section for details.
Credit note createbilling_referenceAt least one reference to the original invoice required.
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 credit note 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.

Resubmit condition

Resubmit is allowed only when:

  • meta_info.peppol_status.overall_status = VALIDATION_FAILED

Attachments

Each attachments item requires file_name, file_type, and Base64 file_content. On resubmit:

  • Omit attachments to keep the existing attachment set unchanged.

  • Send attachments to replace the full set (client uploads are re-persisted).

The response attachments array includes id, file_name, and file_type only. The create-only 8MB payload limit does not apply to this PUT endpoint.

Error responses

StatusDescription
400 Bad RequestResubmit is not allowed while the document is still pending.
401 UnauthorizedAuthentication required or invalid token.
404 Not FoundPurchase credit note not found, or business profile not found.
500 Internal Server ErrorAn error occurred while processing the request.
{
  "errors": {
    "document_status": "document status is still pending state you cannot resubmit"
  }
}
{
  "errors": {
    "message": "Business profile not found with id: {business_profile_id}"
  }
}
Next