Get the voucher PDF links of a booking
Returns the links of the voucher PDFs of a booking of your agency: one with the price and one without it, to hand to the traveler.
/api/v1/hotels/get_voucherThe links are permanent public URLs without a signature: anyone who has one can open the voucher, so do not post it where it should not be read. The voucher is made after the booking is confirmed, usually at the same moment and sometimes up to 10 seconds later: until then the call answers 404 with the code pdf_not_found; try again in 2 seconds. The links stay available after a cancellation. The same links are in voucherUrl and voucherUrlNoPrice of the booking detail.
curl 'https://api.fx-port.com/api/v1/hotels/get_voucher?booking_id=HMVXX4ZQ3' \
-H "Authorization: Bearer fxp_test_YOUR_KEY"{
"environment": "sandbox",
"success": true,
"data": {
"bookingId": "HMVXX4ZQ3",
"voucherUrl": "https://files.example.com/hotel-bookings/HMVXX4ZQ3-Jane-Smith.pdf",
"voucherUrlWithPrice": "https://files.example.com/hotel-bookings/HMVXX4ZQ3-Jane-Smith.pdf",
"voucherUrlNoPrice": "https://files.example.com/hotel-bookings/HMVXX4ZQ3-Jane-Smith-no-price.pdf",
"status": "confirmed"
}
}Request
Query parameters
booking_idstringrequiredThe id of the booking: the bookingId of book_hotel.
partner_order_idstringdeprecatedLegacy name, still accepted. Use booking_id instead.
The booking id, in its older spelling. Use booking_id.
partnerOrderIdstringdeprecatedLegacy name, still accepted. Use booking_id instead.
The booking id, in its older spelling. Use booking_id.
bookingIdstringdeprecatedLegacy name, still accepted. Use booking_id instead.
The booking id, in its older spelling. Use booking_id.
Response
200The voucher links.
environmentstringThe environment of the key that made the call: sandbox for fxp_test_ keys, live for fxp_live_ keys. Present in every JSON body.
One of sandbox, live.
request_idstringThe id of the request, also in the X-Request-Id header.
warningsarray of objectPresent only when the request used a previous spelling of a field or something the endpoint ignored.
ShowHide 5 attributes
codestringWhat the warning is about.
One of deprecated_field, ignored_field, coerced_value, deprecated_value, deprecated_endpoint.
fieldstringThe request field the warning is about.
replacementstringThe name to use instead, for deprecated_* warnings.
messagestringA sentence that says what happened and what to do.
documentation_urlstringWhere the naming rules are explained.
successbooleantrue when the voucher exists.
dataobjectThe voucher links of a booking.
ShowHide 9 attributes
bookingIdstringdeprecatedLegacy name, still accepted. Use booking_id instead.
The id of the booking.
booking_idstringThe id of the booking. The snake_case twin of bookingId, with the same value: use this name.
voucherUrlstringdeprecatedLegacy name, still accepted. Use voucher_url instead.
The voucher PDF, with the price. A permanent public link: anyone who has it can open it.
voucher_urlstringThe voucher PDF, with the price. A permanent public link: anyone who has it can open it. The snake_case twin of voucherUrl, with the same value: use this name.
voucherUrlWithPricestringdeprecatedLegacy name, still accepted. Use voucher_url_with_price instead.
The same link as voucherUrl.
voucher_url_with_pricestringThe same link as voucherUrl. The snake_case twin of voucherUrlWithPrice, with the same value: use this name.
voucherUrlNoPricestringnullabledeprecatedLegacy name, still accepted. Use voucher_url_no_price instead.
The voucher PDF without the price, to hand to the traveler. null when it was not made.
voucher_url_no_pricestringnullableThe voucher PDF without the price, to hand to the traveler. null when it was not made. The snake_case twin of voucherUrlNoPrice, with the same value: use this name.
statusstringThe status of the booking. A voucher stays available after a cancellation.
One of pending, confirmed, failed, refunded, partial_refund, cancelled.
Errors
| Status | Code | Example message |
|---|---|---|
| 403 | forbidden | This booking does not belong to your agency. Only the agency that made the booking can retrieve its voucher. |
| 404 | booking_not_found | Booking not found |
| 404 | pdf_not_found | The voucher is not available yet: it is made shortly after the booking is confirmed. Retry in a few seconds. |
| 422 | validation_error | Field required |
| 503 | service_overloaded | The service is temporarily overloaded; retry after the time given in the Retry-After header. |
The shape of the error body depends on the endpoint. See Errors for every shape and code.