Create, change and archive the currencies, items and packs of your game from your backend with a secret key, like the products and prices of a payment platform.
The catalog is what your game rewards and sells. Besides the dashboard (« Monnaies », « Objets », « Packs »), you can manage it from your own code: a build script that publishes the shop of a new season, an admin tool of your studio, a migration. The five server SDKs (0.4.0) have these operations as currencies, items and packs; the examples on this page continue from the setup.
Warning
Each environment has its own catalog. A gc_sk_test_… key creates, changes and archives only the currencies, items and packs of test; a gc_sk_live_… key only those of live. Nothing a test key does can reach what your players see in live. A secret key can still change what your game sells in its own environment, so create a new pack as a draft and activate it when it is ready. To put a tested catalog in production, use the « Copier le catalogue de test » button of the dashboard (the live pages of « Monnaies », « Objets » and « Packs »): it copies the test catalog into live, with the packs as drafts. Every change is recorded in the audit log of the studio, under the key that made it.
Three resources./currencies (identified by their code), /items and /packs (identified by their sku). Every resource has the same five operations: list, create, read, change and archive.
Identifiers are final. A currency code, an item or pack sku and an item type can never change, because balances, inventories and orders refer to them. A field that cannot change, like any unknown field, is refused with VALIDATION_FAILED.
The identifier is the natural key of a create. A code or sku that is already used, even by an archived resource, answers CONFLICT with fieldErrors.code or fieldErrors.sku set to ["CODE_TAKEN"] or ["SKU_TAKEN"]. So a create takes no Idempotency-Key: if you do not know whether it succeeded, read the resource back.
A change is partial. A field you leave out stays as it is; null clears a description, a price or a limit. grants, items, metadata and availability are replaced as a whole.
Nothing is deleted.DELETE archives: the resource is no longer offered, credited or sold, and the balances, inventories and past orders that refer to it are untouched. An archived resource can still be read, and cannot be changed.
The rules are the dashboard's. Everything you can do here, you can do in the dashboard, with the same checks: a pack needs at least one grant or item, its currencies and items must exist and be active, a paid amount needs a purchasable currency, a stock cannot go below the units already sold.
A lowercase letter, then lowercase letters, digits or _, 2 to 24 characters in all. Unique in the game, final.
name
string, required
The display name, 1 to 60 characters.
purchasable
boolean
true (the default) when packs can sell the currency for real money. false for a currency that is only given, such as gold: it is always credited to the bonus part of a balance.
name and purchasable, both optional. Returns the currency.
A currency cannot become free (purchasable: false) while a pack that is not archived sells it for money: the answer is CONFLICT, with the pack skus in details.blockedBy.packs.
Returns the archived currency. Archiving is refused with CONFLICT while an active pack credits the currency or an active item is priced in it: details.blockedBy lists them as { packs, items }. Archive those first. Archiving an archived currency has no effect.
A lowercase letter or digit, then lowercase letters, digits, _, . or -, 1 to 48 characters. Unique among the items, final.
name
string, required
The display name, 1 to 80 characters.
type
string, required
consumable (can be consumed, like a potion) or durable (is owned, like a skin). Final.
description
string or null
A text of at most 500 characters.
price
object or null
{ "currency": "gems", "amount": 20 }, in an active currency of the game. Leave it out for an item that cannot be bought with currency (it comes from packs or grants).
maxOwned
integer or null
The most units a player can own, 1 to 1,000,000,000. Left out: 1 for a durable item and no limit for a consumable. null: no limit.
clientPurchasable
boolean
true when the browser SDK may sell the item. Needs a price. Defaults to false.
metadata
object
Free key/value strings that your game reads: at most 10 entries, keys of 1 to 40 characters (letters, digits, _, -), values of at most 200 characters.
VALIDATION_FAILED (an invalid sku, a price in a currency that does not exist or is archived, clientPurchasable without a price); CONFLICT when the sku is taken.
Body: name, description, price, maxOwned, clientPurchasable and metadata, all optional. null clears the description, the price or the limit; metadata replaces the whole object. Sending sku or type is a VALIDATION_FAILED. An item that ends up with clientPurchasable: true and no price is refused.
Archives the item and returns it. Inventories keep the units players own. Refused with CONFLICT (details.blockedBy.packs) while an active pack contains the item.
A pack is a bundle of currency and items that a player buys with real money. See Selling packs for how a pack is sold, and Founder packs for limited ones.
Same rules as an item sku. Unique among the packs, final.
name
string, required
The display name, 1 to 80 characters.
priceCents
integer, required
The price in euro cents, VAT included: 50 to 50,000.
description
string or null
A text of at most 500 characters.
grants
array
Currencies credited when the order is paid: { "currency", "amount", "bonus" }. amount goes to the paid part of the balance (purchasable currencies only), bonus to the bonus part. At most 10 lines.
items
array
Items granted when the order is paid: { "sku", "quantity" }, at most 50 lines. A pack needs at least one grant or one item.
badge
string or null
popular or best_value.
maxPerPlayer
integer or null
The most orders per player (a starter pack: 1), 1 to 1,000,000. null: no limit.
sortOrder
integer
The display order in the shop, ascending, from -10,000 to 10,000. Defaults to 0.
availability
object or null
The sale window, the stock and the founder flag, see below. Left out: always on sale, without limit.
status
string
draft (the default: not sold) or active (sold at once).
A new pack is a draft unless you say otherwise, so that you can check it before it is sold.
VALIDATION_FAILED with the faulty lines in details.fieldErrors (an empty pack, an unknown or archived currency or item, a paid amount in a free currency, a price out of range); CONFLICT when the sku is taken.
Body: any field of the create table except sku. A field you leave out is unchanged; grants, items and availability replace the previous value as a whole. status (draft, active or archived) is applied after the rest of the change; turning a pack active checks that every currency and item it uses is still active. If that check fails, the content change stays and the status does not move.
The price of a pack can change at any time; the orders already placed keep the price they were made at. An archived pack cannot be changed, except to bring it back with a status alone.
availability is the whole sale setting of a pack, and it replaces the previous one:
Field
Type
Description
startsAt
string or null
The first instant of sale (included), an ISO 8601 date-time with a time zone. null: on sale from the start.
endsAt
string or null
The first instant when the pack is no longer sold (excluded). null: no end.
stock
integer or null
The total units that can be sold, 1 to 1,000,000. null: unlimited. It cannot go below the units already sold.
founder
boolean
true for a founder pack.
All four fields are required in the API (the Node.js SDK fills the ones you leave out with null and false). To remove every limit, send { "startsAt": null, "endsAt": null, "stock": null, "founder": false }. In a response, availability also has sold, the units delivered so far; the public catalog shows remaining instead.
{ "packs": [ManagedPack, …] } in display order, drafts included; archived packs only with ?includeArchived=true. GET /catalog is the shop's view: it lists the active packs only.
A field is invalid, unknown or final (details.fieldErrors, one entry per field; a line of a pack's content is named by its position, such as grants.0.currency).
NOT_FOUND
Unknown code or sku in this game.
CONFLICT
A code or sku already taken (fieldErrors); a change to an archived resource; an archive or a change that an active pack or item depends on (details.blockedBy).
FORBIDDEN
A publishable key, which cannot manage the catalog.