In short
- Eka sends a profile shared from your facility QR on
abha.hip_profile_share. - Match or register the patient, and issue an OPD token for the counter in
hip_code. - Reply with On-Share, sending the webhook’s
req_idasrequest_id.
When to use this
A patient at your registration counter scans the facility’s Health Facility QR code with a PHR app and shares their ABHA profile. Eka sends you the profile on a webhook. You register or match the patient, issue an OPD token, and reply with it. The PHR app shows the patient the token. This replaces asking the patient for their ABHA at the counter. If the patient has no PHR app, register them at the desk. Use Log in to an existing ABHA or Create an ABHA with Aadhaar OTP. The PHR app’s side of this exchange, scanning and fetching the token, is a separate workflow: Share a profile at a facility counter.Before you start
- A client access token, sent as a Bearer token. See Authorization.
- Your facility onboarded as a Health Information Provider (HIP), with its HIP ID.
- A Health Facility QR code displayed at each counter, each with its counter id (
hip_code). - A webhook URL registered with Eka that can receive
abha.hip_profile_share, and the means to verify the webhook signature. - A way to issue OPD token numbers in your system.
Sequence
Steps
1
Receive the shared profile
Eka sends the
abha.hip_profile_share webhook. Acknowledge it with HTTP 200 within 5 seconds; Eka retries on any other status.From data, keep req_id, abha_address, abha_number, hip_code (the counter the patient scanned), hip_id, oid and partner_patient_id.Look the patient up by abha_address or abha_number. If you find them, use that record. If not, register a new patient and save abha_address, abha_number and oid on the record. Issue an OPD token for the counter in hip_code.2
Reply with the token
Call On-Share. Send the patient’s
oid in X-Pt-Id, your patient id in X-Partner-Pt-Id and your HIP ID in X-Hip-Id. In the body send:request_id: thereq_idfrom the webhook.abha_address: from the webhook.hip_code: the counter id from the webhook.token: withtoken_number(required) andexpires_at.
error with code and message instead of token.The call returns 202 Accepted. Eka passes the token to the patient’s PHR app.State you must persist
When it fails
Error responses carrycode, error and source_error. The codes below are from the errors page.
Test it
The testing page has the sandbox base URL, credentials and the happy path for every journey.- Scan your sandbox facility QR from a PHR app with a test ABHA and receive
abha.hip_profile_share - Reply with a
token_numberand get202 Accepted; the PHR app shows the token - Share the same ABHA again and confirm you match the existing patient instead of creating a duplicate
- Reply with
errorinstead oftokenand check what the PHR app shows

