Skip to content

collectPurchaseBalance

collectPurchaseBalance(purchase: ID!, giftCardCode: String): CheckoutResult!

Collect what a deferred order still owes.

An activity set to collect payment after the fact confirms its bookings at checkout and charges nothing, leaving the whole order owing: that shortfall is Purchase.balanceDue. This mints one more CheckoutSession against the same order for whatever is currently owed, and completePurchase records the funding once the card confirms. Nothing is booked or re-booked — the order is already complete, and collection only adds to how it was funded.

A giftCardCode that covers the whole balance settles it outright, with no Stripe leg and a null checkoutSession. One that covers only part takes its share off what the card is charged: the share is staged against the minted payment and debited only when that payment confirms, so an abandoned checkout leaves the gift card untouched. If the card no longer covers its share by then, completePurchase returns the order with an error and that part stays owing.

Authorized by possession of the unguessable purchase id, exactly as completePurchase is, so the emailed pay link works with no account behind it. A signed-in caller must own the order or be staff of the business.

Arguments

purchaseID!
giftCardCodeString

Returns

CheckoutResult!

See CheckoutResult for the full shape.

Try it

Authentication
Example
Query
mutation CollectPurchaseBalance($purchase: ID!, $giftCardCode: String) {
  collectPurchaseBalance(purchase: $purchase, giftCardCode: $giftCardCode) {
    __typename
  }
}
Variables
{}
POST https://go.sessions.website/api/graphql