Skip to Content
Grail Network

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

  1. Grail Network's staff make a test partner for you on staging, and give you its API key.
  2. Read GET /partner/me with the key. Its code is the partner code of your test slips.
  3. Set your test webhook address with PUT /partner/webhook, and keep the secret.

A test intake

  1. Make a slip code with your test partner's code, with its check character.
  2. 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.
  3. Check that you get intake.ended, and that GET /partner/intakes?reference= and GET /partner/items?reference= give the cards.
  4. 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.

On this page