APS The Solver API dokumentatsioon
Täielik API dokumentatsioon APS The Solver veoteenuse integreerimiseks. Veotellimused, veohinnad, pakisildid ja jälgimise läbi Cargosoni vedajateülese API.
Küsi oma API võtiAPS The Solver API ülevaade
See API pakub programmilise juurdepääsu APS The Solver veoteenustele läbi Cargosoni ühtse veohalduse platvormi. Integreeri APS The Solver võimalused, sealhulgas veotellimused, jälgimine, hinnapakkumised ja pakisildid oma rakendustesse.
API võimalused
- Loo ja halda APS The Solver veotellimusi
- Saadetiste jälgimine ja staatuse uuendused
- Küsi transpordi hinnapakkumisi ja tarneaegu
- Genereeri pakisildid mitmes formaadis (PDF, PNG, ZPL)
- Loo tagastussildid pöördlogistika jaoks
- Küsi pakiautomaatide ja väljastuspunktide asukohti
- Vaata saadaolevaid vedaja teenuseid
- Automatiseeritud kullerikutsed
Baas-URL ja autentimine
Baas-URL
https://www.cargoson.com/api/v1
Autentimine
Kõik päringud peavad sisaldama sinu API võtit ja õiget Accept päist:
Authorization: Bearer SINU_API_VÕTI
Accept: application/vnd.api.v1
APS The Solver veotellimuste API
Cargosoni automatiseeringAPS The Solver ei paku veotellimuste API-d. Cargoson saadab automaatselt tellimuse kinnitused e-posti teel sinu nimel, samal ajal kui kasutad endiselt sama ühtset API liidest.
Loo APS The Solver veotellimused ja saa pakisildid kasutades Queries endpointi. Tellimused edastatakse vedaja süsteemi reaalajas ja pakisildid genereeritakse koheselt.
Saadetis vs otsetellimus
Queries otspunkt toetab kahte tellimisviisi:
- Saadetise režiim - Loo saadetis ilma (veel) vedajat määramata. Sedasi saad hiljem Cargosoni sisse logida ja võrrelda oma erinevate vedajate hindu ja tarneaegu, küsida spot-hinnapakkumisi, teha saadetises muudatusi/uuendusi, või delegeerida vedaja valik kolleegile, enne lõplikku vedaja valiku tegemist.
- Otsetellimus - Määra vedaja teenuse ID (Rate või Services API-st), et tellida otse APS The Solver kaudu. See tagab, et saadetis kasutab täpselt valitud teenust.
Et teha tellimus otse APS The Solver süsteemi, saada alati kaasa direct_booking_service_id-ga.
/queries
Loo saadetise päring või otsene tellimus APS The Solver jaoks. Lisa direct_booking_service_id kohese tellimuse loomiseks.
Request Parameters
collection_date
string
required
Pealekorje kuupäev formaadis AAAA-KK-PP
collection_country
string
required
Pealekorje riigi kood (ISO 3166-1 alpha-2)
collection_postcode
string
required
Pealekorje postiindeks
collection_address_row_1
string
required
Pealekorje tänavaaadress
collection_city
string
required
Pealekorje linn
collection_company_name
string
required
Saatja ettevõtte nimi
collection_contact_name
string
required
Saatja kontaktisik
collection_contact_phone
string
required
Saatja telefoninumber
delivery_country
string
required
Mahalaadimise riigi kood
delivery_postcode
string
required
Mahalaadimise postiindeks
delivery_address_row_1
string
required
Mahalaadimise tänavaaadress
delivery_city
string
required
Mahalaadimise linn
delivery_company_name
string
required
Saaja ettevõtte nimi
delivery_contact_name
string
required
Saaja kontaktisik
delivery_contact_phone
string
required
Saaja telefoninumber
rows_attributes
array
required
Pakendite/kaubaaluste massiiv koos koguse, pakendi tüübi, kaalu ja kirjeldusega
options[direct_booking_service_id]
integer
APS The Solver teenuse ID otsese tellimuse jaoks
Example: Direct Booking Request
{
"collection_date": "2026-02-15",
"collection_country": "DE",
"collection_postcode": "10115",
"collection_address_row_1": "Hauptstraße 123",
"collection_city": "Berlin",
"collection_company_name": "Demo GmbH",
"collection_contact_name": "Max Mustermann",
"collection_contact_phone": "+4930123456",
"delivery_country": "SE",
"delivery_postcode": "11122",
"delivery_address_row_1": "Drottninggatan 45",
"delivery_city": "Stockholm",
"delivery_company_name": "Demo Sweden AB",
"delivery_contact_name": "Erik Andersson",
"delivery_contact_phone": "+46812345678",
"rows_attributes": [
{
"quantity": 1,
"package_type": "EUR",
"weight": 100.0,
"description": "Goods on EUR pallet"
}
],
"options": {
"direct_booking_service_id": 1234
}
}
Example Response
{
"id": 12345,
"reference": "CG12345",
"status": "booked",
"latest_status": "confirmed",
"tracking_reference": "ABC1234567890",
"tracking_url": "https://tracking.carrier.com/ABC1234567890",
"label_url": "https://www.cargoson.com/labels/abc123.pdf",
"confirmed_at": "2026-02-15T10:30:00Z"
}
Pakisildid
APS The Solver pakisildid genereeritakse automaatselt veotellimuse loomisel. Etiketid on saadaval mitmes formaadis erinevate printeritüüpide jaoks.
Toetatud formaadid
a4 - A4 PDF formaat kontoriprinteritele (4 silti lehel)label_printer - 4x6in (~10x15cm) PDF formaat termoprinterile
Sildid on automaatselt kaasas veotellimuse vastuses label_url väljal. Laadi alla ja prindi silt antud URLi kaudu pärast tellimust.
APS The Solver veohindade API
Cargosoni mootorAPS The Solver ei paku hindade API-d. Cargosoni veohindade mootor arvutab hinnad kasutades sinu üleslaaditud hinnalepinguid, pakkudes sulle sama API kogemust nagu vedajatel, kellel on hindade API. Saad üles laadida vedajate hinnad mis tahes formaadis (Excel, PDF, isegi käsitsi kirjutatud hinnakirjad) ja me digiteerime need.
Küsi reaalajas APS The Solver veohindu enne tellimust. Rate API tagastab saadaolevad teenused, hinnad ja hinnangulised tarneajad.
/freightPrices/list
Küsi veohindade hinnapakkumisi APS The Solver-lt ja teistelt sinu kontol aktiveeritud vedajatelt.
Request Parameters
collection_date
string
required
Pealekorje kuupäev formaadis AAAA-KK-PP
collection_country
string
required
Pealekorje riigi kood (ISO 3166-1 alpha-2)
collection_postcode
string
required
Pealekorje postiindeks
delivery_country
string
required
Mahalaadimise riigi kood
delivery_postcode
string
required
Mahalaadimise postiindeks
rows_attributes
array
required
Pakendite/kaubaaluste massiiv koos koguse, pakendi tüübi, kaalu ja kirjeldusega
Example Request
{
"collection_date": "2026-02-15",
"collection_postcode": "10115",
"collection_country": "DE",
"collection_with_tail_lift": true,
"collection_prenotification": true,
"delivery_postcode": "11122",
"delivery_country": "SE",
"delivery_with_tail_lift": true,
"delivery_prenotification": true,
"delivery_return_document": true,
"delivery_to_private_person": true,
"frigo": true,
"adr": false,
"rows_attributes": [
{
"quantity": 1,
"package_type": "EUR",
"weight": 100.0,
"description": "Goods on EUR pallet"
},
{
"quantity": 2,
"package_type": "FIN",
"weight": 300.0,
"description": "Goods on two FIN pallets"
}
],
"request_external_partners": false
}
Example Response
{
"status": 200,
"object": {
"prices": [
{
"carrier": "AZONIK Sp. z o. o",
"reg_no": "388402918",
"id": 1428,
"service": "Main",
"service_id": 85,
"price": "19.13",
"unit": "payable_weight",
"type": "price_list"
},
{
"carrier": "AZONIK Sp. z o. o",
"reg_no": "388402918",
"id": 1428,
"service": "Express Service",
"service_id": 123,
"price": "32.50",
"unit": "real_weight",
"type": "online"
},
{
"carrier": "Demo Logistics GmbH",
"reg_no": "87654321",
"id": 456,
"service": "Main",
"service_id": 555,
"price": "20.00",
"unit": "payable_weight",
"type": "price_list"
}
]
}
}
APS The Solver jälgimise API
Cargosoni automatiseeringAPS The Solver ei paku jälgimise sündmusi API kaudu. Cargoson pakub jälgimisportaali, kus vedaja saab käsitsi uuendada saadetise staatust, andes sulle ja sinu klientidele järjepideva jälgimiskogemuse.
Jälgi APS The Solver saadetisi kasutades Cargosoni viitenumbrit. Vaata hetkestaatust, asukoha uuendusi ja hinnangulist tarnekuupäeva.
/bookings/{reference}
Vaata jälgimise üksikasju APS The Solver saadetise kohta kasutades Cargosoni tellimuse viidet.
Example Response
{
"reference": "CG12345",
"status": "in_transit",
"latest_status": "collected",
"tracking_reference": "ABC1234567890",
"tracking_url": "https://tracking.carrier.com/ABC1234567890",
"confirmed_at": "2026-02-15T10:30:00Z",
"collected_at": "2026-02-15T14:20:00Z",
"estimated_delivery": "2026-02-18T16:00:00Z"
}
APS The Solver tagastusetikettide API
Cargoson tehnoloogialAPS The Solver ei toeta algupäraselt tagastussilte. Cargoson genereerib tagastussildid ja haldab tagastuslogistika protsessi meie platvormi kaudu.
Genereeri tagastusetiketid APS The Solver saadetistele. Tagastussildid võimaldavad klientidel saata kaupu tagasi eelmakstud veoga.
/bookings/{reference}/return_labels
Loo tagastussilt olemasolevale APS The Solver saadetisele.
Request Parameters
label_format
string
Pakisildi formaat: a4 või label_printer (vaikimisi: a4)
Example Request
{
"label_format": "a4"
}
Example Response
{
"return_label_url": "https://www.cargoson.com/labels/return_abc123.pdf",
"tracking_reference": "RETURN9876543210",
"tracking_url": "https://tracking.carrier.com/RETURN9876543210"
}
Tagastusetiketi funktsioonid
- Eelmakstud tagastusetiketid
- Samad formaadi valikud kui väljaminevatel siltidel (A4, termoprinter)
- Eraldi jälgimisviide tagastustele
- Sujuv integratsioon APS The Solver tagastusteenustega
APS The Solver kullerikutsed
Cargosoni automatiseeringCargoson automatiseerib kullerikutsed APS The Solver saadetistele - üks tegevus vähem, mille pärast muretseda.
Kuidas Cargoson käsitleb kullerikutseid
Paljud vedajad nõuavad, et lood pakisildid eraldi ja seejärel tellid käsitsi eraldi kulleri pealekorje. Teistel pole eraldi etiketi ja kullerikutse süsteemi ning iga saadetis on täielik, eraldiseisev tellimus. Meie usume, et vedajate API-d peaksid olema ühtses formaadis, kuid praegusel hetkel on igal vedajal oma süsteem, mis tähendab, et kasutajatel on keeruline meeles pidada iga vedaja eripära. Cargoson lihtsustab kullerikutseid, käsitledes iga saadetist terviklikult: kullerikutseid hallatakse automaatselt osana tellimisprotsessist.
Nutikas pealekorje optimeerimine
Cargoson optimeerib kullerikutseid kulude vähendamiseks ja tõhususe parandamiseks.
- 1. Partii konsolideerimine - Mitu saadetist samast asukohast grupeeritakse üheks pealekorjeks
- 2. Vedajapõhine käsitlemine - Mõned vedaja puhul on tellimus nii pakisilt kui kullerikutse koos, teised nõuavad eraldi päringut. Cargoson haldab mõlemat varianti sinu eest automaatselt
- 3. Regulaarkorjed - Seadista eelplaneeritud pealekorjed kindlatel aegadel (nt pealaoaadressile iga päev kell 15:00) ja Cargoson sellisel juhul eraldi üksikuid kullerikutseid sinna ei tee
Eelised
- Pole vaja jälgida, millised vedajad nõuavad eraldi kullerikutseid
- Automaatne optimeerimine hoiab ära mittevajalikud kullerikutsed
- Regulaarkorjete tugi
- Lihtsustatud veoprotsess - lihtsalt loo tellimus
Seadistamine
Kullerikutse automatiseerimine on vaikimisi sisse lülitatud kõigile APS The Solver saadetistele. Regulaarkorje või kohandatud optimeerimisreeglite seadistamiseks võta ühendust [email protected].
APS The Solver teenuste API
Cargosoni mootorTeenuste API on Cargosoni pakutav funktsioon, mis tagastab ühtse loetelu kõigist saadaolevatest teenustest APS The Solver-lt ja teistelt vedajatelt sinu võrgustikus. See võimaldab sul dünaamiliselt kuvada veoteenuseid oma klientidele ilma teenuse ID-sid kõvakoodimata.
Küsi kõikide saadaolevate APS The Solver veoteenuste nimekiri. Kasuta teenuse ID-sid otsetellimuste esitamisel, et valida soovitud teenus.
/services/list
Tagasta loetelu sinu ettevõtte kontol saadaolevatest APS The Solver teenustest.
Example Response
{
"services": [
{
"carrier": {
"id": 1428,
"name": "AZONIK Sp. z o. o",
"short_name": "APS The Solver",
"reg_no": "388402918"
},
"id": 85,
"name": "Main",
"service_type": "road_freight"
},
{
"carrier": {
"id": 1428,
"name": "AZONIK Sp. z o. o",
"short_name": "APS The Solver",
"reg_no": "388402918"
},
"id": 123,
"name": "Express Service",
"service_type": "express"
}
]
}
Teenuse ID-de kasutamine
Selle otspunkti tagastatavaid teenuste ID-sid saab kasutada direct_booking_service_id parameetriga tellimuste loomisel, et garanteerida saadetise marsruutimine APS The Solver süsteemi.
Täielikud koodinäited
Allpool on täielikud töötavad näited, mis näitavad kogu töövoogu: küsi hinnad, vali teenus, telli vedu ja vaata jälgimisinfot.
# Define the service ID you want to use
CARRIER_SERVICE_ID=85
# Step 1: Get freight prices for APS The Solver
curl -X POST https://www.cargoson.com/api/v1/freightPrices/list \
-H "Content-Type: application/json" \
-H "Accept: application/vnd.api.v1" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"collection_date": "2026-02-15",
"collection_country": "DE",
"collection_postcode": "10115",
"delivery_country": "SE",
"delivery_postcode": "11122",
"rows_attributes": [{
"quantity": 1,
"package_type": "EUR",
"weight": 100.0,
"description": "Goods on EUR pallet"
}]
}'
# Extract the price for your service from response:
# transport_price=$(echo "$response" | jq '.object.prices[] | select(.service_id==85) | .price')
# Step 2: Book shipment using the service_id
curl -X POST https://www.cargoson.com/api/v1/queries \
-H "Content-Type: application/json" \
-H "Accept: application/vnd.api.v1" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"collection_date": "2026-02-15",
"collection_country": "DE",
"collection_postcode": "10115",
"collection_address_row_1": "Hauptstraße 123",
"collection_city": "Berlin",
"collection_company_name": "Demo GmbH",
"collection_contact_name": "Max Mustermann",
"collection_contact_phone": "+4930123456",
"delivery_country": "SE",
"delivery_postcode": "11122",
"delivery_address_row_1": "Drottninggatan 45",
"delivery_city": "Stockholm",
"delivery_company_name": "Demo Sweden AB",
"delivery_contact_name": "Erik Andersson",
"delivery_contact_phone": "+46812345678",
"rows_attributes": [{
"quantity": 1,
"package_type": "EUR",
"weight": 100.0,
"description": "Goods on EUR pallet"
}],
"options": {
"direct_booking_service_id": '$CARRIER_SERVICE_ID'
}
}'
# Response contains:
# - reference: "CG12345"
# - tracking_url: "https://tracking.carrier.com/..."
# - label_url: "https://www.cargoson.com/labels/abc123.pdf"
const axios = require('axios');
const API_KEY = 'YOUR_API_KEY';
const BASE_URL = 'https://www.cargoson.com/api/v1';
const CARRIER_SERVICE_ID = 85;
async function bookToAPSTheSolver() {
try {
// Step 1: Get freight prices
const pricesResponse = await axios.post(`${BASE_URL}/freightPrices/list`, {
collection_date: '2026-02-15',
collection_country: 'DE',
collection_postcode: '10115',
delivery_country: 'SE',
delivery_postcode: '11122',
rows_attributes: [{
quantity: 1,
package_type: 'EUR',
weight: 100.0,
description: 'Goods on EUR pallet'
}]
}, {
headers: {
'Content-Type': 'application/json',
'Accept': 'application/vnd.api.v1',
'Authorization': `Bearer ${API_KEY}`
}
});
// Step 2: Find service by ID and extract price
const prices = pricesResponse.data.object.prices;
const selectedService = prices.find(p => p.service_id === CARRIER_SERVICE_ID);
if (!selectedService) {
throw new Error(`Service ID ${CARRIER_SERVICE_ID} not found in prices`);
}
const transportPrice = selectedService.price;
console.log(`Selected service price: €${transportPrice}`);
// Step 3: Book shipment using the service_id
const bookingResponse = await axios.post(`${BASE_URL}/queries`, {
collection_date: '2026-02-15',
collection_country: 'DE',
collection_postcode: '10115',
collection_address_row_1: 'Hauptstraße 123',
collection_city: 'Berlin',
collection_company_name: 'Demo GmbH',
collection_contact_name: 'Max Mustermann',
collection_contact_phone: '+4930123456',
delivery_country: 'SE',
delivery_postcode: '11122',
delivery_address_row_1: 'Drottninggatan 45',
delivery_city: 'Stockholm',
delivery_company_name: 'Demo Sweden AB',
delivery_contact_name: 'Erik Andersson',
delivery_contact_phone: '+46812345678',
rows_attributes: [{
quantity: 1,
package_type: 'EUR',
weight: 100.0,
description: 'Goods on EUR pallet'
}],
options: {
direct_booking_service_id: CARRIER_SERVICE_ID
}
}, {
headers: {
'Content-Type': 'application/json',
'Accept': 'application/vnd.api.v1',
'Authorization': `Bearer ${API_KEY}`
}
});
// Extract important fields
const reference = bookingResponse.data.reference;
const trackingUrl = bookingResponse.data.tracking_url;
const labelUrl = bookingResponse.data.label_url;
console.log('Shipment booked successfully!');
console.log(`Reference: ${reference}`);
console.log(`Tracking: ${trackingUrl}`);
console.log(`Label: ${labelUrl}`);
return { reference, trackingUrl, labelUrl };
} catch (error) {
console.error('Error:', error.response?.data || error.message);
}
}
// Usage
bookToAPSTheSolver();
import requests
API_KEY = 'YOUR_API_KEY'
BASE_URL = 'https://www.cargoson.com/api/v1'
CARRIER_SERVICE_ID = 85
def book_to_aps_the_solver():
headers = {
'Content-Type': 'application/json',
'Accept': 'application/vnd.api.v1',
'Authorization': f'Bearer {API_KEY}'
}
# Step 1: Get freight prices
prices_data = {
'collection_date': '2026-02-15',
'collection_country': 'DE',
'collection_postcode': '10115',
'delivery_country': 'SE',
'delivery_postcode': '11122',
'rows_attributes': [{
'quantity': 1,
'package_type': 'EUR',
'weight': 100.0,
'description': 'Goods on EUR pallet'
}]
}
prices_response = requests.post(
f'{BASE_URL}/freightPrices/list',
headers=headers,
json=prices_data
)
prices_response.raise_for_status()
# Step 2: Find service by ID and extract price
prices = prices_response.json()['object']['prices']
selected_service = next(
(p for p in prices if p['service_id'] == CARRIER_SERVICE_ID),
None
)
if not selected_service:
raise ValueError(f'Service ID {CARRIER_SERVICE_ID} not found in prices')
transport_price = selected_service['price']
print(f'Selected service price: €{transport_price}')
# Step 3: Book shipment using the service_id
booking_data = {
'collection_date': '2026-02-15',
'collection_country': 'DE',
'collection_postcode': '10115',
'collection_address_row_1': 'Hauptstraße 123',
'collection_city': 'Berlin',
'collection_company_name': 'Demo GmbH',
'collection_contact_name': 'Max Mustermann',
'collection_contact_phone': '+4930123456',
'delivery_country': 'SE',
'delivery_postcode': '11122',
'delivery_address_row_1': 'Drottninggatan 45',
'delivery_city': 'Stockholm',
'delivery_company_name': 'Demo Sweden AB',
'delivery_contact_name': 'Erik Andersson',
'delivery_contact_phone': '+46812345678',
'rows_attributes': [{
'quantity': 1,
'package_type': 'EUR',
'weight': 100.0,
'description': 'Goods on EUR pallet'
}],
'options': {
'direct_booking_service_id': CARRIER_SERVICE_ID
}
}
booking_response = requests.post(
f'{BASE_URL}/queries',
headers=headers,
json=booking_data
)
booking_response.raise_for_status()
booking = booking_response.json()
# Extract important fields
reference = booking['reference']
tracking_url = booking['tracking_url']
label_url = booking['label_url']
print('Shipment booked successfully!')
print(f'Reference: {reference}')
print(f'Tracking: {tracking_url}')
print(f'Label: {label_url}')
return {
'reference': reference,
'tracking_url': tracking_url,
'label_url': label_url
}
# Usage
if __name__ == '__main__':
book_to_aps_the_solver()
<?php
$apiKey = 'YOUR_API_KEY';
$baseUrl = 'https://www.cargoson.com/api/v1';
define('CARRIER_SERVICE_ID', 85);
function bookToAPSTheSolver($apiKey, $baseUrl) {
$headers = [
'Content-Type: application/json',
'Accept: application/vnd.api.v1',
'Authorization: Bearer ' . $apiKey
];
// Step 1: Get freight prices
$pricesData = [
'collection_date' => '2026-02-15',
'collection_country' => 'DE',
'collection_postcode' => '10115',
'delivery_country' => 'SE',
'delivery_postcode' => '11122',
'rows_attributes' => [[
'quantity' => 1,
'package_type' => 'EUR',
'weight' => 100.0,
'description' => 'Goods on EUR pallet'
]]
];
$ch = curl_init($baseUrl . '/freightPrices/list');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($pricesData));
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$pricesResponse = curl_exec($ch);
curl_close($ch);
$prices = json_decode($pricesResponse, true)['object']['prices'];
// Step 2: Find service by ID and extract price
$selectedService = null;
foreach ($prices as $price) {
if ($price['service_id'] === CARRIER_SERVICE_ID) {
$selectedService = $price;
break;
}
}
if (!$selectedService) {
throw new Exception('Service ID ' . CARRIER_SERVICE_ID . ' not found in prices');
}
$transportPrice = $selectedService['price'];
echo "Selected service price: €$transportPrice
";
// Step 3: Book shipment using the service_id
$bookingData = [
'collection_date' => '2026-02-15',
'collection_country' => 'DE',
'collection_postcode' => '10115',
'collection_address_row_1' => 'Hauptstraße 123',
'collection_city' => 'Berlin',
'collection_company_name' => 'Demo GmbH',
'collection_contact_name' => 'Max Mustermann',
'collection_contact_phone' => '+4930123456',
'delivery_country' => 'SE',
'delivery_postcode' => '11122',
'delivery_address_row_1' => 'Drottninggatan 45',
'delivery_city' => 'Stockholm',
'delivery_company_name' => 'Demo Sweden AB',
'delivery_contact_name' => 'Erik Andersson',
'delivery_contact_phone' => '+46812345678',
'rows_attributes' => [[
'quantity' => 1,
'package_type' => 'EUR',
'weight' => 100.0,
'description' => 'Goods on EUR pallet'
]],
'options' => [
'direct_booking_service_id' => CARRIER_SERVICE_ID
]
];
$ch = curl_init($baseUrl . '/queries');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($bookingData));
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$bookingResponse = curl_exec($ch);
curl_close($ch);
$booking = json_decode($bookingResponse, true);
// Extract important fields
$reference = $booking['reference'];
$trackingUrl = $booking['tracking_url'];
$labelUrl = $booking['label_url'];
echo "Shipment booked successfully!
";
echo "Reference: $reference
";
echo "Tracking: $trackingUrl
";
echo "Label: $labelUrl
";
return [
'reference' => $reference,
'tracking_url' => $trackingUrl,
'label_url' => $labelUrl
];
}
// Usage
bookToAPSTheSolver($apiKey, $baseUrl);
?>
require 'net/http'
require 'json'
API_KEY = 'YOUR_API_KEY'
BASE_URL = 'https://www.cargoson.com/api/v1'
CARRIER_SERVICE_ID = 85
def book_to_aps_the_solver
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/vnd.api.v1',
'Authorization' => "Bearer #{API_KEY}"
}
# Step 1: Get freight prices
prices_uri = URI("#{BASE_URL}/freightPrices/list")
prices_data = {
collection_date: '2026-02-15',
collection_country: 'DE',
collection_postcode: '10115',
delivery_country: 'SE',
delivery_postcode: '11122',
rows_attributes: [{
quantity: 1,
package_type: 'EUR',
weight: 100.0,
description: 'Goods on EUR pallet'
}]
}
http = Net::HTTP.new(prices_uri.host, prices_uri.port)
http.use_ssl = true
prices_request = Net::HTTP::Post.new(prices_uri)
headers.each { |k, v| prices_request[k] = v }
prices_request.body = prices_data.to_json
prices_response = http.request(prices_request)
prices = JSON.parse(prices_response.body)['object']['prices']
# Step 2: Find service by ID and extract price
selected_service = prices.find { |p| p['service_id'] == CARRIER_SERVICE_ID }
raise "Service ID #{CARRIER_SERVICE_ID} not found in prices" unless selected_service
transport_price = selected_service['price']
puts "Selected service price: €#{transport_price}"
# Step 3: Book shipment using the service_id
booking_uri = URI("#{BASE_URL}/queries")
booking_data = {
collection_date: '2026-02-15',
collection_country: 'DE',
collection_postcode: '10115',
collection_address_row_1: 'Hauptstraße 123',
collection_city: 'Berlin',
collection_company_name: 'Demo GmbH',
collection_contact_name: 'Max Mustermann',
collection_contact_phone: '+4930123456',
delivery_country: 'SE',
delivery_postcode: '11122',
delivery_address_row_1: 'Drottninggatan 45',
delivery_city: 'Stockholm',
delivery_company_name: 'Demo Sweden AB',
delivery_contact_name: 'Erik Andersson',
delivery_contact_phone: '+46812345678',
rows_attributes: [{
quantity: 1,
package_type: 'EUR',
weight: 100.0,
description: 'Goods on EUR pallet'
}],
options: {
direct_booking_service_id: CARRIER_SERVICE_ID
}
}
booking_request = Net::HTTP::Post.new(booking_uri)
headers.each { |k, v| booking_request[k] = v }
booking_request.body = booking_data.to_json
booking_response = http.request(booking_request)
booking = JSON.parse(booking_response.body)
# Extract important fields
reference = booking['reference']
tracking_url = booking['tracking_url']
label_url = booking['label_url']
puts 'Shipment booked successfully!'
puts "Reference: #{reference}"
puts "Tracking: #{tracking_url}"
puts "Label: #{label_url}"
{
reference: reference,
tracking_url: tracking_url,
label_url: label_url
}
end
# Usage
book_to_aps_the_solver
Miks kasutada Cargosoni API-d APS The Solver integratsiooni jaoks
Otse APS The Solver API-ga integreerimine tähendab vedajapõhise dokumentatsiooniga tegelemist, erinevate andmevormingute käsitlemist ja eraldi koodi haldamist iga vedaja jaoks. Cargoson pakub ühte ühtset RESTful API-d, mis toetab APS The Solver-t ja 2000+ vedajat üle Euroopa ja Põhja-Ameerika - uusi integratsioone lisatakse iganädalaselt. Me vähendame arendusaega kuudelt päevadele, käsitleme vedajate uuendusi automaatselt ja haldame piirkondlikke erandeid. Cargosoniga keskendud oma äri kasvatamisele, mitte vedajate tehniliste keerukuste haldamisele.
APS The Solver integreerimise eelised Cargosoni API kaudu
Üks API kõigile vedajatele
Asenda kümneid eraldi vedajate integratsioone ühe ühendusega APS The Solver ja 2000+ teise vedajaga Cargosoni API kaudu. Pole enam vaja hallata mitut autentimissüsteemi, käsitleda erinevaid andmevorminguid või uuendada koodi, kui vedajad muudavad oma otspunkte.
Selge dokumentatsioon ja tugi
Selge API dokumentatsioon koos töötavate koodinäidetega, üksikasjalike parameetrite kirjeldustega ja selgelt määratletud otspunktidega. Meie kienditugi tunneb logistikat ja aitab sul integratsiooniprobleeme kiiresti lahendada.
Koodinäited mitmes keeles
Alusta kohe kasutamisvalmis koodinäidetega cURL, JavaScript, Python, PHP ja Ruby keeltes. Kopeeri, kleebi ja kohanda neid oma tehnoloogiale - pole vaja autentimist, päringu vormindamist või vigade käsitlemist nullist välja mõelda.
Päris tugi logistika ekspertidelt
Saa abi inimestelt, kes mõistavad logistikat, mitte ainult API-sid. Olenemata sellest, kas teed integratsiooniprobleemi tõrkeotsingut või vajad nõu rahvusvaheliste saadetiste käsitlemiseks, on meie meeskond siin, et aidata.
Maailma kõige arenenum veohindade mootor
Cargosoni veohindade API ei piirdu ainult lihtsate hinnapäringutega. Meie mootor suudab lugeda, analüüsida ja digiteerida mis tahes vedaja hinnakirja olenemata formaadist või struktuurist - see on kõige võimsam veohindade haldussüsteem logistikamaailmas.
Universaalne formaadi tugi
Meie veohindade haldamise mootor käsitleb mis tahes formaati: struktureeritud Exceli failid, keerulised PDF-id, vaba tekst või isegi käsitsi kirjutatud hinnakirjad. Laadi üles oma veolepingud mis tahes formaadis ja meie veohindade mootor digitiseerib hinnaarvutuse reeglid, lisatasud ja tingimused automaatselt.
Otsene vedaja API integratsioon
Kaasaegsete süsteemidega vedajate puhul (tavaliselt globaalsed pakiveod ja tehnoloogiasõbralikud veofirmad) tõmbame hinnad otse nende API-dest reaalajas. See tagab, et saad alati kõige värskemad veohinnad ilma käsitsi uuendusteta.
Avalikud veebipõhised hinnad
Pole veel vedajaga lepingut? Pole probleemi. Cargoson saab tõmmata vedajatelt avalikke veebipõhiseid hindu, mis võimaldab sul võrrelda valikuid isegi enne ametlike kokkulepete sõlmimist.
Spot-hinna päringud
Keeruliste saadetiste või erijuhtude puhul küsi spot-hindu - vedajad vaatavad üle sinu konkreetsed nõuded ja teevad hinnapakkumise. Kõik hallatav sellesama ühtse API kaudu.
APS The Solver veo API: Lihtsustatud logistika automatiseerimine
Automatiseeri oma täitmisprotsess, integreerides Cargosoni veo API APS The Solver ja 2000+ vedajaga üle maailma. Loo pakisildid, telli pealekorjed ja halda kõiki oma vedajaid ühelt platvormilt, säilitades samal ajal oma läbirääkitud hinnad iga pakkujaga.
Automatiseeritud pakisiltide genereerimine
Genereeri vedajale sobivad pakisildid ühe API päringuga. Tugi mitmele formaadile (A4, termoprinter) ja automaatne tollidokumentide koostamine rahvusvahelistele saadetistele tähendab vähem käsitsi tööd ja vähem vigu.
Reaalajas veohindade võrdlus
Võrdle reaalajas veohindasid APS The Solver ja teiste Sinu kontol aktiveeritud vedajate vahel, et valida parim valik veomaksumuse, -kiiruse ja teenuse taseme põhjal.
Eelnevalt läbiräägitud hinnad jäävad samaks
Ühenda oma olemasolev APS The Solver konto, et säilitada oma senised vedajatega kokkulepitud veohinnad. Cargoson pakub lihtsalt tehnilist integratsiooni - otsesed suhted ja hinnakokkulepped oma vedajatega ei kao kuhugi.
Ettevõtte tasemel turvalisus APS The Solver API integratsiooni jaoks
Cargosoni API infrastruktuur vastab Euroopa standarditele, mis tagavad turvalise, auditeerimiseks valmis APS The Solver integratsiooni sinu ettevõttele:
- GDPR-iga kooskõlas andmete käsitlemine ja salvestamine üle Euroopa
- ISO 27001 sertifitseeritud infoturbe haldus
- Otsast lõpuni krüpteerimine kõigile API suhtlustele
Valmis integreerima APS The Solver veoteenust oma süsteemiga?
Broneeri demo, et näha, kuidas Cargosoni ühtne API saab lihtsustada sinu logistikatoiminguid
Broneeri demoSisukord
Korduma kippuvad küsimused
Alusta APS The Solver API kasutamist
Küsi oma API tunnused integratsiooni alustamiseks