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 objectThe UNA segment. Included only when the EdifactInterchange uses at least one non-default delimiter or service character.
- UNB
UNB objectThe UNB segment.
- Groups
list of EdifactGroup objectsThe list of functional groups.
- UNZTrailers
list of UNZ objectsThe list of interchange trailers. Always contains one item for valid interchanges.
- Result
OperationResult objectThe 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
stringComponent data element separator.
- DataElement
stringData element separator.
- DecimalNotation
stringDecimal notation. Comma or full stop.
- ReleaseIndicator
stringRelease indicator. If not used, insert space character.
- Reserved
stringReserved for future use. Insert space character.
- Segment
stringSegment 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
objectSyntax identifier.
-
SyntaxIdentifier_1
stringa3, upper case Controlling Agency (e.g. UNO=UN/ECE) and a1 stating level (e.g. A) (which together give UNOA).
-
SyntaxVersionNumber_2
stringIncrements 1 for each new version. Shall be 2 to indicate this version.
-
- INTERCHANGESENDER_2
objectThe interchange sender.
-
InterchangeSenderIdentification_1
stringSender identification. Code or name as specified in IA
-
IdentificationCodeQualifier_2
stringPartner identification code qualifier. Used with sender identification code.
-
InterchangeSenderInternalIdentification_3
stringAddress for reverse routing.
-
- INTERCHANGERECIPIENT_3
objectThe interchange recipient.
-
InterchangeRecipientIdentification_1
stringRecipient Identification. Code or name as specified in IA
-
IdentificationCodeQualifier_2
stringPartner identification code qualifier. Used with recipient identification code.
-
InterchangeRecipientInternalIdentification_3
stringRouting address. If used, normally coded sub-address for onward routing.
-
- DATEANDTIMEOFPREPARATION_4
objectThe date and time when the interchange was created.
-
Date_1
stringDate.
-
Time_2
stringTime.
-
- InterchangeControlReference_5
stringUnique reference assigned by the sender.
- RECIPIENTSREFERENCEPASSWORDDETAILS_6
objectThe date and time when the interchange was created.
-
RecipientReferencePassword_1
stringRecipient's reference/password.
-
RecipientReferencePasswordQualifier_2
stringRecipient's reference/password qualifier.
-
- ApplicationReference_7
stringOptionally message identification if the interchange contains only one type of message.
- ProcessingPriorityCode_8
stringUsed if specified in IA.
- AcknowledgementRequest_9
stringSet = 1 if sender requests acknowledgment, i.e. UNB and UNZ segments received and identified.
- InterchangeAgreementIdentifier_10
stringIf 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
stringSet = 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 objectThe UNG segment.
- Transactions
list of Transaction objectsThe 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 objectsThe 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
stringIdentifies the one message type in the functional group.
- APPLICATIONSENDERIDENTIFICATION_2
objectApplication sender's identification.
-
ApplicationSenderIdentification_1
stringCode or name identifying the division, department, etc. within the originating sender's organization.
-
IdentificationCodeQualifier_2
stringMay be used if the sender identification is a code.
-
- APPLICATIONRECIPIENTIDENTIFICATION_3
objectRecipient's identification.
-
ApplicationRecipientIdentification_1
stringCode or name identifying the division, department, etc. within the recipient's organization for which the group of messages is intended.
-
IdentificationCodeQualifier_2
stringMay be used if recipient identification is a code.
-
- DATEANDTIMEOFPREPARATION_4
objectDate and time of preparation.
-
Date_1
stringDate.
-
Time_2
stringTime.
-
- GroupReferenceNumber_5
stringUnique reference number assigned by sender's division, department, etc.
- ControllingAgency_6
stringCode to identify the agency controlling the specification, maintenance, and publication of the message type.
- MESSAGEVERSION_7
objectMessage version.
-
MessageVersionNumber_1
stringMessage version number. The version number of the message type the functional group.
-
MessageReleaseNumber_2
stringMessage release number. Release number within current version number.
-
AssociationAssignedCode_3
stringAssociation assigned Code. A code assigned by the association responsible for the design and maintenance of the type of message concerned.
-
- ApplicationPassword_8
stringPassword 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
stringThe count of the number of messages in the functional group.
- GroupReferenceNumber_2
stringShall 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
stringThe count of the number of messages or, if used, the number of functional groups in the interchange.
- InterchangeControlReference_2
stringShall be identical to REFERENCE 0020 in UNB.
Comments
0 comments
Please sign in to leave a comment.