# How to use personnel ticket rights in the sales process
## Overview

This guide explains how to implement personnel ticket rights in your client, enabling the purchase of personnel tickets.

To use personnel ticket in the sales flow:

* The customer must have a private profile in Entur Customers
* The customer must be connected to ticket rights through their profile (See guide: [How to connect profiles with personnel ticket rights](/guides/personnel-ticket/3-connecting-user-profiles))

---

## Summary flow

1. Get existing ticket rights
2. Let user select ticket rights
3. Request discounted offers
4. Validate eligibility
5. Complete payment
6. Register usage and tax reporting

---

## 1. Get existing ticket rights

To fetch the ticket rights for a customer number, use

::endpoint[personnel-tickets/getEntitlementsByCustomerNumber]

### Notes

* Every employee has two **ticket rights**:

  - One for private travel
  - One for work travel

* Family members and pensioners have one personnel ticket right for private travel

---

## 2. Present ticket rights to the user

The sales client should:

- Display relevant ticket rights to the user
- Allow the user to choose which rights to use
- Map each ticket right to a traveller type (e.g. `ADULT`, `CHILD`, `STUDENT`, `SENIOR`)

### Filtering

The available options should be filtered based on:

- Travel date
- Contract validity period

You also need to determine whether any travellers qualify for senior, child or student. 
These categories may be determined by your system if the traveler age is known.

---

## 3. Use selected ticket rights to get discounted offers

After the user selects ticket rights:

- Call

::endpoint[reserve-offers-partner/reserveOffers]

- Include the selected entitlement product IDs in the request
- The response from the API will include discounted prices based on the personnel ticket rights

Here is how to include the entitlement product IDs in the request body:
```
{
    ...
    "travellers": [
        {
            ...
            "customerId": "1234567",
            "productIds": [
                "ENT:EntitlementProduct:PersonnelTicket"
            ]
        }
    ]
}
```

---
## 4. Validate before payment

Before proceeding to payment, validate the offer against personnel ticket rules

⚠️ If validation is skipped, the _purchase_ may succeed, but _ticket issuance_ may fail due to validation errors. 
This can lead to a poor user experience, as the customer may pay for a ticket that cannot be issued.

To validate, use

::endpoint[personnel-tickets/validateContractUse]

---
## 5. Complete payment
Proceed to payment as usual.

Once the ticket is distributed:

- Personnel ticket usage will be registered in the system
- The taxable benefit will be recorded for tax reporting purposes

---
## Next steps
Guide: [Fetching tax savings reports](/guides/personnel-ticket/5-fetching-reports)
