7. Transporter side
This page is for transporters: trucking companies that run trips for a Mile company. The company outsources trips to you, or offers them to you, from the Mile web app. You answer and assign your drivers through the API, with your own login and token, and only the /api/v1/partners/transporters endpoints.
The company can also outsource a trip to you directly, without an offer. It then appears in your trips, ready for a driver, and you skip steps 2 and 3.
Log in
Log in with the email or username and password you use on the Mile web app. See transporter login.
Send data.access_token as Authorization: Bearer ... on every other call. It lasts 90 minutes.
Read your open offers
GET /api/v1/partners/transporters/offers lists the trips offered to you that wait for an answer, soonest to expire first.
You see the route, times and containers. Customer and consignee names and phones are hidden until you accept.
Accept or reject
Send the offer_id values, not the trip ids. You can answer several offers at once.
Accept
Reject
If some offers fail, the call still returns 200 and lists them in failed. If all of them fail, it returns 409, for example Offer 42 (trip 413): Offer is no longer open.
Assign your driver
List your drivers with GET /api/v1/partners/transporters/drivers, then call POST /api/v1/partners/transporters/trips/{tripId}/driver.
The response is the full trip with status 4 Dispatch, your driver, and a new ETA plan. Send another driver_id to change the driver until the trip starts.
Your trips
GET /api/v1/partners/transporters/trips lists trips outsourced to you and trips with an open offer to you, newest first. offer is set on trips you have not answered yet. It takes the same filters as the company list, except partner_id.
GET /api/v1/partners/transporters/trips/{tripId} returns one trip with stops and ETA plan. customer_details_hidden is true while the trip is only offered.

