Add a trip rate
curl --request POST \
--url https://api.exowpee.com/v1/catalog/trips/{trip}/rates \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.exowpee.com/v1/catalog/trips/{trip}/rates"
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/{trip}/rates', 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/{trip}/rates",
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/{trip}/rates"
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/{trip}/rates")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.exowpee.com/v1/catalog/trips/{trip}/rates")
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>",
"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"
}{
"message": "<string>",
"errors": {}
}Reusable trips and waypoints
Add a trip rate
Adds a priced rate to a trip, either for the whole trip or for one leg.
POST
/
catalog
/
trips
/
{trip}
/
rates
Add a trip rate
curl --request POST \
--url https://api.exowpee.com/v1/catalog/trips/{trip}/rates \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.exowpee.com/v1/catalog/trips/{trip}/rates"
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/{trip}/rates', 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/{trip}/rates",
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/{trip}/rates"
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/{trip}/rates")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.exowpee.com/v1/catalog/trips/{trip}/rates")
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>",
"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"
}{
"message": "<string>",
"errors": {}
}Company space
For: Stock keeper, Manager · Permission:
trip_rates.create
Conditions
- Only the company that owns the trip can change it; a trip shared by another company can be read but not modified.
- Only a trip whose status is active can be modified; an archived trip is refused with a validation error.
- label and amount are required; amount is in major units, cannot be negative and may have at most the currency’s decimals; amount_minor is refused.
- When trip_leg_id is sent, the leg must belong to the trip (422).
- A label can be used only once per company on the same level (trip level, or per leg).
- Creates the rate for the calling company, converted to minor units with the team’s currency exponent. Other companies do not see it.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Identifier of the trip (27-character KSUID). The trip must be visible to the calling company.
Response
TripRateResource
Identifier of the rate (27-character KSUID).
Identifier of the trip the rate belongs to.
Identifier of the leg the rate applies to; null for a trip-level rate.
Name of the rate, unique per company on the same trip or leg.
Amount in major units (stored in minor units and divided by 10 to the power currency_exponent).
Date and time the record was created (ISO 8601, UTC).
Date and time the record was last changed (ISO 8601, UTC).