Skip to content

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:

Reading the 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.

Header
Authorization: Bearer <ACCESS_TOKEN>

App sign-in

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.

ScopeAppsRoutes
market:board:readCarrier2
market:booking_requests:readCarrier2
market:booking_requests:writeCarrier2
market:bookings:payShipper4
market:bookings:readCarrier, Shipper19
market:bookings:swap_vehicleCarrier1
market:bookings:writeCarrier, Shipper16
market:carriers:contact:readShipper1
market:consolidation:planCarrier1
market:consolidation:readCarrier2
market:departures:bookShipper1
market:departures:readShipper3
market:finance:readShipper15
market:fleet:drivers:readCarrier1
market:fleet:vehicles:readCarrier1
market:listings:prices:writeCarrier12
market:listings:readCarrier25
market:listings:writeCarrier35
market:map:readCarrier, Shipper1
market:offers:awardShipper3
market:offers:compareShipper2
market:offers:readCarrier3
market:offers:writeCarrier3
market:parcels:moveCarrier1
market:parcels:readCarrier, Shipper2
market:parcels:registerShipper3
market:payment_methods:readShipper1
market:payment_methods:writeShipper2
market:payouts:writeCarrier2
market:places:readShipper2
market:places:writeShipper3
market:rentals:decideCarrier2
market:rentals:rentShipper7
market:rentals:writeCarrier4
market:requests:cancelShipper2
market:requests:readShipper7
market:requests:writeShipper10
market:reviews:readCarrier2
market:reviews:replyCarrier2
market:reviews:writeShipper6
market:standing:readCarrier1
market:threads:readCarrier, Shipper3
market:threads:writeCarrier, Shipper3
market:transfers:approveShipper2
market:transfers:claimCarrier1
market:transfers:readCarrier1
market:transfers:writeCarrier2
market:trips:publishCarrier2
market:trips:readCarrier2
market:trips:writeCarrier8
market:verification:readCarrier2
market:verification:writeCarrier1
market:wallet:readCarrier5
market:workshops:readCarrier1

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.

FamilyAppsRoutes
Agreed prices agreed_pricesShipper2
Availability availabilityCarrier3
Load board boardCarrier3
Booking requests booking_requestsCarrier4
Bookings bookingsCarrier, Shipper48
website::website.developers.guides.market-apps.family_names.calendar calendarCarrier, Shipper1
website::website.developers.guides.market-apps.family_names.carrier carrierCarrier1
Carriers carriersShipper1
Consolidation consolidationCarrier3
Coverage coverageCarrier4
Departures departuresShipper4
Earnings earningsCarrier1
Favourite carriers favouritesShipper3
Finance financeShipper15
website::website.developers.guides.market-apps.family_names.fleet fleetCarrier2
website::website.developers.guides.market-apps.family_names.items itemsCarrier11
Listings listingsCarrier, Shipper57
Map mapCarrier, Shipper1
Offers offersCarrier5
Parcels parcelsCarrier, Shipper6
Payment methods payment_methodsShipper3
Payout requests payout_requestsCarrier3
Saved places placesShipper5
website::website.developers.guides.market-apps.family_names.ratings ratingsShipper3
Recurring requests recurrence_rulesCarrier, Shipper6
Rental extensions rental_extensionsCarrier1
Requests requestsShipper15
Reviews reviewsCarrier4
website::website.developers.guides.market-apps.family_names.shipper_standing shipper_standingShipper1
Carrier standing standingCarrier1
Messages threadsCarrier, Shipper6
Transfers transfersCarrier, Shipper6
Trips tripsCarrier12
Identity verification verificationCarrier3
Wallet walletCarrier3

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.

Safe retries · Request limits

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.

Errors

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.

Download the market API reference