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.
/api/v1/esims/bookings/{booking_id}/verifyThe 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).
curl https://api.fx-port.com/api/v1/esims/bookings/FX-1793546602916/verify \
-H "Authorization: Bearer fxp_test_YOUR_KEY"{
"environment": "sandbox",
"isOwner": true,
"is_owner": true,
"userAgencyId": "0b1c2d3e-4f50-4a6b-8c7d-9e0f1a2b3c4d",
"bookingAgencyId": "0b1c2d3e-4f50-4a6b-8c7d-9e0f1a2b3c4d"
}{
"environment": "sandbox",
"isOwner": false,
"is_owner": false
}Request
Path parameters
booking_idstringrequiredThe booking reference to check.
At most 100 characters.
Response
200Whether the booking is yours.
isOwnerbooleandeprecatedLegacy name, still accepted. Use is_owner instead.
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_ownerbooleantrue 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.
userAgencyIdstring (uuid)Your agency id. Present only when isOwner is true.
bookingAgencyIdstring (uuid)The agency id of the booking, which is your own agency id. Present only when isOwner is true.
Errors
| Status | Code | Example message |
|---|---|---|
| 400 | invalid_booking_id | booking_id is not a valid booking reference (received '!'). |
The shape of the error body depends on the endpoint. See Errors for every shape and code.