# Check that an eSIM booking is yours

> Tell whether an eSIM booking belongs to your agency, before you build a link or a screen around its booking_id.

Endpoint: `GET /esims/bookings/{booking_id}/verify`

Source: https://fx-port.com/docs/api/verify-esim-booking

`GET /api/v1/esims/bookings/{booking_id}/verify`

Requires an API key with **Read** permission; a **Read+Write** key works too.

The answer is `isOwner` (twin `is_owner`). A booking of another agency and a booking that does not exist answer the same, `false` with status 200, so the call cannot be used to find out which references exist. Only an owner gets `userAgencyId` and `bookingAgencyId`, both your own agency id. The booking must be an eSIM booking of this environment (a sandbox key never sees a live booking).

## Request

### Path parameters

- `booking_id` (string, required): The booking reference to check. At most 100 characters.

### Example request

```bash
curl https://api.fx-port.com/api/v1/esims/bookings/FX-1793546602916/verify \
  -H "Authorization: Bearer fxp_test_YOUR_KEY"
```

## Response

### 200: Whether the booking is yours.

- `isOwner` (boolean, deprecated): Legacy name: use `is_owner`. `true` when the booking is an eSIM booking of your agency in this environment. `false` when it belongs to another agency or does not exist: the two cases are not told apart. The older name of `is_owner`: same value, use `is_owner`.
- `is_owner` (boolean): `true` when the booking is an eSIM booking of your agency in this environment. `false` when it belongs to another agency or does not exist: the two cases are not told apart. The snake_case twin of `isOwner`, with the same value: use this name.
- `userAgencyId` (string (uuid)): Your agency id. Present only when `isOwner` is `true`.
- `bookingAgencyId` (string (uuid)): The agency id of the booking, which is your own agency id. Present only when `isOwner` is `true`.

```json
{
  "environment": "sandbox",
  "isOwner": true,
  "is_owner": true,
  "userAgencyId": "0b1c2d3e-4f50-4a6b-8c7d-9e0f1a2b3c4d",
  "bookingAgencyId": "0b1c2d3e-4f50-4a6b-8c7d-9e0f1a2b3c4d"
}
```

## Errors

| Status | Code | Example message |
| --- | --- | --- |
| 400 | `invalid_booking_id` | booking_id is not a valid booking reference (received '!'). |

See [Errors](https://fx-port.com/docs/errors.md) for every code and how to react.

## Related guides

- [eSIM bookings](https://fx-port.com/docs/esims/bookings.md)
