By NPI
Medication Prices by NPI
Inside Rx provides an endpoint that will return prices for a medication, at a given set of pharmacy NPIs. This is ideal in situations where a list of pharmacy data is maintained. An X-API-KEY is used with the pricing endpoint to automatically configure metadata for the request. This ensures that prices are associated with the correct group for the provisioned account.
Pricing is different for people and pets. Make sure to price at the correct endpoint.
Note
Currently limited to 50 NPIs per request. Any additional NPIs will be ignored.
Usual and Customary (UNC) vs. Discounted Price
The pricing API will return both the usual and customary (UNC) price, as well as the discounted price. Client logic may need to show the lower price depending on the plan configured on the account.
People Pricing by NPI
This endpoint will fetch prices for people only. An account must be enabled with this endpoint to resolve pricing.
HTTP Request
POST https://services.insiderx.com/pricing/v1/npi/people HTTP/1.1
Content-Type: application/json
x-api-key: zW7PKpzy6X7UHlI4NymTG8QmYhSlFwVd44xapRCtHTTP Query Params
| param | Description |
|---|---|
accessCode | string (optional) Used to associate a pricing request with a co-brand for the provisioned account. |
sort | boolean (optional) Uses a sort to order by price, defaults to false. |
HTTP POST Params
The following params are sent as JSON in the request body. Dot notation is used to represent nested objects. Square bracket notation represents items that are nested within an array.
| param | Description |
|---|---|
ndc | string NDC11 of medication to price. |
quantity | float Metric quantity to price. |
npis | array containing strings List of 10 digit NPIs to price (e.g., [“1902089667”, “2873059552”]). |
daysSupply | number (optional) Days supply to price. Does not always impact prices for all clients. |
Response Types
| Code | Description |
|---|---|
| 200 | Pharmacies priced successfully. Results returned. |
| 400 | Incorrect or missing required parameters. |
| 403 | Lack of permissions to price. |
| 404 | NDC or Quantity not found, or not covered. |
| 500 | Internal server error, something went wrong. |
Response Attributes
The following attributes are returned as an object within the response body. Dot notation is used to represent nested objects. Square bracket notation represents items that are nested within an array.
| Attribute | Description |
|---|---|
id | string Internal ID used for tracking purposes. |
successful[].npi | string Unique pharmacy identifier that was successful in pricing. |
successful[].type | string Code for the type of pharmacy. See pharmacy types. |
successful[].price.unc | string/null Usual and customary (UNC). UNC price will be returned when available. |
successful[].price.discounted | string Discounted price. |
successful[].featured | boolean True indicates NDC provided is a Featured Brand medication and additional restrictions apply. NOTE - Only applicable for people pricing and if the contract includes Featured Brand medications. |
failed[].npi | string Unique pharmacy identifier that failed to price. |
failed[].code | integer Code identifying the failure type. See Error Codes. |
statusCode | integer (optional) HTTP status code in case of failure. |
message | string (optional) Error description. |
errorCode | string (optional) Error Code for validation failures. See Error Codes. |
metadata | object (optional) Metadata attributes that provides additional context about the response. |
Example CURL Request
curl https://services.insiderx.com/pricing/v1/npi/people \
-H "Content-Type: application/json" \
-H "x-api-key: zW7PKpzy6X7UHlI4NymTG8QmYhSlFwVd44xapRCt" \
-d ndc="12345678901" \
-d quantity=30.0 \
-d npis[]="1902089667" \
-d npis[]="1446449922" \
-d npis[]="2873059552"Where x-api-key is the private key provided when provisioning an account. The example key above is for demonstration purposes.
Example JSON Response
{
"id": "d54c54ad-40be-4305-8a34-0ab44710b90d",
"metadata": {
"cache": true
},
"successful": [
{
"npi": "1902089667",
"type": "retail",
"price": {
"unc": "58.15",
"discounted": "32.17"
},
"featured": true
},
...
],
"failed": [
{
"npi": "2873059552",
"code": 1
},
...
]
}Example JSON Response for Missing or Incorrect Request Data
{
"id": "d54c54ad-40be-4305-8a34-0ab44710b90d",
"message": "Incorrect or missing required parameters.",
"statusCode": 400,
"errorCode": "NDC_INCORRECT_OR_MISSING"
}Pets Pricing by NPI
This endpoint will fetch prices for pets only. An account must be enabled with this endpoint to resolve pricing.
HTTP Request
POST https://services.insiderx.com/pricing/v1/npi/pets HTTP/1.1
Content-Type: application/json
x-api-key: zW7PKpzy6X7UHlI4NymTG8QmYhSlFwVd44xapRCtHTTP Query Params
| param | Description |
|---|---|
accessCode | string (optional) Used to associate a card request with a co-brand for the provisioned account. |
sort | boolean (optional) Uses a sort to order by price, defaults to false. |
HTTP POST Params
The following params are sent as JSON in the request body. Dot notation is used to represent nested objects. Square bracket notation represents items that are nested within an array.
| param | Description |
|---|---|
ndc | string NDC11 of medication to price. |
quantity | float Metric quantity to price. |
npis | array containing strings List of 10 digit NPIs to price (e.g., [“1902089667”, “2873059552”]). |
daysSupply | number (optional) Days supply to price. Does not always impact prices for all clients. |
Response Types
| Code | Description |
|---|---|
| 200 | Pharmacies priced successfully. Results returned. |
| 400 | Incorrect or missing required parameters. |
| 403 | Lack of permissions to price. |
| 404 | NDC not found, is not covered, or will not price for any other reason. |
| 500 | Internal server error, something went wrong. |
Response Attributes
The following attributes are returned as an object within the response body. Dot notation is used to represent nested objects. Square bracket notation represents items that are nested within an array.
| Attribute | Description |
|---|---|
id | string Internal ID used for tracking purposes. |
successful[].npi | string Unique pharmacy identifier that was successful in pricing. |
successful[].type | string Code for the type of pharmacy. See pharmacy types. |
successful[].price.unc | string/null Usual and customary (UNC). UNC price will be returned when available. |
successful[].price.discounted | string Discounted price. |
successful[].featured | boolean True indicates NDC provided is a Featured Brand medication and additional restrictions apply. NOTE - Only applicable for people pricing and if the contract includes Featured Brand medications. |
failed[].npi | string Unique pharmacy identifier that failed to price. |
failed[].code | integer Code identifying the failure type. See Error Codes. |
statusCode | integer (optional) HTTP status code in case of failure. |
message | string (optional) Error description. |
errorCode | string (optional) Error Code for validation failures. See Error Codes. |
metadata | object (optional) Metadata attributes that provides additional context about the response. |
Example CURL Request
curl https://services.insiderx.com/pricing/v1/npi/pets \
-H "Content-Type: application/json" \
-H "x-api-key: zW7PKpzy6X7UHlI4NymTG8QmYhSlFwVd44xapRCt" \
-d ndc="12345678901" \
-d quantity=30.0 \
-d npis[]="1902089667" \
-d npis[]="1446449922" \
-d npis[]="2873059552"Where x-api-key is the private key provided when provisioning an account. The example key above is for demonstration purposes.
Example JSON Response
{
"id": "d54c54ad-40be-4305-8a34-0ab44710b90d",
"metadata": {
"cache": true
},
"successful": [
{
"npi": "1902089667",
"type": "retail",
"price": {
"unc": "58.15",
"discounted": "32.17"
},
"featured": false
},
...
],
"failed": [
{
"npi": "2873059552",
"code": 1
},
...
]
}Example JSON Response for Missing or Incorrect Request Data
{
"id": "d54c54ad-40be-4305-8a34-0ab44710b90d",
"message": "Incorrect or missing required parameters.",
"statusCode": 400,
"errorCode": "NDC_INCORRECT_OR_MISSING"
}Pharmacy Types
The following pharmacy types can be returned during a pricing request.
| Code | Description |
|---|---|
retail | Retail A retail pharmacy with a physical store. |
Pharmacy Error Codes
The following error codes are shown with failed pharmacy pricing requests on individual pharmacies.
| Code | Description |
|---|---|
1 | NPI not in Network This NPI is not found and can not be priced. |
2 | Try Again A service error caused pricing to fail for this pharmacy, try again in the future. |
3 | Unknown An unknown error caused pricing to fail. |
4 | Drug not covered Provided NDC is not covered. |
Sort
The endpoint will return results sorted by price. Price sorting uses the lowest price for a drug between price.unc and price.discounted
Error Codes
| Error Code | Description |
|---|---|
NPIS_INCORRECT_OR_MISSING | Required HTTP POST parameter npis is either missing or invalid. |
NDC_INCORRECT_OR_MISSING | Required HTTP POST parameter ndc is either missing or invalid. |
QUANTITY_INCORRECT_OR_MISSING | Required HTTP POST parameter quantity is either missing or invalid. |
SORT_INCORRECT_OR_MISSING | HTTP Query parameter sort is invalid. |