Update a draft listing
curl --request PUT \
--url https://sandbox-api.instockrx.com/draft-listings/{id} \
--header 'Content-Type: application/json' \
--header 'X-InStockRx-Api-Key: <api-key>' \
--data '
{
"nationalDrugCode": "<string>",
"expirationDate": "2023-12-25",
"lotNumber": "<string>",
"price": "42.50",
"quantity": "1",
"sealedPackage": true,
"originalPackage": true,
"tornPackageLabel": true,
"fullPackage": true,
"additionalPackageNotes": "<string>",
"gtin": "<string>",
"serialNumber": "<string>",
"showOnlyInState": true
}
'const options = {
method: 'PUT',
headers: {'X-InStockRx-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
nationalDrugCode: '<string>',
expirationDate: '2023-12-25',
lotNumber: '<string>',
price: '42.50',
quantity: '1',
sealedPackage: true,
originalPackage: true,
tornPackageLabel: true,
fullPackage: true,
additionalPackageNotes: '<string>',
gtin: '<string>',
serialNumber: '<string>',
showOnlyInState: true
})
};
fetch('https://sandbox-api.instockrx.com/draft-listings/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://sandbox-api.instockrx.com/draft-listings/{id}"
payload = {
"nationalDrugCode": "<string>",
"expirationDate": "2023-12-25",
"lotNumber": "<string>",
"price": "42.50",
"quantity": "1",
"sealedPackage": True,
"originalPackage": True,
"tornPackageLabel": True,
"fullPackage": True,
"additionalPackageNotes": "<string>",
"gtin": "<string>",
"serialNumber": "<string>",
"showOnlyInState": 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>",
"savedByUserId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"nationalDrugCodeNormalized": "<string>",
"expirationDate": "2023-12-25",
"lotNumber": "<string>",
"price": "42.50",
"quantity": "1",
"sealedPackage": true,
"originalPackage": true,
"tornPackageLabel": true,
"fullPackage": true,
"additionalPackageNotes": "<string>",
"gtin": "<string>",
"serialNumber": "<string>",
"drugPackageForm": "<string>",
"drugPackageStrength": "<string>",
"labelerName": "<string>",
"packageName": "<string>",
"sellerPharmacyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sellerPharmacyName": "<string>",
"sellerPharmacyDBA": "<string>",
"branded": true,
"generic": true,
"showOnlyInState": true,
"isCertified": true,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}{
"type": "https://api.instockrx.com/problems/listing-not-available",
"title": "<string>",
"status": 349,
"detail": "<string>",
"instance": "<string>",
"requestId": "<string>",
"errors": [
{
"field": "<string>",
"code": "<string>",
"message": "<string>"
}
]
}Draft Listings
Update a draft listing
Scope: listings:write.
PUT
/
draft-listings
/
{id}
Update a draft listing
curl --request PUT \
--url https://sandbox-api.instockrx.com/draft-listings/{id} \
--header 'Content-Type: application/json' \
--header 'X-InStockRx-Api-Key: <api-key>' \
--data '
{
"nationalDrugCode": "<string>",
"expirationDate": "2023-12-25",
"lotNumber": "<string>",
"price": "42.50",
"quantity": "1",
"sealedPackage": true,
"originalPackage": true,
"tornPackageLabel": true,
"fullPackage": true,
"additionalPackageNotes": "<string>",
"gtin": "<string>",
"serialNumber": "<string>",
"showOnlyInState": true
}
'const options = {
method: 'PUT',
headers: {'X-InStockRx-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
nationalDrugCode: '<string>',
expirationDate: '2023-12-25',
lotNumber: '<string>',
price: '42.50',
quantity: '1',
sealedPackage: true,
originalPackage: true,
tornPackageLabel: true,
fullPackage: true,
additionalPackageNotes: '<string>',
gtin: '<string>',
serialNumber: '<string>',
showOnlyInState: true
})
};
fetch('https://sandbox-api.instockrx.com/draft-listings/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://sandbox-api.instockrx.com/draft-listings/{id}"
payload = {
"nationalDrugCode": "<string>",
"expirationDate": "2023-12-25",
"lotNumber": "<string>",
"price": "42.50",
"quantity": "1",
"sealedPackage": True,
"originalPackage": True,
"tornPackageLabel": True,
"fullPackage": True,
"additionalPackageNotes": "<string>",
"gtin": "<string>",
"serialNumber": "<string>",
"showOnlyInState": 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>",
"savedByUserId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"nationalDrugCodeNormalized": "<string>",
"expirationDate": "2023-12-25",
"lotNumber": "<string>",
"price": "42.50",
"quantity": "1",
"sealedPackage": true,
"originalPackage": true,
"tornPackageLabel": true,
"fullPackage": true,
"additionalPackageNotes": "<string>",
"gtin": "<string>",
"serialNumber": "<string>",
"drugPackageForm": "<string>",
"drugPackageStrength": "<string>",
"labelerName": "<string>",
"packageName": "<string>",
"sellerPharmacyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sellerPharmacyName": "<string>",
"sellerPharmacyDBA": "<string>",
"branded": true,
"generic": true,
"showOnlyInState": true,
"isCertified": true,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}{
"type": "https://api.instockrx.com/problems/listing-not-available",
"title": "<string>",
"status": 349,
"detail": "<string>",
"instance": "<string>",
"requestId": "<string>",
"errors": [
{
"field": "<string>",
"code": "<string>",
"message": "<string>"
}
]
}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.
Examples:
"W/\"AAAAAAAAB9E=\""
"*"
Body
application/json
Response
OK