@gamecore-api/sdk 0.26.1 → 0.26.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -45,12 +45,30 @@ console.log("picked product:", product.id, product.name, "price:", product.price
45
45
 
46
46
  // 4. Create checkout (guest — pass email; no Telegram/VK login required).
47
47
  // For balance-based payment, the user must be authenticated first.
48
- // `amount` in items is the qty for products that have a fixed price
49
- // OR the topup amount for variable-amount products; pass 1 for
50
- // single-unit purchases.
48
+ //
49
+ // Item fields:
50
+ // productId — REQUIRED, the supplier product
51
+ // • gameId — REQUIRED (despite being typed optional). It's
52
+ // the game slug; the backend reads it directly to
53
+ // route Steam top-ups, SuperPass bundles, and
54
+ // Robux-via-pass through their special validation
55
+ // paths. A missing `gameId` crashes the request.
56
+ // • amount — quantity for fixed-price items (default 1) OR
57
+ // the top-up amount in local currency for Steam /
58
+ // variable-amount products.
59
+ // • deliveryData — product-specific fields (account name, server
60
+ // id, etc.). For simple gift cards this can be
61
+ // an empty object.
51
62
  const checkout = await gc.checkout.create({
52
63
  email: "buyer@example.com",
53
- items: [{ productId: product.id, amount: 1, deliveryData: {} }],
64
+ items: [
65
+ {
66
+ productId: product.id,
67
+ gameId: game.slug,
68
+ amount: 1,
69
+ deliveryData: {},
70
+ },
71
+ ],
54
72
  paymentMethod: "antilopay", // gateway slug from checkout.getPaymentMethods()
55
73
  });
56
74
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gamecore-api/sdk",
3
- "version": "0.26.1",
3
+ "version": "0.26.2",
4
4
  "description": "TypeScript SDK for GameCore API — browser-safe, zero dependencies",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",