Accept order conditions

This method allows you to accept con­di­tions of received order with a giv­en id. Only orders with sta­tus “pro­pos­al-wait­ing” can be accept­ed. You can send either an emty body or fill infor­ma­tion about mon­i­tor­ing providers, vehi­cle and dri­ver as well.

When you add vehi­cle and dri­ver data, you can do this in two way — send­ing their id’s or typ­ing text.

You  can get driver_id using method described here.
Val­ues ​​such as semi_trailer_id and vehicle_id can be found in the fleet.

If you don’t have dri­ver or vehi­cle reg­is­tered, you can send a request using dri­ver name and plate num­bers (send as plain text).

Url parameters and connection settings

  • URL: https://api.platform.trans.eu
  • End­point: /ext/orders-api/v1/orders-received/{orderId}/accept
  • Method: PATCH

Headers:

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

Authorization and access

Autho­riza­tion process is described here. Each API request must also con­sist of unique Api-key obtained dur­ing appli­ca­tion reg­is­tra­tion togeth­er with client_id and client_secret.

Example

Sam­ple Json for accept order with vehi­cle and dri­ver id’s:

{
  "monitoring_providers": [
    "trans_task"
  ],
  "vehicle_id": 109,
  "semi_trailer_id": 109,
  "driver_id": 1001111
}

Sam­ple Json for accept order with vehi­cle and dri­ver as a plain text:

{
  "monitoring_providers": [
    "trans_task"
  ],
  "vehicle": "DW100001",
  "semi_trailer": "DW10000",
  "driver": "Adam Kowalski"
}

Response

{
  "additional_terms": "some additional terms",
  "created_at": "2021-06-29T09:47:32.016Z",
  "driver": {
    "account_id": 771476,
    "contact_phone": null,
    "email": "test@trans.eu",
    "employee_id": 999446,
    "family_name": "Kierowca",
    "full_name": "Jan Kierowca",
    "given_name": "Jan",
    "identity_document_number": null,
    "phone": null
  },
  "freight": {
    "carrier": {
      "assignee": null,
      "legal_name": "Firma Testowa Przewoźnik IIT 2",
      "vat_id": "1111111111"
    },
    "id": "",
    "reference_number": null,
    "requirements": {
      "temperature": null
    },
    "shipper": {
      "assignee": {
        "account_id": 749989,
        "email": "test1@trans.eu",
        "family_name": "Testowy",
        "fax": null,
        "given_name": "Jan",
        "telephone": "0048 1111111111",
        "trans_id": "1111111-1"
      },
      "legal_name": "Firma Testowa Spedycja IIT",
      "vat_id": "2222222222"
    },
    "spots": [
      {
        "description": null,
        "name": null,
        "operations": [
          {
            "loads": [],
            "operation_order": 1,
            "time_window": null,
            "time_window_reason": null,
            "timespans": {
              "begin": "2021-06-22T09:00:00.000Z",
              "end": "2021-06-22T10:00:00.000Z"
            },
            "type": "loading"
          }
        ],
        "place": {
          "address": {
            "country": "pl",
            "description": null,
            "locality": "Kraków",
            "number": null,
            "postal_code": "31-001",
            "street": null
          },
          "coordinates": null
        },
        "spot_order": 1
      },
      {
        "description": null,
        "name": null,
        "operations": [
          {
            "loads": [],
            "operation_order": 1,
            "time_window": null,
            "time_window_reason": null,
            "timespans": {
              "begin": "2021-06-23T09:00:00.000Z",
              "end": "2021-06-23T09:00:00.000Z"
            },
            "type": "unloading"
          }
        ],
        "place": {
          "address": {
            "country": "pl",
            "description": null,
            "locality": "Dąbrowa Środkowa",
            "number": null,
            "postal_code": "59-330",
            "street": null
          },
          "coordinates": null
        },
        "spot_order": 2
      }
    ]
  },
  "id": "c80ffb5c-b775-4394-b385-83fdb3117d5c",
  "invoice": null,
  "legacy_freight_id": null,
  "monitoring": {
    "providers": [
      "trans_task"
    ],
    "required": true
  },
  "number": "2021/06/29/14",
  "payment": {
    "days": 30,
    "price": {
      "currency": "pln",
      "protected": false,
      "type": "km",
      "value": 1500
    }
  },
  "related": [],
  "source": {
    "author_account_id": 749989,
    "source_date": "2021-06-29T09:47:32.016Z",
    "source_id": "3_api_trans",
    "type": "api"
  },
  "status": {
    "comment": null,
    "value": "waiting-for-vehicle-and-driver"
  },
  "vehicle": null
}