Skip to content
Medication Prices
By NPI

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: zW7PKpzy6X7UHlI4NymTG8QmYhSlFwVd44xapRCt

HTTP Query Params

paramDescription
accessCodestring (optional) Used to associate a pricing request with a co-brand for the provisioned account.
sortboolean (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.

paramDescription
ndcstring NDC11 of medication to price.
quantityfloat Metric quantity to price.
npisarray containing strings List of 10 digit NPIs to price (e.g., [“1902089667”, “2873059552”]).
daysSupplynumber (optional) Days supply to price. Does not always impact prices for all clients.

Response Types

CodeDescription
200Pharmacies priced successfully. Results returned.
400Incorrect or missing required parameters.
403Lack of permissions to price.
404NDC or Quantity not found, or not covered.
500Internal 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.

AttributeDescription
idstring Internal ID used for tracking purposes.
successful[].npistring Unique pharmacy identifier that was successful in pricing.
successful[].typestring Code for the type of pharmacy. See pharmacy types.
successful[].price.uncstring/null Usual and customary (UNC). UNC price will be returned when available.
successful[].price.discountedstring Discounted price.
successful[].featuredboolean 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[].npistring Unique pharmacy identifier that failed to price.
failed[].codeinteger Code identifying the failure type. See Error Codes.
statusCodeinteger (optional) HTTP status code in case of failure.
messagestring (optional) Error description.
errorCodestring (optional) Error Code for validation failures. See Error Codes.
metadataobject (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: zW7PKpzy6X7UHlI4NymTG8QmYhSlFwVd44xapRCt

HTTP Query Params

paramDescription
accessCodestring (optional) Used to associate a card request with a co-brand for the provisioned account.
sortboolean (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.

paramDescription
ndcstring NDC11 of medication to price.
quantityfloat Metric quantity to price.
npisarray containing strings List of 10 digit NPIs to price (e.g., [“1902089667”, “2873059552”]).
daysSupplynumber (optional) Days supply to price. Does not always impact prices for all clients.

Response Types

CodeDescription
200Pharmacies priced successfully. Results returned.
400Incorrect or missing required parameters.
403Lack of permissions to price.
404NDC not found, is not covered, or will not price for any other reason.
500Internal 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.

AttributeDescription
idstring Internal ID used for tracking purposes.
successful[].npistring Unique pharmacy identifier that was successful in pricing.
successful[].typestring Code for the type of pharmacy. See pharmacy types.
successful[].price.uncstring/null Usual and customary (UNC). UNC price will be returned when available.
successful[].price.discountedstring Discounted price.
successful[].featuredboolean 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[].npistring Unique pharmacy identifier that failed to price.
failed[].codeinteger Code identifying the failure type. See Error Codes.
statusCodeinteger (optional) HTTP status code in case of failure.
messagestring (optional) Error description.
errorCodestring (optional) Error Code for validation failures. See Error Codes.
metadataobject (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.

CodeDescription
retailRetail A retail pharmacy with a physical store.

Pharmacy Error Codes

The following error codes are shown with failed pharmacy pricing requests on individual pharmacies.

CodeDescription
1NPI not in Network This NPI is not found and can not be priced.
2Try Again A service error caused pricing to fail for this pharmacy, try again in the future.
3Unknown An unknown error caused pricing to fail.
4Drug 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 CodeDescription
NPIS_INCORRECT_OR_MISSINGRequired HTTP POST parameter npis is either missing or invalid.
NDC_INCORRECT_OR_MISSINGRequired HTTP POST parameter ndc is either missing or invalid.
QUANTITY_INCORRECT_OR_MISSINGRequired HTTP POST parameter quantity is either missing or invalid.
SORT_INCORRECT_OR_MISSINGHTTP Query parameter sort is invalid.