Shipment of multiple load in multiple locations

Ship­ment of one load from point A to point B

Scenario

  • many defined loads with mul­ti­ple load­ings and unload­ings:
    • load L1 — weight: 8 tonnes
    • load L2 — weight 3 tonnes
    • load L3 — weight 10 tonnes
  • mul­ti­ple oper­a­tions in more than two loca­tions
    • first spot — load­ing L1 and L2
    • sec­ond spot — load­ing L3
    • third spot — unload­ing L3 and load­ing L1
    • fourth spot — unload­ing L1 and unload­ing L2

Authorize access

Before it is pos­si­ble to send any request, user needs to autho­rize access.

  • client app was reg­is­tered using reg­is­tra­tion form
  • exter­nal app was grant­ed api keys (client_id and client_secret)
  • autho­riza­tion process has been imple­ment­ed in exter­nal app

Create new freight

Each freight must con­sist of:

  • loads def­i­n­i­tion
  • load­ing loca­tions and time
  • unload­ing loca­tions and time
  • load ref­er­ence in load­ing and unload­ing points
  • required truck body type
  • sum­ma­ry of freight’s loads weight
  • ftl/ltl para­me­ter

Request

This type of freight para­me­ters can be used with all types of pub­li­ca­tion meth­ods. Some con­di­tions apply.

POST https://api.platform.tran.eu/ext/freights-api/v1/freights-{publication method}

Request example: 

Exam­ple of freight request:

{
  "payment": {
    "price": {
      "value": 123,
      "currency": "eur"
    }
  },
  "capacity": 21,
  "exchange_recipients": "carriers",
  "requirements": {
    "is_ftl": false,
    "required_truck_bodies": [
      "cooler"
    ]
  },
  "loads": [
    {
      "name": "example",
      "description": "Example description of first load",
      "load_id": "L1",
      "type_of_load": "palette",
      "weight": 8,
      "height": 1,
      "length": 1,
      "volume": 1,
      "amount": 1,
      "is_stackable": false,
      "is_exchangeable": false
    },
    {
      "name": "example",
      "description": "Example description of second load",
      "load_id": "L2",
      "type_of_load": "palette",
      "weight": 3,
      "height": 1,
      "length": 1,
      "volume": 1,
      "amount": 1,
      "is_stackable": false,
      "is_exchangeable": false
    },
    {
      "name": "example",
      "description": "Example description of third load",
      "load_id": "L3",
      "type_of_load": "palette",
      "weight": 10,
      "height": 1,
      "length": 1,
      "volume": 1,
      "amount": 1,
      "is_stackable": false,
      "is_exchangeable": false
    }
  ],
  "carriers": [
    {
      "company_id": 1111111
    }
  ],
  "spots": [
    {
      "spot_order": 1,
      "place": {
        "address": {
          "country": "fr",
          "postal_code": "11111",
          "locality": "null"
        },
        "coordinates": {
          "latitude": 49.8056,
          "longitude": 12.1881
        }
      },
      "operations": [
        {
          "timespans": {
            "begin": "2021-07-25T09:00:00+01:00",
            "end": "2021-07-25T09:00:00+01:00"
          },
          "type": "loading",
          "operation_order": 1,
          "loads": [
            {
              "load_id": "L1",
              "weight": 8
            },
            {
              "load_id": "L2",
              "weight": 3
            }
          ]
        }
      ]
    },
    {
      "spot_order": 2,
      "place": {
        "address": {
          "country": "lt",
          "postal_code": "22222",
          "locality": "City"
        },
        "coordinates": {
          "latitude": null,
          "longitude": null
        }
      },
      "operations": [
        {
          "timespans": {
            "begin": "2021-07-27T09:00:00+01:00",
            "end": "2021-07-27T09:00:00+01:00"
          },
          "type": "loading",
          "operation_order": 1,
          "loads": [
            {
              "load_id": "L3",
              "weight": 10
            }
          ]
        }
      ]
    },
    {
      "spot_order": 3,
      "place": {
        "address": {
          "country": "fr",
          "postal_code": "11111",
          "locality": "null"
        },
        "coordinates": {
          "latitude": 49.8056,
          "longitude": 12.1881
        }
      },
      "operations": [
        {
          "timespans": {
            "begin": "2021-07-28T09:00:00+01:00",
            "end": "2021-07-28T09:00:00+01:00"
          },
          "type": "unloading",
          "operation_order": 1,
          "loads": [
            {
              "load_id": "L3",
              "weight": 10
            }
          ]
        },
        {
          "timespans": {
            "begin": "2021-07-29T09:00:00+01:00",
            "end": "2021-07-29T09:00:00+01:00"
          },
          "type": "unloading",
          "operation_order": 2,
          "loads": [
            {
              "load_id": "L1",
              "weight": 4
            }
          ]
        }
      ]
    },
    {
      "spot_order": 4,
      "place": {
        "address": {
          "country": "fr",
          "postal_code": "11111",
          "locality": "null"
        },
        "coordinates": {
          "latitude": 49.8056,
          "longitude": 12.1881
        }
      },
      "operations": [
        {
          "timespans": {
            "begin": "2021-07-30T09:00:00+01:00",
            "end": "2021-07-30T09:00:00+01:00"
          },
          "type": "unloading",
          "operation_order": 1,
          "loads": [
            {
              "load_id": "L1",
              "weight": 4
            },
            {
              "load_id": "L2",
              "weight": 3
            }
          ]
        }
      ]
    }
  ],
  "publish": true
}

Response

Each car­ri­er might respond with price con­di­tions accep­tance. Direct­ly after freight pub­li­ca­tion there will be an emp­ty array of offers received using:

https://api.platform.tran.eu/ext/freights-api/v1/freights/{freightId}/offers

Once offer is sent by car­ri­er, it will fill out this array, for exam­ple:

[
  {
    "company_id": 1111111,
    "created_at": "2021-07-23T13:25:02+02:00",
    "freight_id": 820262,
    "id": 1892813,
    "legal_name": "Firma Testowa Przewoźnik",
    "price": {
      "currency": "eur",
      "value": 130
    },
    "status": "waiting_for_accept",
    "trans_id": "1111111-1",
    "vat_id": "1111111111",
    "version": 3
  }
]

Conditions:

  • each offer has own unique id
  • each car­ri­er is allowed to send one offer
  • each offer can be respond­ed to