This method allows you to accept conditions of received order with a given id. Only orders with status “proposal-waiting” can be accepted. You can send either an emty body or fill information about monitoring providers, vehicle and driver as well.

When you add vehicle and driver data, you can do this in two way – sending their id’s or typing text.

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

If you don’t have driver or vehicle registered, you can send a request using driver name and plate numbers (send as plain text).

Url parameters and connection settings

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

Headers:

  • Content-type: application/json
  • Accept: application/json
  • Authorization: Bearer {access_token}
  • Api-key: {unique_app_api-key}

Authorization and access

Authorization process is described here. Each API request must also consist of unique Api-key obtained during application registration together with client_id and client_secret.

Example

Sample Json for accept order with vehicle and driver id’s:

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

Sample Json for accept order with vehicle and driver 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
}