curl --request POST \
--url https://api.exowpee.com/v1/catalog/transfers/{transfer}/route-legs/{route_leg}/costs \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.exowpee.com/v1/catalog/transfers/{transfer}/route-legs/{route_leg}/costs"
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/transfers/{transfer}/route-legs/{route_leg}/costs', 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/transfers/{transfer}/route-legs/{route_leg}/costs",
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/transfers/{transfer}/route-legs/{route_leg}/costs"
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/transfers/{transfer}/route-legs/{route_leg}/costs")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.exowpee.com/v1/catalog/transfers/{transfer}/route-legs/{route_leg}/costs")
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>",
"transfer_route_leg_id": "<string>",
"company_id": "<string>",
"creator_user_id": "<string>",
"label": "<string>",
"amount": 123,
"amount_minor": 123,
"allocated_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"message": "<string>",
"errors": {}
}Add a route leg cost
Records a transport cost on a route leg so it can be spread over the goods carried.
curl --request POST \
--url https://api.exowpee.com/v1/catalog/transfers/{transfer}/route-legs/{route_leg}/costs \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.exowpee.com/v1/catalog/transfers/{transfer}/route-legs/{route_leg}/costs"
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/transfers/{transfer}/route-legs/{route_leg}/costs', 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/transfers/{transfer}/route-legs/{route_leg}/costs",
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/transfers/{transfer}/route-legs/{route_leg}/costs"
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/transfers/{transfer}/route-legs/{route_leg}/costs")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.exowpee.com/v1/catalog/transfers/{transfer}/route-legs/{route_leg}/costs")
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>",
"transfer_route_leg_id": "<string>",
"company_id": "<string>",
"creator_user_id": "<string>",
"label": "<string>",
"amount": 123,
"amount_minor": 123,
"allocated_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"message": "<string>",
"errors": {}
}transfer_route_leg_costs.create
Conditions
- The transfer must be visible to the current company (owned by it, or not a draft and with a step at a location the company can use).
- The leg must be accessible to the current company, including when it owns the transfer.
- The transfer must be draft or running.
- Costs are frozen once the destination step of the leg is no longer upcoming.
- label and amount are required; label is up to 255 characters; amount is a non-negative number in major units with at most currency_exponent decimals.
- amount_minor and allocated_at are refused: they are set by the server.
- The cost is recorded for the current company and the current user, and is not allocated yet.
- It will be spread over the goods carried when the destination step of the leg is reached (stock-in); nothing is allocated by this call.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Identifier of the transfer.
Identifier of the route leg, which must belong to the transfer.
Response
TransferRouteLegCostResource
Identifier of the cost (27-character KSUID string).
Identifier of the route leg the cost is recorded on.
Identifier of the company the record belongs to.
Identifier of the member who recorded the cost; null when no authenticated user was known; costs copied from a trip are also recorded for the member who creates the transfer.
Free text describing the cost.
Amount of the cost in major units (amount_minor divided by 10 to the power of currency_exponent).
Amount of the cost in minor units (integer).
Date and time the cost was spread over the goods carried (ISO 8601); null while it is pending. Set by the server when the destination step is reached; once set the cost can no longer change or be deleted.
Date and time the record was created (ISO 8601, UTC).
Date and time the record was last changed (ISO 8601, UTC).