Gifting API Webhooks: How to Trigger Real-Time Gift Delivery From Any In-App Event
By the RealGifts Editorial Team,
Gifting API webhooks are the mechanism that turns any event in your application into a real gift at someone's door, in real time and without a human in the loop. An event fires in your product (a purchase, a milestone, a tournament result), your backend sends the event to the gifting API, and the gift is dispatched, shipped, and confirmed back to your system through status callbacks. This guide covers the full pattern for developers evaluating a gifting integration: event subscription, payload design, idempotency, delivery confirmation, and sandbox testing.
Everything here is described conceptually; the exact endpoints, field names, and event types for the RealGifts API live in the developer docs, and sandbox access is included in the free trial so you can verify the flow directly. This post pairs with our guide on how to send bulk gifts via API: webhooks cover the event-driven, one-at-a-time case; the bulk guide covers cohorts and batches.
What a Gifting Webhook Does
The architecture has three legs. First, an event fires inside your application: a user completes an order, hits a milestone, wins a tournament, or takes whatever action your product decides deserves a gift. Second, your backend forwards that event to the gifting API as a webhook-style HTTP call carrying the recipient and the gift parameters. Third, the gifting platform takes over the physical world: order creation, claim flow, fulfillment, shipping, and recipient support, reporting progress back to your system as it goes.
The division of labor is the point. Your application owns the trigger logic, because only your product knows which moments matter. The gifting API owns everything after the trigger, because catalogs, warehouses, and carrier integrations are not things an app team should build for a rewards feature. The broader product case for this architecture is covered in our guide to gift automation for platforms; this post stays on the wire-level mechanics.
One distinction worth settling early: webhook-triggered gifting is event-driven, not schedule-driven. If your program is "every member gets a reward in December", that is a batch job, not a webhook. If your program is "this user just did the thing, send the gift now", webhooks are the right tool. The difference between the two models, and when each fits, is the subject of our comparison of a gifting API vs a loyalty API.
Subscribing to Events
The first design decision is which events trigger gifts. In practice you register a mapping between event types in your system and gift behavior in the gifting platform: an event name like "order_completed", "milestone_reached", or "streak_achieved" on your side, paired with a gift selection, a budget band, or a catalog category on the other.
Keep the mapping in configuration, not code. Product and marketing teams will want to change which milestones earn gifts, and what those gifts are, far more often than engineering wants to deploy. A clean integration treats the event-to-gift mapping as data: your event handler looks up whether the incoming event type is gift-bearing, resolves the gift parameters from configuration, and fires the call. Adding a new gifting moment then becomes a configuration change.
Start with one or two events, not ten. The instrumentation question ("did the gift move the metric?") is only answerable if the program is small enough to measure against a baseline. Most teams begin with their single highest-value moment and expand once the first loop is proven.
Webhook Payload: What to Send
A minimal gift-triggering payload carries four kinds of information, whatever the exact field names in the API you use:
- The recipient: an identifier the gifting platform can act on. In claim-link flows this is typically your internal user ID plus a delivery channel (an email address, or your own notification system carrying the claim link), not a shipping address. The recipient enters their own address in the claim flow, which keeps address handling off your books entirely.
- The gift: either a specific catalog item ID, or a budget and category that let the recipient choose within a range you configured. Recipient choice is usually the better default; it solves taste at the last mile.
- The event context: the event type and a reference to the triggering object (the order, the milestone, the tournament). This is what makes reconciliation and reporting possible later, when someone asks which program a given gift belonged to.
- An idempotency key: a unique key your system generates for this logical gift, covered in the next section. Of the four, this is the one teams most often omit and most often regret omitting.
Resist the urge to send more. Personal data beyond what the gift requires creates compliance surface without adding function. The recipient identifier, the gift parameters, the event reference, and the key are enough.
Idempotency: Preventing Double-Sends
Webhooks retry. Networks fail mid-request, your process restarts after the call left but before the acknowledgment landed, queues redeliver. Every at-least-once delivery system eventually delivers twice, and in most domains a duplicate is a wasted database write. In gifting, a duplicate is a second physical package, real money shipped to a real address because of a TCP timeout.
The fix is the idempotency key: a unique value your system derives from the logical event (for example, a key built from the user ID and the milestone identifier) and sends with the gift order. The gifting platform treats two requests with the same key as one order: the first creates the gift, the second returns the original result instead of creating a duplicate. Your retry logic can then be as aggressive as reliability demands, because replays are safe by construction.
Two rules make keys work. Derive the key from the event, not the request: if the key changes on retry, it protects nothing. And scope it to the logical gift: the same user earning the same milestone twice (where that is legitimate, like a monthly award) needs a key that includes the period, or the second award will be deduplicated away.
Delivery Confirmation Callbacks
The webhook flow runs in both directions. After your system triggers a gift, the gifting platform reports status back to an endpoint you register: the gift was claimed, the order shipped, the package was delivered, or something needs attention. These callbacks are what turn a fire-and-forget call into a closed loop.
Wire the callbacks into your product, not just your logs. The status events are product material: notify the sender when their gift is on the way in user-to-user flows, mark the reward fulfilled in the learner's or player's profile, alert your support tooling when a delivery raises an exception. Treat your callback endpoint with the same discipline you expect from the other side: acknowledge quickly, process asynchronously, and handle redelivery of the same status event gracefully, because callback delivery is at-least-once too.
Sandbox Testing
Always run the full event-to-delivery loop in sandbox before production. A gifting integration has a property most integrations do not: a bug ships physical goods. The sandbox lets you fire your real events at a test environment, watch orders get created against a real catalog, exercise the claim flow, and receive the status callbacks, without anything leaving a warehouse.
Test the unhappy paths deliberately, because in gifting the unhappy paths are where the money is: replay the same event twice and confirm exactly one order exists; kill your process mid-call and confirm the retry deduplicates; send an event for an unknown recipient and confirm the error surfaces somewhere a human will see it. RealGifts includes sandbox access from day one of the 14-day free trial, with no credit card required, so this whole checklist can run before anyone talks to sales.
Common Event Patterns by Vertical
The mechanics above are identical across verticals; what changes is which event carries the value:
- Gaming and esports: the tournament-end event. The bracket resolves, the placement events fire, and physical prizes go out to the winners within minutes of the final match, with delivery callbacks feeding the winners' profiles.
- Dating apps: the match milestone. An anniversary of a match, a streak of conversations, or a user-initiated send in the gift shop; the event is user-to-user, so sender notification callbacks matter as much as delivery.
- Subscription products: the renewal event. Billing webhooks are the cleanest trigger in this list, because the billing system already emits them reliably; the gift order rides the same event your accounting does.
- EdTech and learning platforms: the completion event. A course finished or a certification earned fires the same event that generates the certificate, and the gift claim link arrives alongside it.
Where to Start
Pick the one event in your product where a real gift most obviously belongs, wire it through sandbox with an idempotency key from the first line of code, and run the loop end to end: event, order, claim, callbacks. The developer docs cover the orders API, webhook registration, and the event reference; the trial includes full API and sandbox access for 14 days with no credit card required. If your first program is cohort-shaped rather than event-shaped, start instead with the companion guide on how to send bulk gifts via API.
Fire your first gifting webhook in sandbox today.
Connect any in-app event to a catalog of over one million real gifts, with idempotent orders and delivery callbacks built in. Start the 14-day free trial, no credit card required.