Skip to main content
One booking of a trip moved. Update that line of your trip tracker the moment it changes. Agentcard sends one plan.item.updated each time a flight, hotel or car in the plan changes state.

Follow a booking’s states

Answer a booking that waits

A needs_input booking carries one of two reasons:
  • price_changed: the supplier asks a different price than your customer approved, in asked_cents. Agentcard never books at a price your customer did not see, up or down.
  • approval_required: the payment asks your customer to approve it on their device.
Send your customer’s answer to a changed price with POST /buy/plans/:id/items/:key/answer:
accept_price books the item at the new price when the new price fits inside what your customer approved for the whole trip, which leaves room when another booking came in under its quote. A new price above that answers 409, and difference_cents is the amount above what the approval still covers:
The booking then keeps waiting, because a plan’s approved total cannot be raised yet. Your customer can skip it instead. skip leaves the booking unbooked, along with the bookings that wait on it. Bookings already confirmed stay booked: Agentcard never cancels one for your customer.

Read a refused answer

Keep the newest version per booking

version is the plan’s version at the change. Keep the highest version you have seen for each item.key, so a retried delivery for the hotel still applies after a newer delivery for the car.