New freight using automation rules

Pub­lish­ing new freight using pre­vi­ous­ly cre­at­ed (at Plat­form) automa­tion rules. The freight is cre­at­ed as “sent freight” and imme­di­ate­ly vis­i­ble in appro­pri­ate mod­ule.

Url parameters and connection settings

  • URL: https://api.platform.trans.eu
  • End­point: /ex­t/freights-api/v1/freight-auto
  • Method: POST

Headers:

  • Con­tent-type: application/json
  • Accept: application/json
  • Autho­riza­tion: Bear­er {access_token}
  • Api-key: {unique_app_api_key}

Authorization

Autho­riza­tion process is described here.

Freight publication and content

For infor­ma­tion about freight pay­load please refer to freight descrip­tion.

Pub­li­ca­tion using automa­tion rules does not require any addi­tion­al fields or set­tings. Please remem­ber to set pub­lish para­me­ter to true.

Automa­tion rule must be cre­at­ed man­u­al­ly at the Trans.eu Plat­form (automa­tion rule cre­ation instruc­tion). To apply automa­tion rule for freights cre­at­ed using api, while cre­at­ing a rule at Plat­form you need to check the check­box — Apply the rule for match­ing freights auto­mat­i­cal­ly.

Freight pay­load for pub­li­ca­tion using automa­tion rules does not con­tain price, but pay­ment peri­od and cur­ren­cy are trans­ferred auto­mat­i­cal­ly from cre­at­ed rule.

Json Exam­pleTypeIs requiredDescrip­tion
shipment_external_id2020/ABC/1/1StringNoExter­nal iden­ti­fi­ca­tion num­ber
external_source1_apiStringNoFreight source iden­ti­fi­er assigned to client_id pro­vid­ed by Trans.eu
capac­i­ty12FloatYesTotal freight capac­i­ty in tonnes. This val­ue is being val­i­dat­ed in com­par­i­son to the sum of all loads weight.
Range: 0,001 – 100000
pub­lishTrueBooleanYesDeter­mines if the freight is auto­mat­i­cal­ly pub­lished or only cre­at­ed
require­mentsObjectYesMain freight require­ments, includ­ing truck body and size adr class­es, ways of load­ing
loadsArrayNoCol­lec­tion of freights’ loads. It is pos­si­ble to send emp­ty array of loads, nev­er­the­less an array has to be set
spotsObjectYesCol­lec­tion of freights’ spots — at least one load­ing and one unload­ing is required

Example request

Sam­ple Json for cre­at­ing new freight using required data only

{
  "external_source": "1_api",
  "publish": true,
  "capacity": 15,
  "requirements": {
    "is_ftl": true,
    "required_truck_bodies": [
      "cooler"
    ]
  },
  "loads": [],
  "spots": [
    {
      "spot_order": 1,
      "operations": [
        {
          "type": "loading",
          "timespans": {
            "begin": "2021-02-02T15:00:00+0000",
            "end": "2021-02-02T16:00:00+0000"
          },
          "operation_order": 1
        }
      ],
      "place": {
        "address": {
          "country": "PL",
          "postal_code": "96-500",
          "locality": "Sochaczew"
        }
      }
    },
    {
      "spot_order": 2,
      "operations": [
        {
          "type": "unloading",
          "timespans": {
            "begin": "2021-02-03T21:59:59+0000",
            "end": "2021-02-03T21:59:59+0000"
          },
          "operation_order": 1
        }
      ],
      "place": {
        "address": {
          "country": "PL",
          "postal_code": "50-261",
          "locality": "Wrocław"
        }
      }
    }
  ]
}

Response

{
  "accepted_price": null,
  "capacity": 15,
  "carrier": null,
  "id": 591645,
  "loading_meters": null,
  "loads": [],
  "publication_price": null,
  "reference_number": "FR/2021/02/02/X6T3",
  "requirements": {
    "is_ftl": true,
    "other_requirements": [],
    "required_adr_classes": [],
    "required_truck_bodies": [
      "cooler"
    ],
    "required_ways_of_loading": [],
    "shipping_remarks": null,
    "temperature": {
      "max": null,
      "min": null
    },
    "vehicle_size": "any_size"
  },
  "shipment_external_id": null,
  "spots": [
    {
      "description": null,
      "name": null,
      "operations": [
        {
          "loads": [],
          "operation_order": 1,
          "timespans": {
            "begin": "2021-02-02T16:00:00+01:00",
            "end": "2021-02-02T17:00:00+01:00"
          },
          "type": "loading"
        }
      ],
      "place": {
        "address": {
          "country": "pl",
          "description": null,
          "locality": "Sochaczew",
          "number": null,
          "postal_code": "96-500",
          "street": null
        },
        "coordinates": {
          "latitude": 52.22944,
          "longitude": 20.23838
        }
      },
      "spot_order": 1
    },
    {
      "description": null,
      "name": null,
      "operations": [
        {
          "loads": [],
          "operation_order": 1,
          "timespans": {
            "begin": "2021-02-03T22:59:59+01:00",
            "end": "2021-02-03T22:59:59+01:00"
          },
          "type": "unloading"
        }
      ],
      "place": {
        "address": {
          "country": "pl",
          "description": null,
          "locality": "Wrocław",
          "number": null,
          "postal_code": "50-261",
          "street": null
        },
        "coordinates": {
          "latitude": 51.119967228399,
          "longitude": 17.039585180639
        }
      },
      "spot_order": 2
    }
  ],
  "status": "new"
}