curl --request GET \
--url https://sandbox-api.instockrx.com/pharmacies/{pharmacyId}/purchase-readiness \
--header 'X-InStockRx-Api-Key: <api-key>'const options = {method: 'GET', headers: {'X-InStockRx-Api-Key': '<api-key>'}};
fetch('https://sandbox-api.instockrx.com/pharmacies/{pharmacyId}/purchase-readiness', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://sandbox-api.instockrx.com/pharmacies/{pharmacyId}/purchase-readiness"
headers = {"X-InStockRx-Api-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text){
"pharmacyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ready": true,
"blockers": [
{
"code": "pharmacy-on-probation",
"message": "<string>",
"remediationUrl": "<string>",
"details": {}
}
],
"asOf": "2023-11-07T05:31:56Z",
"listingId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"warnings": [
{
"code": "<string>",
"message": "<string>",
"details": {}
}
],
"verifiedPaymentMethodCount": 1,
"defaultPaymentMethodId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"type": "https://api.instockrx.com/problems/listing-not-available",
"title": "<string>",
"status": 349,
"detail": "<string>",
"instance": "<string>",
"requestId": "<string>",
"errors": [
{
"field": "<string>",
"code": "<string>",
"message": "<string>"
}
]
}Pre-flight check for whether a pharmacy can purchase
Scope: listings:read.
Returns the set of conditions that would block a purchase by this
pharmacy. Designed to be called before POST /marketplace-listings/{id}/purchase
so partners can surface remediation steps without absorbing a 409.
- Without
?listingId=: checks only pharmacy-side preconditions (probation, address, GLN, state license, Dwolla charges-enabled, verified payment method available). - With
?listingId=: additionally checks listing-side preconditions (listing-not-pending,seller-blacklisted-buyer,self-purchase-forbidden, and — if the listing is cold-chain —bundle-full-cold-chainagainst the default pending bundle).
A 200 with ready: true does not guarantee a subsequent purchase
will succeed (race conditions can still produce 409 listing-already-purchased or 412 stale-resource). It does guarantee
the listed blockers were absent at asOf.
Response is Cache-Control: no-store; partners should always re-check
rather than cache.
curl --request GET \
--url https://sandbox-api.instockrx.com/pharmacies/{pharmacyId}/purchase-readiness \
--header 'X-InStockRx-Api-Key: <api-key>'const options = {method: 'GET', headers: {'X-InStockRx-Api-Key': '<api-key>'}};
fetch('https://sandbox-api.instockrx.com/pharmacies/{pharmacyId}/purchase-readiness', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://sandbox-api.instockrx.com/pharmacies/{pharmacyId}/purchase-readiness"
headers = {"X-InStockRx-Api-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text){
"pharmacyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ready": true,
"blockers": [
{
"code": "pharmacy-on-probation",
"message": "<string>",
"remediationUrl": "<string>",
"details": {}
}
],
"asOf": "2023-11-07T05:31:56Z",
"listingId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"warnings": [
{
"code": "<string>",
"message": "<string>",
"details": {}
}
],
"verifiedPaymentMethodCount": 1,
"defaultPaymentMethodId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"type": "https://api.instockrx.com/problems/listing-not-available",
"title": "<string>",
"status": 349,
"detail": "<string>",
"instance": "<string>",
"requestId": "<string>",
"errors": [
{
"field": "<string>",
"code": "<string>",
"message": "<string>"
}
]
}Authorizations
Headers
Which pharmacy in your group you are acting as. Required whenever your group holds more than one pharmacy — omitting it is then 400 missing-pharmacy-context. With exactly one pharmacy it may be omitted, but send it anyway: the call starts failing the day a second pharmacy is added.
Query Parameters
Response
OK
Result of a purchase-readiness pre-flight. ready is true only if
blockers is empty. warnings is non-blocking (e.g. state license
expiring soon).