/xsolla-ai-kit:shop-setupfrom xsolla-ai-kit
Guides building a custom game store using Xsolla headless components: Login, Store API, and Headless Checkout SDK. For users who will code, review, and deploy their own shop frontend.
Ships in xsolla-ai-kit. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
If the user does not want to write, review, and deploy the shop code, stop and open nocode-shop-setup.
If the user has not said which they want, show Shop building paths in AGENTS.md
and ask.
A custom game store assembled from individual Xsolla products and integrated into the partner's own site with the help of AI. The partner writes the frontend; Xsolla provides backend services and SDKs.
Four components:
| Component | Role |
|---|---|
| Login | Player identity — authentication, JWT, social login, game ID binding |
| Store API | Commerce backend — catalog, cart, orders, promos, inventory, virtual currency |
| Headless Checkout SDK ⭐ | Embedded payment UI on the partner's site — recommended for Headless Store |
| Pay Station | Xsolla-hosted payment page — fallback when embedded UI is not needed |
Headless Checkout SDK (
github.com/xsolla/pay-station-sdk) is the recommended payment layer for this integration type. It renders the full payment UI directly on the partner's site without redirecting the player elsewhere — the natural fit when AI is already building the entire storefront. Pay Station redirect is a valid fallback but not the default choice here.
Partner's site
│
├── Store API ──────────────────── catalog, cart, orders, promos, inventory
│ │
│ └── Login (JWT) ────────── authenticated cart, user balance, personal limits
│
└── Headless Checkout SDK ──────── embedded payment UI on partner's site
│
└── Webhook ────────────── partner's backend ← fulfillment trigger
Data flow for a purchase:
The agent builds bottom-up: data first, then identity, then payment.
When an orchestrated step needs the publisher's local merchant and project
settings, reuse merchant-setup's project-local XSOLLA_MERCHANT_ID,
XSOLLA_PROJECT_ID, and XSOLLA_PROJECT_API_KEY configuration. Read .env
as text without exposing values, and keep credentials out of generated
storefront code. Follow each API's own authentication contract.
Goal: Store project with catalog exists before any UI.
projectIdmerchantId, projectId, loginProjectId, cartIdNothing to build on the frontend yet. Without this, all API calls return empty or errors.
Goal: player sees items without logging in.
projectId and localeAuthorization header for public storefrontValidate: catalog loads without JWT; locale changes item names; no errors.
Goal: player accumulates items before checkout.
cartId per storex-unauthorized-id (stable UUID in localStorage)Validate: add item → reload page → cart persists; clear works.
Goal: player can log in; store knows who they are.
loginProjectId) → login-setuplogin-styling (don't ship the stock widget look)What changes in Store after login:
x-unauthorized-id to Authorization: Bearer JWTValidate: login → cart preserved; logout → guest mode; re-login → account cart restored.
Goal: account-level commerce mechanics.
Implement after Phase 3, only what the product needs:
All requests: Store API + Bearer JWT.
Goal: player completes real-money purchase.
The token is always obtained via a backend HTTP call — never generated on the frontend. Three methods exist; choose based on context:
| # | Method | Who calls | When to use | Docs |
|---|---|---|---|---|
| 1 | POST https://store.xsolla.com/api/v2/project/{id}/payment/cart/{cartId} | Browser → Store API directly | Default for Headless Store / AI build — no partner backend needed. Full Store lifecycle: cart validated → order created → token returned. | - |
| 2 | POST https://store.xsolla.com/api/v3/project/{id}/admin/payment/token | Partner's backend → Store API (admin auth, S2S) | Production setup where checkout must go through partner's server. Same internal Store logic as method 1, different call architecture. | https://developers.xsolla.com/api/catalog/payment-server-side/admin-create-payment-token |
| 3 | POST https://api.xsolla.com/merchant/v2/merchants/{id}/token | Partner's backend → Merchant API | No Store catalog needed; simple amount + description; maximum token_data control. Use when Store API is not part of the integration. | https://developers.xsolla.com/payment-ui-and-flow/payment-ui/how-to-get-payment-token/ |
Methods 1 and 2 both return { token, order_id } and include full Store order lifecycle (SKU validation, promo redemption, inventory reservation). Method 3 returns { token } only — no Store order, no SKU validation.
Default for this integration: Method 1 (browser calls Store API, no backend setup required).
openPayStationWidget() or redirect URL → player pays on Xsolla-hosted pageValidate: payment token received; payment UI opens; test payment completes in sandbox.
settings.language)Supported codes:
Pay Station localization
(default when omitted by Xsolla: en). Pass the code in the token payload as
settings.language (Methods 1–3).
Headless Checkout — always set the shop language on the token. Do not rely on IP/geo detection: Headless has no in-UI locale picker like Pay Station, so a wrong token language leaves the payment UI out of sync with the storefront.
| Shop setup | What to put in settings.language |
|---|---|
| Single language | That language on every token |
| Locale switcher / multi-language | Current shop locale on each token create |
| Shop locale not in the Xsolla list above | en |
Match the same code in headlessCheckout.init({ language }).
Pay Station — optional. You may set settings.language or omit it. Pay Station
detects locale on its own and lets the player change language in the hosted UI.
Japanese IP note (Xsolla rule): a Japanese client IP forces Japanese in the payment UI regardless of
settings.language.
Goal: grant purchased item to the player in the game.
After a successful payment — whether through Headless Checkout SDK or Pay Station — Xsolla sends a webhook to the partner's backend. The partner must:
lowercase(sha1(rawBody + secret)), compared in constant time — plain SHA-1 with the secret appended, not HMAC-SHA1 → webhooks-implorder_paid (Methods 1–2 — items in items[], player in user.external_id) or payment (Method 3 — items usually in custom_parameters, player in user.id); when both arrive (separate delivery), grant on order_paid only2xx (200/201/204) to acknowledge receipt; 400 + INVALID_SIGNATURE on a mismatchThis step is required for real-money purchases. Without it, payment succeeds on Xsolla's side but the player receives nothing in the game.
Validate: trigger a test payment → webhook received → item granted in game system.
productionGoal: accept real money; leave sandbox.
productionXSOLLA_SANDBOX / token sandbox / SDK sandbox: false); keep a
toggle for quick environment switchingValidate: developer sign-off on the production checklist (utils OK without
00020004, live card + goods granted, wallets smoked, failed path works).
Optional in-catalog quests (headless shop): if the publisher asks for an
optional quest section inside the existing catalog/product layout (not a
navigation tab), follow quest-setup and its
references/web-shop-module.md.
Keep the full implementation recipe in quest-setup.
Which payment UI to use:
Headless Store / AI-assembled storefront?
└── DEFAULT → Headless Checkout SDK (embedded, player stays on partner's site)
Partner explicitly wants Xsolla-hosted payment page?
└── Pay Station (redirect)
Payment UI language:
Headless Checkout?
└── ALWAYS set settings.language = shop locale (or en if unsupported)
├── one shop language → that code every time
└── locale picker → pass current shop locale into each token
Pay Station?
└── optional — may set settings.language or omit (PS detects + user can change)
Which token method to use:
Does the partner have a backend server for checkout?
├── NO → Method 1 (default): browser calls POST /v2/project/{id}/payment/cart/{cartId}
├── YES → Method 2: server calls POST /v3/project/{id}/admin/payment/token (S2S, admin auth)
└── No Store catalog at all → Method 3: POST /merchant/v2/merchants/{id}/token (Merchant API)
What to build next (if starting from scratch):
Phase 0 done? → no: set up catalog in Publisher Account first
Phase 1 done? → no: implement catalog read
Phase 2 done? → no: implement guest cart
Phase 3 done? → no: integrate Login
Phase 4 needed? → check product requirements
Phase 5 done? → no: implement payment token + payment UI
Phase 6 done? → no: implement webhook handler on partner backend
Phase 7 done? → no: go live — `production` (contract, flip sandbox, deploy, live test)
production.settings.language for Headless Checkout — IP-based language will
desync the payment UI from the shop; always pass the shop locale (fallback en).What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
xsolla, game-store, headless-checkout, payment-integration, ecommerce
npx claudepluginhub xsolla/xsolla-ai-kit --plugin xsolla-ai-kit15 skills in this plugin
/catalog-designSets up an Xsolla catalog: virtual items, virtual currency and its packages, bundles, game keys, item groups, regional prices and LiveOps offers, plus the client purchase flow (buy by SKU or cart, buy for virtual currency, order status). Use for "set up my Xsolla catalog", "create virtual items", "sell game keys", "regional prices"./description-to-shopTurns a game description or store listing (App Store, Google Play, Steam) into the shop brief that shop-builder-assembly builds from. Reached through nocode-shop-setup; not an entry point. Owns intake and inference only: presets, confirmation, CLI writes and preview belong to shop-builder-assembly./game-web-portalBuilds or resumes an unpublished Game Web Portal for a PC or mobile game: Home, News, Rewards, Web Shop, Community and an optional Launcher, on a site made from the Multi-page web portal template. Reached through nocode-shop-setup. Use for "continue my Game Web Portal" or "add the Community section". Never publishes; that stays with the human. Not for XLA Pages on x.la; use `xla-pages`./headless-checkout-integrationIntegrates Xsolla Headless Checkout — a fully customizable, client-controlled payment UI built on the @xsolla/pay-station-sdk JavaScript SDK, where payment data stays isolated in secure iframes and payments run through Xsolla without the standard Pay Station./login-setupIntegrates Xsolla Login (Xsolla ID, NewID): sign-up and sign-in by password, email or SMS code, social networks, Steam, Xbox, PSN, Epic, device or custom ID; Login Widget, API or SDK; JWT validation, server tokens, account linking, MFA, password reset. Use for "integrate Xsolla Login", "add sign-in", "validate a user JWT", or when a feature needs a signed-in user./login-stylingStyles the Xsolla Login widget (sign-in, sign-up, password reset): upload custom CSS through the API and attach it to the login project, or set colors, logo, background and social order through themeJSON. Use for "style the login", "brand the sign-in screen", "upload login CSS", "dark-mode login". Pairs with login-setup, which wires the auth flow.Other plugins' skills for the same job