Set your webhook address
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.
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. ReadGET /partner/items/{itemId}.intake.ended:{ "intakeId": "<uuid>", "reference": "7K3M9QX2G" }. The warehouse ended the intake of one of your slips. ReadGET /partner/intakes?reference=andGET /partner/items?reference=.pool.created:{ "poolDay": "2026-11-23" }. The pool of that UTC day gave you at least one share. ReadGET /partner/report-linesfrom 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_FAILEDaturl: the address is nothttps://, 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.
partnerApiKeyAuthorizationBearer <token>The partner's API key.
application/json- body
url*|The new address, https://, at most 2,000 characters. Null removes the address and the secret, and the waiting webhooks end
urilength <= 2000application/json- response
data*curl -X PUT 'https://api-stg.grailnetwork.com/partner/webhook' \ -H 'Content-Type: application/json' \ -d '{ "url": "http://example.com"}'{ "data": { "url": "string", "secretMadeAt": "2019-08-24T14:15:22Z", "secret": "string" }}Set the price adjustment of a card PATCH
Sets the price of the card in relation to its market price: from "-0.10" (10% below) to "0.10" (10% above), with at most four decimals. A card goes on sale in packs when it has a price adjustment and a market price. The same value again changes nothing. No money moves. Errors: - 400 `VALIDATION_FAILED` at `priceAdjustment`: not a decimal with at most four decimals, or outside the range. - 404 `PARTNER_ITEM_NOT_FOUND`: you have no card with this id. - 409 `PARTNER_ITEM_TAKEN_BACK`: the card has a take-back request, so its price stays as it is. - 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.
Take a card back POST
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.