EDI API defines EDIFACT resources for all EDIFACT core items, such as control segments, interchange, group, transaction, and the validation/operation result, that are represented by JSON.
EdifactInterchange
EdifactInterchange object represents an EDIFACT interchange, UNB/UNZ block. You get an array of EDIFACT interchanges as part of the Read operation when translating an EDIFACT file to JSON. The Read operation supports EDIFACT files that contain multiple interchanges, that's why the response is an array. In most situations, the array will contain only a single item.
The EdifactInterchange object can be used with the Write operation, to translate it into an EDIFACT file, with the Validate operation, to validate that the interchange is compliant, and with the Ack operation, to generate technical and/or functional CONTRL acknowledgment.
Endpoints
POST /edifact/read |
Response |
POST /edifact/write |
Request |
POST /edifact/validate |
Request |
POST /edifact/ack |
Request and Response |
Example
{ "UNB": { "SYNTAXIDENTIFIER_1": { "SyntaxIdentifier_1": "UNOB", "SyntaxVersionNumber_2": "1" }, "INTERCHANGESENDER_2": { "InterchangeSenderIdentification_1": "SENDER1", "IdentificationCodeQualifier_2": "14", "InterchangeSenderInternalIdentification_3": "ZZUK" }, "INTERCHANGERECIPIENT_3": { "InterchangeRecipientIdentification_1": "RECEIVER1", "IdentificationCodeQualifier_2": "1", "InterchangeRecipientInternalIdentification_3": "ZZUK" }, "DATEANDTIMEOFPREPARATION_4": { "Date_1": "071101", "Time_2": "1701" }, "InterchangeControlReference_5": "131", "ApplicationReference_7": "ORDERS", "AcknowledgementRequest_9": "1", "TestIndicator_11": "1" }, "Groups": [{ "Transactions": [{ "UNH": { "MessageReferenceNumber_01": "000000101", "MessageIdentifier_02": { "MessageType_01": "ORDERS", "MessageVersionNumber_02": "D", "MessageReleaseNumber_03": "96A", "ControllingAgencyCoded_04": "UN" } }, "_comment": "... model specific content goes here ...", "UNT": { "NumberofSegmentsinaMessage_01": "38", "MessageReferenceNumber_02": "000000101" }, "Model": "EdiNation.Edifact.UN.D96A" }] }], "UNZTrailers": [{ "InterchangeControlCount_1": "1", "InterchangeControlReference_2": "131" }], "Result": { "LastIndex": 40, "Details": [], "Status": "success" } }
Attributes
- UNA
UNA object
The UNA segment. Included only when the EdifactInterchange uses at least one non-default delimiter or service character.
- UNB
UNB object
The UNB segment.
- Groups
list of EdifactGroup objects
The list of functional groups.
- UNZTrailers
list of UNZ objects
The list of interchange trailers. Always contains one item for valid interchanges.
- Result
OperationResult object
The operation result.
UNA
UNA object is only used as part of the EdifactInterchange object when at least one delimiter is different than the default. This segment defines the characters selected for use as delimiters and indicators in the rest of the interchange.
Example
{ "ComponentDataElement": ":", "DataElement": "|", "DecimalNotation": ".", "ReleaseIndicator": "?", "Reserved": " ", "Segment": "'" }
Attributes
- ComponentDataElement
string
Component data element separator.
- DataElement
string
Data element separator.
- DecimalNotation
string
Decimal notation. Comma or full stop.
- ReleaseIndicator
string
Release indicator. If not used, insert space character.
- Reserved
string
Reserved for future use. Insert space character.
- Segment
string
Segment terminator.
UNB
UNB object is only used as part of the EdifactInterchange object and represents the standard EDIFACT UNB segment, interchange header.
Example
{ "SYNTAXIDENTIFIER_1": { "SyntaxIdentifier_1": "UNOB", "SyntaxVersionNumber_2": "1" }, "INTERCHANGESENDER_2": { "InterchangeSenderIdentification_1": "102096559TEST", "IdentificationCodeQualifier_2": "16", "InterchangeSenderInternalIdentification_3": "ZZUK" }, "INTERCHANGERECIPIENT_3": { "InterchangeRecipientIdentification_1": "PARTNERID", "IdentificationCodeQualifier_2": "01", "InterchangeRecipientInternalIdentification_3": "ZZUK" }, "DATEANDTIMEOFPREPARATION_4": { "Date_1": "071101", "Time_2": "1701" }, "InterchangeControlReference_5": "131", "ApplicationReference_7": "INVOIC", "AcknowledgementRequest_9": "1", "TestIndicator_11": "1" }
Attributes
- SYNTAXIDENTIFIER_1
object
Syntax identifier.
-
SyntaxIdentifier_1
string
a3, upper case Controlling Agency (e.g. UNO=UN/ECE) and a1 stating level (e.g. A) (which together give UNOA).
-
SyntaxVersionNumber_2
string
Increments 1 for each new version. Shall be 2 to indicate this version.
-
- INTERCHANGESENDER_2
object
The interchange sender.
-
InterchangeSenderIdentification_1
string
Sender identification. Code or name as specified in IA
-
IdentificationCodeQualifier_2
string
Partner identification code qualifier. Used with sender identification code.
-
InterchangeSenderInternalIdentification_3
string
Address for reverse routing.
-
- INTERCHANGERECIPIENT_3
object
The interchange recipient.
-
InterchangeRecipientIdentification_1
string
Recipient Identification. Code or name as specified in IA
-
IdentificationCodeQualifier_2
string
Partner identification code qualifier. Used with recipient identification code.
-
InterchangeRecipientInternalIdentification_3
string
Routing address. If used, normally coded sub-address for onward routing.
-
- DATEANDTIMEOFPREPARATION_4
object
The date and time when the interchange was created.
-
Date_1
string
Date.
-
Time_2
string
Time.
-
- InterchangeControlReference_5
string
Unique reference assigned by the sender.
- RECIPIENTSREFERENCEPASSWORDDETAILS_6
object
The date and time when the interchange was created.
-
RecipientReferencePassword_1
string
Recipient's reference/password.
-
RecipientReferencePasswordQualifier_2
string
Recipient's reference/password qualifier.
-
- ApplicationReference_7
string
Optionally message identification if the interchange contains only one type of message.
- ProcessingPriorityCode_8
string
Used if specified in IA.
- AcknowledgementRequest_9
string
Set = 1 if sender requests acknowledgment, i.e. UNB and UNZ segments received and identified.
- InterchangeAgreementIdentifier_10
string
If used, to identify the type of communication agreement controlling the interchange,e.g. Customs or ECE agreement. Code or name as specified in IA.
- TestIndicator_11
string
Set = 1 if the interchange is a test. Otherwise not used.
EdifactGroup
EdifactGroup object represents an EDIFACT functional group, UNG/UNE block. EdifactGroup object is only used as part of the EdifactInterchange object.
Example
{ "UNG": { "MessageGroupIdentification_1": "CUSCAR", "APPLICATIONSENDERIDENTIFICATION_2": { "ApplicationSenderIdentification_1": "LOCK", "IdentificationCodeQualifier_2": "ZZ" }, "APPLICATIONRECIPIENTIDENTIFICATION_3": { "ApplicationRecipientIdentification_1": "CBP-ACE-TEST", "IdentificationCodeQualifier_2": "ZZ" }, "DATEANDTIMEOFPREPARATION_4": { "Date_1": "20041016", "Time_2": "1604" }, "GroupReferenceNumber_5": "54", "ControllingAgency_6": "UN", "MESSAGEVERSION_7": { "MessageVersionNumber_1": "D", "MessageReleaseNumber_2": "03B" } }, "Transactions": [{ "UNH": { "MessageReferenceNumber_01": "000000101", "MessageIdentifier_02": { "MessageType_01": "ORDERS", "MessageVersionNumber_02": "D", "MessageReleaseNumber_03": "96A", "ControllingAgencyCoded_04": "UN" } }, "_comment": "... model specific content goes here ...", "UNT": { "NumberofSegmentsinaMessage_01": "38", "MessageReferenceNumber_02": "000000101" }, "Model": "EdiNation.Edifact.UN.D96A" }], "UNETrailers": [{ "GroupControlCount_1": "1", "GroupReferenceNumber_2": "54" }] }
Attributes
- UNG
UNG object
The UNG segment.
- Transactions
list of Transaction objects
The list of transactions. This can be any type that represents a transaction which is also recognized as a model by EdiNation.
The following transaction models are available as System models:
- UNETrailers
list of UNE objects
The list of group trailers. It always contains one item for valid groups.
UNG
UNG object is only used as part of the EdifactInterchange object and represents the standard EDIFACT UNG segment, functional group header, and is optional.
Example
{ "MessageGroupIdentification_1": "CUSCAR", "APPLICATIONSENDERIDENTIFICATION_2": { "ApplicationSenderIdentification_1": "LOCK", "IdentificationCodeQualifier_2": "ZZ" }, "APPLICATIONRECIPIENTIDENTIFICATION_3": { "ApplicationRecipientIdentification_1": "CBP-ACE-TEST", "IdentificationCodeQualifier_2": "ZZ" }, "DATEANDTIMEOFPREPARATION_4": { "Date_1": "20041016", "Time_2": "1604" }, "GroupReferenceNumber_5": "54", "ControllingAgency_6": "UN", "MESSAGEVERSION_7": { "MessageVersionNumber_1": "D", "MessageReleaseNumber_2": "03B" } }
Attributes
- MessageGroupIdentification_1
string
Identifies the one message type in the functional group.
- APPLICATIONSENDERIDENTIFICATION_2
object
Application sender's identification.
-
ApplicationSenderIdentification_1
string
Code or name identifying the division, department, etc. within the originating sender's organization.
-
IdentificationCodeQualifier_2
string
May be used if the sender identification is a code.
-
- APPLICATIONRECIPIENTIDENTIFICATION_3
object
Recipient's identification.
-
ApplicationRecipientIdentification_1
string
Code or name identifying the division, department, etc. within the recipient's organization for which the group of messages is intended.
-
IdentificationCodeQualifier_2
string
May be used if recipient identification is a code.
-
- DATEANDTIMEOFPREPARATION_4
object
Date and time of preparation.
-
Date_1
string
Date.
-
Time_2
string
Time.
-
- GroupReferenceNumber_5
string
Unique reference number assigned by sender's division, department, etc.
- ControllingAgency_6
string
Code to identify the agency controlling the specification, maintenance, and publication of the message type.
- MESSAGEVERSION_7
object
Message version.
-
MessageVersionNumber_1
string
Message version number. The version number of the message type the functional group.
-
MessageReleaseNumber_2
string
Message release number. Release number within current version number.
-
AssociationAssignedCode_3
string
Association assigned Code. A code assigned by the association responsible for the design and maintenance of the type of message concerned.
-
- ApplicationPassword_8
string
Password to recipient's division, department, or sectional system (if required).
UNE
UNE object is only used as part of the EdifactInterchange object and represents the standard EDIFACT UNE segment, functional group trailer, and is optional (must be present if UNG is used).
Example
{ "GroupControlCount_1": "1", "GroupReferenceNumber_2": "54" }
Attributes
- GroupControlCount_1
string
The count of the number of messages in the functional group.
- GroupReferenceNumber_2
string
Shall be identical to REFERENCE NUMBER 0048 in UNG.
UNZ
UNZ object is only used as part of the EdifactInterchange object and represents the standard EDIFACT UNZ segment, interchange trailer.
Example
{ "InterchangeControlCount_1": "1", "InterchangeControlReference_2": "131" }
Attributes
- InterchangeControlCount_1
string
The count of the number of messages or, if used, the number of functional groups in the interchange.
- InterchangeControlReference_2
string
Shall be identical to REFERENCE 0020 in UNB.
Comments
0 comments
Please sign in to leave a comment.