Swifty API Overview
Domains and Tenants
SwiftyRx is multi-tenant, with each tenant corresponding to a virtual pharmacy. In each environment, there is a bootstrap tenant
that is used for initial authentication and to get a list of tenants that the logged in account has access to. Each tenant
has the concept of a slug that is used as the first part of the domain in the subsequent API calls. For example, in our
development environment (which runs on the swiftyrx.dev domain), the bootstrap url is https://bootstrap.swiftyrx.dev. One of the tenants for demo
purposes is Acme Pharmacy which has a slug of acme. As such, to access the Acme tenant via API, you would then use the domain
acme.swiftyrx.dev.
OAuth API
We are still working on publishing this out to a hosted server. However, you can download the current openapi_auth.yaml file for further review.
With this API, you can perform a login with a username and password and receive a Bearer token that can then be used to interact with the main API.
Main API
The main API Swagger UI can be viewed for any tenant at the /api/ui/ root of the main domain. For example, you can look at the latest API documentation for our Development Environment at Main Swagger API.
With this API, you can send in patient registration information, search for prescriptions, search for patients, search for medications, validate a US address, get the details for a patient, get the details for a prescription, search for providers and pharmacies, etc.
Surescripts API
SwiftyRx exposes an API for use by Surescripts to send messages to us on behalf of the virtual pharmacy. The endpoint pattern is as follows:
POST https://{slug}.{swifty-domain}/api/surescripts/v1/message
Authentication is HTTP Basic Auth with a username and password that is registered with Surescripts for the virtual pharmacy.
In non-production environments, the endpoint can be used to simulate messages from Surescripts. This is useful for testing and development purposes.
As an example, the endpoint for the acme tenant in the development environment is https://acme.swiftyrx.dev/api/surescripts/v1/message.
The endpoint expects to receive properly formatted Surescripts XML messages that follow the underlying NCPDP SCRIPT standard. The following messages are supported: NewRx, RxTransfer, RxTransferConfirm, RxRenewalResponse, RxChangeResponse, RxTransferInitiationRequest.
Contact the Swifty team if you would like to gain access to one of the non-production Surescripts endpoints for your tenant for testing purposes, or for sample Surescripts message templates.