Search returns
curl --request POST \
--url https://sandbox-api.instockrx.com/returns/search \
--header 'Content-Type: application/json' \
--header 'X-InStockRx-Api-Key: <api-key>' \
--data '
{
"filters": {
"status": [],
"buyerPharmacyNpis": [
"1234567890"
],
"sellerPharmacyNpis": [
"1234567890"
],
"createdAt": {
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z"
},
"q": "<string>"
},
"sort": [
"<string>"
],
"page": {
"limit": 50,
"cursor": "<string>"
}
}
'const options = {
method: 'POST',
headers: {'X-InStockRx-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
filters: {
status: [],
buyerPharmacyNpis: ['1234567890'],
sellerPharmacyNpis: ['1234567890'],
createdAt: {from: '2023-11-07T05:31:56Z', to: '2023-11-07T05:31:56Z'},
q: '<string>'
},
sort: ['<string>'],
page: {limit: 50, cursor: '<string>'}
})
};
fetch('https://sandbox-api.instockrx.com/returns/search', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://sandbox-api.instockrx.com/returns/search"
payload = {
"filters": {
"status": [],
"buyerPharmacyNpis": ["1234567890"],
"sellerPharmacyNpis": ["1234567890"],
"createdAt": {
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z"
},
"q": "<string>"
},
"sort": ["<string>"],
"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": "Requested",
"buyingPharmacyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sellingPharmacyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"items": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"marketplaceListingId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"listingCode": "<string>",
"drugName": "<string>",
"nationalDrugCode": "<string>",
"price": "42.50",
"quantity": "1",
"returnReason": "<string>",
"restockingFeeResponsibility": "InstockRx",
"restockingFeeAmount": "42.50",
"restockingFeeAmountToBuyer": "42.50",
"restockingFeeAmountToSeller": "42.50",
"achFeeResponsibility": "InstockRx",
"achFeeAmount": "42.50",
"achFeeAmountToBuyer": "42.50",
"achFeeAmountToSeller": "42.50",
"originalShippingFeeAmount": "42.50",
"returnGtin": "<string>",
"returnSerialNumber": "<string>",
"returnLotNumber": "<string>",
"returnPackageDescription": "<string>",
"returnExpirationDate": "2023-11-07T05:31:56Z",
"returnFullPackage": true,
"returnSealedPackage": true,
"returnOriginalPackage": true,
"returnTornPackageLabel": true
}
],
"requestedDate": "2023-11-07T05:31:56Z",
"approvedDate": "2023-11-07T05:31:56Z",
"notApprovedDate": "2023-11-07T05:31:56Z",
"shippedDate": "2023-11-07T05:31:56Z",
"receivedDate": "2023-11-07T05:31:56Z",
"dateShippingLabelCreated": "2023-11-07T05:31:56Z",
"buyingPharmacyName": "<string>",
"buyingPharmacyNpi": "1234567890",
"sellingPharmacyName": "<string>",
"sellingPharmacyNpi": "1234567890",
"carrier": "UPS",
"trackingCode": "<string>",
"shippingLabelUrl": "<string>",
"returnDeliveryStatus": "Unknown",
"shippingFeeResponsibility": "InstockRx",
"originalShippingFeeAmount": "42.50",
"returnShippingFeeAmount": "42.50",
"refundAmountToBuyer": "42.50",
"chargeAmountFromSeller": "42.50",
"adminNote": "<string>"
}
],
"page": {
"limit": 100,
"nextCursor": "<string>",
"prevCursor": "<string>",
"estimatedTotal": 1
}
}Returns
Search returns
Scope: returns:read.
POST
/
returns
/
search
Search returns
curl --request POST \
--url https://sandbox-api.instockrx.com/returns/search \
--header 'Content-Type: application/json' \
--header 'X-InStockRx-Api-Key: <api-key>' \
--data '
{
"filters": {
"status": [],
"buyerPharmacyNpis": [
"1234567890"
],
"sellerPharmacyNpis": [
"1234567890"
],
"createdAt": {
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z"
},
"q": "<string>"
},
"sort": [
"<string>"
],
"page": {
"limit": 50,
"cursor": "<string>"
}
}
'const options = {
method: 'POST',
headers: {'X-InStockRx-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
filters: {
status: [],
buyerPharmacyNpis: ['1234567890'],
sellerPharmacyNpis: ['1234567890'],
createdAt: {from: '2023-11-07T05:31:56Z', to: '2023-11-07T05:31:56Z'},
q: '<string>'
},
sort: ['<string>'],
page: {limit: 50, cursor: '<string>'}
})
};
fetch('https://sandbox-api.instockrx.com/returns/search', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://sandbox-api.instockrx.com/returns/search"
payload = {
"filters": {
"status": [],
"buyerPharmacyNpis": ["1234567890"],
"sellerPharmacyNpis": ["1234567890"],
"createdAt": {
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z"
},
"q": "<string>"
},
"sort": ["<string>"],
"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": "Requested",
"buyingPharmacyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sellingPharmacyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"items": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"marketplaceListingId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"listingCode": "<string>",
"drugName": "<string>",
"nationalDrugCode": "<string>",
"price": "42.50",
"quantity": "1",
"returnReason": "<string>",
"restockingFeeResponsibility": "InstockRx",
"restockingFeeAmount": "42.50",
"restockingFeeAmountToBuyer": "42.50",
"restockingFeeAmountToSeller": "42.50",
"achFeeResponsibility": "InstockRx",
"achFeeAmount": "42.50",
"achFeeAmountToBuyer": "42.50",
"achFeeAmountToSeller": "42.50",
"originalShippingFeeAmount": "42.50",
"returnGtin": "<string>",
"returnSerialNumber": "<string>",
"returnLotNumber": "<string>",
"returnPackageDescription": "<string>",
"returnExpirationDate": "2023-11-07T05:31:56Z",
"returnFullPackage": true,
"returnSealedPackage": true,
"returnOriginalPackage": true,
"returnTornPackageLabel": true
}
],
"requestedDate": "2023-11-07T05:31:56Z",
"approvedDate": "2023-11-07T05:31:56Z",
"notApprovedDate": "2023-11-07T05:31:56Z",
"shippedDate": "2023-11-07T05:31:56Z",
"receivedDate": "2023-11-07T05:31:56Z",
"dateShippingLabelCreated": "2023-11-07T05:31:56Z",
"buyingPharmacyName": "<string>",
"buyingPharmacyNpi": "1234567890",
"sellingPharmacyName": "<string>",
"sellingPharmacyNpi": "1234567890",
"carrier": "UPS",
"trackingCode": "<string>",
"shippingLabelUrl": "<string>",
"returnDeliveryStatus": "Unknown",
"shippingFeeResponsibility": "InstockRx",
"originalShippingFeeAmount": "42.50",
"returnShippingFeeAmount": "42.50",
"refundAmountToBuyer": "42.50",
"chargeAmountFromSeller": "42.50",
"adminNote": "<string>"
}
],
"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.