Packs
The packs that your shop sells, what each pack holds, and its states.
A pack has a pack price and one or more slots. Each slot gives one card. A slot has tiers: price ranges of cards, each with its chance. A pack can also have featured cards: after the slots, one more roll for each pack can give one of them.
Your shop sells two kinds of packs: Grail Network's packs that your shop uses, and your shop's own packs. A user of your shop chooses the packs, makes your own packs and enables them in the shop back office. Your server reads them.
Read your packs
GET /shop/packsWith your API key, the list holds the packs that your server can sell. Each pack:
| Field | Meaning |
|---|---|
id, name, categoryId | The pack |
version | The number of the pack's current version. A change of the pack makes a new version |
price | The pack price |
ev, minEv, maxEv | The EV of the pack at its last stock check, and the range that the EV must stay in |
inStock | true when a pull can be sold now |
state | The state, below |
slots | Each slot's position and its tiers: id, position, name, chancePpb, minPrice, maxPrice |
featuredCards | Each featured card: position, itemId, oddsPpb, available, price, and the card's names and picture |
A chance is in parts per billion: 800000000 is 80%. A slot's chances add up to exactly 1,000,000,000.
GET /shop/packs/{packId}reads one pack. Each tier then hasitemCount: the cards of the pack in its range now.GET /shop/packs/{packId}/itemslists the cards in the pack now, the most expensive first.tierIdfilters one tier.GET /shop/packs/{packId}/versions/{number}reads a past version, for example the version of a pull (packVersion).- The filters of the list:
categoryId,inStock,state,pageandpageSize.
The states
state | Meaning | A pull |
|---|---|---|
on_sale | Enabled and in stock | Sold |
off_sale | Enabled, but not in stock now. It comes back by itself when the pack has its cards again | 409 PACK_OUT_OF_STOCK |
disabled | Not enabled, or refused by Grail Network's staff | 409 PACK_OUT_OF_STOCK |
waiting_for_approval | Your shop's own pack waits for Grail Network's approval | 409 PACK_OUT_OF_STOCK |
archived | Archived. It is out of your lists | 404 PACK_NOT_FOUND |
Your shop's own pack needs Grail Network's approval before its first sale, and again after a change of its pack price,
its tiers or its featured cards. Until the approval, a pull of it gets 409 PACK_OUT_OF_STOCK.
Show a pack to your buyers only when its state is on_sale. Read the pack again before you show its price: a pull
with an old price gets 409 PULL_PRICE_CHANGED.