Search marketplace listings
curl --request POST \
--url https://sandbox-api.instockrx.com/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,
"createdByMyGroup": false,
"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,
"changeToken": null
}
'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,
createdByMyGroup: false,
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,
changeToken: null
})
};
fetch('https://sandbox-api.instockrx.com/api/v1/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/api/v1/marketplace-listings/search"
payload = {
"pharmacyNpi": 1234567890,
"nationalDrugCodes": ["01234567890"],
"notTornPackageLabel": True,
"fullPackage": True,
"sealedPackage": True,
"isGroupOnly": True,
"createdByMyGroup": False,
"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,
"changeToken": None
}
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",
"gtin": "<string>",
"serialNumber": "<string>",
"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",
"restrictions": {
"inStateOnly": "<string>",
"chainExclusiveUntil": "2023-11-07T05:31:56Z",
"blockedBuyerStates": [
"<string>"
],
"blockedSellerStates": [
"<string>"
]
},
"removedFromMarketplace": true
}
],
"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>"
}
]
},
"changeToken": "<string>",
"hasMoreChanges": true
}{
"error": "<string>",
"statusCode": 123,
"message": "<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 |
| CreatedByMyGroup | No | bool | Only records created through this API key’s group. Use with SellingActivity (listings) / BuyingActivity (offers) to see every status; Marketplace shows only what is currently live. Older records may be unattributed. Not the same as IsGroupOnly. |
| 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) |
| ChangeToken | No | string | The changeToken of an earlier response: returns only the records changed since, oldest change first. Start must be 0 and SortName/SortDirection empty. 410 when what the pharmacy can see changed since the token: search again without it |
Response fields gtin and serialNumber:
- SellingActivity (3): real values for the caller’s own listings.
- BuyingActivity (2): real values when the caller is the buyer.
- Marketplace (1):
"HIDDEN"for other pharmacies’ Pending listings; real values once sold.
POST
/
api
/
v1
/
marketplace-listings
/
search
Search marketplace listings
curl --request POST \
--url https://sandbox-api.instockrx.com/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,
"createdByMyGroup": false,
"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,
"changeToken": null
}
'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,
createdByMyGroup: false,
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,
changeToken: null
})
};
fetch('https://sandbox-api.instockrx.com/api/v1/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/api/v1/marketplace-listings/search"
payload = {
"pharmacyNpi": 1234567890,
"nationalDrugCodes": ["01234567890"],
"notTornPackageLabel": True,
"fullPackage": True,
"sealedPackage": True,
"isGroupOnly": True,
"createdByMyGroup": False,
"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,
"changeToken": None
}
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",
"gtin": "<string>",
"serialNumber": "<string>",
"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",
"restrictions": {
"inStateOnly": "<string>",
"chainExclusiveUntil": "2023-11-07T05:31:56Z",
"blockedBuyerStates": [
"<string>"
],
"blockedSellerStates": [
"<string>"
]
},
"removedFromMarketplace": true
}
],
"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>"
}
]
},
"changeToken": "<string>",
"hasMoreChanges": true
}{
"error": "<string>",
"statusCode": 123,
"message": "<string>"
}{
"error": "<string>",
"statusCode": 123,
"message": "<string>"
}{
"error": "<string>",
"statusCode": 123,
"message": "<string>"
}Authorizations
Body
application/jsonapplication/json-patch+jsontext/jsonapplication/*+json