Offers
Proves your system receives an offer for a journey and reads it, accepts it with a meeting point, declines another offer with a reason, and follows each offer's status by webhook.
Instructions
- This section starts once Direct assignment has passed. Choose a hub where your fleet has an offer tender on staging, and an address; the portal suggests the ones you used for Direct assignment. Without an offer tender, offers go to other companies.
- Offer received: the portal books a test journey from the hub and offers it to your fleet. Answer offerCreatedEvent with a 2xx response and enter the journey's pickup time from the offer (the fare including VAT when the offer has no pickup time).
- Accept the offer: send
POST /offers/{offerId}/acceptfrom your system with theidandtypeof one of the offer's meeting points, before the offer expires. The portal shows the offer ID; everything after uses the journey ID. - Journey assigned: answer journeyFleetAssignedEvent with a 2xx response and enter the traveller detail the portal asks for.
- Offer accepted: answer offerStatusChangedEvent (ACCEPTED) with a 2xx response.
- Second offer: the portal books another test journey, to the hub, and offers it to your fleet. Answer offerCreatedEvent with a 2xx response.
- Decline the offer: send
POST /offers/{offerId}/declinefrom your system with a reason (OTHER needs a description), before the offer expires. If your system accepts offers automatically, turn that rule off for this test. - Offer declined: answer offerStatusChangedEvent (DECLINED) with a 2xx response and confirm that the offer is no longer open in your system. The portal then cancels the journey.
- If no offer reaches your company within 2 minutes of booking, your fleet has no offer tender with free capacity for the hub in that direction: ask Transferz for one, then try again. If you accept or decline the wrong offer, or an offer expires, use Get a new offer.
- Each event step waits up to 5 minutes for a 2xx answer; a 2xx to an event Transferz delivers late still counts. Calls made with Try it in the portal don't count.
Pass criteria
- Your endpoint answers offerCreatedEvent (twice), journeyFleetAssignedEvent and offerStatusChangedEvent (ACCEPTED, then DECLINED) with 2xx, each within 5 minutes (a 2xx to an event Transferz delivers late still counts)
- The pickup time (or fare) and the traveller detail you enter match the ones in the events
- A successful POST /offers/{offerId}/accept from your system with one of the offer's meeting points, before the offer expires
- A successful POST /offers/{offerId}/decline from your system with a reason, before the offer expires
- You confirm that the declined offer is no longer open in your system
Links
- Guide:Offers
- POST/offers/{id}/acceptAccept offer
- POST/offers/{id}/declineDecline offer
- GET/offers/{id}Get offer