Edit and resubmit a purchase credit note
Posts the corrected purchase credit note to POST /api/purchase-credit-notes/{business_profile_id} after a validation failure (VALIDATION_FAILED) or a receiving-ASP rejection (REJECTED). Send the full create payload with the same document_number. The API marks the previous document obsolete and returns 201 Created with a new document id.
Rate limit
60 requests/minute per authenticated account. See Rate limiting for response headers (X-RateLimit-*) and retry guidance.
Path parameters
Request body
Resubmit uses POST /api/purchase-credit-notes/{business_profile_id} — the same endpoint as create. There is no document UUID in the path. Send the complete purchase credit note JSON, 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.
document_number is required and must equal the number on the failed document. If you omit it, the API creates a new credit note instead of resubmitting.
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
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
VALIDATION_FAILED applies only to overall_status.
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.
Example `meta_info` values
Typical meta_info.peppol_status shapes:
APPROVED
{
"meta_info": {
"peppol_status": {
"participant_status": "APPROVED",
"fta_status": "APPROVED",
"overall_status": "APPROVED",
"validation_results": []
}
}
}REJECTED
{
"meta_info": {
"peppol_status": {
"participant_status": "REJECTED",
"fta_status": "APPROVED",
"overall_status": "REJECTED",
"validation_results": []
}
}
}VALIDATION_FAILED
VALIDATION_FAILED applies only to overall_status. participant_status and fta_status can be null.
{
"meta_info": {
"peppol_status": {
"participant_status": null,
"fta_status": null,
"overall_status": "VALIDATION_FAILED",
"validation_results": [
{
"flag": "fatal",
"reasonCode": "IBR-128-AE",
"text": "Country subentity must be a valid UAE subdivision code",
"location": "/Invoice/cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cbc:CountrySubentity",
"test": "normalize-space(.) = 'AUH' or normalize-space(.) = 'DXB' or normalize-space(.) = 'SHJ' or normalize-space(.) = 'UAQ' or normalize-space(.) = 'FUJ' or normalize-space(.) = 'AJM' or normalize-space(.) = 'RAK'"
}
]
}
}
}Resubmit condition
Send POST /api/purchase-credit-notes/{business_profile_id} with the same document_number. The API resubmits when that number matches a non-obsolete, non-Peppol purchase credit note in your organization for the customer TIN on {business_profile_id}, and meta_info.peppol_status.overall_status is VALIDATION_FAILED or REJECTED.
VALIDATION_FAILED: correct the payload usingvalidation_results, then post the full document again with the samedocument_number.REJECTED: the receiving ASP (C3) rejected the document. Correct the source data and post the full document again with the samedocument_number. Do not post it to the ledger.
If document_number matches a document whose overall_status is not VALIDATION_FAILED or REJECTED, the call is treated as create and returns 409 when an active duplicate exists. A document that is PENDING or APPROVED cannot be resubmitted this way.
Response
Status code: 201 Created
The API marks the previous document obsolete and returns a new document. id in the response is a new UUID. Use that id for later retrieve, PDF, and XML calls. document_number stays the same.
Attachments
Each attachments item requires file_name, file_type, and Base64 file_content. On resubmit:
Omit
attachmentsto keep the existing attachment set unchanged.Send
attachmentsto replace the full set (client uploads are re-persisted).
The response attachments array includes id, file_name, and file_type only. The entire POST body must not exceed 8 MB.
Error responses
{
"errors": {
"document_number": "Credit note number 'PCN-0001' already exists.",
"uuid": "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
}
}{
"errors": {
"message": "Business profile not found with id: {business_profile_id}"
}
}