# Offers

> Transfer company track · Module: Offer flow · Certification test case

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.

## How it is verified

- **Webhook acknowledged**: Transferz delivered the event and your endpoint answered with success.
- **Proof of receipt**: You enter a value that only your endpoint received. The portal hides it on screen.
- **Request observed**: Your own system sent the expected call to staging for this case's journey or booking, with the required fields, and got a success response.
- **Declaration**: You confirm something the portal cannot observe, optionally with a screenshot. The reviewer judges it.

## Instructions

1. 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.
2. 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).
3. Accept the offer: send `POST /offers/{offerId}/accept` from your system with the `id` and `type` of one of the offer's meeting points, before the offer expires. The portal shows the offer ID; everything after uses the journey ID.
4. Journey assigned: answer journeyFleetAssignedEvent with a 2xx response and enter the traveller detail the portal asks for.
5. Offer accepted: answer offerStatusChangedEvent (ACCEPTED) with a 2xx response.
6. Second offer: the portal books another test journey, to the hub, and offers it to your fleet. Answer offerCreatedEvent with a 2xx response.
7. Decline the offer: send `POST /offers/{offerId}/decline` from 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.
8. 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.
9. 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.
10. 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](https://developers.transferz.com/guides/transfer-companies/offers)
- Endpoint: [POST Accept offer](https://developers.transferz.com/reference/transfer-companies/accept-offer) (`POST /offers/{id}/accept`)
- Endpoint: [POST Decline offer](https://developers.transferz.com/reference/transfer-companies/decline-offer) (`POST /offers/{id}/decline`)
- Endpoint: [GET Get offer](https://developers.transferz.com/reference/transfer-companies/get-offer) (`GET /offers/{id}`)

Running this case needs sign-in to the developer portal. Calls from the portal's Try it console do not count.
