curl --request POST \
--url https://api.exowpee.com/v1/catalog/transfers/{transfer}/route-legs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"from_step_id": "<string>",
"from_step_position": 2,
"to_step_id": "<string>",
"to_step_position": 2,
"costs": [
{
"label": "<string>",
"amount": 123,
"amount_minor": "<string>"
}
]
}
'import requests
url = "https://api.exowpee.com/v1/catalog/transfers/{transfer}/route-legs"
payload = {
"from_step_id": "<string>",
"from_step_position": 2,
"to_step_id": "<string>",
"to_step_position": 2,
"costs": [
{
"label": "<string>",
"amount": 123,
"amount_minor": "<string>"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
from_step_id: '<string>',
from_step_position: 2,
to_step_id: '<string>',
to_step_position: 2,
costs: [{label: '<string>', amount: 123, amount_minor: '<string>'}]
})
};
fetch('https://api.exowpee.com/v1/catalog/transfers/{transfer}/route-legs', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'from_step_id' => '<string>',
'from_step_position' => 2,
'to_step_id' => '<string>',
'to_step_position' => 2,
'costs' => [
[
'label' => '<string>',
'amount' => 123,
'amount_minor' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.exowpee.com/v1/catalog/transfers/{transfer}/route-legs"
payload := strings.NewReader("{\n \"from_step_id\": \"<string>\",\n \"from_step_position\": 2,\n \"to_step_id\": \"<string>\",\n \"to_step_position\": 2,\n \"costs\": [\n {\n \"label\": \"<string>\",\n \"amount\": 123,\n \"amount_minor\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
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")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"from_step_id\": \"<string>\",\n \"from_step_position\": 2,\n \"to_step_id\": \"<string>\",\n \"to_step_position\": 2,\n \"costs\": [\n {\n \"label\": \"<string>\",\n \"amount\": 123,\n \"amount_minor\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.exowpee.com/v1/catalog/transfers/{transfer}/route-legs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"from_step_id\": \"<string>\",\n \"from_step_position\": 2,\n \"to_step_id\": \"<string>\",\n \"to_step_position\": 2,\n \"costs\": [\n {\n \"label\": \"<string>\",\n \"amount\": 123,\n \"amount_minor\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"transfer_id": "<string>",
"from_step_id": "<string>",
"to_step_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"cost_total_minor": 123,
"costs": [
{
"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"
}
],
"from_step": {
"id": "<string>",
"transfer_id": "<string>",
"position": 123,
"location_group_id": "<string>",
"status": "<string>",
"operations_executed_at": "2023-11-07T05:31:56Z",
"approved_by_company_id": "<string>",
"approved_by_user_id": "<string>",
"approved_at": "2023-11-07T05:31:56Z",
"completed_by_company_id": "<string>",
"completed_by_user_id": "<string>",
"completed_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"location_group": {
"id": "<string>",
"name": "<string>"
},
"receipts": [
{
"id": "<string>",
"transfer_step_id": "<string>",
"transfer_line_id": "<string>",
"asset_id": "<string>",
"quantity": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"asset_name": "<string>"
}
],
"dispatches": [
{
"id": "<string>",
"transfer_step_id": "<string>",
"transfer_segment_id": "<string>",
"transfer_line_id": "<string>",
"position": 123,
"asset_id": "<string>",
"group_id": "<string>",
"vendor_name": "<string>",
"quantity": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"asset_name": "<string>"
}
]
},
"to_step": {
"id": "<string>",
"transfer_id": "<string>",
"position": 123,
"location_group_id": "<string>",
"status": "<string>",
"operations_executed_at": "2023-11-07T05:31:56Z",
"approved_by_company_id": "<string>",
"approved_by_user_id": "<string>",
"approved_at": "2023-11-07T05:31:56Z",
"completed_by_company_id": "<string>",
"completed_by_user_id": "<string>",
"completed_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"location_group": {
"id": "<string>",
"name": "<string>"
},
"receipts": [
{
"id": "<string>",
"transfer_step_id": "<string>",
"transfer_line_id": "<string>",
"asset_id": "<string>",
"quantity": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"asset_name": "<string>"
}
],
"dispatches": [
{
"id": "<string>",
"transfer_step_id": "<string>",
"transfer_segment_id": "<string>",
"transfer_line_id": "<string>",
"position": 123,
"asset_id": "<string>",
"group_id": "<string>",
"vendor_name": "<string>",
"quantity": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"asset_name": "<string>"
}
]
}
}{
"message": "<string>",
"errors": {}
}Add a route leg
Adds a leg between two steps of the transfer route.
curl --request POST \
--url https://api.exowpee.com/v1/catalog/transfers/{transfer}/route-legs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"from_step_id": "<string>",
"from_step_position": 2,
"to_step_id": "<string>",
"to_step_position": 2,
"costs": [
{
"label": "<string>",
"amount": 123,
"amount_minor": "<string>"
}
]
}
'import requests
url = "https://api.exowpee.com/v1/catalog/transfers/{transfer}/route-legs"
payload = {
"from_step_id": "<string>",
"from_step_position": 2,
"to_step_id": "<string>",
"to_step_position": 2,
"costs": [
{
"label": "<string>",
"amount": 123,
"amount_minor": "<string>"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
from_step_id: '<string>',
from_step_position: 2,
to_step_id: '<string>',
to_step_position: 2,
costs: [{label: '<string>', amount: 123, amount_minor: '<string>'}]
})
};
fetch('https://api.exowpee.com/v1/catalog/transfers/{transfer}/route-legs', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'from_step_id' => '<string>',
'from_step_position' => 2,
'to_step_id' => '<string>',
'to_step_position' => 2,
'costs' => [
[
'label' => '<string>',
'amount' => 123,
'amount_minor' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.exowpee.com/v1/catalog/transfers/{transfer}/route-legs"
payload := strings.NewReader("{\n \"from_step_id\": \"<string>\",\n \"from_step_position\": 2,\n \"to_step_id\": \"<string>\",\n \"to_step_position\": 2,\n \"costs\": [\n {\n \"label\": \"<string>\",\n \"amount\": 123,\n \"amount_minor\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
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")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"from_step_id\": \"<string>\",\n \"from_step_position\": 2,\n \"to_step_id\": \"<string>\",\n \"to_step_position\": 2,\n \"costs\": [\n {\n \"label\": \"<string>\",\n \"amount\": 123,\n \"amount_minor\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.exowpee.com/v1/catalog/transfers/{transfer}/route-legs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"from_step_id\": \"<string>\",\n \"from_step_position\": 2,\n \"to_step_id\": \"<string>\",\n \"to_step_position\": 2,\n \"costs\": [\n {\n \"label\": \"<string>\",\n \"amount\": 123,\n \"amount_minor\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"transfer_id": "<string>",
"from_step_id": "<string>",
"to_step_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"cost_total_minor": 123,
"costs": [
{
"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"
}
],
"from_step": {
"id": "<string>",
"transfer_id": "<string>",
"position": 123,
"location_group_id": "<string>",
"status": "<string>",
"operations_executed_at": "2023-11-07T05:31:56Z",
"approved_by_company_id": "<string>",
"approved_by_user_id": "<string>",
"approved_at": "2023-11-07T05:31:56Z",
"completed_by_company_id": "<string>",
"completed_by_user_id": "<string>",
"completed_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"location_group": {
"id": "<string>",
"name": "<string>"
},
"receipts": [
{
"id": "<string>",
"transfer_step_id": "<string>",
"transfer_line_id": "<string>",
"asset_id": "<string>",
"quantity": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"asset_name": "<string>"
}
],
"dispatches": [
{
"id": "<string>",
"transfer_step_id": "<string>",
"transfer_segment_id": "<string>",
"transfer_line_id": "<string>",
"position": 123,
"asset_id": "<string>",
"group_id": "<string>",
"vendor_name": "<string>",
"quantity": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"asset_name": "<string>"
}
]
},
"to_step": {
"id": "<string>",
"transfer_id": "<string>",
"position": 123,
"location_group_id": "<string>",
"status": "<string>",
"operations_executed_at": "2023-11-07T05:31:56Z",
"approved_by_company_id": "<string>",
"approved_by_user_id": "<string>",
"approved_at": "2023-11-07T05:31:56Z",
"completed_by_company_id": "<string>",
"completed_by_user_id": "<string>",
"completed_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"location_group": {
"id": "<string>",
"name": "<string>"
},
"receipts": [
{
"id": "<string>",
"transfer_step_id": "<string>",
"transfer_line_id": "<string>",
"asset_id": "<string>",
"quantity": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"asset_name": "<string>"
}
],
"dispatches": [
{
"id": "<string>",
"transfer_step_id": "<string>",
"transfer_segment_id": "<string>",
"transfer_line_id": "<string>",
"position": 123,
"asset_id": "<string>",
"group_id": "<string>",
"vendor_name": "<string>",
"quantity": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"asset_name": "<string>"
}
]
}
}{
"message": "<string>",
"errors": {}
}transfer_route_legs.create
Conditions
- Only the company that owns the transfer can add a leg.
- The transfer must be draft or running.
- Each end must be given either as a step id or as a step position (1 or more); both ends are required, and the id wins when both forms are sent.
- Both steps must belong to the transfer and the end must sit exactly one position after the start.
- Only one leg can join a given pair of steps in a transfer.
- When costs are sent, each needs a label (up to 255 characters) and an amount in major units, non-negative with at most currency_exponent decimals; amount_minor is refused.
- After the change every transfer segment must still be covered by a complete, continuous chain of legs, otherwise the call is refused.
- The route-leg links of the transfer segments are recomputed.
- When costs are sent they are recorded on the new leg for the current company and user.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Identifier of the transfer.
Body
Identifier of the step where the leg starts (27 characters). Required unless from_step_position is sent; when both are sent the id is used.
27Position (1 or more) of the step where the leg starts. Required unless from_step_id is sent.
x >= 1Identifier of the step where the leg ends. Required unless to_step_position is sent. The end step must come right after the start step.
27Position of the step where the leg ends; it must equal the start position plus one. Required unless to_step_id is sent.
x >= 1Costs to record on the new leg at creation. Not accepted on update; use the route leg cost endpoints instead.
Show child attributes
Show child attributes
Response
TransferRouteLegResource
Identifier of the route leg.
Identifier of the transfer.
Step the leg starts from.
Step the leg arrives at; always the next step in order.
Date and time the record was created (ISO 8601, UTC).
Date and time the record was last changed (ISO 8601, UTC).
Total of the leg's costs in minor units (divide by 10 to the power currency_exponent). Present only when costs are loaded.
Cost lines of the leg (label and amount); shown to the owner company only.
Show child attributes
Show child attributes
Starting step, when included.
Show child attributes
Show child attributes
Arrival step, when included.
Show child attributes
Show child attributes