Fortrip

Create hotel order and payment link

Order one offer from get_hotel_offers.

The answer is an unpaid order with a payment link: status awaiting_payment, the total, the stay and its terms, and payment.url, a Fortrip page to pay on. Nothing is charged until the order is paid, on that page or with pay_order (or Alipay/WeChat Pay); anyone holding the link can pay. Send the contact and, for each room of the offer, at least one guest. If the price or terms changed since the offer, the answer is offer_changed with every change and a new offer: show the changes and ask the user again before ordering it. Sending the same details again returns the same order. An offer is ordered once: for another order of the stay (another party, or a corrected guest name), get offers again and order the new offer; when it replaces an unpaid order, tell the user to pay only the new link, as the earlier one expires unpaid. To cancel an order, use cancel_order; for changes, or a cancellation cancel_order can't make, the user emails info@fortrip.ai with the order's reference.

book_hotel · Creates an unpaid order · CLI: fortrip hotels book

Input

contactobjectrequired

Who the hotel and the confirmation reach.

contact.firstNamestringrequired

Contact person's first name, at most 59 characters.

contact.lastNamestringrequired

Contact person's last name, at most 59 characters.

contact.emailstringrequired

Contact email; the confirmation is sent here.

contact.phonestringrequired

Contact phone number, with country code.3–40 chars

itemsobject[]required

The offer to book: exactly one.1–1 items

items[].offerIdstringrequired

offerId from an offers response.matches ^off_[0-9A-Za-z]{20}$

items[].hotelobjectrequired

What the hotel needs to know.

items[].hotel.roomsobject[]required

One entry per room of the offer, in order.1–8 items

items[].hotel.rooms[].guestsobject[]required

Guests staying in this room: at least one, no more than the room sleeps.1–12 items

items[].hotel.rooms[].guests[].firstNamestringrequired

Guest's first name, in Latin letters as on the passport; transliterate accents (Müller → Mueller).1–60 chars

items[].hotel.rooms[].guests[].lastNamestringrequired

Guest's last name, in Latin letters as on the passport.1–60 chars

items[].hotel.specialRequestsstring

Requests for the hotel, in English. Not guaranteed.0–500 chars

Output

structuredContent is the Order object. content[0] is the answer as compact text. It also carries nextStep, the rule for sharing payment.url. Errors are described in the overview.

On this page