Skip to content

Get booking

[ GET ] booking/:booking_id

Fetch data on the current booking and use it for your desired purpose.

{
    "data": {
        "pickup_address": string,
        "pickup_email": string,
        "pickup_phone": string,
        "pickup_name": string,
        "delivery_address": string,
        "delivery_email": string,
        "delivery_phone": string,
        "delivery_name": string,
        "comment": string,
        "pickup_date": null|string,
        "company_name_pickup": string,
        "company_name_delivery": string,
        "pickup_sender_address": null,
        "pickup_comment": null|string,
        "delivery_comment": null|string,
        "currency": string,
        "orders": Object
    }
}
<?php
    $ch = curl_init();

    curl_setopt_array($ch, [
        CURLOPT_URL => 'YOUR-BASEURL/booking/:booking_id',
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_ENCODING => '',
        CURLOPT_MAXREDIRS => 10,
        CURLOPT_TIMEOUT => 0,
        CURLOPT_FOLLOWLOCATION => true,
        CURLOPT_CUSTOMREQUEST => 'GET',
        CURLOPT_HTTPHEADER => [
            'X-Api-Key: YOUR-API-KEY'
        ],
    ]);

    $response = curl_exec($ch);

    curl_close($ch);
const axios = require('axios');
axios.get('YOUR-BASEURL/booking/:booking_id', {
    headers: {
        'X-Api-Key': 'YOUR-API-KEY'
    }
})
.then(response => {
    console.log(response.data);
})
.catch(error => {
    console.error(error);
});
Parameter Required Description
booking_id booking_id response from the [POST] order which is the booking that your carID is attached to