curl --request PUT \
--url https://sandbox-api.instockrx.com/evergreen-cash-offer-preferences/{id} \
--header 'Content-Type: application/json' \
--header 'X-InStockRx-Api-Key: <api-key>' \
--data '
{
"nationalDrugCode": "<string>",
"price": "42.50",
"maxQuantityPerOffer": "1",
"minimalExpirationDate": "2023-12-25",
"requireFullPackage": true,
"requireSealedPackage": true,
"requireOriginalPackage": true,
"requireIntactPackageLabel": true,
"maxShippingPrice": "42.50",
"active": true
}
'const options = {
method: 'PUT',
headers: {'X-InStockRx-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
nationalDrugCode: '<string>',
price: '42.50',
maxQuantityPerOffer: '1',
minimalExpirationDate: '2023-12-25',
requireFullPackage: true,
requireSealedPackage: true,
requireOriginalPackage: true,
requireIntactPackageLabel: true,
maxShippingPrice: '42.50',
active: true
})
};
fetch('https://sandbox-api.instockrx.com/evergreen-cash-offer-preferences/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://sandbox-api.instockrx.com/evergreen-cash-offer-preferences/{id}"
payload = {
"nationalDrugCode": "<string>",
"price": "42.50",
"maxQuantityPerOffer": "1",
"minimalExpirationDate": "2023-12-25",
"requireFullPackage": True,
"requireSealedPackage": True,
"requireOriginalPackage": True,
"requireIntactPackageLabel": True,
"maxShippingPrice": "42.50",
"active": True
}
headers = {
"X-InStockRx-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text){
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"nationalDrugCode": "<string>",
"buyingPharmacyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"price": "42.50",
"buyingPharmacyNpi": "1234567890",
"maxQuantityPerOffer": "1",
"minimalExpirationDate": "2023-12-25",
"requireFullPackage": true,
"requireSealedPackage": true,
"requireOriginalPackage": true,
"requireIntactPackageLabel": true,
"shippingRequestMethod": "Custom",
"maxShippingPrice": "42.50",
"active": true,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}Update an evergreen preference
Scope: offers:write.
curl --request PUT \
--url https://sandbox-api.instockrx.com/evergreen-cash-offer-preferences/{id} \
--header 'Content-Type: application/json' \
--header 'X-InStockRx-Api-Key: <api-key>' \
--data '
{
"nationalDrugCode": "<string>",
"price": "42.50",
"maxQuantityPerOffer": "1",
"minimalExpirationDate": "2023-12-25",
"requireFullPackage": true,
"requireSealedPackage": true,
"requireOriginalPackage": true,
"requireIntactPackageLabel": true,
"maxShippingPrice": "42.50",
"active": true
}
'const options = {
method: 'PUT',
headers: {'X-InStockRx-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
nationalDrugCode: '<string>',
price: '42.50',
maxQuantityPerOffer: '1',
minimalExpirationDate: '2023-12-25',
requireFullPackage: true,
requireSealedPackage: true,
requireOriginalPackage: true,
requireIntactPackageLabel: true,
maxShippingPrice: '42.50',
active: true
})
};
fetch('https://sandbox-api.instockrx.com/evergreen-cash-offer-preferences/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://sandbox-api.instockrx.com/evergreen-cash-offer-preferences/{id}"
payload = {
"nationalDrugCode": "<string>",
"price": "42.50",
"maxQuantityPerOffer": "1",
"minimalExpirationDate": "2023-12-25",
"requireFullPackage": True,
"requireSealedPackage": True,
"requireOriginalPackage": True,
"requireIntactPackageLabel": True,
"maxShippingPrice": "42.50",
"active": True
}
headers = {
"X-InStockRx-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text){
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"nationalDrugCode": "<string>",
"buyingPharmacyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"price": "42.50",
"buyingPharmacyNpi": "1234567890",
"maxQuantityPerOffer": "1",
"minimalExpirationDate": "2023-12-25",
"requireFullPackage": true,
"requireSealedPackage": true,
"requireOriginalPackage": true,
"requireIntactPackageLabel": true,
"shippingRequestMethod": "Custom",
"maxShippingPrice": "42.50",
"active": true,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}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.
The ETag from your most recent read of this resource, to avoid overwriting a change someone else made in the meantime. A stale value is 412 stale-resource and nothing is modified. * means "any current version". Omitting it is not an error — it means last write wins.
"W/\"AAAAAAAAB9E=\""
"*"
Body
Response
OK
NPI as a fixed-width 10-digit string. v2 treats an NPI as an opaque identifier
rather than a number, consistent with how it handles NDC, GTIN and other
healthcare identifiers. CMS-issued NPIs always start with 1 or 2, so
leading-zero NPIs do not arise in practice, but string typing rules out the
broader class of integer-identifier truncation bugs that v1 was open to.
^\d{10}$"1234567890"
"2987654321"