Save a lane
curl --request POST \
--url https://agent.lanesurf.com/v1/carrier/lanes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"origin_city": "Dallas",
"origin_state": "TX",
"destination_city": "Atlanta",
"destination_state": "GA",
"equipment_type": "Reefer"
}
'import requests
url = "https://agent.lanesurf.com/v1/carrier/lanes"
payload = {
"origin_city": "Dallas",
"origin_state": "TX",
"destination_city": "Atlanta",
"destination_state": "GA",
"equipment_type": "Reefer"
}
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({
origin_city: 'Dallas',
origin_state: 'TX',
destination_city: 'Atlanta',
destination_state: 'GA',
equipment_type: 'Reefer'
})
};
fetch('https://agent.lanesurf.com/v1/carrier/lanes', 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://agent.lanesurf.com/v1/carrier/lanes",
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([
'origin_city' => 'Dallas',
'origin_state' => 'TX',
'destination_city' => 'Atlanta',
'destination_state' => 'GA',
'equipment_type' => 'Reefer'
]),
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://agent.lanesurf.com/v1/carrier/lanes"
payload := strings.NewReader("{\n \"origin_city\": \"Dallas\",\n \"origin_state\": \"TX\",\n \"destination_city\": \"Atlanta\",\n \"destination_state\": \"GA\",\n \"equipment_type\": \"Reefer\"\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://agent.lanesurf.com/v1/carrier/lanes")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"origin_city\": \"Dallas\",\n \"origin_state\": \"TX\",\n \"destination_city\": \"Atlanta\",\n \"destination_state\": \"GA\",\n \"equipment_type\": \"Reefer\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://agent.lanesurf.com/v1/carrier/lanes")
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 \"origin_city\": \"Dallas\",\n \"origin_state\": \"TX\",\n \"destination_city\": \"Atlanta\",\n \"destination_state\": \"GA\",\n \"equipment_type\": \"Reefer\"\n}"
response = http.request(request)
puts response.read_body{
"lane_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"origin_state": "<string>",
"destination_state": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"origin_city": "<string>",
"destination_city": "<string>",
"equipment_type": "<string>"
}{
"error": "invalid API key",
"code": "invalid_api_key",
"missing": [
"<string>"
],
"next_step": "<string>",
"current_rate": 123,
"request_id": "req_0192f3a4-7b1c-7d2e-9f00-1a2b3c4d5e6f"
}{
"error": "invalid API key",
"code": "invalid_api_key"
}{
"error": "this API key can't use broker routes",
"code": "wrong_role"
}{
"error": "required fields are missing; send them and try again",
"code": "missing_fields",
"missing": [
"destination_state"
]
}{
"error": "too many requests for this API key; slow down",
"code": "rate_limited"
}{
"error": "invalid API key",
"code": "invalid_api_key",
"missing": [
"<string>"
],
"next_step": "<string>",
"current_rate": 123,
"request_id": "req_0192f3a4-7b1c-7d2e-9f00-1a2b3c4d5e6f"
}{
"error": "a Lanesurf system behind the API failed; try again later",
"code": "upstream_error"
}{
"error": "invalid API key",
"code": "invalid_api_key",
"missing": [
"<string>"
],
"next_step": "<string>",
"current_rate": 123,
"request_id": "req_0192f3a4-7b1c-7d2e-9f00-1a2b3c4d5e6f"
}Lanes API
Save a lane
Save a lane the carrier runs.
POST
/
v1
/
carrier
/
lanes
Save a lane
curl --request POST \
--url https://agent.lanesurf.com/v1/carrier/lanes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"origin_city": "Dallas",
"origin_state": "TX",
"destination_city": "Atlanta",
"destination_state": "GA",
"equipment_type": "Reefer"
}
'import requests
url = "https://agent.lanesurf.com/v1/carrier/lanes"
payload = {
"origin_city": "Dallas",
"origin_state": "TX",
"destination_city": "Atlanta",
"destination_state": "GA",
"equipment_type": "Reefer"
}
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({
origin_city: 'Dallas',
origin_state: 'TX',
destination_city: 'Atlanta',
destination_state: 'GA',
equipment_type: 'Reefer'
})
};
fetch('https://agent.lanesurf.com/v1/carrier/lanes', 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://agent.lanesurf.com/v1/carrier/lanes",
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([
'origin_city' => 'Dallas',
'origin_state' => 'TX',
'destination_city' => 'Atlanta',
'destination_state' => 'GA',
'equipment_type' => 'Reefer'
]),
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://agent.lanesurf.com/v1/carrier/lanes"
payload := strings.NewReader("{\n \"origin_city\": \"Dallas\",\n \"origin_state\": \"TX\",\n \"destination_city\": \"Atlanta\",\n \"destination_state\": \"GA\",\n \"equipment_type\": \"Reefer\"\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://agent.lanesurf.com/v1/carrier/lanes")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"origin_city\": \"Dallas\",\n \"origin_state\": \"TX\",\n \"destination_city\": \"Atlanta\",\n \"destination_state\": \"GA\",\n \"equipment_type\": \"Reefer\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://agent.lanesurf.com/v1/carrier/lanes")
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 \"origin_city\": \"Dallas\",\n \"origin_state\": \"TX\",\n \"destination_city\": \"Atlanta\",\n \"destination_state\": \"GA\",\n \"equipment_type\": \"Reefer\"\n}"
response = http.request(request)
puts response.read_body{
"lane_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"origin_state": "<string>",
"destination_state": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"origin_city": "<string>",
"destination_city": "<string>",
"equipment_type": "<string>"
}{
"error": "invalid API key",
"code": "invalid_api_key",
"missing": [
"<string>"
],
"next_step": "<string>",
"current_rate": 123,
"request_id": "req_0192f3a4-7b1c-7d2e-9f00-1a2b3c4d5e6f"
}{
"error": "invalid API key",
"code": "invalid_api_key"
}{
"error": "this API key can't use broker routes",
"code": "wrong_role"
}{
"error": "required fields are missing; send them and try again",
"code": "missing_fields",
"missing": [
"destination_state"
]
}{
"error": "too many requests for this API key; slow down",
"code": "rate_limited"
}{
"error": "invalid API key",
"code": "invalid_api_key",
"missing": [
"<string>"
],
"next_step": "<string>",
"current_rate": 123,
"request_id": "req_0192f3a4-7b1c-7d2e-9f00-1a2b3c4d5e6f"
}{
"error": "a Lanesurf system behind the API failed; try again later",
"code": "upstream_error"
}{
"error": "invalid API key",
"code": "invalid_api_key",
"missing": [
"<string>"
],
"next_step": "<string>",
"current_rate": 123,
"request_id": "req_0192f3a4-7b1c-7d2e-9f00-1a2b3c4d5e6f"
}Save a lane the carrier runs regularly: its terminals, with no specific truck.
origin_state and
destination_state are required (2-letter codes); cities and equipment are optional.
Safe to repeat: saving the same lane again (same states, cities and equipment, any letter case)
returns the lane already saved.Authorizations
One key per broker rep or per carrier signup. Keep it secret.
Body
application/json