Testing
How you test your system on staging with a test partner.
Staging is the test environment: https://api-stg.grailnetwork.com. Its cards and money are not real. It has the same
routes and webhooks as production. No route exists only for tests.
Your test partner
- Grail Network's staff make a test partner for you on staging, and give you its API key.
- Read
GET /partner/mewith the key. Itscodeis the partner code of your test slips. - Set your test webhook address with
PUT /partner/webhook, and keep the secret.
A test intake
- Make a slip code with your test partner's code, with its check character.
- Ask Grail Network's staff to run an intake of that slip on staging, with the number of cards that you want, and one refused card if you want to test it.
- Check that you get
intake.ended, and thatGET /partner/intakes?reference=andGET /partner/items?reference=give the cards. - Set a price adjustment on a card, and watch
partner-item.changed.
A sale and a pool share take time: a sale comes at the end of a buyer's offer, and a pool comes after the end of a UTC day. A report line appears 60 seconds after it is written.
A stand-in server
The API file of the partners' routes is at /openapi/partners.json (OpenAPI 3.1). Make a
client of your own from it, or a stand-in server for your own tests, with any tool that reads OpenAPI.
Errors
The error body, the statuses, and the partner's codes with what to do next.
Read one of your cards GET
One card with its state, its prices, its buyer facts while a buyer holds it, its sale and its take-back request. Errors: - 404 `PARTNER_ITEM_NOT_FOUND`: you have no card with this id. - 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.