Skip to main content

Status messages

Responses are sent in CIUS XML MessageStatus version 2.1, in which:

  • The file name sent by ilink follows the structure Response_{UUID_MESSAGE_STATUS}
  • The element DocumentResponse>DocumentReference>ID contains the document number in question
  • The element DocumentResponse>DocumentReference>UUID contains the AdditionalDocumentReference>ID[schemeID=AIM] of the document in question. If it does not exist, this element is not sent.

Note: If the received document cannot be read (corrupted file, invalid XML), ilink returns a .txt message to the issuer with a title equal to the AS2_MESSAGE_ID of the document in question, indicating that the file could not be read.

Note: If sending the MessageStatus fails, ilink retries at the end of the day and will continue attempting until the file is delivered to the recipient.

Example of a status file:

<?xml version="1.0" encoding="UTF-8"?>
<ubl:DocumentStatus xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
xmlns:ubl="urn:oasis:names:specification:ubl:schema:xsd:DocumentStatus-2">
<cbc:CustomizationID>urn:feap.gov.pt:MSGSTS_CIUS-PT:2.1</cbc:CustomizationID>
<cbc:ID>Response_f02866d2-feeb-4f96-9320-d00507c0018a_6e098568-dfde-4835-87e9-28f6ca1b139d</cbc:ID>
<cbc:IssueDate>2021-04-13</cbc:IssueDate>
<cbc:IssueTime>09:06:41.0000000+01:00</cbc:IssueTime>
<cac:SenderParty>
<cac:PartyName>
<cbc:Name>PUBLIC ENTITY Nº 156</cbc:Name>
</cac:PartyName>
<cac:PostalAddress>
<cac:Country>
<cbc:IdentificationCode>PT</cbc:IdentificationCode>
</cac:Country>
</cac:PostalAddress>
<cac:PartyTaxScheme>
<cbc:CompanyID>PT614054128</cbc:CompanyID>
<cac:TaxScheme>
<cbc:ID>VAT</cbc:ID>
</cac:TaxScheme>
</cac:PartyTaxScheme>
<cac:PartyLegalEntity>
<cbc:RegistrationName>PUBLIC ENTITY Nº 156</cbc:RegistrationName>
</cac:PartyLegalEntity>
</cac:SenderParty>
<cac:ReceiverParty>
<cac:PartyName>
<cbc:Name>Consulting Services, Lda.</cbc:Name>
</cac:PartyName>
<cac:PostalAddress>
<cac:Country>
<cbc:IdentificationCode>PT</cbc:IdentificationCode>
</cac:Country>
</cac:PostalAddress>
<cac:PartyTaxScheme>
<cbc:CompanyID>PT547570692</cbc:CompanyID>
<cac:TaxScheme>
<cbc:ID>VAT</cbc:ID>
</cac:TaxScheme>
</cac:PartyTaxScheme>
<cac:PartyLegalEntity>
<cbc:RegistrationName>Consulting Services, Lda.</cbc:RegistrationName>
</cac:PartyLegalEntity>
</cac:ReceiverParty>
<cac:DocumentResponse>
<cac:Response>
<cbc:ResponseCode>11</cbc:ResponseCode>
</cac:Response>
<cac:DocumentReference>
<cbc:ID>ZM 02/7000009232102</cbc:ID>
<cbc:UUID>f02866d2-feeb-4f96-9320-d00507c0018a</cbc:UUID>
<cbc:IssueDate>2021-03-10</cbc:IssueDate>
<cbc:DocumentTypeCode>380</cbc:DocumentTypeCode>
</cac:DocumentReference>
</cac:DocumentResponse>
</ubl:DocumentStatus>

Status list

ilink MessageStatus values include the EDI statuses defined by eSPap in the element DocumentResponse>Response>ResponseCode:

CodeDescription
ACCEPTEDDocument passed XML validation and quality rules, was integrated into the system and sent to recipient
ERRORDocument did not pass initial quality validation (invalid XML, missing mandatory fields, recipient rules not met, etc.)
14Document rejected by recipient and awaiting regularization (must be corrected and resent, or replaced with a credit/debit note)
22Document returned by recipient and must be cancelled; a new document should be issued
33Document in payment
29Document paid
11Document processed by recipient (accepted)
30Credit note accepted by recipient

Note: ERROR, 14 and 22 statuses include an error description in DocumentResponse>Response>Description. While 33 and 29 are not sent by ilink, they are received and interpreted correctly by the system.

EDI status flow

Possible flows a document can follow:

DescriptionProcess
Document arrived at ilink and failed semantic XML or quality rules validation (CIUS-PT error, missing mandatory fields, non-existent connection).ERROR
Document arrived at ilink and passed XML validation, being sent to the recipient.ACCEPTED
DDocument arrived at ilink, validated correctly, and reached the recipient, but the recipient did not integrate it and requested regularisation (credit note issuance or rectified resending).ACCEPTED > 14
Document arrived at ilink, validated correctly, and reached the recipient, but was returned, requiring a new document.ACCEPTED > 22
Document arrived at ilink, validated correctly, and was integrated into the recipient’s accounting system.ACCEPTED > 11
Credit note arrived at ilink, validated correctly, and was integrated into the recipient’s system for cash adjustment.ACCEPTED > 30

Document resending

A document can only be resent after rectification if the last status is:

  • ERROR (validation or connection error)
  • 14 (regularisation requested by the customer)

For other statuses, resending is not allowed and the document will be rejected by the system.