⚡ Developer Portal
Build on MyRx-Access
Integrate patient-sovereign health identity into your application. FHIR R4 APIs, SMART on FHIR OAuth, and a published npm SDK — everything you need to get to production in minutes.
FHIR R4
SMART on FHIR
@myrx-token/mrx-access
Hyperledger
HIPAA Compliant
Sandbox Instant
Platform Status
EHR API
LIVE
FHIR R4
LIVE
SMART OAuth
LIVE
Sandbox
LIVE
SDK Version
0.1.0
What You Can Build
EHR Integrations
Pull patient records via FHIR R4 with patient consent. 15+ US Core resource types: Patient, Observation, MedicationRequest, Condition, and more.
Identity Verification
Verify patient identity using MyRx-ID NFT tokens. Cryptographic proof of identity without exposing PHI. Perfect for telehealth and prescription workflows.
Prescription & Drug Safety
DSCSA drug provenance verification, FDA recall alerts, NLM drug interaction checks. Build patient safety features with real FDA data.
Health Finance
MRT token rewards, gas fee transparency, and the MyRx-Rail payment layer. Build cashback apps, HSA integrations, or DeFi health finance tools.
Patient Engagement
Consent flows, push notifications, QR-based sharing, and NFC proximity tap. Patient experience tools that eliminate friction.
Blockchain Anchoring
Anchor consent events and health data to Hyperledger Fabric via MyRx-Chain. Immutable audit trails for compliance and legal use cases.
Access Levels
| Level | Description | Key Type | Approval |
|---|---|---|---|
| Sandbox | Synthetic FHIR data, all endpoints, no PHI. Instant approval. | mrx_sb_… |
Automatic |
| Basic | Read-only FHIR R4 access. Production patient data with consent. | mrx_lv_… |
Manual Review |
| FHIR | Read + write FHIR R4. Full consent lifecycle, NFT identity, AI agents. | mrx_lv_… |
Manual Review |
| Full | All APIs including admin, MyRx-Chain, Rail, Nexus. Enterprise partners only. | mrx_lv_… |
Partner Agreement |
Quickstart
From zero to your first FHIR patient record in under 5 minutes.
1
Get your API key
Go to the tab and register your app. A sandbox key is issued immediately — no approval required.
2
Install the SDK
Install
@myrx-token/mrx-access from npm.bash
npm install @myrx-token/mrx-access
3
Get a sandbox bearer token
Exchange your API key for a short-lived bearer token (4 hours). Works in sandbox without patient consent flows.
javascript
import { MRxAccess } from '@myrx-token/mrx-access'; const client = new MRxAccess({ apiKey: 'mrx_sb_YOUR_SANDBOX_KEY', environment: 'sandbox', baseUrl: 'https://ehr.myrxwallet.io', }); // Exchange API key for bearer token const { access_token } = await client.getSandboxToken(); console.log('Token:', access_token);
4
Fetch a patient record (FHIR R4)
Query the FHIR R4 Patient endpoint using your bearer token.
javascript
// With the SDK const patient = await client.fhir.getPatient('patient-id-here'); console.log(patient.name, patient.birthDate); // Or direct REST with your token const res = await fetch( 'https://ehr.myrxwallet.io/api/v1/fhir/r4/Patient/patient-id', { headers: { 'Authorization': `Bearer ${access_token}` } } ); const data = await res.json();
5
Search medications
Use FHIR search to find active medications for a patient.
javascript
const meds = await client.fhir.search('MedicationRequest', { patient: 'patient-id', status: 'active', }); meds.entry?.forEach((e) => { console.log(e.resource.medicationCodeableConcept?.text); });
cURL Examples
bash — Get sandbox token
curl -X GET https://ehr.myrxwallet.io/api/v1/developer/sandbox/token \ -H "X-Api-Key: mrx_sb_YOUR_KEY"
bash — FHIR Patient search
curl https://ehr.myrxwallet.io/api/v1/fhir/r4/Patient?name=Smith \ -H "Authorization: Bearer YOUR_TOKEN"
bash — SMART discovery
curl https://ehr.myrxwallet.io/.well-known/smart-configuration
🎉 Ready for production?
When your integration is tested in sandbox, go to and request a production key upgrade. Typical review takes 1–3 business days.
API Reference
Base URL: https://ehr.myrxwallet.io/api/v1
All endpoints require Authorization: Bearer <token> unless marked Public.
Developer Portal
| Method | Endpoint | Description | Auth |
|---|---|---|---|
| POST | /developer/register | Register app — returns sandbox key instantly | Public |
| GET | /developer/sandbox/token | Exchange API key for sandbox bearer token | X-Api-Key |
| POST | /developer/keys | Create additional API key for app | JWT |
| GET | /developer/keys?app_id=… | List keys (prefix only, never full) | JWT |
| POST | /developer/keys/{id}/rotate | Revoke + reissue key | JWT |
| POST | /developer/keys/{id}/revoke | Permanently revoke key | JWT |
| GET | /developer/stats?app_id=… | Usage stats: request count, last used | JWT |
| GET | /developer/status | Public platform status | Public |
FHIR R4 Resources
| Method | Endpoint | Resource | Scope |
|---|---|---|---|
| GET | /fhir/r4/metadata | Capability Statement | Public |
| GET | /fhir/r4/Patient/{id} | Patient demographics | patient/*.rs |
| GET | /fhir/r4/Observation | Lab results, vitals | patient/*.rs |
| GET | /fhir/r4/MedicationRequest | Prescriptions | patient/*.rs |
| GET | /fhir/r4/Condition | Diagnoses, conditions | patient/*.rs |
| GET | /fhir/r4/AllergyIntolerance | Allergies | patient/*.rs |
| GET | /fhir/r4/Immunization | Immunization records | patient/*.rs |
| GET | /fhir/r4/DiagnosticReport | Diagnostic reports | patient/*.rs |
| GET | /fhir/r4/Procedure | Procedures | patient/*.rs |
| GET | /fhir/r4/CarePlan | Care plans | patient/*.rs |
| GET | /fhir/r4/$export | Bulk data export (NDJSON) | system/*.rs |
SMART on FHIR OAuth
| Method | Endpoint | Description |
|---|---|---|
| GET | /.well-known/smart-configuration | SMART discovery document |
| GET | /oauth/authorize | Authorization endpoint (PKCE) |
| POST | /oauth/token | Token exchange |
| POST | /oauth/introspect | Token introspection |
| POST | /oauth/revoke | Revoke token |
| POST | /oauth/register | Dynamic client registration |
| GET | /oauth/jwks | Server public JWKS |
Drug Safety
| Method | Endpoint | Description |
|---|---|---|
| POST | /dscsa/verify-provenance | DSCSA drug provenance check |
| GET | /dscsa/recalls | FDA active drug recalls |
| GET | /dscsa/recalls/{ndc} | Recalls by NDC code |
| GET | /dscsa/patient-alerts/{pid} | Personalized recall alerts for patient |
Consent & Access
| Method | Endpoint | Description |
|---|---|---|
| POST | /consent/request | Request patient consent (notifies patient) |
| GET | /consent/qr/{patient_id} | QR code token (10 min TTL) |
| GET | /consent/audit/{patient_id} | SHA-256 consent audit log |
SDK Documentation
Package: @myrx-token/mrx-access · Version: 0.1.0
TypeScript-first npm SDK for MyRxWallet platform integrations.
bash — Install
npm install @myrx-token/mrx-access
# or
yarn add @myrx-token/mrx-accessConstructor
typescript
import { MRxAccess } from '@myrx-token/mrx-access'; const client = new MRxAccess({ apiKey: 'mrx_sb_…', // required environment: 'sandbox', // 'sandbox' | 'production' baseUrl: 'https://ehr.myrxwallet.io', // optional override timeout: 30000, // optional ms, default 30s });
Authentication
typescript
// Get sandbox bearer token (4h TTL) const token = await client.getSandboxToken(); // Returns: { access_token, token_type, expires_in, scope } // SMART on FHIR OAuth (production — patient authorization) const authUrl = client.getAuthorizationUrl({ clientId: 'your-smart-client-id', redirectUri: 'https://yourapp.com/callback', scope: 'openid fhirUser launch/patient patient/*.rs', launchContext: launchToken, // optional EHR launch }); // Redirect user to authUrl, then handle callback const tokens = await client.exchangeCode({ code, codeVerifier, redirectUri });
FHIR Client
typescript
// Set bearer token first client.setToken(access_token); // ── Get patient ── const patient = await client.fhir.getPatient('pid-123'); // ── Search resources ── const bundle = await client.fhir.search('MedicationRequest', { patient: 'pid-123', status: 'active', _count: 50, }); // ── Get specific resource ── const obs = await client.fhir.read('Observation', 'obs-id'); // ── Capability statement ── const caps = await client.fhir.metadata(); // ── Supported resource types ── // Patient · Observation · MedicationRequest · Condition // AllergyIntolerance · Immunization · Procedure · DiagnosticReport // DocumentReference · Goal · CarePlan · Practitioner // Organization · Coverage · Encounter
Drug Safety
typescript
// Verify drug provenance (DSCSA) const prov = await client.drug.verifyProvenance({ ndc: '12345-678-90' }); // FDA recalls for an NDC const recalls = await client.drug.getRecalls('12345-678-90'); // Patient personalized alerts const alerts = await client.drug.getPatientAlerts('pid-123');
Scopes Reference
patient/*.rs
Read + search all patient-context FHIR resources. Standard for patient-facing apps.
patient/*.r
Read individual patient resources (no search). More restrictive.
system/*.rs
System-level FHIR access (bulk export). Requires full access level.
openid fhirUser
OpenID Connect identity + FHIR user resource link.
offline_access
Refresh token issuance (90-day TTL per ONC requirement).
launch/patient
EHR launch context — patient pre-selected when app launched from EHR.
sandbox:all
Sandbox-only scope. Grants access to all synthetic endpoints.
Error Codes
| HTTP | Code | Meaning |
|---|---|---|
| 400 | invalid_request | Bad parameters |
| 401 | invalid_token | Missing, expired, or revoked token/key |
| 403 | insufficient_scope | Token lacks required scope |
| 404 | not_found | Resource not found |
| 409 | conflict | Duplicate registration |
| 429 | rate_limited | Too many requests — see Retry-After header |
| 500 | server_error | Platform error — contact support@myrxwallet.io |
Get Your API Key
Register your app below. A sandbox API key is issued instantly — no approval required. Production keys are reviewed within 1–3 business days.
Register Developer App
All fields are required unless marked optional. Your key will be displayed once — save it immediately.
⚠️ This key is displayed ONCE. Store it securely (e.g., environment variable or secrets manager). It cannot be recovered.
Your API Key
—
App ID
—
Environment
SANDBOX
Sandbox Base URL
https://ehr.myrxwallet.io/api/v1
Expires
365 days
Next steps:
1
Read the — you'll be making API calls in minutes.
2
Install
@myrx-token/mrx-access and call getSandboxToken().3
When ready for production, email dev@myrxwallet.io with your App ID to request a production key upgrade.
Rate Limits
| Tier | Requests/min | Requests/day |
|---|---|---|
| Sandbox | 60 | 5,000 |
| Basic | 120 | 50,000 |
| FHIR | 300 | 500,000 |
| Full | Unlimited | Unlimited |