Milestone Interface
Goal is to keep SAP up to date with status information for each milestone in the transport process provided by the carrier. Additionally Viya will map towards the SAP source system.
Requirements:
- Send
Viya-Tracking-XML
milestone update to SAP system - Mapping of Carrier/Viya codes to SAP milestone codes
- Validation of SAP codes on SAP entry
- Retrigger functionality in case of failures
SAP CPI will provide an endpoint based on the XSD provided by Viya.
Endpoint Definition
Request
- Request-Urls: :
TBD
- Request-Method: POST
- Accept: application/xml; charset=utf-8
- Accept-encoding: gzip, deflate
- TBD
Request Body
Example:
Tracking XML - Milestone Update
<?xml version="1.0" encoding="UTF-8" ?> <milestone> <carrier> <name>MPS LOG SRL</name> <reference>SAPCARRIERCODE:VENDORID:9483743</reference> <integration>mps-logs-srl</integration> <equipment> <licencePlate>AB-123-CD</licencePlate> </equipment> </carrier> <trackingReference> <customer>309239032902</customer> <carrier>6135449611</carrier> <viya>498fasd0</viya> </trackingReference> <event> <eventDatetime>2024-02-12T18:49:00Z</eventDatetime> <eventDescription>Delivered</eventDescription> <scannedBy>Henk</scannedBy> <eventMessage></eventMessage> <eventType> <original> <code>POD</code> <description>Delivered</description> </original> <translated> <code>P1</code> <description>Delivered</description> </translated> </eventType> <eventReason> <translated> <code>DELIVERED AT NEIGHBOUR</code> <description></description> </translated> <original> <code>DELIVERED AT NEIGHBOUR</code> <description></description> </original> </eventReason> <eventLocation> <companyName>BRESCIA GEODIS HUB</companyName> <address> <addressline1></addressline1> <addressline2></addressline2> <addressline3></addressline3> <city></city> <postCode></postCode> <stateCode></stateCode> <countryCode></countryCode> </address> <airportCode></airportCode> <seaportCode></seaportCode> <depotCode></depotCode> </eventLocation> <documents> <type>Packlist</type> <type>ProofOfDeliveryAttempt</type> <type>Signature</type> <content>base64encoded</content> </documents> </event> </milestone>
Specific Milestone Events:
Tracking XML - BOOKING_CREATED
<?xml version="1.0" encoding="UTF-8" ?> <milestone> <carrier> <name>DHL Freight</name> <reference>SAPCARRIERCODE:VENDORID:9483743</reference> <integration></integration> <equipment> <licencePlate></licencePlate> </equipment> </carrier> <trackingReference> <customer>00000000006100001461</customer> <carrier>6135449611</carrier> <viya>36eeafae-ef18-4152-8f0b-cba23b8b4578</viya> </trackingReference> <event> <eventDatetime>2024-02-12T18:49:00Z</eventDatetime> <eventDescription></eventDescription> <scannedBy></scannedBy> <eventMessage></eventMessage> <eventType> <original> <code>ABC</code> <description>Data received</description> </original> <translated> <code>BOOKING_CREATED</code> <description>Booking created</description> </translated> </eventType> <eventReason> <translated> <code></code> <description></description> </translated> <original> <code></code> <description></description> </original> </eventReason> </event> </milestone>
Tracking XML - AWB_UPDATE
<?xml version="1.0" encoding="UTF-8" ?> <milestone> <carrier> <name>DHL Freight</name> <reference>SAPCARRIERCODE:VENDORID:9483743</reference> <integration></integration> <equipment> <licencePlate></licencePlate> </equipment> </carrier> <trackingReference> <customer>00000000006100001461</customer> <carrier>6135449611</carrier> <viya>36eeafae-ef18-4152-8f0b-cba23b8b4578</viya> </trackingReference> <event> <eventDatetime>2024-02-12T18:49:00Z</eventDatetime> <eventDescription></eventDescription> <scannedBy></scannedBy> <eventMessage></eventMessage> <eventType> <original> <code>AWB_UPDATE</code> <description>AWB_UPDATE</description> </original> <translated> <code>AWB_UPDATE</code> <description>AWB_UPDATE</description> </translated> </eventType> <eventReason> <translated> <code></code> <description></description> </translated> <original> <code></code> <description></description> </original> </eventReason> </event> </milestone>
Tracking XML - DELAYED with a reason code
<?xml version="1.0" encoding="UTF-8" ?> <milestone> <carrier> <name>DHL Freight</name> <reference>SAPCARRIERCODE:VENDORID:9483743</reference> <integration></integration> <equipment> <licencePlate></licencePlate> </equipment> </carrier> <trackingReference> <customer>00000000006100001461</customer> <carrier>6135449611</carrier> <viya>36eeafae-ef18-4152-8f0b-cba23b8b4578</viya> </trackingReference> <event> <eventDatetime>2024-02-12T18:49:00Z</eventDatetime> <eventDescription></eventDescription> <scannedBy></scannedBy> <eventMessage></eventMessage> <eventType> <original> <code>OOPS1</code> <description>Truck broke down</description> </original> <translated> <code>DELAYED</code> <description>Delayed</description> </translated> </eventType> <eventReason> <translated> <code>ABCTRUCKDOWN</code> <description>Truck breakdown</description> </translated> <original> <code>DELAYED_ACCIDENT</code> <description>Accidental delay</description> </original> </eventReason> </event> </milestone>
Tracking XML - POD
<?xml version="1.0" encoding="UTF-8" ?> <milestone> <carrier> <name>DHL Freight</name> <reference>SAPCARRIERCODE:VENDORID:9483743</reference> <integration></integration> <equipment> <licencePlate></licencePlate> </equipment> </carrier> <trackingReference> <customer>00000000006100001461</customer> <carrier>6135449611</carrier> <viya>36eeafae-ef18-4152-8f0b-cba23b8b4578</viya> </trackingReference> <event> <eventDatetime>2024-02-12T20:49:00Z</eventDatetime> <eventDescription></eventDescription> <scannedBy></scannedBy> <eventMessage></eventMessage> <eventType> <original> <code>X1</code> <description>Delivered</description> </original> <translated> <code>POD</code> <description>Delivery at customer</description> </translated> </eventType> <eventReason> <translated> <code></code> <description></description> </translated> <original> <code></code> <description></description> </original> </eventReason> </event> </milestone>
Response
Response Headers
- Content-type: application/xml; charset=utf-8
Responses:
Technical Reponses
202 Accepted
- Payload: No Content
401 Unauthorized
- Payload: No Content
500 Server Error
- Payload: No Content
503 Service Unavailable
- Payload: No Content
Function Responses
TODO: Determine endpoint response structure
Potential errors:
- Milestone event already exist
- Mapping incorrect on line X