Introduction
This documentation aims to provide all the information you need to work with our API.
Authenticating requests
To authenticate requests, include an Authorization header with the value "Bearer {YOUR_AUTH_KEY}".
All authenticated endpoints are marked with a requires authentication badge in the documentation below.
You can retrieve your token by sending your credentials to the api/auth/login endpoint.
Endpoints
Get Bearer authorization token
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://dashboard.wearewuunder.com/api/auth/login';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'email' => 'fstracke@example.org',
'password' => '})xX|s&FCU',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://dashboard.wearewuunder.com/api/auth/login"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"email": "fstracke@example.org",
"password": "})xX|s&FCU"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());curl --request POST \
"https://dashboard.wearewuunder.com/api/auth/login" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"email\": \"fstracke@example.org\",
\"password\": \"})xX|s&FCU\"
}"
import requests
import json
url = 'https://dashboard.wearewuunder.com/api/auth/login'
payload = {
"email": "fstracke@example.org",
"password": "})xX|s&FCU"
}
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (200, Ok):
{
"status": "Success",
"message": null,
"data": {
"token": "28|wTSuF1AdPOmx8bTP2XSgVfsoD5V4sFMqUNMEg4Eq"
}
}
Example response (401, Wrong email/password combination):
{
"status": "Error",
"message": "Wrong email/password combination",
"data": null
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get shipments
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://dashboard.wearewuunder.com/api/v1/shipments';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {token}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'inserted_at_start' => '2022-01-01T00:10:12',
'inserted_at_end' => '2022-10-18T00:10:12',
'shipment_status' => 'delivered',
'ref' => 'testref',
'track_and_trace_code' => '0ABCDE012345678',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://dashboard.wearewuunder.com/api/v1/shipments"
);
const params = {
"inserted_at_start": "2022-01-01T00:10:12",
"inserted_at_end": "2022-10-18T00:10:12",
"shipment_status": "delivered",
"ref": "testref",
"track_and_trace_code": "0ABCDE012345678",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {token}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());curl --request GET \
--get "https://dashboard.wearewuunder.com/api/v1/shipments?inserted_at_start=2022-01-01T00%3A10%3A12&inserted_at_end=2022-10-18T00%3A10%3A12&shipment_status=delivered&ref=testref&track_and_trace_code=0ABCDE012345678" \
--header "Authorization: Bearer {token}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"import requests
import json
url = 'https://dashboard.wearewuunder.com/api/v1/shipments'
params = {
'inserted_at_start': '2022-01-01T00:10:12',
'inserted_at_end': '2022-10-18T00:10:12',
'shipment_status': 'delivered',
'ref': 'testref',
'track_and_trace_code': '0ABCDE012345678',
}
headers = {
'Authorization': 'Bearer {token}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (200, Ok):
{
"data": [{
"wuunder_id": "LAM-768",
"correlation_id": "123456789",
"customer_reference": "123456",
"inserted_at": "2022-09-17 21:23:49",
"shipment_status": "delivered",
// Since when shipment_status?
"shipment_status_inserted_at": "2022-09-20 09:42:24",
// Carrier information
"carrier_name": "DHL Parcel",
"carrier_code": "DHL_PARCEL",
"carrier_product_description": "DHL Parcel Connect",
"service_level": "DHL_PARCEL_CONNECT",
"actual_track_and_trace_url": "https://my-tracking-url",
"track_and_trace_code": "A1CWOED133",
"is_return": 1,
"source": "Woocommerce extension",
// In centimeters
"length": 475,
"width": 370,
"height": 883,
// In grams
"weight": null,
// In eurocents
"value": 1234.4,
// Options: package, pallet, null, document, letterbox
"kind": "package",
// Pickup address information
"pickup_country_code": "NL",
"pickup_type": null,
"pickup_given_name": "John",
"pickup_family_name": "Doe",
"pickup_locality": "Amsterdam",
"pickup_zip_code": "1234AB",
"pickup_email_address": null,
"pickup_phone_number": "58923298",
"pickup_chamber_of_commerce_number": null,
"pickup_house_number": "123",
"pickup_street_name": "Kerkstraat",
"pickup_vat": null,
"pickup_eori_number": null,
"pickup_business": "Primera",
"pickup_date": "2022-09-23",
// Delivery address information
"delivery_country_code": "DJ",
"delivery_type": null,
"delivery_given_name": "John",
"delivery_family_name": "Doe",
"delivery_locality": "Amsterdam",
"delivery_zip_code": "1234AB",
"delivery_email_address": null,
"delivery_phone_number": "123456",
"delivery_chamber_of_commerce_number": null,
"delivery_house_number": "123",
"delivery_street_name": "Kerkstraat",
"delivery_vat": null,
"delivery_eori_number": null,
"delivery_date": "2022-02-14",
"delivery_business": "Test business",
"route_type": "b2c",
// Delay information
"delay_in_transit_days": 1,
"days_in_transit": 2,
"first_delivered_date": "2022-02-02",
"predicted_days_in_transit": 1,
"first_in_transit_date": "2022-02-01",
// Shipment flags. Datetime corresponds to the first time detected
"address_issue": 1,
"address_issue_date": "2022-02-01 17:02:56",
"delivery_neighbour": 0,
"delivery_neighbour_date": null,
"issue_carrier": 0,
"issue_carrier_date": null,
"issue_receiver": 0,
"issue_receiver_date": null,
"issue_sender": 0,
"issue_sender_date": null,
"issue_unidentified": 0,
"issue_unidentified_date": null,
"no_transit_scan": 0,
"no_transit_scan_date": null,
"parcelshop_pickup": 0,
"parcelshop_pickup_date": null,
"parcelshop_delivery": 0,
"parcelshop_delivery_date": null,
"returned_to_sender": 0,
"returned_to_sender_date": null,
"delay_in_transit": 1,
"delay_in_transit_date": "2022-02-01 17:02:56",
"is_pre_transit": 0,
"is_pre_transit_date": null,
"is_in_transit": 0,
"is_in_transit_date": null,
"is_out_for_delivery": 0,
"is_out_for_delivery_date": null,
}],
"links": {
"first": "http://base_url/api/v1/shipments?page=1",
"last": "http://dashboard.wearewuunder.com/api/v1/shipments?page=14",
"prev": null,
"next": "http://dashboard.wearewuunder.com/api/v1/shipments?page=2"
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 14,
"links": [
{
"url": null,
"label": "previous",
"active": false
},
{
"url": "http://dashboard.wearewuunder.com/api/v1/shipments?page=1",
"label": "1",
"active": true
},
....
],
"path": "http://dashboard.wearewuunder.com/api/v1/shipments",
"per_page": 15,
"to": 15,
"total": 206
}
}
Example response (400, Non-valid datetime):
{
"status": "Error",
"message": "inserted_at_start is not a valid datetime",
"data": null
}
Example response (400, Start time later than end time):
{
"status": "Error",
"message": "inserted_at_start is later than inserted_at_end",
"data": null
}
Example response (422, Invalid shipment status):
{
"status": "Error",
"message": "Invalid value for shipment status. Please send one of the following available statuses: ....",
"data": null
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.