curl --request POST \
--url https://api.exowpee.com/v1/catalog/trips \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.exowpee.com/v1/catalog/trips"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.exowpee.com/v1/catalog/trips', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.exowpee.com/v1/catalog/trips",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.exowpee.com/v1/catalog/trips"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.exowpee.com/v1/catalog/trips")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.exowpee.com/v1/catalog/trips")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"company_id": "<string>",
"is_private": true,
"name": "<string>",
"description": "<string>",
"status": "<string>",
"creator_user_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"stops": [
{
"id": "<string>",
"trip_id": "<string>",
"position": 123,
"point_type": "<string>",
"point_id": "<string>",
"point": {},
"label": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
],
"legs": [
{
"id": "<string>",
"trip_id": "<string>",
"from_stop_id": "<string>",
"to_stop_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"rates": [
{
"id": "<string>",
"trip_id": "<string>",
"trip_leg_id": "<string>",
"label": "<string>",
"amount": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
]
}
],
"rates": [
{
"id": "<string>",
"trip_id": "<string>",
"trip_leg_id": "<string>",
"label": "<string>",
"amount": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
],
"vehicles": [
{
"id": "<string>",
"trip_id": "<string>",
"asset_id": "<string>",
"driver_label": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
]
}{
"message": "<string>",
"errors": {}
}Create a trip
Defines a reusable route with its stops, legs, rates and vehicles in one go, for use when moving stock between locations.
curl --request POST \
--url https://api.exowpee.com/v1/catalog/trips \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.exowpee.com/v1/catalog/trips"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.exowpee.com/v1/catalog/trips', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.exowpee.com/v1/catalog/trips",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.exowpee.com/v1/catalog/trips"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.exowpee.com/v1/catalog/trips")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.exowpee.com/v1/catalog/trips")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"company_id": "<string>",
"is_private": true,
"name": "<string>",
"description": "<string>",
"status": "<string>",
"creator_user_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"stops": [
{
"id": "<string>",
"trip_id": "<string>",
"position": 123,
"point_type": "<string>",
"point_id": "<string>",
"point": {},
"label": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
],
"legs": [
{
"id": "<string>",
"trip_id": "<string>",
"from_stop_id": "<string>",
"to_stop_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"rates": [
{
"id": "<string>",
"trip_id": "<string>",
"trip_leg_id": "<string>",
"label": "<string>",
"amount": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
]
}
],
"rates": [
{
"id": "<string>",
"trip_id": "<string>",
"trip_leg_id": "<string>",
"label": "<string>",
"amount": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
],
"vehicles": [
{
"id": "<string>",
"trip_id": "<string>",
"asset_id": "<string>",
"driver_label": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
]
}{
"message": "<string>",
"errors": {}
}trips.create, trip_stops.create, trip_legs.create, trip_rates.create, trip_vehicles.create
Conditions
- When nested stops, legs, rates or vehicles are sent, the caller also needs the matching trip_stops, trip_legs, trip_rates or trip_vehicles create permission.
- name and is_private are required; stops is required with at least two entries; status and company_id are refused.
- name must be unique: among the organization’s shared trips when is_private is false, or among the calling company’s private trips when it is true.
- Each stop needs a distinct position, a point_type and a 27-character point_id. The point type must be registered (location_group, waypoint, vendor, vendor_pickup_point, customer, customer_address) and the point must exist.
- Supplier, supplier pickup point, customer and customer address stops are only allowed on private trips; shared trips accept location groups and waypoints only.
- Each leg must name two stops by position that exist in the request and the destination must come after the source; a source and destination pair can appear only once (409).
- Vehicle asset_id must be a vehicle asset of the organization; load_weight and load_volume are refused. Rate amounts are in major units with at most the currency’s decimals and cannot be negative; amount_minor is refused.
- The whole creation runs in one transaction: if any nested item is refused nothing is created.
- Creates the trip with status active, owned by the calling company and organization, with the caller as creator.
- Creates the nested stops (with a copy of the point name and address), legs, leg rates, trip-level rates (owned by the calling company) and vehicles that were sent.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Response
TripResource
Identifier of the trip (27-character KSUID).
Identifier of the company the record belongs to.
True when only the owning company sees the trip; false when the trip is shared with every company of the organization. Set at creation and never changed.
Name of the trip, unique among shared trips of the organization or among the private trips of the owning company.
Free-text description of the trip; null when none.
active: the trip and its stops, legs, rates and vehicles can be modified. archived: they are frozen until the trip is set back to active.
Identifier of the member who created the trip, set by the server.
Date and time the record was created (ISO 8601, UTC).
Date and time the record was last changed (ISO 8601, UTC).
Stops of the trip, ordered by position.
Show child attributes
Show child attributes
Legs of the trip, ordered by the position of their source stop. Each leg carries only the rates of the calling company.
Show child attributes
Show child attributes
Trip-level rates (not attached to a leg) owned by the calling company; rates of other companies are never returned.
Show child attributes
Show child attributes
Vehicle assets attached to the trip.
Show child attributes
Show child attributes