Sweepstakes Payments API: How to Integrate Coin Purchases and Prize Redemptions
A sweepstakes platform moves money in two directions. Players buy coin packages, and players redeem prizes. A sweepstakes payments API handles both: it takes the payment for a coin package and sends the prize payout, with the identity and location checks the platform needs along the way.
This guide walks through how that works with Soap: the two checkout types, the webhooks to listen for, and what to plan for before going live. The full reference is in Soap's developer docs.
How does a sweepstakes payments integration work?
Every payment starts the same way. Your server creates a checkout session through the API, Soap returns a URL, and the player completes the payment on a Soap-hosted page. You can send the player to that page, or embed it in your site or app. When the player finishes, Soap sends a webhook to your server and, if you set a return URL, sends the player back to your app.
- Step 1Create a checkout
Your server calls the API with the player and what they're buying or redeeming.
- Step 2Player completes it
On a Soap-hosted page, redirected or embedded in your app.
- Step 3Webhook arrives
Your server learns the result and updates the player's account.
- Step 4Player returns
Back to your app, with coins added or the redemption on its way.
How do players buy gold coin packages and get sweeps coins?
Coin purchases use a deposit checkout with line items. Each line item is one product: a name, a price and a quantity, such as a 10,000 gold coin package that comes with bonus sweeps coins. You can keep a product catalog in Soap and reference products by ID, or describe each package inline when you create the checkout, which suits prices that change with promotions.
- The player sees the packages, quantities and total in the checkout's order summary.
- When the payment succeeds, a webhook tells your server to credit the coins.
How are prize redemptions paid out?
Prize redemptions use a withdrawal checkout. There are two ways to set the amount:
- Player chooses the amount: you pass the player's available balance, and the player redeems any amount up to it.
- Fixed amount: you pass an exact amount, for pre-approved redemptions or fixed cashout tiers such as $25, $50 or $100.
In both cases the player picks a payout method and confirms. Your platform keeps the ledger: Soap doesn't store player balances. It uses the balance you send as the ceiling for that one checkout.
The hold: avoid paying a prize twice
Redemptions use a hold so a player can't spend sweeps coins that are already being cashed out. When the redemption starts, Soap sends a hold webhook and you take the amount off the player's balance. From there, the hold ends in one of these ways, and each one sends its own webhook:
- The payout succeeds: a succeeded webhook. Nothing more to do: the balance is already updated.
- The payout fails right away: a release hold webhook. Put the amount back.
- The payout is accepted, then fails: a failed webhook. Put the amount back.
- The payout is accepted, then cancelled (on some payout methods): a cancelled webhook. Put the amount back.
- The player abandons the redemption: an expired webhook. Put the amount back.
Succeeded and release hold are always sent. Failed, cancelled and expired are off until you turn them on in the dashboard, so turn them on before you take redemptions live. Getting this handshake right is the most important part of a redemption integration.
- Step 1Player redeems
Chooses an amount and a payout method.
- Step 2Hold webhook
You take the amount off the player's balance.
- Step 3Payout succeeds
Nothing more to do: the balance is already updated.
- Step 4Or it doesn't complete
A release hold, failed, cancelled or expired webhook arrives, and you put the amount back.
Which webhooks should a sweepstakes platform listen for?
- Succeeded: a coin purchase or redemption went through.
- Hold: take a redemption off the player's balance.
- Release hold, failed, cancelled and expired: a redemption didn't complete, so put the amount back. Failed, cancelled and expired are off until you turn them on.
- Returned: a bank payment came back after it went through.
- Review created, approved and declined: if you hold redemptions for review before payout.
- Customer restricted and unrestricted: when a player's deposits or withdrawals are paused, for example after a failed identity check.
Treat webhooks as the source of truth. The return to your app is a good moment to update the screen, but credit coins and settle redemptions from webhooks.
What about identity and location checks?
Sweepstakes platforms usually need to know who a player is and where they are playing from. Soap can run both inside the checkout:
- Identity (KYC): verify the player in the checkout, or send Soap the result from the identity provider you already use. Soap can also check the player's age against your minimum and that the verified name matches the account.
- Location: check the player's location at the moments that matter, such as a purchase or a redemption, from the device's location or, where you turn it on, the player's IP address.
- Payment reviews: hold a redemption until someone on your team approves or declines it in the dashboard.
Which checks you need, and in which states you operate, is a decision for your team and your counsel. The API gives you the tools to apply that decision consistently.
How do you test before going live?
Soap has a sandbox API and a sandbox dashboard. Developers can create test purchases and redemptions, receive webhooks and try the review flow before switching to production keys.
FAQ
What is a sweepstakes payments API?
It is the set of API calls a sweepstakes or social casino platform uses to sell coin packages to players and pay out prize redemptions. With Soap, the platform creates a checkout session on its server, the player completes it on a Soap-hosted page, and webhooks tell the platform what happened.
How do players buy gold coin packages and get sweeps coins?
The platform creates a deposit checkout with line items: each line item is a coin package with a name, price and quantity, either from a product catalog or defined inline. The player sees the items and total on the hosted checkout, picks a payment method and pays. A webhook confirms the purchase.
How are prize redemptions paid out?
The platform creates a withdrawal checkout. It either passes the player's available balance, so the player chooses how much to redeem up to that amount, or a fixed amount, such as a preset cashout tier. The player picks a payout method and confirms.
Does Soap store player balances?
No. The platform owns the ledger. Soap only sees the balance figure sent when a withdrawal checkout is created, and uses it as the ceiling for that one checkout.
Can I test the integration before going live?
Yes. Soap has a sandbox API and dashboard, so developers can build and test purchases, redemptions and webhooks before going live.