Skip to Content
Grail Network

Purchases of packs

A commitment, then a pull of 1 to 5 packs, paid from your balance.

A purchase is a pull. One pull opens 1 to 5 packs of one pack, for one buyer. It is all or nothing: either every pack opens, or none does. The pack price of each pack comes from your shop's balance at Grail Network, in one debit.

A pull has two steps:

  1. A commitment. Grail Network makes a secret server seed, and gives you only its SHA-256 hash.
  2. The pull. You name the commitment and send your own client seed. Grail Network picks the cards with both seeds, and reveals the server seed in the answer.

The commitment proves that Grail Network chose its seed before it knew yours. See Check a pull.

1. Get a commitment

POST /shop/pull-commitments

No body. The answer (201):

{
  "data": {
    "id": "019a8c11-2b3c-7d4e-8f5a-6b7c8d9e77aa",
    "serverSeedHash": "5be0c2a1...",
    "createdAt": "2026-11-25T09:59:58.010Z"
  }
}

Keep the id and the serverSeedHash. You can show the hash to your buyer before the pull. One commitment serves one pull.

2. Send the pull

POST /shop/pulls
{
  "requestId": "order-88412",
  "packId": "019a8b2c-0000-7000-8000-000000000101",
  "buyerId": "buyer-5521",
  "packCount": 3,
  "packPrice": { "amountAtomic": "10400", "currency": "USD" },
  "commitmentId": "019a8c11-2b3c-7d4e-8f5a-6b7c8d9e77aa",
  "clientSeed": "b7e1c2d4-5a6f-4e3b-9c8d-1f2a3b4c5d6e"
}
FieldMeaning
requestIdYour own id of this purchase, such as your order's id, 1 to 200 characters. A repeat with the same id and the same body gets the same pull
packIdThe pack
buyerIdYour own id of the buyer, 1 to 200 characters. Grail Network stores no name
packCount1 to 5
packPriceThe pack price that your buyer saw. If the price changed, the pull is refused, and nothing is debited
commitmentIdThe commitment of step 1
clientSeedYour own random text, such as a new UUID: 1 to 128 printable ASCII characters, with no space and no colon. Grail Network cannot know it before the pull

The amount of the pull is packCount × the pack price. 3 packs at $104.00 are one debit of $312.00.

The answer

A completed pull (201), with one pack of three shown:

{
  "data": {
    "id": "019a8c12-5f60-7a3e-9f00-2b1c4d5e6f70",
    "requestId": "order-88412",
    "packId": "019a8b2c-0000-7000-8000-000000000101",
    "packVersion": 7,
    "buyerId": "buyer-5521",
    "packCount": 3,
    "packPrice": { "amountAtomic": "10400", "currency": "USD" },
    "amount": { "amountAtomic": "31200", "currency": "USD" },
    "state": "completed",
    "reason": null,
    "createdAt": "2026-11-25T10:00:00.120Z",
    "buybackOfferEndsAt": "2026-12-25T10:00:00.480Z",
    "serverSeedHash": "5be0c2a1...",
    "serverSeed": "0c9a71fe...",
    "clientSeed": "b7e1c2d4-5a6f-4e3b-9c8d-1f2a3b4c5d6e",
    "packs": [
      {
        "index": 1,
        "cards": [
          {
            "slotPosition": 1,
            "tierName": "Common",
            "holdingId": "019a8c12-6a70-7b8c-9d00-1e2f3a4b5c6d",
            "priceAtHold": { "amountAtomic": "4500", "currency": "USD" },
            "payout": { "amountAtomic": "4050", "currency": "USD" },
            "item": {
              "id": "019a8b90-0c1d-7e2f-8a3b-4c5d6e7f8091",
              "cardName": "Eevee",
              "cardNumber": "133",
              "setName": "Base Set",
              "categoryName": "Pokémon",
              "gradeName": "PSA 10",
              "conditionName": null,
              "frontPictureUrl": null
            }
          }
        ],
        "featuredRoll": "none",
        "featuredCard": null
      }
    ]
  }
}
  • Each card is a holding of the buyer: keep its holdingId.
  • priceAtHold is the card price at the pull. payout is what the buyer gets for a sale back.
  • buybackOfferEndsAt is the end of the offer to sell the cards back.
  • featuredRoll is hit, unavailable or none when the pack has featured cards, and null when it has none. featuredCard is filled only for hit.
  • frontPictureUrl is null when the card has no picture of its own. Show your own picture for it.
  • serverSeed is filled only when the pull is completed.

The states

A pull is started, then completed or failed. The answer of POST /shop/pulls gives the final state. Read a pull again with GET /shop/pulls/{pullId}, and your list with GET /shop/pulls (filters buyerId, packId, state, requestId, from, to).

The refusals

The first checks fail before Grail Network uses the commitment. Send the same commitment again after you correct the request.

CodeStatusWhenMoneyThe commitment
VALIDATION_FAILED400packCount is not 1 to 5, or clientSeed is not validNothingNot used
PULL_REQUEST_ID_REUSED409The requestId exists with another bodyNothing–
PACK_NOT_FOUND404No pack that your shop can see has this idNothingNot used
PACK_NOT_USED409Your shop can see the pack, but does not use itNothingNot used
PACK_OUT_OF_STOCK409The pack cannot be sold nowNothingNot used
PULL_PRICE_CHANGED409packPrice is not the pack price nowNothingNot used
PULL_COMMITMENT_NOT_FOUND404Your shop has no commitment with this idNothing–
PULL_COMMITMENT_USED409Another pull used the commitmentNothing–
PULL_NOT_ENOUGH_CARDS409A slot found no free cardNothing, or a debit and its refundUsed
PULL_BALANCE_TOO_LOW409Your balance is lower than the amountNothingUsed
PULL_FAILED503A part of Grail Network gave no answerNothing, or a debit and its refundUsed
PULL_IN_PROGRESS409The pull is still started. It ends within 2 minutes–Used

A failed pull stays failed. A repeat of its request gets its first error again. To try again, get a new commitment and send a new requestId.

The money

What happensYour balance list
The pull completesOne debit, such as −$312.00
The balance is too lowNo row
A slot finds no free card at the pickNo row
A card is taken by another pull in the same moment, with no free card left−$312.00, then +$312.00
A part of Grail Network gives no answer−$312.00 and +$312.00, or one row of $0.00

Grail Network writes the refund itself. Your server sends nothing for it.

On this page