Documentation

Core Resources

Article author
Admin
  • Updated

EDI API defines several core resources shared across multiple operations that represent the result from the parsing and the validation operations.

 

OperationResult

The OperationResult object represents the outcome and details of an operation. The API will contain all translation and validation errors and will report them back as OperationResult.

The OperationResult object is always included in the response from the Read operation, to report back any read errors, such as corrupt EDI file, unrecognized EDI transaction, unsupported EDI transaction where no transaction model exists or unparseable transaction, which was only processed partially. The OperationResult will also report any read warnings, such as when a transaction was translated with a secondary model.

The OperationResult object is always included as the response from the Validate operation, to report back the overall validation result as well as any validation errors. The OperationResult reports some control segment data validation as "non-critical".

 

Endpoints

POST /x12/read In Response
POST /x12/validate Response
POST /edifact/read In Response
POST /edifact/validate Response

 

Example Success

{
  "LastIndex": 46,
  "Details": [],
  "Status": "success"
}

 

Example Error

{
  "LastIndex": 19,
  "Details": [
    {
      "Index": 10,
      "TransactionIndex": 2,
      "TransactionRef": "0001",
      "SegmentId": "PO1",
      "Value": "P",
      "Message": "Invalid EDI code P - permitted codes are: AA,AB,AP",
      "Status": "error"
    }
  ],
  "Status": "error"
}

 

Attributes

  • LastIndex integer

    The index of the last segment in the interchange, starting from the ISA. When multiple interchanges are present, the index starts from the first ISA of the first interchange. It is 1 based.

  • Status enumeration

    The status of the Read or Validation operation.

    The available values are:

    Value Description
    success The interchange(s) was translated successfully or are valid
    warning Some transactions were translated using a secondary model
    error Some transactions were partially translated or are invalid
  • Details list of OperationDetail objects

    The list of validation or translation errors and warnings if any.

 

OperationDetail

The OperationDetail object represents the validation or translation context of an EDI item. It reports the error state of either a data element or segment and is used only as part of the OperationResult object.

 

Example

{
  "Index": 10,
  "TransactionIndex": 2,
  "TransactionRef": "0001",
  "SegmentId": "PO1",
  "Value": "P",
  "Message": "Invalid EDI code P - permitted codes are: AA,AB,AP",
  "Status": "error"   
}

 

Attributes

  • Index integer

    The index of the reported segment, starting from the ISA. When multiple interchanges are present, the index starts from the first ISA of the first interchange. It is 0 based.

  • TransactionIndex integer

    The index of the transaction, which contains the failed segment. Starting from the ISA. When multiple interchanges are present, the index starts from the first ISA of the first interchange. It is 0 based.

  • TransactionRef string

    The transaction reference of the transaction, which contains the failed segment. The value is for X12 is ISA.InterchangeControlNumber_13 and for EDIFACT is UNB.InterchangeControlReference_5.

    This value can be used to reference a transaction in the interchange if you need to know the status of a particular transaction instead of the whole interchange.

  • SegmentId string

    The ID of the failed segment.

  • Value string

    The value of the failed item. It could be either the whole segment or a data element.

  • Message string

    The error message.

  • Status enumeration

    The status of the failed item.

    The available values are:

    Value Description
    info Control segment non-critical data validation
    warning Some transactions were translated using a secondary model
    error The item is invalid or a transaction was partially parsed

 

Share this:

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.