Put a purchase button in your game.
Try it first
Test one in-game purchase#
You need A playable game, one product and your chosen payment provider.
- Choose managed checkout or connect your existing provider.
- Register the product on your payment server and wire the SDK purchase action into the game.
- Run a test purchase and verify its receipt and exactly one item grant.
Check your result The game resumes with a verified purchase and one delivered item.
Keep your game and the backend you already use. Choose who processes the payment and who delivers the item, then use the matching SDK integration.
1. Choose your setup#
| Setup | Use this path |
|---|---|
| Fully Managed | Use Playmos services for the capabilities actually provisioned for your game. Confirm inventory fulfillment is available before accepting payments. |
| Hybrid Managed | Use Playmos payments with your existing server, or your processor in a Hub-hosted game. Choose payment processing and fulfillment separately. |
| Self Hosted | Keep your catalogue, checkout, processor and server verification. You do not need a second catalogue or payment credentials in Playmos. |
Your game’s hosting location does not decide its payment provider. Configure only what you use in Game setup. The onboarding guide is optional and can be dismissed.
2. Add the purchase action#
npm install @playmos/sdk@0.3.38
Inside Playmos Hub
Use the SDK communication bridge. The trusted Hub connects the wallet and keeps checkout over the running game. Your game sends an item ID, not a client-defined price.
import {createCheckoutBridge} from '@playmos/sdk/checkout';const bridge = createCheckoutBridge({hubOrigin: 'https://test.playmos.io'});export async function buyItem(sku, savedRequestId) {const capabilities = await bridge.detect();if (!capabilities.services.purchase) {throw new Error('Purchases are not configured for this game.');}return bridge.checkout({kind: 'purchase', itemId: sku, requestId: savedRequestId,});}// Call buyItem from your shop button. Persist and reuse the request ID// for this authenticated player's order after interruption.// Refresh inventory from your server; wallet approval is not a grant.
The host must register the game’s purchase capability and trusted fulfillment adapter first. An uploaded ZIP or shared preview does not automatically enable paid checkout. See bridge configuration and the complete checkout workflow.
Outside Playmos Hub
Use the provided checkout interface or your own in-game UI. Start with the runnable example that matches your backend:
- Playmos payments + your game server
- Your existing checkout and processor
- Order endpoints, callbacks and recovery contract
3. Connect trusted delivery#
Your server authenticates the player, saves the order and verifies payment before granting the item once. Use one grant ledger for callbacks and manual completion. Playmos Managed IAP keeps the payment catalogue; your game keeps item behavior and inventory. Privy supplies wallet signing, not delivery.
Manual backend walkthrough · All IAP variables in one place · Callback verification
4. Buy one item, then test recovery#
- Open your running game and buy one item on Base Sepolia.
- Cancel before signing: no item is delivered.
- Reload a pending checkout: check the same saved payment.
- Repeat its callback: the backend grants exactly once.
- Reject an incorrect player, SKU, game, amount or network.
Using an agent?#
Give your agent this guide as Markdown or the IAP integration skill. Public MCP exposes playmos_get_iap_guide and playmos://guides/in-app-purchases without signing in. Start with your existing purchase flow and identify the ownership model before creating a catalogue.
For Apple and Google releases, keep provider-specific SKU mappings and implement native billing, receipt verification, notifications and restore as separate integrations. See the configuration reference.
If it did not work#
Keep the order ID and check payment verification and backend fulfillment separately before retrying.
Try one variation
Continue with the next guide →