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:
- A commitment. Grail Network makes a secret server seed, and gives you only its SHA-256 hash.
- 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-commitmentsNo 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"
}| Field | Meaning |
|---|---|
requestId | Your 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 |
packId | The pack |
buyerId | Your own id of the buyer, 1 to 200 characters. Grail Network stores no name |
packCount | 1 to 5 |
packPrice | The pack price that your buyer saw. If the price changed, the pull is refused, and nothing is debited |
commitmentId | The commitment of step 1 |
clientSeed | Your 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. priceAtHoldis the card price at the pull.payoutis what the buyer gets for a sale back.buybackOfferEndsAtis the end of the offer to sell the cards back.featuredRollishit,unavailableornonewhen the pack has featured cards, andnullwhen it has none.featuredCardis filled only forhit.frontPictureUrlisnullwhen the card has no picture of its own. Show your own picture for it.serverSeedis filled only when the pull iscompleted.
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.
| Code | Status | When | Money | The commitment |
|---|---|---|---|---|
VALIDATION_FAILED | 400 | packCount is not 1 to 5, or clientSeed is not valid | Nothing | Not used |
PULL_REQUEST_ID_REUSED | 409 | The requestId exists with another body | Nothing | – |
PACK_NOT_FOUND | 404 | No pack that your shop can see has this id | Nothing | Not used |
PACK_NOT_USED | 409 | Your shop can see the pack, but does not use it | Nothing | Not used |
PACK_OUT_OF_STOCK | 409 | The pack cannot be sold now | Nothing | Not used |
PULL_PRICE_CHANGED | 409 | packPrice is not the pack price now | Nothing | Not used |
PULL_COMMITMENT_NOT_FOUND | 404 | Your shop has no commitment with this id | Nothing | – |
PULL_COMMITMENT_USED | 409 | Another pull used the commitment | Nothing | – |
PULL_NOT_ENOUGH_CARDS | 409 | A slot found no free card | Nothing, or a debit and its refund | Used |
PULL_BALANCE_TOO_LOW | 409 | Your balance is lower than the amount | Nothing | Used |
PULL_FAILED | 503 | A part of Grail Network gave no answer | Nothing, or a debit and its refund | Used |
PULL_IN_PROGRESS | 409 | The 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 happens | Your balance list |
|---|---|
| The pull completes | One debit, such as −$312.00 |
| The balance is too low | No row |
| A slot finds no free card at the pick | No 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.