DFDS Logistics API Documentation
  • Home
  • Data Format
  • Security
  • API Sections
    • Bookings
    • Notification Hooks
    • Test Scenario #1
    • Instruction model
  • EDI Sections
    • Introduction
    • XML Standard
    • EDIFACT Standard
    • Invoicing
  • Support
  • About
  • Introduction - Test Scenario #1
  • Create Booking
  • Simulate Truck Position Tracking
  • Simulate Collection/Delivery
  • Simulate Ship Arrival/Departure

Introduction - Test Scenario #1

This test scenario can be used to test various parts of the API, by simulating actions which would normally occur ouside of your control. Scenario one is a booking with a single sub booking. The sub booking is collected at a DFDS Logistics office in Larkhall, United Kindom and delivered to a DFDS Logistics office in Boulogne-sur-Mer, France. It will be transported by truck and ship to reach its destination.

Not for production use! The test scenarios are fully supported, but only available in test environment. They cannot be used in production.

The APIs should be invoked in the following order. Note that truck position simulations may be invoked multiple times if desired.

  1. Start by creating a new approved booking
  2. Simulate truck position on the way to collection
  3. Simulate collection
  4. Simulate truck position on the way to departure terminal
  5. Simulate ship departure
  6. Simulate ship arrival
  7. Simulate truck position on the way to delivery
  8. Simulate delivery

In order to use the test scenario, the user must be authenticated as described in the Security section and have access to the feature TestScenarioOne.

Create Booking

This endpoint creates a simple booking with one subbooking. The created booking will end up in approved state, and it will trigger received and approved notifications if notification hooks are registered. See the Booking Flow documentation for details.

POST https://logisticsapi.dfds.com/api/test/scenario1/createbooking

The endpoint returns the booking with all attributes. See Booking Details for details. You will need the sub booking id when creating trackings with the other test APIs

Use test bookings only! The test APIs only work on bookings created using this API. Simulating truck positions or triggering events on other bookings is not supported.

Simulate Truck Position Tracking

The following endpoints simulates an incoming GPS tracking from a truck carrying the sub booking. Sub booking id is required along with values for longitude and latitude. GPS coordinates are provided in the body of the POST request in WGS84 format. The timestamp of the tracking is set to the current date and time. This API will trigger the booking tracking notification if a notification hook is registered.


{
    "latitude" : "51.06853",
    "longitude" : "1.03675"
}

    

To create a Truck Position Tracking that is related to the collection part of the booking (truck on the way for collection), use the following endpoint:

POST https://logisticsapi.dfds.com/api/test/scenario1/{subBookingId}/collection/createtruckposition

The truck position while on route to the departure terminal, can be simulated using the following endpoint.

POST https://logisticsapi.dfds.com/api/test/scenario1/{subBookingId}/departure/createtruckposition

And for creating a Truck Position Tracking on the delivery part of the booking, use this endpoint:

POST https://logisticsapi.dfds.com/api/test/scenario1/{subBookingId}/delivery/createtruckposition

Simulate Collection/Delivery

Collection or delivery of a sub booking can be simulated using this API. The timestamp of the collection of the tracking will be +1 day at 00:00:00 from the time the booking was created and the timestamp of the delivery tracking will be +3 days at 00:00:00. This API will trigger the booking tracking notification if a notification hook is registered.

POST https://logisticsapi.dfds.com/api/test/scenario1/{subBookingId}/collection/confirm

POST https://logisticsapi.dfds.com/api/test/scenario1/{subBookingId}/delivery/confirm

Simulate Ship Arrival/Departure

Much similar to the collection/delivery simulation functionality, there is functionality to simulate the status of a ship that carries the goods of the sub booking. Basically a ship has three states; "Not Departed", "Departed" and "Arrived". The timestamp of the specific tracking is returned in the response. This API will trigger the booking tracking notification if a notification hook is registered.

POST https://logisticsapi.dfds.com/api/test/scenario1/{subBookingId}/ship/departed

POST https://logisticsapi.dfds.com/api/test/scenario1/{subBookingId}/ship/arrived


© 2023 - DFDS Logistics