# Catalog management API

> 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](/docs/api/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](/docs/sdk/server) (0.4.0) have these operations as `currencies`, `items` and `packs`; the examples on this page continue from the [setup](/docs/api#setup-for-the-examples).

> [!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.

## How it works

- **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.

The objects are the [catalog objects](/docs/api/objects#catalog) plus `status`, `createdAt` and `updatedAt`: see [ManagedCurrency, ManagedItem and ManagedPack](/docs/api/objects#managedcurrency-manageditem-and-managedpack).

## Currencies

### Create a currency

```endpoint
POST /currencies
```

**Authentication:** secret key. **Idempotency:** not needed (the code is the key).

| Field | Type | Description |
|---|---|---|
| `code` | string, required | 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. |

<!-- tabs:start -->
```bash tab="curl"
curl "https://gamecoin.apilow.com/api/v1/currencies" \
  -H "Authorization: Bearer $GAMECOIN_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "code": "rubies", "name": "Rubies", "purchasable": true }'
```
```javascript tab="Node.js"
const currency = await gamecoin.currencies.create({ code: "rubies", name: "Rubies", purchasable: true });
console.log(currency.code, currency.status); // "rubies" "active"
```
```python tab="Python"
currency = gamecoin.currencies.create(code="rubies", name="Rubies", purchasable=True)
print(currency.code, currency.status)  # rubies active
```
```php tab="PHP"
$currency = $gamecoin->currencies->create(['code' => 'rubies', 'name' => 'Rubies', 'purchasable' => true]);
echo $currency->code, ' ', $currency->status, "\n"; // rubies active
```
```go tab="Go"
currency, err := client.Currencies.Create(ctx, gamecoin.CreateCurrencyParams{Code: "rubies", Name: "Rubies", Purchasable: gamecoin.Ptr(true)})
check(err)
fmt.Println(currency.Code, currency.Status) // rubies active
```
```csharp tab="C#"
var currency = await gamecoin.Currencies.CreateAsync(new CreateCurrencyRequest { Code = "rubies", Name = "Rubies", Purchasable = true });
Console.WriteLine($"{currency.Code} {currency.Status}"); // rubies active
```
<!-- tabs:end -->

**Response** `200 OK`: a [ManagedCurrency](/docs/api/objects#managedcurrency-manageditem-and-managedpack).

```json
{
  "code": "rubies",
  "name": "Rubies",
  "purchasable": true,
  "status": "active",
  "createdAt": "2026-10-20T14:28:21.404Z",
  "updatedAt": "2026-10-20T14:28:21.404Z"
}
```

**Errors:** `VALIDATION_FAILED` for an invalid code or name; `CONFLICT` when the code is taken.

### Change a currency

```endpoint
PATCH /currencies/{code}
```

**Authentication:** secret key. **Body:** `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`.

<!-- tabs:start -->
```bash tab="curl"
curl -X PATCH "https://gamecoin.apilow.com/api/v1/currencies/rubies" \
  -H "Authorization: Bearer $GAMECOIN_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Red rubies" }'
```
```javascript tab="Node.js"
const renamed = await gamecoin.currencies.update("rubies", { name: "Red rubies" });
```
```python tab="Python"
renamed = gamecoin.currencies.update("rubies", name="Red rubies")
```
```php tab="PHP"
$renamed = $gamecoin->currencies->update('rubies', ['name' => 'Red rubies']);
```
```go tab="Go"
renamed, err := client.Currencies.Update(ctx, "rubies", &gamecoin.UpdateCurrencyParams{Name: gamecoin.Ptr("Red rubies")})
check(err)
```
```csharp tab="C#"
var renamed = await gamecoin.Currencies.UpdateAsync("rubies", new UpdateCurrencyRequest { Name = "Red rubies" });
```
<!-- tabs:end -->

### Archive a currency

```endpoint
DELETE /currencies/{code}
```

**Authentication:** secret key. 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.

<!-- tabs:start -->
```bash tab="curl"
curl -X DELETE "https://gamecoin.apilow.com/api/v1/currencies/rubies" \
  -H "Authorization: Bearer $GAMECOIN_SECRET_KEY"
```
```javascript tab="Node.js"
const archived = await gamecoin.currencies.archive("rubies");
console.log(archived.status); // "archived"
```
```python tab="Python"
archived = gamecoin.currencies.archive("rubies")
print(archived.status)  # archived
```
```php tab="PHP"
$archived = $gamecoin->currencies->archive('rubies');
echo $archived->status, "\n"; // archived
```
```go tab="Go"
archived, err := client.Currencies.Archive(ctx, "rubies")
check(err)
fmt.Println(archived.Status) // archived
```
```csharp tab="C#"
var archived = await gamecoin.Currencies.ArchiveAsync("rubies");
Console.WriteLine(archived.Status); // archived
```
<!-- tabs:end -->

### Read a currency

```endpoint
GET /currencies/{code}
```

Returns one currency, archived ones included; `NOT_FOUND` for an unknown code.

<!-- tabs:start -->
```bash tab="curl"
curl "https://gamecoin.apilow.com/api/v1/currencies/rubies" \
  -H "Authorization: Bearer $GAMECOIN_SECRET_KEY"
```
```javascript tab="Node.js"
const rubies = await gamecoin.currencies.get("rubies");
```
```python tab="Python"
rubies = gamecoin.currencies.get("rubies")
```
```php tab="PHP"
$rubies = $gamecoin->currencies->get('rubies');
```
```go tab="Go"
rubies, err := client.Currencies.Get(ctx, "rubies")
check(err)
```
```csharp tab="C#"
var rubies = await gamecoin.Currencies.GetAsync("rubies");
```
<!-- tabs:end -->
### List currencies

```endpoint
GET /currencies
```

Returns `{ "currencies": [ManagedCurrency, …] }`, oldest first. Archived currencies are left out unless you add `?includeArchived=true`.

<!-- tabs:start -->
```bash tab="curl"
curl "https://gamecoin.apilow.com/api/v1/currencies?includeArchived=true" \
  -H "Authorization: Bearer $GAMECOIN_SECRET_KEY"
```
```javascript tab="Node.js"
const everything = await gamecoin.currencies.list({ includeArchived: true });
```
```python tab="Python"
everything = gamecoin.currencies.list(include_archived=True)
```
```php tab="PHP"
$everything = $gamecoin->currencies->list(['include_archived' => true]);
```
```go tab="Go"
everything, err := client.Currencies.List(ctx, &gamecoin.ListParams{IncludeArchived: true})
check(err)
```
```csharp tab="C#"
var everything = await gamecoin.Currencies.ListAsync(includeArchived: true);
```
<!-- tabs:end -->

## Items

### Create an item

```endpoint
POST /items
```

**Authentication:** secret key. **Idempotency:** not needed (the sku is the key).

| Field | Type | Description |
|---|---|---|
| `sku` | string, required | 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. |

<!-- tabs:start -->
```bash tab="curl"
curl "https://gamecoin.apilow.com/api/v1/items" \
  -H "Authorization: Bearer $GAMECOIN_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "sku": "elixir",
    "name": "Elixir",
    "type": "consumable",
    "price": { "currency": "gems", "amount": 15 },
    "clientPurchasable": true,
    "metadata": { "heal": "30" }
  }'
```
```javascript tab="Node.js"
const elixir = await gamecoin.items.create({
  sku: "elixir",
  name: "Elixir",
  type: "consumable",
  price: { currency: "gems", amount: 15 },
  clientPurchasable: true,
  metadata: { heal: "30" },
});
```
```python tab="Python"
elixir = gamecoin.items.create(
    sku="elixir",
    name="Elixir",
    type="consumable",
    price={"currency": "gems", "amount": 15},
    client_purchasable=True,
    metadata={"heal": "30"},
)
```
```php tab="PHP"
$elixir = $gamecoin->items->create([
    'sku' => 'elixir',
    'name' => 'Elixir',
    'type' => 'consumable',
    'price' => ['currency' => 'gems', 'amount' => 15],
    'client_purchasable' => true,
    'metadata' => ['heal' => '30'],
]);
```
```go tab="Go"
elixir, err := client.Items.Create(ctx, gamecoin.CreateItemParams{
	SKU: "elixir", Name: "Elixir", Type: gamecoin.ItemConsumable,
	Price: &gamecoin.Price{Currency: "gems", Amount: 15}, ClientPurchasable: true,
	Metadata: map[string]string{"heal": "30"},
})
check(err)
```
```csharp tab="C#"
var elixir = await gamecoin.Items.CreateAsync(new CreateItemRequest
{
    Sku = "elixir",
    Name = "Elixir",
    Type = ItemType.Consumable,
    Price = new ItemPrice { Currency = "gems", Amount = 15 },
    ClientPurchasable = true,
    Metadata = new Dictionary<string, string> { ["heal"] = "30" },
});
```
<!-- tabs:end -->

**Response** `200 OK`: a [ManagedItem](/docs/api/objects#managedcurrency-manageditem-and-managedpack).

```json
{
  "sku": "elixir",
  "name": "Elixir",
  "description": null,
  "type": "consumable",
  "price": { "currency": "gems", "amount": 15 },
  "maxOwned": null,
  "clientPurchasable": true,
  "metadata": { "heal": "30" },
  "status": "active",
  "createdAt": "2026-10-20T14:28:21.404Z",
  "updatedAt": "2026-10-20T14:28:21.404Z"
}
```

**Errors:** `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.

### Change an item

```endpoint
PATCH /items/{sku}
```

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.

<!-- tabs:start -->
```bash tab="curl"
curl -X PATCH "https://gamecoin.apilow.com/api/v1/items/elixir" \
  -H "Authorization: Bearer $GAMECOIN_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "price": { "currency": "gems", "amount": 25 } }'
```
```javascript tab="Node.js"
await gamecoin.items.update("elixir", { price: { currency: "gems", amount: 25 } });
await gamecoin.items.update("elixir", { price: null, clientPurchasable: false }); // no longer sold for currency
```
```python tab="Python"
gamecoin.items.update("elixir", price={"currency": "gems", "amount": 25})
gamecoin.items.update("elixir", price=None, client_purchasable=False)  # no longer sold for currency
```
```php tab="PHP"
$gamecoin->items->update('elixir', ['price' => ['currency' => 'gems', 'amount' => 25]]);
$gamecoin->items->update('elixir', ['price' => null, 'client_purchasable' => false]); // no longer sold for currency
```
```go tab="Go"
_, err = client.Items.Update(ctx, "elixir", &gamecoin.UpdateItemParams{Price: &gamecoin.Price{Currency: "gems", Amount: 25}})
check(err)
_, err = client.Items.Update(ctx, "elixir", &gamecoin.UpdateItemParams{Clear: []gamecoin.ItemField{gamecoin.ItemFieldPrice}, ClientPurchasable: gamecoin.Ptr(false)}) // no longer sold for currency
check(err)
```
```csharp tab="C#"
await gamecoin.Items.UpdateAsync("elixir", new UpdateItemRequest { Price = new ItemPrice { Currency = "gems", Amount = 25 } });
await gamecoin.Items.UpdateAsync("elixir", new UpdateItemRequest { Clear = ItemFields.Price, ClientPurchasable = false }); // no longer sold for currency
```
<!-- tabs:end -->
### Archive an item

```endpoint
DELETE /items/{sku}
```

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.

<!-- tabs:start -->
```bash tab="curl"
curl -X DELETE "https://gamecoin.apilow.com/api/v1/items/elixir" \
  -H "Authorization: Bearer $GAMECOIN_SECRET_KEY"
```
```javascript tab="Node.js"
await gamecoin.items.archive("elixir");
```
```python tab="Python"
gamecoin.items.archive("elixir")
```
```php tab="PHP"
$gamecoin->items->archive('elixir');
```
```go tab="Go"
_, err = client.Items.Archive(ctx, "elixir")
check(err)
```
```csharp tab="C#"
await gamecoin.Items.ArchiveAsync("elixir");
```
<!-- tabs:end -->
### Read an item

```endpoint
GET /items/{sku}
```

Returns one item, archived ones included; `NOT_FOUND` for an unknown sku.

<!-- tabs:start -->
```bash tab="curl"
curl "https://gamecoin.apilow.com/api/v1/items/elixir" \
  -H "Authorization: Bearer $GAMECOIN_SECRET_KEY"
```
```javascript tab="Node.js"
const elixir = await gamecoin.items.get("elixir");
```
```python tab="Python"
elixir = gamecoin.items.get("elixir")
```
```php tab="PHP"
$elixir = $gamecoin->items->get('elixir');
```
```go tab="Go"
elixir, err := client.Items.Get(ctx, "elixir")
check(err)
```
```csharp tab="C#"
var elixir = await gamecoin.Items.GetAsync("elixir");
```
<!-- tabs:end -->
### List items

```endpoint
GET /items
```

Same as for currencies: `{ "items": [ManagedItem, …] }`, archived ones with `?includeArchived=true`.

<!-- tabs:start -->
```bash tab="curl"
curl "https://gamecoin.apilow.com/api/v1/items?includeArchived=true" \
  -H "Authorization: Bearer $GAMECOIN_SECRET_KEY"
```
```javascript tab="Node.js"
const items = await gamecoin.items.list({ includeArchived: true });
```
```python tab="Python"
items = gamecoin.items.list(include_archived=True)
```
```php tab="PHP"
$items = $gamecoin->items->list(['include_archived' => true]);
```
```go tab="Go"
items, err := client.Items.List(ctx, &gamecoin.ListParams{IncludeArchived: true})
check(err)
```
```csharp tab="C#"
var items = await gamecoin.Items.ListAsync(includeArchived: true);
```
<!-- tabs:end -->

## Packs

A pack is a bundle of currency and items that a player buys with real money. See [Selling packs](/docs/guides/selling-packs) for how a pack is sold, and [Founder packs](/docs/guides/founder-packs) for limited ones.

### Create a pack

```endpoint
POST /packs
```

**Authentication:** secret key. **Idempotency:** not needed (the sku is the key).

| Field | Type | Description |
|---|---|---|
| `sku` | string, required | 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](#availability). 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.

<!-- tabs:start -->
```bash tab="curl"
curl "https://gamecoin.apilow.com/api/v1/packs" \
  -H "Authorization: Bearer $GAMECOIN_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "sku": "mega",
    "name": "Mega pack",
    "priceCents": 999,
    "grants": [{ "currency": "gems", "amount": 1200, "bonus": 100 }],
    "items": [{ "sku": "potion", "quantity": 2 }],
    "badge": "best_value"
  }'
```
```javascript tab="Node.js"
const pack = await gamecoin.packs.create({
  sku: "mega",
  name: "Mega pack",
  priceCents: 999,
  grants: [{ currency: "gems", amount: 1200, bonus: 100 }],
  items: [{ sku: "potion", quantity: 2 }],
  badge: "best_value",
});
console.log(pack.status); // "draft": it is not in GET /catalog yet
```
```python tab="Python"
pack = gamecoin.packs.create(
    sku="mega",
    name="Mega pack",
    price_cents=999,
    grants=[{"currency": "gems", "amount": 1200, "bonus": 100}],
    items=[{"sku": "potion", "quantity": 2}],
    badge="best_value",
)
print(pack.status)  # draft: it is not in GET /catalog yet
```
```php tab="PHP"
$pack = $gamecoin->packs->create([
    'sku' => 'mega',
    'name' => 'Mega pack',
    'price_cents' => 999,
    'grants' => [['currency' => 'gems', 'amount' => 1200, 'bonus' => 100]],
    'items' => [['sku' => 'potion', 'quantity' => 2]],
    'badge' => 'best_value',
]);
echo $pack->status, "\n"; // draft: it is not in GET /catalog yet
```
```go tab="Go"
pack, err := client.Packs.Create(ctx, gamecoin.CreatePackParams{
	SKU: "mega", Name: "Mega pack", PriceCents: 999,
	Grants: []gamecoin.PackGrant{{Currency: "gems", Amount: 1200, Bonus: 100}},
	Items:  []gamecoin.PackItem{{SKU: "potion", Quantity: 2}},
	Badge:  "best_value",
})
check(err)
fmt.Println(pack.Status) // draft: it is not in GET /catalog yet
```
```csharp tab="C#"
var pack = await gamecoin.Packs.CreateAsync(new CreatePackRequest
{
    Sku = "mega",
    Name = "Mega pack",
    PriceCents = 999,
    Grants = new[] { new PackGrant { Currency = "gems", Amount = 1200, Bonus = 100 } },
    Items = new[] { new PackItem { Sku = "potion", Quantity = 2 } },
    Badge = "best_value",
});
Console.WriteLine(pack.Status); // draft: it is not in GET /catalog yet
```
<!-- tabs:end -->

**Response** `200 OK`: a [ManagedPack](/docs/api/objects#managedcurrency-manageditem-and-managedpack).

```json
{
  "sku": "mega",
  "name": "Mega pack",
  "description": null,
  "priceCents": 999,
  "currency": "EUR",
  "grants": [{ "currency": "gems", "amount": 1200, "bonus": 100 }],
  "items": [{ "sku": "potion", "quantity": 2 }],
  "badge": "best_value",
  "maxPerPlayer": null,
  "sortOrder": 0,
  "status": "draft",
  "availability": null,
  "createdAt": "2026-10-20T14:28:21.404Z",
  "updatedAt": "2026-10-20T14:28:21.404Z"
}
```

**Errors:** `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.

### Change a pack

```endpoint
PATCH /packs/{sku}
```

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.

<!-- tabs:start -->
```bash tab="curl"
curl -X PATCH "https://gamecoin.apilow.com/api/v1/packs/mega" \
  -H "Authorization: Bearer $GAMECOIN_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "priceCents": 1099, "status": "active" }'
```
```javascript tab="Node.js"
const live = await gamecoin.packs.update("mega", { priceCents: 1099, status: "active" });
console.log(live.status); // "active": players can buy it now
```
```python tab="Python"
live = gamecoin.packs.update("mega", price_cents=1099, status="active")
print(live.status)  # active: players can buy it now
```
```php tab="PHP"
$live = $gamecoin->packs->update('mega', ['price_cents' => 1099, 'status' => 'active']);
echo $live->status, "\n"; // active: players can buy it now
```
```go tab="Go"
live, err := client.Packs.Update(ctx, "mega", &gamecoin.UpdatePackParams{PriceCents: gamecoin.Ptr(int64(1099)), Status: gamecoin.PackActive})
check(err)
fmt.Println(live.Status) // active: players can buy it now
```
```csharp tab="C#"
var live = await gamecoin.Packs.UpdateAsync("mega", new UpdatePackRequest { PriceCents = 1099, Status = PackStatus.Active });
Console.WriteLine(live.Status); // active: players can buy it now
```
<!-- tabs:end -->

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

`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](/docs/api/catalog) shows `remaining` instead.

<!-- tabs:start -->
```bash tab="curl"
curl -X PATCH "https://gamecoin.apilow.com/api/v1/packs/mega" \
  -H "Authorization: Bearer $GAMECOIN_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "availability": { "startsAt": "2026-11-01T00:00:00Z", "endsAt": "2026-12-01T00:00:00Z", "stock": 500, "founder": true } }'
```
```javascript tab="Node.js"
await gamecoin.packs.update("mega", {
  availability: { startsAt: new Date("2026-11-01T00:00:00Z"), endsAt: "2026-12-01T00:00:00Z", stock: 500, founder: true },
});
```
```python tab="Python"
gamecoin.packs.update(
    "mega",
    availability={"starts_at": datetime(2026, 11, 1, tzinfo=timezone.utc), "ends_at": "2026-12-01T00:00:00Z", "stock": 500, "founder": True},
)
```
```php tab="PHP"
$gamecoin->packs->update('mega', [
    'availability' => ['starts_at' => new DateTimeImmutable('2026-11-01T00:00:00Z'), 'ends_at' => '2026-12-01T00:00:00Z', 'stock' => 500, 'founder' => true],
]);
```
```go tab="Go"
start := time.Date(2026, 11, 1, 0, 0, 0, 0, time.UTC)
end := time.Date(2026, 12, 1, 0, 0, 0, 0, time.UTC)
_, err = client.Packs.Update(ctx, "mega", &gamecoin.UpdatePackParams{
	Availability: &gamecoin.PackAvailabilityParams{StartsAt: &start, EndsAt: &end, Stock: gamecoin.Ptr(int64(500)), Founder: true},
})
check(err)
```
```csharp tab="C#"
await gamecoin.Packs.UpdateAsync("mega", new UpdatePackRequest
{
    Availability = new PackAvailabilityRequest
    {
        StartsAt = new DateTimeOffset(2026, 11, 1, 0, 0, 0, TimeSpan.Zero),
        EndsAt = new DateTimeOffset(2026, 12, 1, 0, 0, 0, TimeSpan.Zero),
        Stock = 500,
        Founder = true,
    },
});
```
<!-- tabs:end -->

### Archive a pack

```endpoint
DELETE /packs/{sku}
```

Archives the pack (the same as setting `status` to `archived`) and returns it. The pack is no longer sold; the orders already placed are unaffected.

<!-- tabs:start -->
```bash tab="curl"
curl -X DELETE "https://gamecoin.apilow.com/api/v1/packs/mega" \
  -H "Authorization: Bearer $GAMECOIN_SECRET_KEY"
```
```javascript tab="Node.js"
await gamecoin.packs.archive("mega"); // nothing is deleted
```
```python tab="Python"
gamecoin.packs.archive("mega")  # nothing is deleted
```
```php tab="PHP"
$gamecoin->packs->archive('mega'); // nothing is deleted
```
```go tab="Go"
_, err = client.Packs.Archive(ctx, "mega") // nothing is deleted
check(err)
```
```csharp tab="C#"
await gamecoin.Packs.ArchiveAsync("mega"); // nothing is deleted
```
<!-- tabs:end -->
### Read a pack

```endpoint
GET /packs/{sku}
```

Returns one pack with its `status` and `availability`, archived ones included; `NOT_FOUND` for an unknown sku.

<!-- tabs:start -->
```bash tab="curl"
curl "https://gamecoin.apilow.com/api/v1/packs/mega" \
  -H "Authorization: Bearer $GAMECOIN_SECRET_KEY"
```
```javascript tab="Node.js"
const mega = await gamecoin.packs.get("mega");
```
```python tab="Python"
mega = gamecoin.packs.get("mega")
```
```php tab="PHP"
$mega = $gamecoin->packs->get('mega');
```
```go tab="Go"
mega, err := client.Packs.Get(ctx, "mega")
check(err)
```
```csharp tab="C#"
var mega = await gamecoin.Packs.GetAsync("mega");
```
<!-- tabs:end -->
### List packs

```endpoint
GET /packs
```

`{ "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.

<!-- tabs:start -->
```bash tab="curl"
curl "https://gamecoin.apilow.com/api/v1/packs?includeArchived=true" \
  -H "Authorization: Bearer $GAMECOIN_SECRET_KEY"
```
```javascript tab="Node.js"
const everything = await gamecoin.packs.list({ includeArchived: true });
```
```python tab="Python"
everything = gamecoin.packs.list(include_archived=True)
```
```php tab="PHP"
$everything = $gamecoin->packs->list(['include_archived' => true]);
```
```go tab="Go"
everything, err := client.Packs.List(ctx, &gamecoin.ListParams{IncludeArchived: true})
check(err)
```
```csharp tab="C#"
var everything = await gamecoin.Packs.ListAsync(includeArchived: true);
```
<!-- tabs:end -->

## Errors

| Code | When |
|---|---|
| `VALIDATION_FAILED` | 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. |

See also the [errors common to every operation](/docs/api#errors-common-to-every-operation).
