Credits tools
All tool areas. Each tool acts within your access.
Credits
get_credit_liability
Get what the business owes in money-like credits, per issuing entity and currency, over local dates (the organization's time zone, up to 366 days): outstanding at the start, issued, redeemed (net of refunds back to them), voided, expired, and outstanding at the end (start + issued − redeemed − voided − expired = end). Counts session_moved, session_canceled, gift_certificate_voided, voucher_refunded, and guest_change: value given instead of money back. Goodwill and service recovery are free discounts, not money owed, and never counted. A refund that pushes an expired credit's expiry out brings its remaining balance back as negative expired from that moment, without rewriting a past period. Narrow with entityId. Needs orders:amounts and bookings:read where the source booking is; a location-limited member sees only credits from bookings there. columns and rows give the same figures as a table, to export as a CSV.
Reads · Members of an organization · Needs bookings:read, orders:amounts
Input
fromFirst local date, inclusive
toLast local date, inclusive, up to 366 days after
fromentityIdThe entity's id, from get_setup
Output
fromtocanExportWhether the organization's plan includes CSV export (Growth and up): the screen offers the download only then. The rows are the same either way
columnscolumns[]columns[].keycolumns[].labelcolumns[].kindrowsrows[]rows[].entityIdrows[].entityNamerows[].currencyrows[].outstandingAtStartMinor units (cents) in the row's currency
rows[].issuedMinor units (cents) in the row's currency
rows[].redeemedPaid with them, less what refunds gave back to them
rows[].voidedMinor units (cents) in the row's currency
rows[].expiredBalances whose expiry passed; negative when a later refund revives an expired balance
rows[].outstandingAtEndoutstandingAtStart + issued − redeemed − voided − expired
issue_credit
Give a booking's guest a credit: stored value with a code, a liability of the entity that sold the booking, in its currency, to use on a later booking (redeeming comes with gift certificates). For service_recovery (making up for something that went wrong) or goodwill; a session moved or called off gives its credits through move_session and cancel_session. amount in minor units. The guest is emailed its code and amount (the creditEmail setting). It expires after creditExpiryMonths (by default never). Managers and front desk are capped per order by the refundCaps setting, counting what they've refunded and credited on it. Needs orders:amounts as well as refunds:create. Undo voids it while it's unused. To give money back to the card use refund_order; for free value with no booking, issue_gift_certificate. Returns a preview to confirm.
Changes · Members of an organization · Needs refunds:create
Input
orderIdThe order's id, from list_bookings or list_orders
amountMinor units (cents) in the location's currency
reasonservice_recovery: made right after something went wrong; goodwill: a gesture
noteWhat it's for, in staff's words, for the activity log and list_credits. Never shown to the guest
Output
idcodeWhat the guest quotes to use it. In full only to someone who may give a credit there (refunds:create and orders:amounts); masked (•••• and its last 4) otherwise, since whoever reads it can spend it
statusreasonsession_moved, session_canceled: given instead of a refund when the session moved or was called off; service_recovery, goodwill: staff's own; gift_certificate_voided: Given because the gift certificate it was paid with had been cancelled; voucher_refunded: a refund reached what a third party's voucher paid, which can't be handed back, so that part is this credit (the refund's creditId); guest_change: the guest cancelled, removed seats, or moved to a cheaper date on their manage link, and the booking's refund policy gives refunds as credit, so what would have gone back to the card is this credit (the refunds' creditId)
entityIdThe entity it's a liability of
currencyamountMinor units, as issued; null without orders:amounts
balanceWhat's left to use; null without orders:amounts
customerIdcustomerNameFirst name only without customers:contact
orderIdorderCodesessionIdnoteStaff's own words; null without orders:amounts
expiresAtcreatedAt
list_credits
List credits (stored value given to guests: a session moved or called off, goodwill, service recovery), newest first: code, status (active, voided, expired), reason, amount and balance, the customer, and the order and session it came from. Find them by customerId, orderId, or code (as the guest quotes it, any case), or page through all with before. Amounts and staff's note need orders:amounts; the code itself shows in full only to someone who may give a credit there (refunds:create as well), and is masked to its last 4 otherwise, since whoever reads it can spend it. Full names need customers:contact. Someone limited to a location sees credits from bookings there.
Reads · Members of an organization · Needs bookings:read
Input
customerIdThe customer's id, from list_customers
orderIdThe order's id, from list_bookings or list_orders
codebeforeThe credit's id, from list_credits
limitThe most results to return (default 50)
Output
creditscredits[]credits[].idcredits[].codeWhat the guest quotes to use it. In full only to someone who may give a credit there (refunds:create and orders:amounts); masked (•••• and its last 4) otherwise, since whoever reads it can spend it
credits[].statuscredits[].reasonsession_moved, session_canceled: given instead of a refund when the session moved or was called off; service_recovery, goodwill: staff's own; gift_certificate_voided: Given because the gift certificate it was paid with had been cancelled; voucher_refunded: a refund reached what a third party's voucher paid, which can't be handed back, so that part is this credit (the refund's creditId); guest_change: the guest cancelled, removed seats, or moved to a cheaper date on their manage link, and the booking's refund policy gives refunds as credit, so what would have gone back to the card is this credit (the refunds' creditId)
credits[].entityIdThe entity it's a liability of
credits[].currencycredits[].amountMinor units, as issued; null without orders:amounts
credits[].balanceWhat's left to use; null without orders:amounts
credits[].customerIdcredits[].customerNameFirst name only without customers:contact
credits[].orderIdcredits[].orderCodecredits[].sessionIdcredits[].noteStaff's own words; null without orders:amounts
credits[].expiresAtcredits[].createdAtnextBefore
void_credit
Void a credit that hasn't been used: its code stops working and its whole amount is taken back, with note (staff's words, for the activity log; never shown to the guest). A credit given as a guest's refund (their booking's refund policy gives refunds as a credit, or a voucher's part of a refund) takes that refund back too, so the booking reads as not refunded that much: for when the card was also refunded in the payment provider (the refund_exceeded alert). A credit that has paid for anything, even in part, can't be voided. Needs refunds:create and orders:amounts where the credit's booking is. Can't be undone. Returns a preview to confirm.
Changes · Members of an organization · Needs refunds:create
Input
creditIdThe credit's id, from list_credits
noteWhy it's voided, in staff's words, for the activity log. Never shown to the guest
Output
idcodeWhat the guest quotes to use it. In full only to someone who may give a credit there (refunds:create and orders:amounts); masked (•••• and its last 4) otherwise, since whoever reads it can spend it
statusreasonsession_moved, session_canceled: given instead of a refund when the session moved or was called off; service_recovery, goodwill: staff's own; gift_certificate_voided: Given because the gift certificate it was paid with had been cancelled; voucher_refunded: a refund reached what a third party's voucher paid, which can't be handed back, so that part is this credit (the refund's creditId); guest_change: the guest cancelled, removed seats, or moved to a cheaper date on their manage link, and the booking's refund policy gives refunds as credit, so what would have gone back to the card is this credit (the refunds' creditId)
entityIdThe entity it's a liability of
currencyamountMinor units, as issued; null without orders:amounts
balanceWhat's left to use; null without orders:amounts
customerIdcustomerNameFirst name only without customers:contact
orderIdorderCodesessionIdnoteStaff's own words; null without orders:amounts
expiresAtcreatedAt