This guide issues a reward to a person who has no Davi account, at a door, a
stand or a counter. You need an
organization-scoped token and a published reward
template with no required_entitlement (see below).
A reward is issued to a wallet, and a wallet can exist before its owner does.
1. Redeem to the card or link you have
curl -X POST "https://api.davi.social/api/v1/rewards/REWARD_SLUG/redeem" \
-H "Authorization: Bearer ORG_SCOPED_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"identifier": { "type": "card", "value": "CARD_UID" },
"scope": "single-use",
"idempotency_key": "stand-a-CARD_UID"
}'
identifier names the recipient; Recipients lists
every type it takes. Use card or link for someone without an account. Each
resolves to a wallet, and that wallet does not need an owner. An unclaimed card is bound to a
wallet with nobody behind it, and a reward issued there is held, not refused.
The reward stays in the wallet. When somebody later claims the card, the wallet and the reward come with it. You do not issue anything a second time.
2. Handle both response shapes
A redemption answers either completed with a transaction_id, or pending
with a delivery_uuid to poll. Which one depends on the reward template, not on
your request, so handle both; Results has the details.
Retries and repeats
Send an idempotency_key on every redemption here, built from the card or
link you redeemed to. A repeat with the same key returns the first redemption,
so a retry after a dropped connection does not issue twice. Without a key, Davi
cannot tell two people without accounts apart, and the second card's
redemption can come back as the first card's.
Put whatever makes the redemption unique into the key. stand-a-CARD_UID gives
each card one reward from that stand; add the date or visit for one per visit.
Keys are up to 64 characters.
Leave the reward ungated
The reward's required_entitlement still applies. A wallet with no owner holds
no entitlements, so a reward gated on a membership tier cannot be issued to it.
Leave required_entitlement unset on rewards you hand out this way.
Next
- Issue Rewards: templates, redemption and triggers.
- Read a User's Rewards: how the recipient reads the reward later.
- Read a Card: the card that carries the wallet.