Update order
[ POST ] order/update
Update fields on an existing booking. ID is the booking_id returned from POST order.
Only fields that already have a value on the order are written. Empty fields are ignored.
state is not applied as a normal order field. Send it together with navision_booking_number to change that car's status.
Fields
| Field | Type | Required | Description | Example |
|---|---|---|---|---|
ID |
string or int | Yes | Booking id (booking_id from POST order). |
"12345" |
fields |
object | Yes | Order fields to update. Keys must match columns on the booking. | See below |
fields
Typical booking fields. Any existing booking field with a current value can be sent.
| Field | Type | Required | Description | Example |
|---|---|---|---|---|
comment |
string | No | Comment visible to Autologik. | "Ring ved ankomst" |
pickup_email |
string | No | Contact email at pickup. | "lager@example.dk" |
pickup_phone |
string | No | Contact phone at pickup. | "+4570131410" |
pickup_name |
string | No | Contact name at pickup. | "Anders Jensen" |
company_name_pickup |
string | No | Company name at pickup. | "Eksempel A/S" |
delivery_email |
string | No | Contact email at delivery. | "modtagelse@example.dk" |
delivery_phone |
string | No | Contact phone at delivery. | "+4522334455" |
delivery_name |
string | No | Contact name at delivery. | "Mette Nielsen" |
company_name_delivery |
string | No | Company name at delivery. | "Modtager ApS" |
pickup_comment |
string | No | Comment for pickup. | "Port 2" |
delivery_comment |
string | No | Comment for delivery. | "Ring på forhånd" |
navision_booking_number |
string | No | Navision booking number of the car to update status for. Required together with state. |
"B12345" |
state |
string | No | Car status code. Only used together with navision_booking_number. 31 = cancelled, 35 = in_vein. |
"31" |
Example request
{
"ID": string|int,
"fields": {
"comment": *string,
"pickup_email": *string,
"pickup_phone": *string,
"pickup_name": *string,
"company_name_pickup": *string,
"delivery_email": *string,
"delivery_phone": *string,
"delivery_name": *string,
"company_name_delivery": *string,
"pickup_comment": *string,
"delivery_comment": *string,
"navision_booking_number": *string,
"state": *string
}
}
ID:
Must be the booking_id from POST order.
A missing ID returns 400.
An unknown ID returns 401.
fields:
Only keys that already have a value on the booking are updated.
Unknown keys and empty current values are ignored.
state:
Not written as a regular booking field.
Must be sent together with navision_booking_number.
31 sets the car status to cancelled.
35 sets the car status to in_vein.
If every car on the booking is cancelled and state is 31,
the booking itself is cancelled.
<?php
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => 'YOUR-BASEURL/order/update',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => '{
"ID": "12345",
"fields": {
"comment": "Ring ved ankomst",
"pickup_phone": "+4570131410"
}
}',
CURLOPT_HTTPHEADER => [
'X-Api-Key: YOUR-API-KEY',
'Content-Type: application/json'
],
]);
$response = curl_exec($ch);
curl_close($ch);
const axios = require('axios');
const postData = {
ID: '12345',
fields: {
comment: 'Ring ved ankomst',
pickup_phone: '+4570131410'
}
};
axios.post('YOUR-BASEURL/order/update', postData, {
headers: {
'X-Api-Key': 'YOUR-API-KEY'
}
})
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error(error);
});