Exception Endpoint

Exception Responses / process

Exceptions for the GS1-TI endpoints will result in a callback to a status endpoint and/or an mail to the person responsible for the process.

Depending on the exception a change in ERP can be made and the process can be retried or a issues is raised to resolve the technical problem.

Most common exceptions:

Exception Endpoint

  • Request-Urls:
TBD
  • Request-Method: POST
  • Accept: application/xml; charset=utf-8
  • Accept-encoding: gzip, deflate
  • x-api-pat:: {{PAT_TOKEN}}
  • messageId: Unique id for this message
Exception example
<problem xmlns="urn:ietf:rfc:7807">
<originalMessageId>12893752289</originalMessageId>
<resourceReference>TRL1036LNUM</resourceReference>
<title>Invalid XML according to schema</title>
<status>400</status>
<detail>Elements in the XML are invalid, see details in errors</detail>
<instance>api/v0/gs1-ti</instance>
<type>https://httpstatuses.com/400</type>
<timestamp>2021-06-14 09:13:18<timestamp>
<errors>
<error>
<code>INVALID_SCHEMA</code>
<message>Invalid schema, child element not existent</message>
<explanation>The element 'transportInstruction' has invalid child element 'NonExistent'. List of possible elements expected: 'logisticServicesSeller';
The 'date' element is invalid - The value 'aaa' is invalid according to its datatype. http://www.w3.org/2001/XMLSchema:date' - The string 'aaa' is not a valid Date value
</explanation>
</error>
<error>
<code>REFERENCE_EXIST</code>
<message>Reference already exist</message>
<explanation></explanation>
</error>
</errors>
</problem>
Exception XSD
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns="urn:ietf:rfc:7807"
targetNamespace="urn:ietf:rfc:7807"
elementFormDefault="qualified">
<!-- Definition of the root element -->
<xs:element name="problem">
<xs:complexType>
<xs:sequence>
<xs:element name="originalMessageId" type="xs:string"/>
<xs:element name="resourceReference" type="xs:string"/>
<xs:element name="title" type="xs:string"/>
<xs:element name="status" type="xs:int"/>
<xs:element name="detail" type="xs:string"/>
<xs:element name="instance" type="xs:string"/>
<xs:element name="type" type="xs:anyURI"/>
<xs:element name="timestamp" type="xs:dateTime"/>
<xs:element name="errors">
<xs:complexType>
<xs:sequence>
<xs:element name="error" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="code" type="xs:string"/>
<xs:element name="message" type="xs:string"/>
<xs:element name="explanation" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

Exception Structure:

  • originalMessageId = MessageID as provided by the incoming messageID header from SAP
  • resourceReference = EntityIdentification as provided by SAP GS1-TI (optional)
  • title = A short, human-readable summary of the problem type.
  • status = The HTTP status code generated by the origin server for this occurrence of the problem.
  • detail = A human-readable explanation specific to this occurrence of the problem.
  • instance = A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.
  • type = A URI reference that identifies the problem type. (mostly about:blank)
  • timestamp = datetime the exception occurred
  • errors = Optional array of errors
    • error
      • code = Error Code provided by Viya or Carrier
    • message = Human readable summary of the error description
    • explanation = Optional explanation with suggestion for recovery

To Be Discussed:

Exception list:

  • InvalidXML
  • InvalidXMLAccordingToSchema
  • InvalidXMlNamespace
  • ComsignmentNodeNotFound
  • ConsignorBuilding not present
  • ConsignorBuilding ‘XXX’ not found
  • ConsigneeBuildingNotFound
  • ConsgineeBuilding < 4 Characters
  • ConsgineeBuilding ‘XXX’ Not Found
  • InvalidAWB
  • InvalidModeOfTransport
  • InvalidGS1TiContentException
  • AlreadyBookedException
  • RefusedByCarrier (+ reason)