BitBear StudioINDEPENDENT SOFTWARE
6 PRODUCTS中文Blog
Back to blog

Telegram loyalty bots: verified purchases, point ledgers, and redemption

Turn a real cafe brief into requirements for verified point accrual, reserved rewards, cancellation, and corrections, with a reusable bot specification and acceptance checklist.

A digital stamp card needs more than a message saying “you have three points.” The merchant must be able to explain which purchase earned each point, what a pending reward has reserved, and how cancellations or mistakes change the balance.

A public self-service cafe bot brief asks customers to report purchase times and drinks, lets the operator verify records, and provides a reward after qualifying visits. It also requests preference polls. When checked on November 20, 2026, the page had completion reviews from both parties: this is a historical request, not a current bidding opportunity. An absolute publication date could not be reliably established from the displayed month and day.

The buyer also requested money returned to a bank card. This article uses only the purchase-verification and loyalty-recording need to design a small prototype that does not execute cashback. Switching to a physical reward requires the merchant's explicit agreement and published rules. A point tracker does not fulfill the entire original brief. The workflow below is hypothetical, not a BitBear client delivery.

Define earning rules separately from rewards

Square's Loyalty Program documentation distinguishes accrual based on visits, spending, particular items, or categories, and describes reward tiers separately. That distinction helps define a small shop's requirements; it does not establish a Square integration in Telegram or BotFatherV2.

A first release might award one point per verified qualifying drink purchase and offer one specified reward for three points. Three points is an illustrative threshold. Decide:

  • Does a purchase containing two drinks earn one point or two?
  • Which drinks qualify? Do freebies or refunded purchases count?
  • Does the balance belong to one location or the entire merchant?
  • Is the reward an item, discount, or cash, and what happens when an item is unavailable?
  • Are expiration, transfers, multiple rewards, or multiple currencies included?

These are merchant decisions. A small first version could use one location, integer points, one physical reward, no transfers, and no automatic expiration. That is a scope choice, not universal advice about running a loyalty program.

Separate a claim from a verified purchase and earned points

A customer entering a time and drink creates a pending claim. It is not proof of payment from a register and should not immediately increase the spendable balance.

The operator first finds the purchase in trusted sales records and assigns an internal purchase reference. One reference may produce only one effective earning event, even if it is submitted repeatedly or claimed by a different account. Matching times and drink names can flag possible duplicates but cannot serve as the unique purchase identity.

Verification should save the purchase association, point change, and reviewer together. If the supported storage operations cannot maintain those associations reliably, leave the claim unresolved for manual investigation rather than reporting successful accrual. Rejections need reasons; define whether additional information updates the original claim or creates another one.

Show “one purchase awaiting review; two available points” without adding those quantities together. Minimize collection: a shop reference, drink, necessary time information, and Telegram user identifier are more appropriate to this non-cash prototype than bank-card details. Choose actual fields according to what verification needs.

Explain the balance with a ledger

Record effective changes as separate events: earning from a verified purchase, reserving points for a reward, releasing a reservation, completing redemption, and correcting a mistake. Associate each event with the customer, shop, business record, rule version, change amount, operator, and processing time.

Display available and reserved points separately. If a customer has five points and requests a three-point reward, show two available and three reserved. A second reward request must use the available two, not spend the reserved three again.

Correct an accidental award with a reasoned adjustment linked to the original record. Deleting the purchase and silently overwriting the balance removes the explanation. If the points are already reserved or spent, pause the affected reward and send the case to a person; the first release should not silently create a negative balance.

Rules need versions too. Before changing a three-point reward to five points, decide what happens to existing balances and requests. One understandable policy is to snapshot the required points and reward when a request is issued, applying new rules only to new requests. The merchant still needs to approve that policy; it is not an assumed platform default.

Requesting a reward is different from receiving it

Square's reward-management documentation describes reserving points when a reward is issued, consuming them on redemption, and releasing them when an unredeemed reward is canceled. The model here borrows that separation, not Square's API or its checkout automation.

A small Telegram prototype can define five steps:

  1. Preview: show the reward, required points, and available balance without reserving anything.
  2. Request: recheck the balance, create a unique request, and reserve points. Concurrent requests must not spend the same balance twice.
  3. Confirm delivery: authorized staff record redemption after actually handing over the reward, including who confirmed it and when.
  4. Cancel: only an unfulfilled request can be canceled, releasing its original reservation once.
  5. Handle a dispute: keep a redeemed record intact and route it to a person. An ordinary cancel button must not pretend delivery never happened.

Specify who may cancel when stock is unavailable, staff make a mistake, or a customer leaves. Manual cancellation is sufficient for a first version; do not promise a background timer that has not been verified. A failed notification must not undo a saved point operation. A later balance lookup should reflect the ledger and reward state.

A reusable BotFatherV2 brief

This is a prototype specification awaiting validation. Commands and numbers are examples:

Build a private-chat coffee loyalty bot for one shop. /claim records the purchase time and drink as a pending claim. The maintainer configures administrators; check their permission on every review. Staff verify sales outside the bot and enter an internal purchase reference. Each reference can earn points only once. Approval earns one point; rejection keeps a reason. /balance shows available and reserved points separately and lets customers inspect their own changes. Three points can request one specified physical reward. Preview reserves nothing. Submission checks the balance and reserves three points once, creating a unique request. Staff mark it redeemed after actual delivery. An unredeemed request can be canceled, releasing its reservation only once. Rule changes must not rewrite an issued request's point cost or item snapshot. Correct accidental awards through an adjustment linked to the original record; errors involving reserved or spent points go to manual handling without automatic negative balances. Repeated requests, simultaneous redemptions, old buttons, and failed notifications must not duplicate accrual, reservations, or releases. Customers can access only their own records. Do not collect bank cards, issue cashback, automatically connect a POS, or add runtime AI. Validate with fictional purchases first.

The critical checks concern consistency between the ledger, balances, and reward states, including simultaneous requests. Receiving a “redemption successful” message does not establish that these conditions hold.

A prototype and a full loyalty system have different boundaries

BotFatherV2 supports creating and modifying Telegram bots through AI conversation. Start by describing these deterministic rules, reviewing the requirements card, and generating a small prototype. Its public documentation does not promise a built-in loyalty system or Square integration. Verify the required database operations against the current fixed SDK and test persistence, authorization, and concurrency in Telegram.

The documented code surface uses TypeScript and a fixed SDK, with no arbitrary npm modules or Node/Bun runtime APIs. New paid runtime AI integrations are outside the initial beta. AI-assisted development does not give the deployed bot automatic POS verification or autonomous reward fulfillment. BotFatherV2 is independent and is not affiliated with Telegram's official BotFather.

Automatic POS accrual, multiple shops, cash payouts, bank-card handling, and complex refunds require separately verified external systems or custom development. A bot must not claim a transaction succeeded through an interface that has not been connected. The original cafe brief's cashback requirement remains outside this prototype.

Keep fictional ledger events for regression checks before publishing. A code rollback preserves current business data; it does not restore past balances or undo delivered rewards. If an older version cannot interpret new ledger events, stop the relevant writes and ask an administrator to investigate.

Ten acceptance checks

  1. Submitting a purchase leaves the balance unchanged. Verification produces exactly one earning event.
  2. Two accounts claim the same reference repeatedly. Only one award takes effect, with its outcome recorded.
  3. Customers try each other's record identifiers. Neither can retrieve the other's claims, balance, or rewards.
  4. Non-administrators and revoked staff cannot approve claims, adjust points, or redeem rewards.
  5. A customer with five points submits two three-point requests simultaneously. Only one reservation succeeds, leaving two available.
  6. Preview reserves nothing. Canceling an unfulfilled reward releases its points once; repeated cancellation creates no extra points.
  7. An already redeemed reward cannot be canceled normally. Retrying a failed notification consumes no additional points.
  8. A correction retains the original reference, reason, and operator. Cases involving used points go to manual handling.
  9. After a rule change, an issued request keeps its original reward snapshot; new requests use the new rule.
  10. Restart, deploy, and roll back compatible code. Ledger events, available and reserved balances, and rewards remain consistent; incompatibility explicitly stops processing.

Use fictional purchases and rewards: no actual payment, payout, or delivery is necessary. The callback-action guide covers general button idempotency. This workflow checks where every point came from, what reserves it, and which reward ultimately consumes it.

Sources and dates

BITBEAR / TELEGRAM-LOYALTY-BOT-POINTS-REDEMPTIONNovember 20, 2026