# Orders tools

[All tool areas](/docs/tools.md). Each tool acts within your access.

## Orders

### cancel_order

Cancel a guest's order at any time, for a recorded reason (a listed one, staff's own words in `note`, or both): its booking is canceled, or its hold released if it isn't paid yet, so the seats go back on sale; its reminder won't go out, and the guest is emailed (the cancellationEmail setting). For a session that has started or ended the preview warns, names the guests already checked in, doesn't put the seats back on sale, and leaves the guest's email off unless `notifyGuest` is true (`notifyGuest` false leaves it off for a future one too). `refund` is null to refund nothing (the default under a no-refund policy), "refundable" for everything staff can refund (fees sold as non-refundable, such as the service charge, are kept), or an amount in minor units; refunding needs refunds:create. A payment that comes through after an unpaid order is canceled is refunded in full. Can't be undone. Find the order with list_orders. Returns a preview to confirm.

Changes · Members of an organization · Needs bookings:write

#### Input

- `orderId` — string; required. The order's id, from list_bookings or list_orders
- `reason` — string; optional. guest_request: the guest asked; session_canceled: the session was called off; duplicate: a second order for the same booking; other (or leave it out): staff's own reason, in note Allowed: "guest\_request", "session\_canceled", "duplicate", "other"
- `note` — string; optional. Staff's own reason, or more about the one chosen, in a sentence, for the activity log. Enough on its own (the reason is then other). Never shown to the guest minLength: 1; maxLength: 500
- `refund` — any value or null; optional. Refund with the cancellation: `refundable` for everything staff can refund, an amount in minor units, or null for none default: null
- `notifyGuest` — boolean; optional. Whether the guest is emailed about the cancellation. Left out: yes for a session still to come, no for one that has started or ended (the preview says which)

#### Output

- `order` — object; required. 
  - `order.id` — string; required. 
  - `order.code` — string; required. The booking code guests quote
  - `order.status` — string; required.  Allowed: "pending", "confirmed", "canceled"
  - `order.cancelReason` — string or null; required.  Allowed: "seats\_unavailable", "guest\_request", "session\_canceled", "duplicate", "other"
  - `order.cancelNote` — string or null; required. Staff's own words. Null without orders:amounts
  - `order.createdAt` — string; required.  format: "date-time"
  - `order.confirmedAt` — string or null; required.  format: "date-time"
  - `order.canceledAt` — string or null; required.  format: "date-time"
  - `order.customer` — object; required. 
    - `order.customer.id` — string; required. 
    - `order.customer.name` — string; required. The first name only, without customers:contact
    - `order.customer.email` — string or null; required. Null without customers:contact
    - `order.customer.phone` — string or null; required. Null without customers:contact, or when there's none
    - `order.customer.contactHidden` — boolean; required. True when email and phone are hidden from you (you lack customers:contact here). False with a null email or phone means the guest gave none
  - `order.product` — object; required. 
    - `order.product.id` — string; required. 
    - `order.product.name` — string; required. 
  - `order.location` — object; required. 
    - `order.location.id` — string; required. 
    - `order.location.name` — string; required. 
    - `order.location.timeZone` — string; required. 
  - `order.session` — object; required. 
    - `order.session.id` — string; required. 
    - `order.session.startsAt` — string; required.  format: "date-time"
    - `order.session.when` — string; required. In the location's time zone
  - `order.partySize` — integer; required.  minimum: -9007199254740991; maximum: 9007199254740991
  - `order.currency` — string; required. 
  - `order.total` — integer or null; required. Null without orders:amounts
  - `order.paid` — integer or null; required. Null without orders:amounts
  - `order.refunded` — integer or null; required. Refunded or on its way back. Null without orders:amounts
  - `order.kept` — integer or null; required. Fees sold as non-refundable (the service charge) and their tax, kept on staff refunds, as far as the money is still held: 0 once everything paid has come back, refunded or as a credit in its place (a session the operator moved or called off), and none on an order canceled before it was booked. Null without orders:amounts
  - `order.refundable` — integer or null; required. What staff can still refund: paid, less refunds, less a credit given in place of a refund (a session moved or called off), less what's kept. Null without orders:amounts
  - `order.refunds` — array; required. 
    - `order.refunds[]` — object; optional. 
      - `order.refunds[].id` — string; required. 
      - `order.refunds[].amount` — integer or null; required. Null without orders:amounts
      - `order.refunds[].status` — string; required. pending (on its way), succeeded, failed, or reversed: given as a credit or gift certificate that was voided unused since, so it was taken back and isn't counted as refunded Allowed: "pending", "succeeded", "failed", "reversed"
      - `order.refunds[].reason` — string or null; required.  Allowed: "seats\_unavailable", "guest\_request", "session\_canceled", "service\_issue", "duplicate", "goodwill", "other"
      - `order.refunds[].note` — string or null; required. Staff's own words. Null without orders:amounts
      - `order.refunds[].failureReason` — string or null; required. 
      - `order.refunds[].createdAt` — string; required.  format: "date-time"
      - `order.refunds[].tender` — string; optional. What the refunded payment was made with: card (back to the guest's card), gift_certificate or credit (back to it), or an offline tender (card_terminal, cash, debit, e_transfer, cheque), which staff gave back that way at the desk; a voucher's part is given back as a credit (creditId), and a guest's own refund under the booking's refundDestination as a credit (creditId) or gift certificate (giftCertificateId) instead of back to the card or the desk Allowed: "card", "gift\_certificate", "credit", "card\_terminal", "cash", "debit", "e\_transfer", "cheque", "voucher"
      - `order.refunds[].creditId` — string or null; optional. The credit this refund became instead of going back where it was paid: a third party's voucher can't be handed back, so its part is a credit (voucher_refunded); a guest's own cancellation or change under refundDestination credit gives one (guest_change). The same credit the booking's credits list shows. Null for every other refund. Always present
      - `order.refunds[].giftCertificateId` — string or null; optional. The gift certificate (kind refund) this refund became instead of going back where it was paid: a guest's own cancellation or change under refundDestination gift_certificate. Null for every other refund. Always present
      - `order.refunds[].issuer` — string or null; optional. Who issued the voucher the refunded payment was (such as Costco); null for any other tender, and without orders:amounts. Always present
  - `order.bookingId` — string or null; optional. Null until it's booked. Always present
  - `order.booker` — string; optional. Who made it: a guest at checkout, or staff. Always present Allowed: "customer", "staff"
  - `order.balanceDue` — integer or null; optional. What's still owing. Above 0 on a staff booking with payment to come, or seats added since: confirmed isn't paid. Null without orders:amounts. Always present
  - `order.overPaid` — integer or null; optional. What's been paid beyond the total: seats removed, which refunds nothing by itself. Null without orders:amounts. Always present
  - `order.paymentStatus` — string or null; optional. unpaid, partly_paid, paid, over_paid, refunded (all but any kept fee has gone back), or nothing_due, from what's actually been paid. A partial refund stays paid. Null without orders:amounts. Always present Allowed: "unpaid", "partly\_paid", "paid", "over\_paid", "refunded", "nothing\_due"
  - `order.staffNote` — string or null; optional. Staff's own note, never shown to the guest. Null without orders:amounts, or when there's none. Always present
- `refunds` — array; required. 
  - `refunds[]` — object; optional. 
    - `refunds[].id` — string; required. 
    - `refunds[].amount` — integer or null; required. Null without orders:amounts
    - `refunds[].status` — string; required. pending (on its way), succeeded, failed, or reversed: given as a credit or gift certificate that was voided unused since, so it was taken back and isn't counted as refunded Allowed: "pending", "succeeded", "failed", "reversed"
    - `refunds[].reason` — string or null; required.  Allowed: "seats\_unavailable", "guest\_request", "session\_canceled", "service\_issue", "duplicate", "goodwill", "other"
    - `refunds[].note` — string or null; required. Staff's own words. Null without orders:amounts
    - `refunds[].failureReason` — string or null; required. 
    - `refunds[].createdAt` — string; required.  format: "date-time"
    - `refunds[].tender` — string; optional. What the refunded payment was made with: card (back to the guest's card), gift_certificate or credit (back to it), or an offline tender (card_terminal, cash, debit, e_transfer, cheque), which staff gave back that way at the desk; a voucher's part is given back as a credit (creditId), and a guest's own refund under the booking's refundDestination as a credit (creditId) or gift certificate (giftCertificateId) instead of back to the card or the desk Allowed: "card", "gift\_certificate", "credit", "card\_terminal", "cash", "debit", "e\_transfer", "cheque", "voucher"
    - `refunds[].creditId` — string or null; optional. The credit this refund became instead of going back where it was paid: a third party's voucher can't be handed back, so its part is a credit (voucher_refunded); a guest's own cancellation or change under refundDestination credit gives one (guest_change). The same credit the booking's credits list shows. Null for every other refund. Always present
    - `refunds[].giftCertificateId` — string or null; optional. The gift certificate (kind refund) this refund became instead of going back where it was paid: a guest's own cancellation or change under refundDestination gift_certificate. Null for every other refund. Always present
    - `refunds[].issuer` — string or null; optional. Who issued the voucher the refunded payment was (such as Costco); null for any other tender, and without orders:amounts. Always present

### list_orders

Find orders (a guest's booking and payment), newest first: by booking code, the customer's email, or session, or filtered by status. Each shows the guest, the session, party size, the total, what's paid, refunded, kept (fees sold as non-refundable), and still refundable, with its refunds. Only orders your grants cover. Without customers:contact the guest is a first name, with no email or phone (and finding by email is refused); without orders:amounts the amounts are null. Page back with `before`. Use it before cancel_order or refund_order. For a booking's page and its seats, use list_bookings and get_booking; this one is for money: refunds and what's still refundable.

Reads · Members of an organization · Needs bookings:read

#### Input

- `code` — string; optional. The booking code, e.g. EE2EQN minLength: 1; maxLength: 20
- `email` — string; optional. The customer's email; needs customers:contact minLength: 1; maxLength: 320
- `sessionId` — string; optional. The session's id, from list_sessions
- `status` — string; optional. Only orders in this state Allowed: "pending", "confirmed", "canceled"
- `limit` — integer; optional. The most results to return (default 25) minimum: 1; maximum: 100; default: 25
- `before` — string; optional. An order id; returns orders older than it

#### Output

- `orders` — array; required. 
  - `orders[]` — object; optional. 
    - `orders[].id` — string; required. 
    - `orders[].code` — string; required. The booking code guests quote
    - `orders[].status` — string; required.  Allowed: "pending", "confirmed", "canceled"
    - `orders[].cancelReason` — string or null; required.  Allowed: "seats\_unavailable", "guest\_request", "session\_canceled", "duplicate", "other"
    - `orders[].cancelNote` — string or null; required. Staff's own words. Null without orders:amounts
    - `orders[].createdAt` — string; required.  format: "date-time"
    - `orders[].confirmedAt` — string or null; required.  format: "date-time"
    - `orders[].canceledAt` — string or null; required.  format: "date-time"
    - `orders[].customer` — object; required. 
      - `orders[].customer.id` — string; required. 
      - `orders[].customer.name` — string; required. The first name only, without customers:contact
      - `orders[].customer.email` — string or null; required. Null without customers:contact
      - `orders[].customer.phone` — string or null; required. Null without customers:contact, or when there's none
      - `orders[].customer.contactHidden` — boolean; required. True when email and phone are hidden from you (you lack customers:contact here). False with a null email or phone means the guest gave none
    - `orders[].product` — object; required. 
      - `orders[].product.id` — string; required. 
      - `orders[].product.name` — string; required. 
    - `orders[].location` — object; required. 
      - `orders[].location.id` — string; required. 
      - `orders[].location.name` — string; required. 
      - `orders[].location.timeZone` — string; required. 
    - `orders[].session` — object; required. 
      - `orders[].session.id` — string; required. 
      - `orders[].session.startsAt` — string; required.  format: "date-time"
      - `orders[].session.when` — string; required. In the location's time zone
    - `orders[].partySize` — integer; required.  minimum: -9007199254740991; maximum: 9007199254740991
    - `orders[].currency` — string; required. 
    - `orders[].total` — integer or null; required. Null without orders:amounts
    - `orders[].paid` — integer or null; required. Null without orders:amounts
    - `orders[].refunded` — integer or null; required. Refunded or on its way back. Null without orders:amounts
    - `orders[].kept` — integer or null; required. Fees sold as non-refundable (the service charge) and their tax, kept on staff refunds, as far as the money is still held: 0 once everything paid has come back, refunded or as a credit in its place (a session the operator moved or called off), and none on an order canceled before it was booked. Null without orders:amounts
    - `orders[].refundable` — integer or null; required. What staff can still refund: paid, less refunds, less a credit given in place of a refund (a session moved or called off), less what's kept. Null without orders:amounts
    - `orders[].refunds` — array; required. 
      - `orders[].refunds[]` — object; optional. 
        - `orders[].refunds[].id` — string; required. 
        - `orders[].refunds[].amount` — integer or null; required. Null without orders:amounts
        - `orders[].refunds[].status` — string; required. pending (on its way), succeeded, failed, or reversed: given as a credit or gift certificate that was voided unused since, so it was taken back and isn't counted as refunded Allowed: "pending", "succeeded", "failed", "reversed"
        - `orders[].refunds[].reason` — string or null; required.  Allowed: "seats\_unavailable", "guest\_request", "session\_canceled", "service\_issue", "duplicate", "goodwill", "other"
        - `orders[].refunds[].note` — string or null; required. Staff's own words. Null without orders:amounts
        - `orders[].refunds[].failureReason` — string or null; required. 
        - `orders[].refunds[].createdAt` — string; required.  format: "date-time"
        - `orders[].refunds[].tender` — string; optional. What the refunded payment was made with: card (back to the guest's card), gift_certificate or credit (back to it), or an offline tender (card_terminal, cash, debit, e_transfer, cheque), which staff gave back that way at the desk; a voucher's part is given back as a credit (creditId), and a guest's own refund under the booking's refundDestination as a credit (creditId) or gift certificate (giftCertificateId) instead of back to the card or the desk Allowed: "card", "gift\_certificate", "credit", "card\_terminal", "cash", "debit", "e\_transfer", "cheque", "voucher"
        - `orders[].refunds[].creditId` — string or null; optional. The credit this refund became instead of going back where it was paid: a third party's voucher can't be handed back, so its part is a credit (voucher_refunded); a guest's own cancellation or change under refundDestination credit gives one (guest_change). The same credit the booking's credits list shows. Null for every other refund. Always present
        - `orders[].refunds[].giftCertificateId` — string or null; optional. The gift certificate (kind refund) this refund became instead of going back where it was paid: a guest's own cancellation or change under refundDestination gift_certificate. Null for every other refund. Always present
        - `orders[].refunds[].issuer` — string or null; optional. Who issued the voucher the refunded payment was (such as Costco); null for any other tender, and without orders:amounts. Always present
    - `orders[].bookingId` — string or null; optional. Null until it's booked. Always present
    - `orders[].booker` — string; optional. Who made it: a guest at checkout, or staff. Always present Allowed: "customer", "staff"
    - `orders[].balanceDue` — integer or null; optional. What's still owing. Above 0 on a staff booking with payment to come, or seats added since: confirmed isn't paid. Null without orders:amounts. Always present
    - `orders[].overPaid` — integer or null; optional. What's been paid beyond the total: seats removed, which refunds nothing by itself. Null without orders:amounts. Always present
    - `orders[].paymentStatus` — string or null; optional. unpaid, partly_paid, paid, over_paid, refunded (all but any kept fee has gone back), or nothing_due, from what's actually been paid. A partial refund stays paid. Null without orders:amounts. Always present Allowed: "unpaid", "partly\_paid", "paid", "over\_paid", "refunded", "nothing\_due"
    - `orders[].staffNote` — string or null; optional. Staff's own note, never shown to the guest. Null without orders:amounts, or when there's none. Always present
- `nextBefore` — string or null; required. 

### refund_gift_certificate_purchase

Refund a gift certificate purchase to the buyer's card, for a recorded reason: first voids what's left on the certificate (so it can't be spent and refunded both), then refunds `amount` in minor units, or leave it out for everything it can: what was paid and isn't back yet, up to what the certificate hasn't paid for. What it already paid on bookings stays paid. Managers and front desk are capped per order by the refundCaps setting, as for refund_order. Needs orders:amounts as well as refunds:create where it was sold. Applying a preview of everything is refused if that amount has changed since. Can't be undone. Returns a preview to confirm.

Changes · Members of an organization · Needs refunds:create

#### Input

- `orderId` — string; required. The order's id, from list_bookings or list_orders
- `amount` — integer; optional. Minor units (cents) in the location's currency exclusiveMinimum: 0
- `reason` — string; optional. guest_request: the buyer asked; duplicate: bought twice; goodwill; other (or leave it out): staff's own reason, in note Allowed: "guest\_request", "session\_canceled", "service\_issue", "duplicate", "goodwill", "other"
- `note` — string; optional. Staff's own reason, or more about the one chosen, in a sentence, for the activity log. Enough on its own (the reason is then other). Never shown to the guest minLength: 1; maxLength: 500

#### Output

- `orderId` — string; required. 
- `code` — string; required. The purchase's order code
- `giftCertificate` — object; required. 
  - `giftCertificate.id` — string; required. 
  - `giftCertificate.code` — string; required. Masked: •••• and its last 4
  - `giftCertificate.status` — string; required.  Allowed: "pending", "active", "voided"
  - `giftCertificate.amount` — integer; required. Minor units (cents) in the location's currency
  - `giftCertificate.balance` — integer; required. Minor units (cents) in the location's currency
- `voided` — integer; required. What was left on the certificate, voided by this refund
- `refunds` — array; required. 
  - `refunds[]` — object; optional. 
    - `refunds[].id` — string; required. 
    - `refunds[].amount` — integer or null; required. Null without orders:amounts
    - `refunds[].status` — string; required. pending (on its way), succeeded, failed, or reversed: given as a credit or gift certificate that was voided unused since, so it was taken back and isn't counted as refunded Allowed: "pending", "succeeded", "failed", "reversed"
    - `refunds[].reason` — string or null; required.  Allowed: "seats\_unavailable", "guest\_request", "session\_canceled", "service\_issue", "duplicate", "goodwill", "other"
    - `refunds[].note` — string or null; required. Staff's own words. Null without orders:amounts
    - `refunds[].failureReason` — string or null; required. 
    - `refunds[].createdAt` — string; required.  format: "date-time"
    - `refunds[].tender` — string; optional. What the refunded payment was made with: card (back to the guest's card), gift_certificate or credit (back to it), or an offline tender (card_terminal, cash, debit, e_transfer, cheque), which staff gave back that way at the desk; a voucher's part is given back as a credit (creditId), and a guest's own refund under the booking's refundDestination as a credit (creditId) or gift certificate (giftCertificateId) instead of back to the card or the desk Allowed: "card", "gift\_certificate", "credit", "card\_terminal", "cash", "debit", "e\_transfer", "cheque", "voucher"
    - `refunds[].creditId` — string or null; optional. The credit this refund became instead of going back where it was paid: a third party's voucher can't be handed back, so its part is a credit (voucher_refunded); a guest's own cancellation or change under refundDestination credit gives one (guest_change). The same credit the booking's credits list shows. Null for every other refund. Always present
    - `refunds[].giftCertificateId` — string or null; optional. The gift certificate (kind refund) this refund became instead of going back where it was paid: a guest's own cancellation or change under refundDestination gift_certificate. Null for every other refund. Always present
    - `refunds[].issuer` — string or null; optional. Who issued the voucher the refunded payment was (such as Costco); null for any other tender, and without orders:amounts. Always present

### refund_order

Refund a guest's order, in full or in part, for a recorded reason, without canceling it: a confirmed booking stays confirmed, its seats stay taken, and its reminder still goes out, even after a full refund (to cancel too, use cancel_order). `amount` in minor units, or leave it out for everything staff can refund: what was paid, less what's already refunded, less fees sold as non-refundable (the service charge), which an order canceled before it was booked doesn't keep (to retry Lokl's refund of it after a failed one). Applying a preview of everything is refused if that amount has changed since. A refund of the whole order previews line by line, with what's kept. Managers and front desk are capped per order by the refundCaps setting (what they've already refunded on it counts), and it takes orders:amounts as well as refunds:create. The refund goes back to the card through the payment provider, usually within a minute; list_orders shows its status, the guest is emailed when it comes back (the refundEmail setting), and staff who can refund are alerted if it fails. Can't be undone. Returns a preview to confirm.

Changes · Members of an organization · Needs refunds:create

#### Input

- `orderId` — string; required. The order's id, from list_bookings or list_orders
- `amount` — integer; optional. Minor units (cents) in the location's currency exclusiveMinimum: 0
- `reason` — string; optional. guest_request: the guest asked; session_canceled: the session was called off; service_issue: something went wrong on the night; duplicate: charged twice; goodwill: a gesture; other (or leave it out): staff's own reason, in note Allowed: "guest\_request", "session\_canceled", "service\_issue", "duplicate", "goodwill", "other"
- `note` — string; optional. Staff's own reason, or more about the one chosen, in a sentence, for the activity log. Enough on its own (the reason is then other). Never shown to the guest minLength: 1; maxLength: 500

#### Output

- `order` — object; required. 
  - `order.id` — string; required. 
  - `order.code` — string; required. The booking code guests quote
  - `order.status` — string; required.  Allowed: "pending", "confirmed", "canceled"
  - `order.cancelReason` — string or null; required.  Allowed: "seats\_unavailable", "guest\_request", "session\_canceled", "duplicate", "other"
  - `order.cancelNote` — string or null; required. Staff's own words. Null without orders:amounts
  - `order.createdAt` — string; required.  format: "date-time"
  - `order.confirmedAt` — string or null; required.  format: "date-time"
  - `order.canceledAt` — string or null; required.  format: "date-time"
  - `order.customer` — object; required. 
    - `order.customer.id` — string; required. 
    - `order.customer.name` — string; required. The first name only, without customers:contact
    - `order.customer.email` — string or null; required. Null without customers:contact
    - `order.customer.phone` — string or null; required. Null without customers:contact, or when there's none
    - `order.customer.contactHidden` — boolean; required. True when email and phone are hidden from you (you lack customers:contact here). False with a null email or phone means the guest gave none
  - `order.product` — object; required. 
    - `order.product.id` — string; required. 
    - `order.product.name` — string; required. 
  - `order.location` — object; required. 
    - `order.location.id` — string; required. 
    - `order.location.name` — string; required. 
    - `order.location.timeZone` — string; required. 
  - `order.session` — object; required. 
    - `order.session.id` — string; required. 
    - `order.session.startsAt` — string; required.  format: "date-time"
    - `order.session.when` — string; required. In the location's time zone
  - `order.partySize` — integer; required.  minimum: -9007199254740991; maximum: 9007199254740991
  - `order.currency` — string; required. 
  - `order.total` — integer or null; required. Null without orders:amounts
  - `order.paid` — integer or null; required. Null without orders:amounts
  - `order.refunded` — integer or null; required. Refunded or on its way back. Null without orders:amounts
  - `order.kept` — integer or null; required. Fees sold as non-refundable (the service charge) and their tax, kept on staff refunds, as far as the money is still held: 0 once everything paid has come back, refunded or as a credit in its place (a session the operator moved or called off), and none on an order canceled before it was booked. Null without orders:amounts
  - `order.refundable` — integer or null; required. What staff can still refund: paid, less refunds, less a credit given in place of a refund (a session moved or called off), less what's kept. Null without orders:amounts
  - `order.refunds` — array; required. 
    - `order.refunds[]` — object; optional. 
      - `order.refunds[].id` — string; required. 
      - `order.refunds[].amount` — integer or null; required. Null without orders:amounts
      - `order.refunds[].status` — string; required. pending (on its way), succeeded, failed, or reversed: given as a credit or gift certificate that was voided unused since, so it was taken back and isn't counted as refunded Allowed: "pending", "succeeded", "failed", "reversed"
      - `order.refunds[].reason` — string or null; required.  Allowed: "seats\_unavailable", "guest\_request", "session\_canceled", "service\_issue", "duplicate", "goodwill", "other"
      - `order.refunds[].note` — string or null; required. Staff's own words. Null without orders:amounts
      - `order.refunds[].failureReason` — string or null; required. 
      - `order.refunds[].createdAt` — string; required.  format: "date-time"
      - `order.refunds[].tender` — string; optional. What the refunded payment was made with: card (back to the guest's card), gift_certificate or credit (back to it), or an offline tender (card_terminal, cash, debit, e_transfer, cheque), which staff gave back that way at the desk; a voucher's part is given back as a credit (creditId), and a guest's own refund under the booking's refundDestination as a credit (creditId) or gift certificate (giftCertificateId) instead of back to the card or the desk Allowed: "card", "gift\_certificate", "credit", "card\_terminal", "cash", "debit", "e\_transfer", "cheque", "voucher"
      - `order.refunds[].creditId` — string or null; optional. The credit this refund became instead of going back where it was paid: a third party's voucher can't be handed back, so its part is a credit (voucher_refunded); a guest's own cancellation or change under refundDestination credit gives one (guest_change). The same credit the booking's credits list shows. Null for every other refund. Always present
      - `order.refunds[].giftCertificateId` — string or null; optional. The gift certificate (kind refund) this refund became instead of going back where it was paid: a guest's own cancellation or change under refundDestination gift_certificate. Null for every other refund. Always present
      - `order.refunds[].issuer` — string or null; optional. Who issued the voucher the refunded payment was (such as Costco); null for any other tender, and without orders:amounts. Always present
  - `order.bookingId` — string or null; optional. Null until it's booked. Always present
  - `order.booker` — string; optional. Who made it: a guest at checkout, or staff. Always present Allowed: "customer", "staff"
  - `order.balanceDue` — integer or null; optional. What's still owing. Above 0 on a staff booking with payment to come, or seats added since: confirmed isn't paid. Null without orders:amounts. Always present
  - `order.overPaid` — integer or null; optional. What's been paid beyond the total: seats removed, which refunds nothing by itself. Null without orders:amounts. Always present
  - `order.paymentStatus` — string or null; optional. unpaid, partly_paid, paid, over_paid, refunded (all but any kept fee has gone back), or nothing_due, from what's actually been paid. A partial refund stays paid. Null without orders:amounts. Always present Allowed: "unpaid", "partly\_paid", "paid", "over\_paid", "refunded", "nothing\_due"
  - `order.staffNote` — string or null; optional. Staff's own note, never shown to the guest. Null without orders:amounts, or when there's none. Always present
- `refunds` — array; required. 
  - `refunds[]` — object; optional. 
    - `refunds[].id` — string; required. 
    - `refunds[].amount` — integer or null; required. Null without orders:amounts
    - `refunds[].status` — string; required. pending (on its way), succeeded, failed, or reversed: given as a credit or gift certificate that was voided unused since, so it was taken back and isn't counted as refunded Allowed: "pending", "succeeded", "failed", "reversed"
    - `refunds[].reason` — string or null; required.  Allowed: "seats\_unavailable", "guest\_request", "session\_canceled", "service\_issue", "duplicate", "goodwill", "other"
    - `refunds[].note` — string or null; required. Staff's own words. Null without orders:amounts
    - `refunds[].failureReason` — string or null; required. 
    - `refunds[].createdAt` — string; required.  format: "date-time"
    - `refunds[].tender` — string; optional. What the refunded payment was made with: card (back to the guest's card), gift_certificate or credit (back to it), or an offline tender (card_terminal, cash, debit, e_transfer, cheque), which staff gave back that way at the desk; a voucher's part is given back as a credit (creditId), and a guest's own refund under the booking's refundDestination as a credit (creditId) or gift certificate (giftCertificateId) instead of back to the card or the desk Allowed: "card", "gift\_certificate", "credit", "card\_terminal", "cash", "debit", "e\_transfer", "cheque", "voucher"
    - `refunds[].creditId` — string or null; optional. The credit this refund became instead of going back where it was paid: a third party's voucher can't be handed back, so its part is a credit (voucher_refunded); a guest's own cancellation or change under refundDestination credit gives one (guest_change). The same credit the booking's credits list shows. Null for every other refund. Always present
    - `refunds[].giftCertificateId` — string or null; optional. The gift certificate (kind refund) this refund became instead of going back where it was paid: a guest's own cancellation or change under refundDestination gift_certificate. Null for every other refund. Always present
    - `refunds[].issuer` — string or null; optional. Who issued the voucher the refunded payment was (such as Costco); null for any other tender, and without orders:amounts. Always present

### renew_manage_link

Issue a new manage link for a paid or canceled order, so a link that went to the wrong people stops working: the old one is not found from then on, and every earlier email's link with it. The guest gets the new link by email, unless `sendEmail` is false (their inbox can't be trusted; they'd need another renewal to get in again). If the old link went to the wrong address, give the right one in `deliverTo`: the order and its messages move there. Nobody sees the link itself, staff included. It can't be undone, so an old link never comes back: renew again for another one. Returns a preview to confirm.

Changes · Members of an organization · Needs bookings:write

#### Input

- `orderId` — string; required. The order's id, from list_bookings or list_orders
- `reason` — string; required. exposed: the link was shared or leaked; wrong_recipient: it went to the wrong address; guest_request: the guest asked; other: say why in note Allowed: "exposed", "wrong\_recipient", "guest\_request", "other"
- `note` — string; optional. Staff's own reason, or more about the one chosen, in a sentence, for the activity log. Enough on its own (the reason is then other). Never shown to the guest minLength: 1; maxLength: 500
- `deliverTo` — string or null; optional. The right address, if the old link went to a wrong one format: "email"; maxLength: 254
- `sendEmail` — boolean; optional. Email the new link to the guest (default true) default: true

#### Output

- `orderId` — string; required. 
- `code` — string; required. 
- `linkVersion` — integer; required.  minimum: -9007199254740991; maximum: 9007199254740991
- `emailed` — boolean; optional. Whether the new link is emailed. Always present
- `emailedTo` — string or null; required. Who the new link is emailed to; null when none is sent, or without customers:contact

### resend_booking_confirmation

Email a booking's confirmation to its guest again (a lost email): the same message the booking sent at checkout, with the booking's current details and its current manage link. It makes no new manage link (renew_manage_link does), and goes out even when automatic confirmations are off. Refused for a cancelled booking, one that isn't confirmed yet, one with no guest email, and an address that can't be emailed (it bounced, or the guest marked an email as spam). It can't be undone. Needs bookings:write where the booking is; the address is shown only with customers:contact. Returns a preview to confirm.

Changes · Members of an organization · Needs bookings:write

#### Input

- `orderId` — string; required. The order's id, from list_bookings or list_orders

#### Output

- `sentTo` — string; required. The address it was sent to; without customers:contact, the words "the guest's email address"
- `at` — string; required. When it was queued format: "date-time"
