Skip to Content
Grail Network
API reference

List the intakes of a slip

The intakes of one of your slips that ended, the newest end first. A parcel comes with a slip, and the slip code is `<your code>:<reference>`, such as `PRT:7K3M9QX2G`. Send only the reference. Each intake gives how many cards the warehouse took in (`itemCount`), and each refused card with its reason as a text. A refused card comes with no picture, and its `id` is no card of yours. When to read it: at the webhook `intake.ended`, which names the intake and the reference. Then read the cards that the warehouse took in with `GET /partner/items?reference=`: they are there before the webhook goes. An empty list: no intake of this reference has ended yet, or the reference names no slip of yours. The last character of a reference is the check character of the whole slip code, so a typo, or another partner's reference, names no slip of yours and gives an empty list too. Errors: - 400 `VALIDATION_FAILED` at `reference`: not 6 to 20 characters of the digits 0 to 9 and the capital letters A to Z without I, L, O and U. - 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.

GET
/partner/intakes

The intakes of one of your slips that ended, the newest end first. A parcel comes with a slip, and the slip code is <your code>:<reference>, such as PRT:7K3M9QX2G. Send only the reference. Each intake gives how many cards the warehouse took in (itemCount), and each refused card with its reason as a text. A refused card comes with no picture, and its id is no card of yours.

When to read it: at the webhook intake.ended, which names the intake and the reference. Then read the cards that the warehouse took in with GET /partner/items?reference=: they are there before the webhook goes.

An empty list: no intake of this reference has ended yet, or the reference names no slip of yours. The last character of a reference is the check character of the whole slip code, so a typo, or another partner's reference, names no slip of yours and gives an empty list too.

Errors:

  • 400 VALIDATION_FAILED at reference: not 6 to 20 characters of the digits 0 to 9 and the capital letters A to Z without I, L, O and U.
  • 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.

Authorization

partnerApiKey
headerAuthorizationBearer <token>

The partner's API key.

Query Parameters

reference*string

The slip's reference, such as 7K3M9QX2G

Match^[0-9A-HJKMNP-TV-Z]{6,20}$

Response Body

application/json
  1. response
data*array<>
Example Request
curl -X GET 'https://api-stg.grailnetwork.com/partner/intakes?reference=string'
Example Response
{  "data": [    {      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "reference": "string",      "state": "ended",      "startedAt": "2019-08-24T14:15:22Z",      "endedAt": "2019-08-24T14:15:22Z",      "itemCount": 0,      "refusedCards": [        {          "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",          "note": "string"        }      ]    }  ]}

Read your webhook GET

Your webhook address and the time of its secret. The secret itself is always null here: it shows only in the answer of the call that made it.

List your cards that changed GET

Your cards, sorted by the time of their last change (`changedAt`), the oldest first: all of them, or those that changed after `changedAfter`, of one slip `reference` when you give it. After the webhook `intake.ended`, `GET /partner/items?reference=7K3M9QX2G` gives every card of that intake at once. How to read the list to its end: - The page has `limit` cards, and the `changedAt` of its last card is not later than the time in `nextCursor`: read the next page at once with `changedAfter=<nextCursor>`. - The page has `limit` cards, and its last card is newer than `nextCursor`: the page holds the newest changes, and the cursor waits 60 seconds behind now. Wait 60 seconds before the next read: a read before that gives the same page again. - The page has fewer than `limit` cards: you have every change to now. Read again with `nextCursor` at your own pace, or at the next webhook. You can see a card of the last 60 seconds again at your next read. Keep the answer with the newest `changedAt`: a repeat changes nothing. Errors: - 400 `VALIDATION_FAILED`: `changedAfter` is neither a `nextCursor` nor an RFC 3339 time, `reference` is not a slip reference, or `limit` is not from 1 to 500. - 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.