Logistica REST API
Create listings, manage offers, push deal stages and vehicle locations from your TMS, ERP or own software. Events reach your system instantly via webhooks.
Start
Base URL: https://alfaloji.forum/api/v1. The key is created by the company owner on the Integrations page; it’s shown only once. “Read” keys can only make GET requests. Each key is limited to 120 requests per minute (X-RateLimit-Remaining header).
Dates are returned in ISO 8601 (UTC); when sending, include a time zone or write local time according to the listing’s timezone field. IDs match the platform: UUID for listings, offer T-…, deal A-…, company F-….
Authentication
curl https://alfaloji.forum/api/v1/me \ -H "Authorization: Bearer lgk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
A key works with the permissions of the person who created it. If they leave the company or lose permissions, the key stops working; create a new one. Never put the key in client-side code (browser, mobile app).
Responses and errors
Successful responses are {"data": …}, errors {"error": {"code", "message"}} . The message language follows the Accept-Language header (tr, en, ru).
| HTTP | Code | Meaning |
|---|---|---|
| 401 | unauthorized, invalid_key | Key missing, invalid or revoked. |
| 403 | insufficient_scope, forbidden | Write with a read key, or an unauthorised action. |
| 403 | plan_required | API access is not included in your company membership plan (Enterprise plan). |
| 404 | not_found | Record doesn’t exist or doesn’t belong to your company. |
| 422 | validation, confirmation_required | Field error or business rule (e.g. unverified company). |
| 429 | rate_limited | Retry-After seconds, then retry. |
Account
| GET | /me | Company, scope and user of the key. |
| GET | /events | List of webhook event types. |
Listings
| GET | /listings | Your company’s listings. Filters: status, kind, limit, offset. |
| POST | /listings | Creates a listing. "publish": true publishes immediately. |
| GET | /listings/{id} | Single listing. |
| PATCH | /listings/{id} | Updates a listing; if live, a new version is created and bidders are notified. |
| POST | /listings/{id}/publish | Publishes a draft. |
| POST | /listings/{id}/close | Unpublishes a listing; open offers are closed. |
| GET | /listings/{id}/offers | Offers received on the listing. |
Marketplace
| GET | /market/listings | Search live listings. Filters: kind, from, to, vehicle, mode, date, sort, limit. |
| GET | /market/listings/{id} | Single live listing. When it belongs to another company it includes the “company.trust” trust summary. |
| POST | /market/listings/{id}/offers | Places an offer: price, currency, vat (excl/incl), payment_term (prepaid, net15, net30, net45, net60), valid_hours (6, 24, 48, 72, 168), note. |
Bids
| GET | /offers | direction=incoming|outgoing, status=open|accepted|rejected|withdrawn|closed. |
| GET | /offers/{id} | Single offer (T-…). Every offer response carries the counterparty’s trust summary in “trust” (level: trusted|new|caution, supporting lines, counts); it is not a payment or delivery guarantee. |
| POST | /offers/{id}/accept | Accepts the offer and creates a deal. Body {"confirm": true} is required. |
| POST | /offers/{id}/reject | reason: price_too_high, date_unsuitable, vehicle_unsuitable, other_solution, other; note. |
| POST | /offers/{id}/withdraw | Withdraws your own offer. |
Deals and location
| GET | /deals | Deals. Filter: status (active, completed, cancelled, dispute). |
| GET | /deals/{id} | Deal, event history, last location and payment protection status. |
| POST | /deals/{id}/stage | {"stage": 1–4}. 1–3 by the carrier, 4 (completion) by the shipper. |
| GET | /deals/{id}/positions | Location trail. |
| POST | /deals/{id}/positions | Carrier sends trip location: lat, lng, speed_kmh, heading, recorded_at or {"positions": […]} (max 500). |
Telematics and rentals
| GET | /telematics/vehicles | Connected vehicles and their last locations. |
| POST | /telematics/positions | Bulk locations for vehicles on the “API push” connection: {"positions":[{"vehicle","lat","lng","speed_kmh","heading","recorded_at"}]}. |
| GET | /rentals | Rental requests. direction=incoming|outgoing. |
| GET | /webhooks | Configured webhooks. |
Webhooks
Choose an https URL and events on the Integrations page. Each event is POSTed as JSON; if you don’t return 2xx within 10 seconds it’s retried 6 times with increasing intervals. The same event may arrive more than once; id deduplicate by the id field.
POST /logistica/webhook
X-Logistica-Event: deal.stage_changed
X-Logistica-Signature: t=1790260000,v1=5f1c…
{"id":"evt_…","event":"deal.stage_changed","created_at":"2026-09-24T10:15:00+00:00",
"data":{"deal":{"id":"A-3110","stage":2,"stage_label":"Taşımada", …}}}
Verify the signature: hex(HMAC_SHA256(imza_anahtarı, t + "." + ham_gövde)) == v1 and t must not be older than 5 minutes.
$sig = $_SERVER['HTTP_X_LOGISTICA_SIGNATURE'];
preg_match('/t=(\d+),v1=([0-9a-f]+)/', $sig, $m);
$ok = abs(time() - (int)$m[1])
offer.createdNew offer received offer.acceptedYour bid was accepted offer.rejectedYour bid was declined offer.withdrawnBid withdrawn deal.createdDeal created deal.stage_changedTransport stage changed deal.completedDeal completed deal.cancelledDeal cancelled deal.disputedDispute opened message.createdNew message listing.publishedListing published listing.closedListing closed rental.requestedRental request rental.acceptedRental approved rental.declinedRental declined rental.cancelledRental cancelled/withdrawn tender.awardedTender won escrow.fundedProtected payment funded escrow.releasedProtected payment released escrow.refundedProtected payment refunded
Example flow: cargo listing from a TMS
curl -X POST https://alfaloji.forum/api/v1/listings \
-H "Authorization: Bearer $KEY" -H "Content-Type: application/json" -d '{
"kind": "cargo", "title": "İstanbul → Münih tekstil",
"origin": {"city": "İstanbul", "country": "Türkiye"},
"destination": {"city": "Münih", "country": "Almanya"},
"transport_mode": "FTL", "vehicle_type": "tent", "weight_kg": 18000,
"available_from": "2026-10-01T08:00:00+03:00", "available_until": "2026-10-03T18:00:00+03:00",
"timezone": "Europe/Istanbul", "price_type": "offer", "currency": "EUR", "publish": true }'
Bids offer.created webhook. Accept a suitable offer with POST /offers/T-…/accept ; as the carrier reports loading and delivery you receive deal.stage_changed events, and if a vehicle is linked GET /deals/A-… returns the last location.
Vehicle types: tent (Tenteli), refrigerated (Frigorifik), box (Kapalı kasa), flatbed (Açık kasa), mega (Mega), container (Konteyner taşıyıcı), lowbed (Lowbed), tanker (Tanker).