Skip to content
Medication Prices
By Region

By Region

Medication Prices by Region

Inside Rx provides an endpoint that will return pharmacy chains found in a given region. This is ideal in situations where the client wants to compare prices across different chains rather than individual pharmacies in a given region. The prices should be a close estimate of the prices at the chain’s pharmacies, but is not guaranteed to be the actual price for each chain location within the region.

Note

A “region” used in this documentation is a geographical area containing the zip code. This includes the radius around the given zip code’s center point but may also include other zip codes nearby. The distance is determined by the density of pharmacies in the area.

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.

Usual and Customary vs. Discounted Price

The pricing API will return both the usual and customary price, as well as the discounted price. Client logic may need to show the lower price depending on the plan configured on the account.

Default National Chain Prices

Medication Prices by Region endpoint will return default national chain prices for a given NDC and quantity if zip code is not provided as part of the request or if we don’t find prices for the given zipcode.

People Pricing by Chains

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/region/people 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.
limitstring (optional) Limits number of retail pharmacies returned to [1...10], defaults to 10.
indexstring (optional) Starting index position of records returned for pagination, defaults to 0.

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.
zipstring (optional) Five digit zip code used to specify the region to price in.
daysSupplynumber (optional) Days supply to price. Does not always impact prices for all clients.

Response Types

CodeDescription
200Priced 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.
pharmacies[]array Array of Chain Pricing Objects containing data for each chain priced.
paginationobject Pagination Object containing information for pagination of the pricing results.
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/region/people \
  -H "Content-Type: application/json" \
  -H "x-api-key: zW7PKpzy6X7UHlI4NymTG8QmYhSlFwVd44xapRCt" \
  -d ndc="12345678901" \
  -d quantity=30.0 \
  -d zip="78758"

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
  },
  "pharmacies": [
    {
      "type": "chain",
      "name": "WALGREENS",
      "code": "58765431",
      "price": {
        "unc": "48.15",
        "discounted": "33.17"
      },
      "count": 8,
      "featured": true,
      "score": 3
    },
    ...
  ],
  "pagination": {
    "size": 50,
    "index": 0,
    "limit": 10
  }
}

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 Chain

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/region/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.
limitstring (optional) Limits number of retail pharmacies returned to [1...10], defaults to 10
indexstring (optional) Starting index position of records returned for pagination, defaults to 0

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.
zipstring (optional) Five digit zip code used to specify the region to price in.
daysSupplynumber (optional) Days supply to price. Does not always impact prices for all clients.

Response Types

CodeDescription
200Priced 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.
pharmacies[]array Array of Chain Pricing Objects containing data for each chain priced.
paginationobject Pagination Object containing information for pagination of the pricing results.
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/region/pets \
  -H "Content-Type: application/json" \
  -H "x-api-key: zW7PKpzy6X7UHlI4NymTG8QmYhSlFwVd44xapRCt" \
  -d ndc="12345678901" \
  -d quantity=30.0 \
  -d zip="78758"

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
  },
  "pharmacies": [
    {
      "type": "chain",
      "name": "HEB",
      "code": "96365431",
      "price": {
        "unc": "58.15",
        "discounted": "32.17"
      },
      "count": 19,
      "featured": false,
      "score": 11
    },
    ...
  ],
  "pagination": {
    "size": 4,
    "index": 0,
    "limit": 4
  }
}

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
chainChain A pharmacy chain, with a price for that chain for the metric quantity given.

Response Attribute Objects

Chain Pricing Object

A pharmacy chain, with the price for that chain for the quantity/drug given.

AttributeDescription
pharmacies[].typestring Identifier for the type of pharmacy priced at. See pharmacy types.
pharmacies[].namestring Display name of pharmacy chain.
pharmacies[].codestring Unique pharmacy chain identifier.
pharmacies[].price.discountedstring Discounted price.
pharmacies[].price.uncstring/null Usual and customary (UNC). UNC price will be returned when available.
pharmacies[].countinteger Number of pharmacies found under a chain in a given region. This value will be null for default national chain prices.
pharmacies[].scoreinteger Pharmacies popularity ranking assigned by Inside Rx. This value will be null for default national chain prices.
pharmacies[].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.

Pagination Object

Pagination object to specify the details of the pharmacy chains found.

AttributeDescription
pagination.sizeinteger Total number of chains found in the given zip code’s region.
pagination.indexinteger Starting index position of records returned out of total records.
pagination.limitinteger Maximum number of records returned per response.

Error Codes

Error CodeDescription
ZIP_INCORRECT_OR_MISSINGHTTP POST parameter zip is 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.
INDEX_INCORRECT_OR_MISSINGHTTP Query parameter index is invalid.
LIMIT_INCORRECT_OR_MISSINGHTTP Query parameter limit is invalid.