Search marketplace listings
curl --request POST \
--url https://sandbox-api.instockrx.com/marketplace-listings/search \
--header 'Content-Type: application/json' \
--header 'X-InStockRx-Api-Key: <api-key>' \
--data '
{
"filters": {
"nationalDrugCodes": [
"<string>"
],
"sellingPharmacyNpis": [
"1234567890"
],
"buyingPharmacyNpis": [
"1234567890"
],
"status": [],
"deliveryStatus": [],
"fullPackage": true,
"sealedPackage": true,
"notTornPackageLabel": true,
"isGroupOnly": true,
"listingDate": {
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z"
},
"purchasedDate": {
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z"
},
"shippedDate": {
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z"
},
"receivedDate": {
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z"
},
"cancelledDate": {
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z"
},
"minPrice": "42.50",
"maxPrice": "42.50",
"q": "<string>"
},
"sort": [
"-listingDate"
],
"page": {
"limit": 50,
"cursor": "<string>"
}
}
'const options = {
method: 'POST',
headers: {'X-InStockRx-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
filters: {
nationalDrugCodes: ['<string>'],
sellingPharmacyNpis: ['1234567890'],
buyingPharmacyNpis: ['1234567890'],
status: [],
deliveryStatus: [],
fullPackage: true,
sealedPackage: true,
notTornPackageLabel: true,
isGroupOnly: true,
listingDate: {from: '2023-11-07T05:31:56Z', to: '2023-11-07T05:31:56Z'},
purchasedDate: {from: '2023-11-07T05:31:56Z', to: '2023-11-07T05:31:56Z'},
shippedDate: {from: '2023-11-07T05:31:56Z', to: '2023-11-07T05:31:56Z'},
receivedDate: {from: '2023-11-07T05:31:56Z', to: '2023-11-07T05:31:56Z'},
cancelledDate: {from: '2023-11-07T05:31:56Z', to: '2023-11-07T05:31:56Z'},
minPrice: '42.50',
maxPrice: '42.50',
q: '<string>'
},
sort: ['-listingDate'],
page: {limit: 50, cursor: '<string>'}
})
};
fetch('https://sandbox-api.instockrx.com/marketplace-listings/search', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://sandbox-api.instockrx.com/marketplace-listings/search"
payload = {
"filters": {
"nationalDrugCodes": ["<string>"],
"sellingPharmacyNpis": ["1234567890"],
"buyingPharmacyNpis": ["1234567890"],
"status": [],
"deliveryStatus": [],
"fullPackage": True,
"sealedPackage": True,
"notTornPackageLabel": True,
"isGroupOnly": True,
"listingDate": {
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z"
},
"purchasedDate": {
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z"
},
"shippedDate": {
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z"
},
"receivedDate": {
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z"
},
"cancelledDate": {
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z"
},
"minPrice": "42.50",
"maxPrice": "42.50",
"q": "<string>"
},
"sort": ["-listingDate"],
"page": {
"limit": 50,
"cursor": "<string>"
}
}
headers = {
"X-InStockRx-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"data": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "Pending",
"nationalDrugCode": "<string>",
"sellerPharmacyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"deliveryStatus": "Unknown",
"paymentStatus": "NotInitiated",
"nationalDrugCodeNormalized": "<string>",
"labelerName": "<string>",
"packageName": "<string>",
"drugPackageForm": "<string>",
"drugPackageStrength": "<string>",
"quantityUnitQualifier": "<string>",
"price": "42.50",
"pricePerQuantity": "42.50",
"quantity": "1",
"inventoryQuantity": "1",
"expirationDate": "2023-12-25",
"lotNumber": "<string>",
"gtin": "<string>",
"serialNumber": "<string>",
"fullPackage": true,
"originalPackage": true,
"sealedPackage": true,
"tornPackageLabel": true,
"additionalPackageNotes": "<string>",
"branded": true,
"generic": true,
"sellerPharmacyName": "<string>",
"sellerPharmacyDBA": "<string>",
"sellerPharmacyNpi": "1234567890",
"sellerPharmacyPhone": "<string>",
"sellerPharmacyAddress": {
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"stateAcronym": "<string>",
"postalCode": "<string>"
},
"buyerPharmacyName": "<string>",
"buyingPharmacyName": "<string>",
"buyingPharmacyDBA": "<string>",
"buyingPharmacyNpi": "1234567890",
"buyingPharmacyPhone": "<string>",
"buyingPharmacyAddress": {
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"stateAcronym": "<string>",
"postalCode": "<string>"
},
"buyersMessage": "<string>",
"listingDate": "2023-11-07T05:31:56Z",
"soldDate": "2023-11-07T05:31:56Z",
"shippingConfirmDate": "2023-11-07T05:31:56Z",
"shippingReceivedConfirmDate": "2023-11-07T05:31:56Z",
"paymentConfirmedDate": "2023-11-07T05:31:56Z",
"shipByDate": "2023-12-25",
"cancelledDate": "2023-11-07T05:31:56Z",
"cancellationReason": "SellerCancelled",
"cancellationDescription": "<string>",
"receivedDetails": {
"gtin": "<string>",
"serialNumber": "<string>",
"lotNumber": "<string>",
"expirationDate": "2023-12-25",
"nationalDrugCode": "<string>"
},
"receivedDetailsMatch": true,
"receivedDetailsConfirmationType": "NotChecked"
}
],
"page": {
"limit": 100,
"nextCursor": "<string>",
"prevCursor": "<string>",
"estimatedTotal": 1
}
}Marketplace Listings
Search marketplace listings
Scope: listings:read.
POST
/
marketplace-listings
/
search
Search marketplace listings
curl --request POST \
--url https://sandbox-api.instockrx.com/marketplace-listings/search \
--header 'Content-Type: application/json' \
--header 'X-InStockRx-Api-Key: <api-key>' \
--data '
{
"filters": {
"nationalDrugCodes": [
"<string>"
],
"sellingPharmacyNpis": [
"1234567890"
],
"buyingPharmacyNpis": [
"1234567890"
],
"status": [],
"deliveryStatus": [],
"fullPackage": true,
"sealedPackage": true,
"notTornPackageLabel": true,
"isGroupOnly": true,
"listingDate": {
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z"
},
"purchasedDate": {
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z"
},
"shippedDate": {
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z"
},
"receivedDate": {
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z"
},
"cancelledDate": {
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z"
},
"minPrice": "42.50",
"maxPrice": "42.50",
"q": "<string>"
},
"sort": [
"-listingDate"
],
"page": {
"limit": 50,
"cursor": "<string>"
}
}
'const options = {
method: 'POST',
headers: {'X-InStockRx-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
filters: {
nationalDrugCodes: ['<string>'],
sellingPharmacyNpis: ['1234567890'],
buyingPharmacyNpis: ['1234567890'],
status: [],
deliveryStatus: [],
fullPackage: true,
sealedPackage: true,
notTornPackageLabel: true,
isGroupOnly: true,
listingDate: {from: '2023-11-07T05:31:56Z', to: '2023-11-07T05:31:56Z'},
purchasedDate: {from: '2023-11-07T05:31:56Z', to: '2023-11-07T05:31:56Z'},
shippedDate: {from: '2023-11-07T05:31:56Z', to: '2023-11-07T05:31:56Z'},
receivedDate: {from: '2023-11-07T05:31:56Z', to: '2023-11-07T05:31:56Z'},
cancelledDate: {from: '2023-11-07T05:31:56Z', to: '2023-11-07T05:31:56Z'},
minPrice: '42.50',
maxPrice: '42.50',
q: '<string>'
},
sort: ['-listingDate'],
page: {limit: 50, cursor: '<string>'}
})
};
fetch('https://sandbox-api.instockrx.com/marketplace-listings/search', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://sandbox-api.instockrx.com/marketplace-listings/search"
payload = {
"filters": {
"nationalDrugCodes": ["<string>"],
"sellingPharmacyNpis": ["1234567890"],
"buyingPharmacyNpis": ["1234567890"],
"status": [],
"deliveryStatus": [],
"fullPackage": True,
"sealedPackage": True,
"notTornPackageLabel": True,
"isGroupOnly": True,
"listingDate": {
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z"
},
"purchasedDate": {
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z"
},
"shippedDate": {
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z"
},
"receivedDate": {
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z"
},
"cancelledDate": {
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z"
},
"minPrice": "42.50",
"maxPrice": "42.50",
"q": "<string>"
},
"sort": ["-listingDate"],
"page": {
"limit": 50,
"cursor": "<string>"
}
}
headers = {
"X-InStockRx-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"data": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "Pending",
"nationalDrugCode": "<string>",
"sellerPharmacyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"deliveryStatus": "Unknown",
"paymentStatus": "NotInitiated",
"nationalDrugCodeNormalized": "<string>",
"labelerName": "<string>",
"packageName": "<string>",
"drugPackageForm": "<string>",
"drugPackageStrength": "<string>",
"quantityUnitQualifier": "<string>",
"price": "42.50",
"pricePerQuantity": "42.50",
"quantity": "1",
"inventoryQuantity": "1",
"expirationDate": "2023-12-25",
"lotNumber": "<string>",
"gtin": "<string>",
"serialNumber": "<string>",
"fullPackage": true,
"originalPackage": true,
"sealedPackage": true,
"tornPackageLabel": true,
"additionalPackageNotes": "<string>",
"branded": true,
"generic": true,
"sellerPharmacyName": "<string>",
"sellerPharmacyDBA": "<string>",
"sellerPharmacyNpi": "1234567890",
"sellerPharmacyPhone": "<string>",
"sellerPharmacyAddress": {
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"stateAcronym": "<string>",
"postalCode": "<string>"
},
"buyerPharmacyName": "<string>",
"buyingPharmacyName": "<string>",
"buyingPharmacyDBA": "<string>",
"buyingPharmacyNpi": "1234567890",
"buyingPharmacyPhone": "<string>",
"buyingPharmacyAddress": {
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"stateAcronym": "<string>",
"postalCode": "<string>"
},
"buyersMessage": "<string>",
"listingDate": "2023-11-07T05:31:56Z",
"soldDate": "2023-11-07T05:31:56Z",
"shippingConfirmDate": "2023-11-07T05:31:56Z",
"shippingReceivedConfirmDate": "2023-11-07T05:31:56Z",
"paymentConfirmedDate": "2023-11-07T05:31:56Z",
"shipByDate": "2023-12-25",
"cancelledDate": "2023-11-07T05:31:56Z",
"cancellationReason": "SellerCancelled",
"cancellationDescription": "<string>",
"receivedDetails": {
"gtin": "<string>",
"serialNumber": "<string>",
"lotNumber": "<string>",
"expirationDate": "2023-12-25",
"nationalDrugCode": "<string>"
},
"receivedDetailsMatch": true,
"receivedDetailsConfirmationType": "NotChecked"
}
],
"page": {
"limit": 100,
"nextCursor": "<string>",
"prevCursor": "<string>",
"estimatedTotal": 1
}
}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.
Body
application/json