Take a card back
Asks to take the card back. The card stays on sale for the whole notice (`takeBackNoticeHours` of `GET /partner/me`). At the end of the notice it leaves sale for good: an available card at once, a card that a buyer holds when the buyer sells it back. Then `takeBack.state` is `completed`, and the card waits for its return. If a buyer keeps the card first, `takeBack.state` is `sold`. A second request answers the first one. You get the webhook `partner-item.changed` at the request and at its completion. Errors: - 404 `PARTNER_ITEM_NOT_FOUND`: you have no card with this id. - 409 `PARTNER_ITEM_SOLD`: the card is sold. - 503 `SERVICE_UNAVAILABLE` with the header `Retry-After: 5`: a system that this request needs gave no answer. Send the same request again after 5 seconds.
Asks to take the card back. The card stays on sale for the whole notice (takeBackNoticeHours of GET /partner/me). At the end of the notice it leaves sale for good: an available card at once, a card that a buyer holds when the buyer sells it back. Then takeBack.state is completed, and the card waits for its return. If a buyer keeps the card first, takeBack.state is sold. A second request answers the first one. You get the webhook partner-item.changed at the request and at its completion.
Errors:
- 404
PARTNER_ITEM_NOT_FOUND: you have no card with this id. - 409
PARTNER_ITEM_SOLD: the card is sold. - 503
SERVICE_UNAVAILABLEwith the headerRetry-After: 5: a system that this request needs gave no answer. Send the same request again after 5 seconds.
partnerApiKeyAuthorizationBearer <token>The partner's API key.
itemId*stringThe card's id at Grail Network
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$uuidapplication/json- response
data*curl -X POST 'https://api-stg.grailnetwork.com/partner/items/497f6eca-6276-4993-bfeb-53cbbbba6f08/take-back'{ "data": { "itemId": "f11b669d-7201-4c21-88af-d85092f0c005", "reference": "string", "receivedAt": "2019-08-24T14:15:22Z", "card": { "name": "string", "setName": "string", "categoryName": "string", "number": "string", "gradeName": "string" }, "frontPictureUrl": "string", "state": "available", "marketPrice": { "amountAtomic": "string", "currency": "string" }, "priceAdjustment": "string", "price": { "amountAtomic": "string", "currency": "string" }, "pulledAt": "2019-08-24T14:15:22Z", "priceAtPull": { "amountAtomic": "string", "currency": "string" }, "buybackOfferEndsAt": "2019-08-24T14:15:22Z", "soldAt": "2019-08-24T14:15:22Z", "takeBack": { "state": "requested", "requestedAt": "2019-08-24T14:15:22Z", "noticeEndsAt": "2019-08-24T14:15:22Z", "completedAt": "2019-08-24T14:15:22Z" }, "changedAt": "2019-08-24T14:15:22Z" }}Set your webhook address PUT
Sets the address that gets your webhooks. The first address makes a secret, and this answer shows it once: keep it, because no later answer shows it. A new address keeps the secret. `null` removes the address and the secret, and the webhooks that wait end with no delivery. Grail Network checks the address again before each try. **What arrives at the address.** Grail Network posts one JSON body for each fact, signed by the rules of the Standard Webhooks specification (standardwebhooks.com). A webhook is thin: it names the fact, and you read the API for the facts themselves. The body: `{ "id": "<uuid>", "type": "<type>", "createdAt": "2026-11-24T10:00:00.000Z", "data": { … } }`. `id` is the same at each try of one webhook: keep it, and handle an `id` once. The types and their `data`: - `partner-item.changed`: `{ "itemId": "<uuid>", "reference": "7K3M9QX2G" }`. One of your cards changed: a buyer got it, its price, its sale, a take-back request or its completion. Read `GET /partner/items/{itemId}`. - `intake.ended`: `{ "intakeId": "<uuid>", "reference": "7K3M9QX2G" }`. The warehouse ended the intake of one of your slips. Read `GET /partner/intakes?reference=` and `GET /partner/items?reference=`. - `pool.created`: `{ "poolDay": "2026-11-23" }`. The pool of that UTC day gave you at least one share. Read `GET /partner/report-lines` from your last cursor. **The check of the signature.** The headers: `webhook-id` (the body's `id`), `webhook-timestamp` (Unix seconds), and `webhook-signature`: `v1,<signature>`, where the signature is the base64 of HMAC-SHA256 over the text `<webhook-id>.<webhook-timestamp>.<the raw body>`. The key of the HMAC is the bytes of the base64 after `whsec_` in your secret. Compare the signatures in constant time, and refuse a timestamp more than 5 minutes from your clock. After a new secret, the next try of every webhook is signed with the new one. **Your answer and the tries.** Answer 2xx within 10 seconds, after the check of the signature, also for a fact that you cannot place yet: keep it in a place of your own and read the API. Any other answer, or no answer, is a failed try. Grail Network tries 8 times, with these waits after a failed try: 1 minute, 5 minutes, 30 minutes, 2 hours, 5 hours, 10 hours, 10 hours. So the last try is about 27.6 hours after the first, and then the webhook has failed for good. No route sends a webhook again: a webhook is a nudge, and `GET /partner/items?changedAfter=` and `GET /partner/report-lines?after=` from your last cursors give you everything that you missed. Errors: - 400 `VALIDATION_FAILED` at `url`: the address is not `https://`, or it has more than 2,000 characters. - 409 `PARTNER_WEBHOOK_URL_INVALID`: the host of the address is a private address, or it is not found.
Changelog
How the API changes, and each change.