hdp_test_ and cURL, Node.js 18 or Python 3.
Last reviewed: 2026-11-04
Every request on this page is listed in the generated Partner API reference. For the concepts behind the steps, read How the Partner API works.
Before you start
- A test API key that starts with
hdp_test_, with the scopesconsultations:read,consultations:write,prescriptions:readandwebhooks:manage. The first two cover steps 1 to 6; registering a webhook endpoint with the API in step 7 needs all four. Addpatients:readif you also want to read the patients you create. See Authentication for every scope. Listing products and fetching a questionnaire need no scope. Your Hi Doctor contact issues the first key; after that you manage keys in the Business portal. curl, Node.js 18 or later, or Python 3 withrequests.
1. Check the key
GET /v1/partner/ping/ confirms the key is accepted and tells you its mode.
2. List your products for a country
GET /v1/partner/products/?country=NL returns the products in your agreement that are open in that country. Each product names its questionnaire and the current schema_version and schema_hash. Plans and dosages can only be chosen from this list.
product_id, name, category, questionnaire_slug, schema_version, schema_hash, country, plans (plan_key, supply_days), dosages (dosage, label) and price (amount_cents, currency, as agreed in your partner agreement).
3. Fetch the questionnaire schema
GET /v1/partner/questionnaires/{slug}/ returns the schema the doctor’s review is based on. Set QUESTIONNAIRE_SLUG to the questionnaire_slug of the product you chose in step 2. Render every applicable step to the patient and collect the answers in the entries-v1 format. Questionnaires and schema documents every step kind.
4. Upload a photo
Upload each photo the schema asks for withPOST /v1/partner/files/ as multipart/form-data. JPEG, PNG and PDF are accepted, detected from the file’s bytes. Keep the returned upload_id. See Photos and files.
5. Submit the consultation
Put the request body inconsultation.json. The question keys below are illustrative; use the keys from the schema you fetched. locale is one of the questionnaire locales served (en, es or zh; anything else falls back to English). Send the schema_hash from the schema you fetched; the hash of any served locale is accepted. An upload answer is the scalar "value": "<upload_id>".
Idempotency-Key that you create once for this consultation and store before the first attempt. If the request times out, rerun the same sample: it reads the stored key back, so the retry carries the same key and body and you get the original response instead of a second consultation. Delete idempotency-key.txt only when you submit a different consultation. See Partner API idempotency.
201 response returns the consultation resource with status: "submitted" and version: 1.
6. Move the test consultation and read it
In test mode nothing happens until you advance the consultation. SetCONSULTATION_ID to the id from the step 5 response, move the consultation to in_review, then read it back:
7. Receive the webhook
Register an HTTPS endpoint for test mode in the Business portal or withPOST /v1/partner/webhook-endpoints/ (scopes webhooks:manage, consultations:read and prescriptions:read). The response returns the signing secret once, as whsec_ followed by base64: store it straight away.
approved. Each change produces one signed event whose data is the full consultation snapshot. Deliveries follow the Standard Webhooks specification: verify the webhook-id, webhook-timestamp and webhook-signature headers with the code in Webhooks, or any Standard Webhooks library, before trusting the body.
Frequently asked questions
Do test consultations reach a doctor?
No. Test consultations are synthetic, never reach a doctor, create no medical record and are never billed.Why does my test consultation stay submitted?
Nothing moves on its own in test mode. Advance the consultation with the test advance endpoint to reach each status.Which scopes does the quickstart key need?
consultations:read and consultations:write cover steps 1 to 6. Registering a webhook endpoint in step 7 also needs prescriptions:read and webhooks:manage.Where do I get the questionnaire slug?
From the product list in step 2. Each product names its questionnaire_slug together with the current schema_version and schema_hash.What happens if I retry the submission after a timeout?
Send the same Idempotency-Key and the same body. You get the original response instead of a second consultation.Which locale should I send?
One of the questionnaire locales served, en, es or zh. Any other value falls back to English. Send the schema_hash from the schema you fetched; the hash of any served locale is accepted.Do Partner API paths end with a slash?
The samples use the paths exactly as the Partner API reference lists them, with a trailing slash. Keep the same form on a retry, because an idempotent retry must use the same path as the first attempt.Next steps
Questionnaires and schema
Render every step kind correctly.
Webhooks
Signatures, retries and the ordering rule.
Go-live checklist
What must be in place before live mode.