Update marketplace listing
curl --request PUT \
--url https://sandbox-api.instockrx.com/api/v1/marketplace-listings/{id} \
--header 'Content-Type: application/json' \
--header 'X-INVIEW-AUTH: <api-key>' \
--data '
{
"pharmacyNPI": 1234567890,
"expirationDate": "12-31-2026",
"fullPackage": true,
"lotNumber": "1234ABC",
"sealedPackage": true,
"originalPackage": true,
"tornPackageLabel": true,
"serialNumber": "1234ABC",
"additionalPackageNotes": "overstocked, selling this med.",
"price": 125.5,
"quantity": 30,
"showOnlyInState": false,
"populatedByTwoDScan": null
}
'const options = {
method: 'PUT',
headers: {'X-INVIEW-AUTH': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
pharmacyNPI: 1234567890,
expirationDate: '12-31-2026',
fullPackage: true,
lotNumber: '1234ABC',
sealedPackage: true,
originalPackage: true,
tornPackageLabel: true,
serialNumber: '1234ABC',
additionalPackageNotes: 'overstocked, selling this med.',
price: 125.5,
quantity: 30,
showOnlyInState: false,
populatedByTwoDScan: null
})
};
fetch('https://sandbox-api.instockrx.com/api/v1/marketplace-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/api/v1/marketplace-listings/{id}"
payload = {
"pharmacyNPI": 1234567890,
"expirationDate": "12-31-2026",
"fullPackage": True,
"lotNumber": "1234ABC",
"sealedPackage": True,
"originalPackage": True,
"tornPackageLabel": True,
"serialNumber": "1234ABC",
"additionalPackageNotes": "overstocked, selling this med.",
"price": 125.5,
"quantity": 30,
"showOnlyInState": False,
"populatedByTwoDScan": None
}
headers = {
"X-INVIEW-AUTH": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text){
"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>",
"sealedPackage": true,
"sellerPharmacyName": "<string>",
"sellerPharmacyDBA": "<string>",
"sellerPharmacyNationalProviderIdentifier": 123,
"sellerPharmacyPhone": 123,
"sellerPharmacyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"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,
"gtin": "<string>",
"serialNumber": "<string>",
"deliveryStatus": 0,
"referralGroupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"stateGroupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"resultingMarketplaceListingRequestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"error": "<string>",
"statusCode": 123,
"message": "<string>"
}{
"error": "<string>",
"statusCode": 123,
"message": "<string>"
}{
"error": "<string>",
"statusCode": 123,
"message": "<string>"
}{
"error": "<string>",
"statusCode": 123,
"message": "<string>"
}Marketplace Listings
Update marketplace listing
Updates an existing marketplace listing on InStockRx. Validates the pharmacy based on the provided NPI and token claims, then applies updates only if the listing is still in a Pending state.
Validation Rules
| Field | Required | Type | Rules |
|---|---|---|---|
| PharmacyNPI | Yes | long | Must be a valid NPI |
| ExpirationDate | Yes | string | Must be a valid future date in ISO 8601 format (e.g. “2025-12-31T00:00:00Z”) |
| LotNumber | Yes | string | Non-empty string |
| Price | Yes | decimal | Must be a positive number |
| FullPackage | Yes | bool | Affects Quantity validation |
| Quantity | Yes | decimal | Must be positive. If FullPackage=true: must equal 1. If FullPackage=false: between 0.01 and the drug’s package size |
| SealedPackage | Yes | bool | - |
| OriginalPackage | Yes | bool | - |
| TornPackageLabel | No | bool | - |
| SerialNumber | No | string | If provided, must be a non-empty, non-whitespace string |
| AdditionalPackageNotes | No | string | If provided, must be a non-empty, non-whitespace string |
| ShowOnlyInState | No | bool | Not returned in the response. Instead, stateGroupId is returned: if showOnlyInState = true, stateGroupId will have a GUID value; if false, stateGroupId will be null |
Note: Listing must be in Pending status to be updated. Returns 409 Conflict otherwise.
PUT
/
api
/
v1
/
marketplace-listings
/
{id}
Update marketplace listing
curl --request PUT \
--url https://sandbox-api.instockrx.com/api/v1/marketplace-listings/{id} \
--header 'Content-Type: application/json' \
--header 'X-INVIEW-AUTH: <api-key>' \
--data '
{
"pharmacyNPI": 1234567890,
"expirationDate": "12-31-2026",
"fullPackage": true,
"lotNumber": "1234ABC",
"sealedPackage": true,
"originalPackage": true,
"tornPackageLabel": true,
"serialNumber": "1234ABC",
"additionalPackageNotes": "overstocked, selling this med.",
"price": 125.5,
"quantity": 30,
"showOnlyInState": false,
"populatedByTwoDScan": null
}
'const options = {
method: 'PUT',
headers: {'X-INVIEW-AUTH': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
pharmacyNPI: 1234567890,
expirationDate: '12-31-2026',
fullPackage: true,
lotNumber: '1234ABC',
sealedPackage: true,
originalPackage: true,
tornPackageLabel: true,
serialNumber: '1234ABC',
additionalPackageNotes: 'overstocked, selling this med.',
price: 125.5,
quantity: 30,
showOnlyInState: false,
populatedByTwoDScan: null
})
};
fetch('https://sandbox-api.instockrx.com/api/v1/marketplace-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/api/v1/marketplace-listings/{id}"
payload = {
"pharmacyNPI": 1234567890,
"expirationDate": "12-31-2026",
"fullPackage": True,
"lotNumber": "1234ABC",
"sealedPackage": True,
"originalPackage": True,
"tornPackageLabel": True,
"serialNumber": "1234ABC",
"additionalPackageNotes": "overstocked, selling this med.",
"price": 125.5,
"quantity": 30,
"showOnlyInState": False,
"populatedByTwoDScan": None
}
headers = {
"X-INVIEW-AUTH": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text){
"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>",
"sealedPackage": true,
"sellerPharmacyName": "<string>",
"sellerPharmacyDBA": "<string>",
"sellerPharmacyNationalProviderIdentifier": 123,
"sellerPharmacyPhone": 123,
"sellerPharmacyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"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,
"gtin": "<string>",
"serialNumber": "<string>",
"deliveryStatus": 0,
"referralGroupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"stateGroupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"resultingMarketplaceListingRequestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"error": "<string>",
"statusCode": 123,
"message": "<string>"
}{
"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
The update model containing the new listing details.
Response
OK