lesson_billing module on a company or coach connection. It requires
the company’s bill-later lesson feature and the coach’s current finance
permissions. Select each write action the connection needs.
Review outstanding booking payments
Calllist_booking_payment_attention with kind and either bookingId
for one booking or dateFrom and dateTo for a company-wide list.
The inclusive range can span up to 92 days. Send offset-aware timestamps to
match the company’s local dates. Each call lists one category and requires
company-wide access. The default page has 25 bookings and the maximum is 50.
Pass nextCursor as cursor with the same category, booking filter and
date range until hasMore is false. Start a fresh query if the filters change.
The cursor keeps the original due-date cutoff while each page reads current
booking and billing statuses.
If the tool reaches its query budget, retry the same cursor after the supplied
delay. For a query timeout, shorten the date range and start a fresh query.
The nextAction field suggests a check or identifies what the booking is
waiting for.
bill_laterincludes scheduled and open lessons, invoicing in progress, failed billing and bookings with a missing billing item. Upcoming recurring bookings can be scheduled before a billing item exists. AMissingitem needs review. Use the credit-options tool whenbillingStatusisOpen. Invoiced, settled and voided items are outside this queue.pending_creditsincludes due after-lesson deductions. The result includes the recorded wait reason and attempt date when available.blocked_by_older_bookingmeans the older deduction is handled first.
Confirm a credit settlement
- Read the item and preview its eligible credit sources.
- Show the coach the lesson, the selected membership or credit pack, the credits to deduct and the estimated total balance after deduction. Ask the coach to confirm.
- Call
settle_lesson_billing_with_creditswithitemId, the selectedclientProductId, areason,userConfirmed: trueand a uniqueidempotencyKey.
recovered: true.
If a price change returns LESSON_BILLING_ITEM_CHANGED, refresh the item
before confirming a new change.
Generate invoices for selected lessons
Callpreview_lesson_billing_invoices with 1–25 selected open item IDs.
Review the invoice groups, currencies, amounts, and blocking reasons.
After confirmation, pass the same item IDs and all four preview hashes
(itemHash, totalsHash, paymentContextHash, and itemDetailsHash) to
generate_lesson_billing_invoices with userConfirmed: true and a
unique idempotency key. If the preview changed, read it again and reconfirm.
This creates invoices without sending them or initiating collection.