Should you build your own rewards API?
The balance is easy. The second request, the refund and the support ticket are where the decision lives.
9 minutes read
On this page
The short answer
Build a small points counter yourself when the rules are simple and a mistake is cheap to repair. Consider a rewards API when balances carry real promises, several rules interact, or people outside engineering need to change the program. Test the unhappy paths before comparing the dashboards.
- Your application must prove that the action happened, even when another service manages the reward.
- Price the system you will operate: retries, reversals, support, exports and rule changes.
- Use one written pilot to compare an internal build and every vendor.
- A points balance, a checkout discount and an affiliate commission are different jobs.
An interactive responsibility map: your app verifies the action and identity, the rewards service applies a rule, and your app delivers the experience.
Interactive example · system design
Follow the reward across four boundaries.
- ProofYour trusted server
- IdentityThe same action once
- RewardRules and ledger
- ExperienceYour app or provider
Your server verifies the action. The reward service evaluates the rule, records the change and returns a receipt. Your app displays the confirmed result.
Start with the promise you are making
Write the user-facing promise before you write the schema. A useful starting point is: finish a verified lesson, earn ten points, spend fifty points on an extra practice pack. That sentence contains three different decisions. Your application decides whether the lesson was completed. A balance system decides whether the person earned enough. Your product decides whether the practice pack became available. A vendor can own some of these responsibilities, but the boundaries still need names.
Now make the promise smaller. Does the user need points at all, or would a history of completed lessons do the job? If the number cannot be spent, transferred or exchanged, a simple progress record might be enough. If the reward is a one-time badge for a single event, a unique database row may be the whole implementation. Do not adopt a general rules system to avoid making a product decision.
The reason to buy appears when you need to change that promise safely. Someone wants a weekend bonus, an earning cap, a second type of credit, a preview before publishing, and an explanation of why a particular person received nothing. Those requests are reasonable. Together they turn a counter into an operating system for your program. Decide whether maintaining that system is work your team wants to own.
Draw the boundaries before choosing a vendor
The most useful architecture diagram has four boxes: proof, identity, reward and experience. Proof means an action really happened. Identity means it belongs to the intended person and project. Reward means the rules produced an authorized change. Experience means the user saw or received what was promised. For each box, name an owner, the durable record it creates, and the thing support can inspect when it fails.
A confirmed spend, a pending external delivery and an explicit recovery policy are separate records in the example workflow.
Illustrative product design
The balance changed. Did the benefit arrive?
- REWARD RECORDSpend confirmed
A receipt explains the balance change. It identifies what the person claimed.
- DELIVERY RECORDStill pending
Your app or fulfillment provider has work left to do. A second spend is not a retry strategy.
- RECOVERY POLICYComplete or correct
Retry delivery under a stable identity, or record an explicit linked correction.
A design to evaluate, not a built-in fulfillment guarantee. Keep the reward record and external delivery state connected.
A browser saying lesson completed is a request to your application, not proof of completion. If the reward matters, your trusted backend should validate the lesson result and send the event with its own credentials. Do not ship a privileged rewards key inside the client. A managed reward ledger cannot tell that a plausible event was fabricated before it arrived. That remains your application's job.
Likewise, receiving an award does not automatically deliver an external benefit. A balance deduction and a shipped T-shirt are separate facts. Decide whether the benefit is reserved, fulfilled, cancelled or retried, and what the customer sees while that happens. For noncash app credits, the delivery may simply be permission to run a feature. For physical goods, it crosses a much larger boundary. The AI credits guide covers that narrower consumption model.
Make the second request part of the demo
The first request usually works. The interesting request is the retry after your server timed out. The remote service may have accepted the event even though your application never received the response. If the retry uses a fresh identity, the system may pay twice. If you never retry, it may pay nobody. Ask every candidate to show the original receipt after the uncertain response, then repeat the same request.
An idempotency key gives one intended action a stable identity across retries. Keep it tied to the business action, such as the verified completion record, rather than generating a new value every time the HTTP client runs. Amazon's guide to idempotent APIs explains why retry safety depends on recognizing intent, including late requests and a reused identifier with different parameters. Ask about retention of these identities and conflict behavior, not just whether the API accepts a header.
| Try this | Decide what should happen |
|---|---|
| Repeat one completion after a timeout | One award, with an inspectable original result |
| Reuse its identity with a different amount | A clear conflict, never a silent second intention |
| Send two spends against the same remaining balance | Only the affordable operation succeeds |
| Correct a mistaken award | A linked correction that preserves the original history |
| Make delivery fail after a successful spend | A recoverable delivery state, not a disappearing promise |
Also test two different verified actions that happen close together. Deduplication must not collapse them merely because they share a user and timestamp. Conversely, changing the transport request must not make the same underlying completion eligible again. These are different identities: the network attempt and the business fact. Keeping them separate makes the implementation much easier to explain.
Price the operation, not the first implementation
Here is a deliberately invented cost example. Suppose an internal implementation needs forty hours to build, then four hours per month to maintain. At an assumed loaded engineering cost of one hundred dollars per hour, the first year costs eight thousand eight hundred dollars before infrastructure: four thousand to build and four thousand eight hundred to maintain. None of these figures is a market benchmark. Replace all three inputs with your own estimates.
The equivalent vendor calculation includes integration time, subscription charges, usage charges, support needs and exit work. Ask what counts as a billable event. A completion that triggers several rules may not cost the same everywhere. Retries, test environments, exports and historical reprocessing can also matter. Use a realistic event trace from your application, with identifiers removed, to estimate volume. A headline monthly price is not an architecture decision.
The difficult term is the maintenance estimate. Include investigating disputed rewards, changing the rules without a release, reconciling balances after a bug, rotating credentials, and helping support find a receipt. Ask who wakes up when the reward pipeline stops and who can pause it. A service can be cheap while still requiring your most expensive engineer to answer every ordinary question.
An illustrative credits receipt showing credits bought, credits spent and a remaining balance.
- WelcomeSigned up+200200
- Report: Q3 salesFinished−20180
- Report: churnStarted−20160
- RefundReport failed, credits back+20180
- Friend bonusLeo finished his first report+500680
Do not turn this into a theatrical total-cost spreadsheet with imaginary precision. Use a range and identify what would change the decision. If your rules will barely change and the downside of a wrong badge is small, building can be sensible. If every campaign adds exceptions and a customer can lose something valuable, operating the system deserves a larger budget than drawing its first screen.
Give every candidate the same awkward pilot
Choose one real journey with a small reward and a clear completion signal. Write its event, eligibility condition, award and cap in plain language. Include the correction path and the person allowed to publish changes. Then ask each implementation to demonstrate that same journey. A polished sample store tells you less than your own ugly edge case.
Verify the happy path
Send a trusted completion, inspect the decision and receipt, and read the balance from the surface your app will use. Confirm how the end user is authenticated for that read.
Repeat and race it
Retry the completion with the same identity. Attempt concurrent spending. Confirm the final state and inspect the records, rather than accepting a successful HTTP response as proof.
Change the rule
Have the intended operator draft a different award, preview it if supported, and take it through the actual approval boundary. Check what happens to events already in flight.
Correct and leave
Reverse a mistake, export enough history to explain the resulting balance, and sketch the migration to another system. A credible exit path is part of a credible purchase.
A simulation is useful evidence about a model. It is not evidence that your checkout integration, webhook delivery or identity mapping works. Keep those tests separate. Likewise, a local dashboard preview cannot establish a hosted service's uptime. Ask for the evidence that matches the claim, and write down what remains untested. You are choosing an operational dependency, not judging a slideshow.
Compare products that own the same job
A streak API, a promotion engine and an affiliate platform may all mention rewards while doing quite different work. The important question is what each considers its durable business object. Is it a daily achievement, a cart redemption, a member wallet, or an unpaid commission? Choosing the wrong object makes every new request an adapter you have to maintain.
Our comparison library starts from that distinction. Trophy is worth examining for app progress and detailed streak behavior. Voucherify deserves attention when checkout promotions and stacking are central. Open Loyalty has a broader member-program model. Rewardful addresses affiliate attribution and commissions. Those pages explain when each is the stronger fit and what to verify in its current documentation.
Lurk is a candidate when you want trusted events to drive configurable units and rules, with receipts and human approval before agent-proposed rules go live. Your application still owns event verification, its interface, and external fulfillment. Do not choose it assuming every design recipe is an installable feature. Inspect the current catalog and the exact rule behavior you need, including any referral qualification, streak repair or ranking requirement.
Start with one promise you can keep
Write down access boundaries as part of your pilot. A person who can inspect a reward should not automatically be able to change it. A machine credential used by your application should have only the operations it needs. A support operator needs a safe correction path with a reason, not an unrestricted balance editor. Test those distinctions with the actual credential types you intend to use. A role name on a pricing page is not evidence that your exact operation is protected.
Before importing existing balances, decide where the authoritative balance will live during the change. Avoid a period where both systems can independently spend the same value. Reconcile a small sample of people from their source history, document any adjustments, and test an export before the full move. If the new system cannot represent an old pending reward or expiry rule, that is a migration decision to resolve explicitly. Renaming the amount does not preserve its meaning.
Keep configuration changes observable too. When a person reports an unexpected award, you need to know which rule applied at that moment, not merely which rule is visible today. Ask how published versions, paused rules and historical receipts relate. An old receipt should remain explainable after a campaign changes. This is one of the most useful support exercises to include in the pilot, because it tests the system's memory rather than its ability to increment a number.
Keep the first release narrow enough that someone can explain every award. A verified event, one reward, one cap, one visible receipt and a way to stop the program make a useful starting boundary. Add another mechanism when evidence shows why it belongs. You can learn whether people value the reward without launching a store, leaderboard and referral network in the same week.
Illustrative starter ruleDraft
Whena verified lesson is completedLimitonce per dayDogive 10 points
That sentence is an example specification, not proof that an integration has been installed. Choose the day boundary, send the event from a trusted server, and test repeated delivery before launch. If you use Lurk, start by reviewing the Points recipe and developer integration, then ask for a draft that matches the currently supported operations. A person should review the behavior and approve publication.
The decision is reversible only if you preserve the facts that matter. Keep your own stable identity for the action, document what the customer was promised, and retain access to the reward history. Whether you build or buy, the product should still be able to answer a simple question months later: what happened, why did it count, and what did we give this person?
Plan it with your agent
Paste this to your coding agent. It reads this post and checks what is supported in your project, using these recipes as references. Nothing goes live until you say yes.
- Claude Code
- Cursor
- Codex
- Grok
- Grok Build
- Meta Muse
- Dots
- OpenClaw
- Hermes Agent
Questions people ask
When should I build a points system myself?
Build when the behavior is narrow, changes are infrequent and errors are cheap to repair. Include duplicate delivery, concurrent spending and support history in the estimate before calling the system simple.
Does a rewards API stop users from faking events?
It can enforce its own authentication and rules, but your application must establish that the underlying action happened. Send valuable completion or purchase events from a trusted backend after verification.
What should I test in a rewards API trial?
Test one real journey, a repeated event, concurrent spending, a correction, rule approval and an export. Inspect the final records as well as the API response.
Is a rewards API the same as an affiliate platform?
No. Product rewards usually manage progress or balances inside an experience. Affiliate platforms also need attribution, commission accounting and payout operations; confirm those requirements explicitly.
Should I choose the cheapest monthly plan?
Compare total integration and operation costs for your expected usage. A low subscription can still require substantial engineering work if the product does not own the responsibilities you need.
Can an agent build the integration?
An agent can help implement and inspect it, using the tools a provider exposes. Keep credentials scoped and make human review of live reward behavior an explicit boundary.
Sources
More posts to read
Bring them back
How to build a daily streak people can trust
A flame is the easy part. Decide what a day means, what counts, and who fixes the day your servers went down.
Bring them back
Get trial users to a second useful session
The welcome email is rarely the whole problem. Find the unfinished job, then make the return worth it.