Search marketplace listings
curl --request POST \
--url https://test-instockrx-api.azurewebsites.net/api/v1/marketplace-listings/search \
--header 'Content-Type: application/json' \
--header 'X-INVIEW-AUTH: <api-key>' \
--data '
{
"pharmacyNpi": 1234567890,
"nationalDrugCodes": [
"01234567890"
],
"notTornPackageLabel": true,
"fullPackage": true,
"sealedPackage": true,
"isGroupOnly": true,
"allowedStatuses": [
0
],
"allowedDeliveryStatuses": [
0
],
"searchingContext": 1,
"buyingPharmacyNpis": [
987654321
],
"sellingPharmacyNpis": [
1122334455
],
"listingDate": {
"start": "2026-01-01T00:00:00Z",
"end": "2026-01-31T23:59:59Z"
},
"purchasedDate": {
"start": "2026-01-01T00:00:00Z",
"end": "2026-01-31T23:59:59Z"
},
"shippedDate": {
"start": "2026-01-01T00:00:00Z",
"end": "2026-01-31T23:59:59Z"
},
"cancelledDate": {
"start": "2026-01-01T00:00:00Z",
"end": "2026-01-31T23:59:59Z"
},
"receivedDate": {
"start": "2026-01-01T00:00:00Z",
"end": "2026-01-31T23:59:59Z"
},
"searchTerm": "Rexulti",
"sortDirection": "desc",
"sortName": "price",
"start": 0,
"take": 10
}
'const options = {
method: 'POST',
headers: {'X-INVIEW-AUTH': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
pharmacyNpi: 1234567890,
nationalDrugCodes: ['01234567890'],
notTornPackageLabel: true,
fullPackage: true,
sealedPackage: true,
isGroupOnly: true,
allowedStatuses: [0],
allowedDeliveryStatuses: [0],
searchingContext: 1,
buyingPharmacyNpis: [987654321],
sellingPharmacyNpis: [1122334455],
listingDate: {start: '2026-01-01T00:00:00Z', end: '2026-01-31T23:59:59Z'},
purchasedDate: {start: '2026-01-01T00:00:00Z', end: '2026-01-31T23:59:59Z'},
shippedDate: {start: '2026-01-01T00:00:00Z', end: '2026-01-31T23:59:59Z'},
cancelledDate: {start: '2026-01-01T00:00:00Z', end: '2026-01-31T23:59:59Z'},
receivedDate: {start: '2026-01-01T00:00:00Z', end: '2026-01-31T23:59:59Z'},
searchTerm: 'Rexulti',
sortDirection: 'desc',
sortName: 'price',
start: 0,
take: 10
})
};
fetch('https://test-instockrx-api.azurewebsites.net/api/v1/marketplace-listings/search', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://test-instockrx-api.azurewebsites.net/api/v1/marketplace-listings/search"
payload = {
"pharmacyNpi": 1234567890,
"nationalDrugCodes": ["01234567890"],
"notTornPackageLabel": True,
"fullPackage": True,
"sealedPackage": True,
"isGroupOnly": True,
"allowedStatuses": [0],
"allowedDeliveryStatuses": [0],
"searchingContext": 1,
"buyingPharmacyNpis": [987654321],
"sellingPharmacyNpis": [1122334455],
"listingDate": {
"start": "2026-01-01T00:00:00Z",
"end": "2026-01-31T23:59:59Z"
},
"purchasedDate": {
"start": "2026-01-01T00:00:00Z",
"end": "2026-01-31T23:59:59Z"
},
"shippedDate": {
"start": "2026-01-01T00:00:00Z",
"end": "2026-01-31T23:59:59Z"
},
"cancelledDate": {
"start": "2026-01-01T00:00:00Z",
"end": "2026-01-31T23:59:59Z"
},
"receivedDate": {
"start": "2026-01-01T00:00:00Z",
"end": "2026-01-31T23:59:59Z"
},
"searchTerm": "Rexulti",
"sortDirection": "desc",
"sortName": "price",
"start": 0,
"take": 10
}
headers = {
"X-INVIEW-AUTH": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"data": [
{
"buyerPharmacyName": "<string>",
"buyerPharmacyNationalProviderIdentifier": 123,
"buyersMessage": "<string>",
"buyingPharmacyAddress": {
"city": "<string>",
"line1": "<string>",
"line2": "<string>",
"postalCode": "<string>",
"stateAcronym": "<string>"
},
"buyingPharmacyName": "<string>",
"buyingPharmacyDBA": "<string>",
"buyingPharmacyPhone": 123,
"cancellationDescription": "<string>",
"cancellationReason": 1,
"cancelledDate": "2023-11-07T05:31:56Z",
"drugPackageForm": "<string>",
"drugPackageStrength": "<string>",
"expirationDate": "2023-11-07T05:31:56Z",
"fullPackage": true,
"originalPackage": true,
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"inventoryQuantity": 123,
"labelerName": "<string>",
"listingDate": "2023-11-07T05:31:56Z",
"lotNumber": "<string>",
"nationalDrugCode": "<string>",
"nationalDrugCodeNormalized": "<string>",
"additionalPackageNotes": "<string>",
"packageName": "<string>",
"paymentConfirmedDate": "2023-11-07T05:31:56Z",
"price": 123,
"pricePerQuantity": 123,
"quantity": 123,
"quantityUnitQualifier": "<string>",
"saleConfirmedBySellerDate": "2023-11-07T05:31:56Z",
"sealedPackage": true,
"sellerPharmacyName": "<string>",
"sellerPharmacyDBA": "<string>",
"sellerPharmacyNationalProviderIdentifier": 123,
"sellerPharmacyPhone": 123,
"shippingConfirmDate": "2023-11-07T05:31:56Z",
"shippingReceivedConfirmDate": "2023-11-07T05:31:56Z",
"soldDate": "2023-11-07T05:31:56Z",
"tornPackageLabel": true,
"sellerPharmacyAddress": {
"city": "<string>",
"line1": "<string>",
"line2": "<string>",
"postalCode": "<string>",
"stateAcronym": "<string>"
},
"status": 0,
"shipByDate": "2023-11-07T05:31:56Z",
"branded": true,
"generic": true,
"deliveryStatus": 0,
"groupId": "<string>",
"inStockRxUrl": "<string>",
"createdByGroupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"resultingMarketplaceListingRequestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"recordsFiltered": 123,
"recordsTotal": 123,
"writePagedSearch": {
"columns": [
"<string>"
],
"searchTerm": "<string>",
"sortDirection": "<string>",
"sortName": "<string>",
"start": 123,
"take": 123,
"columnFilters": [
{
"column": "<string>",
"operator": 1,
"value": "<string>",
"valueTo": "<string>"
}
]
}
}{
"error": "<string>",
"statusCode": 123,
"message": "<string>"
}{
"error": "<string>",
"statusCode": 123,
"message": "<string>"
}Search
Search marketplace listings
Flexible search across InStockRx marketplace listings with filtering, sorting, and pagination.
Validation Rules
| Field | Required | Type | Rules |
|---|---|---|---|
| PharmacyNpi | Yes | long | Must be a valid NPI |
| SearchingContext | Yes | enum | Marketplace (1), BuyingActivity (2), SellingActivity (3) |
| NationalDrugCodes | No | string[] | Filter by NDC codes |
| BuyingPharmacyNpis | No | long[] | Filter by buying pharmacy NPIs. Not allowed when SearchingContext is Marketplace (1) or BuyingActivity (2) |
| SellingPharmacyNpis | No | long[] | Filter by selling pharmacy NPIs. Not allowed when SearchingContext is SellingActivity (3) |
| AllowedStatuses | No | enum[] | Pending (0), Purchased (1), Cancelled (2), ShippingConfirmed (5), ShippingReceivedConfirmed (6), ShippingNotReceived (7) |
| AllowedDeliveryStatuses | No | enum[] | Unknown (0), PreTransit (1), InTransit (2), OutForDelivery (3), Delivered (4), AvailableForPickup (5), ReturnToSender (6), Failure (7), Cancelled (8), Error (9) |
| ListingDate | No | DateRange | Object with start and end (ISO 8601) |
| PurchasedDate | No | DateRange | Object with start and end (ISO 8601) |
| ShippedDate | No | DateRange | Object with start and end (ISO 8601) |
| CancelledDate | No | DateRange | Object with start and end (ISO 8601) |
| ReceivedDate | No | DateRange | Object with start and end (ISO 8601) |
| NotTornPackageLabel | No | bool | Filter by intact package labels |
| FullPackage | No | bool | Filter by full packages only |
| SealedPackage | No | bool | Filter by sealed packages only |
| IsGroupOnly | No | bool | Filter by group membership |
| SearchTerm | No | string | Free-text search |
| SortName | No | string | Allowed: nationalDrugCode, listingDate, purchasedDate, shippedDate, cancelledDate, receivedDate |
| SortDirection | No | string | asc or desc |
| Start | No | int | Pagination offset (default: 0) |
| Take | No | int | Page size (default: 10) |
POST
/
api
/
v1
/
marketplace-listings
/
search
Search marketplace listings
curl --request POST \
--url https://test-instockrx-api.azurewebsites.net/api/v1/marketplace-listings/search \
--header 'Content-Type: application/json' \
--header 'X-INVIEW-AUTH: <api-key>' \
--data '
{
"pharmacyNpi": 1234567890,
"nationalDrugCodes": [
"01234567890"
],
"notTornPackageLabel": true,
"fullPackage": true,
"sealedPackage": true,
"isGroupOnly": true,
"allowedStatuses": [
0
],
"allowedDeliveryStatuses": [
0
],
"searchingContext": 1,
"buyingPharmacyNpis": [
987654321
],
"sellingPharmacyNpis": [
1122334455
],
"listingDate": {
"start": "2026-01-01T00:00:00Z",
"end": "2026-01-31T23:59:59Z"
},
"purchasedDate": {
"start": "2026-01-01T00:00:00Z",
"end": "2026-01-31T23:59:59Z"
},
"shippedDate": {
"start": "2026-01-01T00:00:00Z",
"end": "2026-01-31T23:59:59Z"
},
"cancelledDate": {
"start": "2026-01-01T00:00:00Z",
"end": "2026-01-31T23:59:59Z"
},
"receivedDate": {
"start": "2026-01-01T00:00:00Z",
"end": "2026-01-31T23:59:59Z"
},
"searchTerm": "Rexulti",
"sortDirection": "desc",
"sortName": "price",
"start": 0,
"take": 10
}
'const options = {
method: 'POST',
headers: {'X-INVIEW-AUTH': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
pharmacyNpi: 1234567890,
nationalDrugCodes: ['01234567890'],
notTornPackageLabel: true,
fullPackage: true,
sealedPackage: true,
isGroupOnly: true,
allowedStatuses: [0],
allowedDeliveryStatuses: [0],
searchingContext: 1,
buyingPharmacyNpis: [987654321],
sellingPharmacyNpis: [1122334455],
listingDate: {start: '2026-01-01T00:00:00Z', end: '2026-01-31T23:59:59Z'},
purchasedDate: {start: '2026-01-01T00:00:00Z', end: '2026-01-31T23:59:59Z'},
shippedDate: {start: '2026-01-01T00:00:00Z', end: '2026-01-31T23:59:59Z'},
cancelledDate: {start: '2026-01-01T00:00:00Z', end: '2026-01-31T23:59:59Z'},
receivedDate: {start: '2026-01-01T00:00:00Z', end: '2026-01-31T23:59:59Z'},
searchTerm: 'Rexulti',
sortDirection: 'desc',
sortName: 'price',
start: 0,
take: 10
})
};
fetch('https://test-instockrx-api.azurewebsites.net/api/v1/marketplace-listings/search', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://test-instockrx-api.azurewebsites.net/api/v1/marketplace-listings/search"
payload = {
"pharmacyNpi": 1234567890,
"nationalDrugCodes": ["01234567890"],
"notTornPackageLabel": True,
"fullPackage": True,
"sealedPackage": True,
"isGroupOnly": True,
"allowedStatuses": [0],
"allowedDeliveryStatuses": [0],
"searchingContext": 1,
"buyingPharmacyNpis": [987654321],
"sellingPharmacyNpis": [1122334455],
"listingDate": {
"start": "2026-01-01T00:00:00Z",
"end": "2026-01-31T23:59:59Z"
},
"purchasedDate": {
"start": "2026-01-01T00:00:00Z",
"end": "2026-01-31T23:59:59Z"
},
"shippedDate": {
"start": "2026-01-01T00:00:00Z",
"end": "2026-01-31T23:59:59Z"
},
"cancelledDate": {
"start": "2026-01-01T00:00:00Z",
"end": "2026-01-31T23:59:59Z"
},
"receivedDate": {
"start": "2026-01-01T00:00:00Z",
"end": "2026-01-31T23:59:59Z"
},
"searchTerm": "Rexulti",
"sortDirection": "desc",
"sortName": "price",
"start": 0,
"take": 10
}
headers = {
"X-INVIEW-AUTH": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"data": [
{
"buyerPharmacyName": "<string>",
"buyerPharmacyNationalProviderIdentifier": 123,
"buyersMessage": "<string>",
"buyingPharmacyAddress": {
"city": "<string>",
"line1": "<string>",
"line2": "<string>",
"postalCode": "<string>",
"stateAcronym": "<string>"
},
"buyingPharmacyName": "<string>",
"buyingPharmacyDBA": "<string>",
"buyingPharmacyPhone": 123,
"cancellationDescription": "<string>",
"cancellationReason": 1,
"cancelledDate": "2023-11-07T05:31:56Z",
"drugPackageForm": "<string>",
"drugPackageStrength": "<string>",
"expirationDate": "2023-11-07T05:31:56Z",
"fullPackage": true,
"originalPackage": true,
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"inventoryQuantity": 123,
"labelerName": "<string>",
"listingDate": "2023-11-07T05:31:56Z",
"lotNumber": "<string>",
"nationalDrugCode": "<string>",
"nationalDrugCodeNormalized": "<string>",
"additionalPackageNotes": "<string>",
"packageName": "<string>",
"paymentConfirmedDate": "2023-11-07T05:31:56Z",
"price": 123,
"pricePerQuantity": 123,
"quantity": 123,
"quantityUnitQualifier": "<string>",
"saleConfirmedBySellerDate": "2023-11-07T05:31:56Z",
"sealedPackage": true,
"sellerPharmacyName": "<string>",
"sellerPharmacyDBA": "<string>",
"sellerPharmacyNationalProviderIdentifier": 123,
"sellerPharmacyPhone": 123,
"shippingConfirmDate": "2023-11-07T05:31:56Z",
"shippingReceivedConfirmDate": "2023-11-07T05:31:56Z",
"soldDate": "2023-11-07T05:31:56Z",
"tornPackageLabel": true,
"sellerPharmacyAddress": {
"city": "<string>",
"line1": "<string>",
"line2": "<string>",
"postalCode": "<string>",
"stateAcronym": "<string>"
},
"status": 0,
"shipByDate": "2023-11-07T05:31:56Z",
"branded": true,
"generic": true,
"deliveryStatus": 0,
"groupId": "<string>",
"inStockRxUrl": "<string>",
"createdByGroupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"resultingMarketplaceListingRequestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"recordsFiltered": 123,
"recordsTotal": 123,
"writePagedSearch": {
"columns": [
"<string>"
],
"searchTerm": "<string>",
"sortDirection": "<string>",
"sortName": "<string>",
"start": 123,
"take": 123,
"columnFilters": [
{
"column": "<string>",
"operator": 1,
"value": "<string>",
"valueTo": "<string>"
}
]
}
}{
"error": "<string>",
"statusCode": 123,
"message": "<string>"
}{
"error": "<string>",
"statusCode": 123,
"message": "<string>"
}Authorizations
Custom API Key authentication. Default header: X-INVIEW-AUTH.
Body
application/jsonapplication/json-patch+jsontext/jsonapplication/*+json
Available options:
1, 2, 3 Available options:
0, 1, 2, 5, 6, 7, 10 Available options:
0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Maximum string length:
256Maximum string length:
20Maximum string length:
100