
Step 1: Create Unopened Card Pack
First, create an unopened card pack item with an “Open” action:Step 2: Handle Pack Opening
When a user activates the “Open Pack” action, they will be redirected to your game’s API endpoint with their auth token and the item’s origin. Your server should then process the pack opening using the provided auth token:Process Overview
- Create Card Pack: Your game creates an unopened card pack item with an “Open Pack” action.
- User Interaction: The user purchases the pack from the Handcash market and selects the “Open Pack” action.
- Redirect: Handcash redirects the user to your game’s API with the user’s auth token and the pack’s item origin.
- Authentication: Your server creates a new SDK instance using the auth token provided in the query parameters.
- Generate Cards: Your game logic generates random cards to represent the pack’s contents.
- Burn and Create: In a single API call, your server burns the unopened pack and creates the new card items using the authenticated SDK instance.
- User Feedback: The user is redirected to a page showing their newly opened cards.