Developers
Market apps
The market apps, the shipper app and the carrier app, use the market's own API: the same calls the market screens use. It is one versioned API, it answers on the market's own address and a reference file describes it. These calls are for a person signed in to an app; a company key, described in the Company keys guide, does not open them.
Address and a first call
Calls to the market go to its own address, never to the address of the main API, and every path starts with /market. This reads the shipper's agreed prices:
curl -H "Authorization: Bearer <ACCESS_TOKEN>" "https://sentysms.com/api/v1/market/agreed-prices"
Signing in
Sign in as the App sign-in guide describes, with app set to shipper or carrier, then send the access token with every call. The person's role decides which of the two apps they may use, and the app decides the scopes the session carries: GET /app/session lists them in abilities.
Authorization: Bearer <ACCESS_TOKEN>
Scopes
Every route names the scope it needs, and a session that does not carry it gets 403 with the code forbidden. The table lists each scope the reference holds, the apps that carry it and how many routes ask for it.
| Scope | Apps | Routes |
|---|---|---|
market:board:read | Carrier | 2 |
market:booking_requests:read | Carrier | 2 |
market:booking_requests:write | Carrier | 2 |
market:bookings:pay | Shipper | 4 |
market:bookings:read | Carrier, Shipper | 19 |
market:bookings:swap_vehicle | Carrier | 1 |
market:bookings:write | Carrier, Shipper | 16 |
market:carriers:contact:read | Shipper | 1 |
market:consolidation:plan | Carrier | 1 |
market:consolidation:read | Carrier | 2 |
market:departures:book | Shipper | 1 |
market:departures:read | Shipper | 3 |
market:finance:read | Shipper | 15 |
market:fleet:drivers:read | Carrier | 1 |
market:fleet:vehicles:read | Carrier | 1 |
market:listings:prices:write | Carrier | 12 |
market:listings:read | Carrier | 25 |
market:listings:write | Carrier | 35 |
market:map:read | Carrier, Shipper | 1 |
market:offers:award | Shipper | 3 |
market:offers:compare | Shipper | 2 |
market:offers:read | Carrier | 3 |
market:offers:write | Carrier | 3 |
market:parcels:move | Carrier | 1 |
market:parcels:read | Carrier, Shipper | 2 |
market:parcels:register | Shipper | 3 |
market:payment_methods:read | Shipper | 1 |
market:payment_methods:write | Shipper | 2 |
market:payouts:write | Carrier | 2 |
market:places:read | Shipper | 2 |
market:places:write | Shipper | 3 |
market:rentals:decide | Carrier | 2 |
market:rentals:rent | Shipper | 7 |
market:rentals:write | Carrier | 4 |
market:requests:cancel | Shipper | 2 |
market:requests:read | Shipper | 7 |
market:requests:write | Shipper | 10 |
market:reviews:read | Carrier | 2 |
market:reviews:reply | Carrier | 2 |
market:reviews:write | Shipper | 6 |
market:standing:read | Carrier | 1 |
market:threads:read | Carrier, Shipper | 3 |
market:threads:write | Carrier, Shipper | 3 |
market:transfers:approve | Shipper | 2 |
market:transfers:claim | Carrier | 1 |
market:transfers:read | Carrier | 1 |
market:transfers:write | Carrier | 2 |
market:trips:publish | Carrier | 2 |
market:trips:read | Carrier | 2 |
market:trips:write | Carrier | 8 |
market:verification:read | Carrier | 2 |
market:verification:write | Carrier | 1 |
market:wallet:read | Carrier | 5 |
market:workshops:read | Carrier | 1 |
Families
The routes are grouped in families, one for each part of the market. The table lists the families the reference file documents today, the apps that use each and how many routes it has; a family or a route that is not in the file is not documented yet.
| Family | Apps | Routes |
|---|---|---|
Agreed prices agreed_prices | Shipper | 2 |
Availability availability | Carrier | 3 |
Load board board | Carrier | 3 |
Booking requests booking_requests | Carrier | 4 |
Bookings bookings | Carrier, Shipper | 48 |
website::website.developers.guides.market-apps.family_names.calendar calendar | Carrier, Shipper | 1 |
website::website.developers.guides.market-apps.family_names.carrier carrier | Carrier | 1 |
Carriers carriers | Shipper | 1 |
Consolidation consolidation | Carrier | 3 |
Coverage coverage | Carrier | 4 |
Departures departures | Shipper | 4 |
Earnings earnings | Carrier | 1 |
Favourite carriers favourites | Shipper | 3 |
Finance finance | Shipper | 15 |
website::website.developers.guides.market-apps.family_names.fleet fleet | Carrier | 2 |
website::website.developers.guides.market-apps.family_names.items items | Carrier | 11 |
Listings listings | Carrier, Shipper | 57 |
Map map | Carrier, Shipper | 1 |
Offers offers | Carrier | 5 |
Parcels parcels | Carrier, Shipper | 6 |
Payment methods payment_methods | Shipper | 3 |
Payout requests payout_requests | Carrier | 3 |
Saved places places | Shipper | 5 |
website::website.developers.guides.market-apps.family_names.ratings ratings | Shipper | 3 |
Recurring requests recurrence_rules | Carrier, Shipper | 6 |
Rental extensions rental_extensions | Carrier | 1 |
Requests requests | Shipper | 15 |
Reviews reviews | Carrier | 4 |
website::website.developers.guides.market-apps.family_names.shipper_standing shipper_standing | Shipper | 1 |
Carrier standing standing | Carrier | 1 |
Messages threads | Carrier, Shipper | 6 |
Transfers transfers | Carrier, Shipper | 6 |
Trips trips | Carrier | 12 |
Identity verification verification | Carrier | 3 |
Wallet wallet | Carrier | 3 |
Writing and limits
A call that changes something should send an Idempotency-Key header, so that sending it again after a lost answer is safe; 131 of the 247 documented routes ask for one, as the Safe retries guide describes. Writes and the heavier reads have their own limits: the reference marks each route write or heavy, and a refused call is 429 with Retry-After, as the Request limits guide describes.
Errors
Errors come in the shape the Errors guide describes. A conflict, a limit, a missing record, a forbidden call and a plan feature each carry a reason from a closed list, which the reference file prints under errors; a reason that is not listed may still come back, so act on the code alone.
The reference file
One JSON file holds every documented route: its name, method and path, its scope, the apps that use it, whether it takes an Idempotency-Key, its limit, a sentence in Arabic and English, a worked example with the request, the answer and the errors, and the closed lists of error reasons.