curl --request PUT \
--url https://sandbox-api.instockrx.com/marketplace-listings/{id} \
--header 'Content-Type: application/json' \
--header 'X-InStockRx-Api-Key: <api-key>' \
--data '
{
"expirationDate": "2023-12-25",
"lotNumber": "<string>",
"price": "42.50",
"quantity": "1",
"fullPackage": true,
"originalPackage": true,
"sealedPackage": true,
"tornPackageLabel": true,
"serialNumber": "<string>",
"additionalPackageNotes": "<string>",
"showOnlyInState": true
}
'const options = {
method: 'PUT',
headers: {'X-InStockRx-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
expirationDate: '2023-12-25',
lotNumber: '<string>',
price: '42.50',
quantity: '1',
fullPackage: true,
originalPackage: true,
sealedPackage: true,
tornPackageLabel: true,
serialNumber: '<string>',
additionalPackageNotes: '<string>',
showOnlyInState: true
})
};
fetch('https://sandbox-api.instockrx.com/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/marketplace-listings/{id}"
payload = {
"expirationDate": "2023-12-25",
"lotNumber": "<string>",
"price": "42.50",
"quantity": "1",
"fullPackage": True,
"originalPackage": True,
"sealedPackage": True,
"tornPackageLabel": True,
"serialNumber": "<string>",
"additionalPackageNotes": "<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",
"status": "Pending",
"nationalDrugCode": "<string>",
"sellerPharmacyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"deliveryStatus": "Unknown",
"paymentStatus": "NotInitiated",
"nationalDrugCodeNormalized": "<string>",
"labelerName": "<string>",
"packageName": "<string>",
"drugPackageForm": "<string>",
"drugPackageStrength": "<string>",
"quantityUnitQualifier": "<string>",
"price": "42.50",
"pricePerQuantity": "42.50",
"quantity": "1",
"inventoryQuantity": "1",
"expirationDate": "2023-12-25",
"lotNumber": "<string>",
"gtin": "<string>",
"serialNumber": "<string>",
"fullPackage": true,
"originalPackage": true,
"sealedPackage": true,
"tornPackageLabel": true,
"additionalPackageNotes": "<string>",
"branded": true,
"generic": true,
"sellerPharmacyName": "<string>",
"sellerPharmacyDBA": "<string>",
"sellerPharmacyNpi": "1234567890",
"sellerPharmacyPhone": "<string>",
"sellerPharmacyAddress": {
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"stateAcronym": "<string>",
"postalCode": "<string>"
},
"buyerPharmacyName": "<string>",
"buyingPharmacyName": "<string>",
"buyingPharmacyDBA": "<string>",
"buyingPharmacyNpi": "1234567890",
"buyingPharmacyPhone": "<string>",
"buyingPharmacyAddress": {
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"stateAcronym": "<string>",
"postalCode": "<string>"
},
"buyersMessage": "<string>",
"listingDate": "2023-11-07T05:31:56Z",
"soldDate": "2023-11-07T05:31:56Z",
"shippingConfirmDate": "2023-11-07T05:31:56Z",
"shippingReceivedConfirmDate": "2023-11-07T05:31:56Z",
"paymentConfirmedDate": "2023-11-07T05:31:56Z",
"shipByDate": "2023-12-25",
"cancelledDate": "2023-11-07T05:31:56Z",
"cancellationReason": "SellerCancelled",
"cancellationDescription": "<string>",
"receivedDetails": {
"gtin": "<string>",
"serialNumber": "<string>",
"lotNumber": "<string>",
"expirationDate": "2023-12-25",
"nationalDrugCode": "<string>"
},
"receivedDetailsMatch": true,
"receivedDetailsConfirmationType": "NotChecked"
}{
"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>"
}
]
}{
"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>"
}
]
}{
"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>"
}
]
}Update a marketplace listing
Scope: listings:write.
curl --request PUT \
--url https://sandbox-api.instockrx.com/marketplace-listings/{id} \
--header 'Content-Type: application/json' \
--header 'X-InStockRx-Api-Key: <api-key>' \
--data '
{
"expirationDate": "2023-12-25",
"lotNumber": "<string>",
"price": "42.50",
"quantity": "1",
"fullPackage": true,
"originalPackage": true,
"sealedPackage": true,
"tornPackageLabel": true,
"serialNumber": "<string>",
"additionalPackageNotes": "<string>",
"showOnlyInState": true
}
'const options = {
method: 'PUT',
headers: {'X-InStockRx-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
expirationDate: '2023-12-25',
lotNumber: '<string>',
price: '42.50',
quantity: '1',
fullPackage: true,
originalPackage: true,
sealedPackage: true,
tornPackageLabel: true,
serialNumber: '<string>',
additionalPackageNotes: '<string>',
showOnlyInState: true
})
};
fetch('https://sandbox-api.instockrx.com/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/marketplace-listings/{id}"
payload = {
"expirationDate": "2023-12-25",
"lotNumber": "<string>",
"price": "42.50",
"quantity": "1",
"fullPackage": True,
"originalPackage": True,
"sealedPackage": True,
"tornPackageLabel": True,
"serialNumber": "<string>",
"additionalPackageNotes": "<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",
"status": "Pending",
"nationalDrugCode": "<string>",
"sellerPharmacyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"deliveryStatus": "Unknown",
"paymentStatus": "NotInitiated",
"nationalDrugCodeNormalized": "<string>",
"labelerName": "<string>",
"packageName": "<string>",
"drugPackageForm": "<string>",
"drugPackageStrength": "<string>",
"quantityUnitQualifier": "<string>",
"price": "42.50",
"pricePerQuantity": "42.50",
"quantity": "1",
"inventoryQuantity": "1",
"expirationDate": "2023-12-25",
"lotNumber": "<string>",
"gtin": "<string>",
"serialNumber": "<string>",
"fullPackage": true,
"originalPackage": true,
"sealedPackage": true,
"tornPackageLabel": true,
"additionalPackageNotes": "<string>",
"branded": true,
"generic": true,
"sellerPharmacyName": "<string>",
"sellerPharmacyDBA": "<string>",
"sellerPharmacyNpi": "1234567890",
"sellerPharmacyPhone": "<string>",
"sellerPharmacyAddress": {
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"stateAcronym": "<string>",
"postalCode": "<string>"
},
"buyerPharmacyName": "<string>",
"buyingPharmacyName": "<string>",
"buyingPharmacyDBA": "<string>",
"buyingPharmacyNpi": "1234567890",
"buyingPharmacyPhone": "<string>",
"buyingPharmacyAddress": {
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"stateAcronym": "<string>",
"postalCode": "<string>"
},
"buyersMessage": "<string>",
"listingDate": "2023-11-07T05:31:56Z",
"soldDate": "2023-11-07T05:31:56Z",
"shippingConfirmDate": "2023-11-07T05:31:56Z",
"shippingReceivedConfirmDate": "2023-11-07T05:31:56Z",
"paymentConfirmedDate": "2023-11-07T05:31:56Z",
"shipByDate": "2023-12-25",
"cancelledDate": "2023-11-07T05:31:56Z",
"cancellationReason": "SellerCancelled",
"cancellationDescription": "<string>",
"receivedDetails": {
"gtin": "<string>",
"serialNumber": "<string>",
"lotNumber": "<string>",
"expirationDate": "2023-12-25",
"nationalDrugCode": "<string>"
},
"receivedDetailsMatch": true,
"receivedDetailsConfirmationType": "NotChecked"
}{
"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>"
}
]
}{
"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>"
}
]
}{
"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.
"W/\"AAAAAAAAB9E=\""
"*"
Body
Response
OK
Lifecycle of a marketplace listing. V1 values 3 (PaymentConfirmed) and
4 (SaleConfirmed) are commented out in C# and excluded here.
The wire value ShippingReceivedNotConfirmed corresponds to the C#
member ShippingNotReceived (overridden via [EnumMember(Value=…)]).
Pending, Purchased, Cancelled, ShippingConfirmed, ShippingReceivedConfirmed, ShippingReceivedNotConfirmed, Paused Where a listing's payment has got to. Confirmed against
Inview.Domain/Enum/MarketplaceListingPaymentStatus.cs; the live document never
emits this enum, because it appears only on responses, so the drift check cannot
confirm it and a reader has to.
NotInitiated, Pending, PaymentConfirmed, PaymentSentToSeller, SellerReceivedPayment, Refunded, FailedDueToInsufficientFunds, Cancelled 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"
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"
On reads, any of the eight values may appear — ReturnCompleted when a completed
return cancelled the sale, ShipByDateExpired when the seller missed the ship-by
date, and DuplicateOfAcceptedCashOffer when the listing was cancelled as a
duplicate of a cash offer that had already been accepted, and AdminRefund when an
InStockRx admin refunded the order after the seller had already been paid.
On writes (POST /marketplace-listings/{id}/cancel) only SellerCancelled and
BuyerCancelled are accepted, and the one you send must match the side you are
acting as: a seller sends SellerCancelled, a buyer sends BuyerCancelled. The
auto-trigger values are reserved for system use. Anything else is
400 invalid-cancellation-reason.
Choosing the right value matters beyond bookkeeping: BuyerCancelled on a listing
that is still Purchased makes the backend auto-relist the item under the same
seller. A seller-initiated cancel mislabelled as BuyerCancelled would spawn an
unwanted replacement listing. After the listing is marked shipped no cancel
relists, whichever reason is used.
SellerCancelled, PharmacyInventoryQuantityAutoTrigger, AutomaticDrugExpired, BuyerCancelled, ReturnCompleted, ShipByDateExpired, DuplicateOfAcceptedCashOffer, AdminRefund Server-computed comparison of receivedDetails against the
seller-declared pedigree on the listing. true if every field the
buyer supplied agreed with the listing; false if any disagreed;
null if no comparison was performed (no receivedDetails
supplied or confirmationType was NotChecked / Skipped).
Drives whether the seller earns a positive rating bump on receipt.