curl --request POST \
--url https://sandbox-api.instockrx.com/marketplace-listings/{id}/ship \
--header 'Content-Type: application/json' \
--header 'X-InStockRx-Api-Key: <api-key>' \
--data '
{
"gtin": "<string>",
"serialNumber": "<string>",
"lotNumber": "<string>",
"expirationDate": "2023-12-25",
"sellerNotes": "<string>"
}
'const options = {
method: 'POST',
headers: {'X-InStockRx-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
gtin: '<string>',
serialNumber: '<string>',
lotNumber: '<string>',
expirationDate: '2023-12-25',
sellerNotes: '<string>'
})
};
fetch('https://sandbox-api.instockrx.com/marketplace-listings/{id}/ship', 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}/ship"
payload = {
"gtin": "<string>",
"serialNumber": "<string>",
"lotNumber": "<string>",
"expirationDate": "2023-12-25",
"sellerNotes": "<string>"
}
headers = {
"X-InStockRx-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(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>"
}
]
}Seller confirms shipment of a purchased listing
Scope: listings:write.
Transitions the listing from Purchased to ShippingConfirmed. DSCSA
pedigree fields are required: gtin, serialNumber, lotNumber,
expirationDate. If the bundle is cold-chain, the ship date must fall
on Mon–Thu (returns 409 cold-chain-ship-day otherwise). The bundle
transitions to Shipped when its first listing ships.
InStockRx caps how many of a seller’s bundles may sit in Shipped
status awaiting buyer receipt (an admin-configured limit). If shipping
this listing would carry the seller past that cap, the call is rejected
with 409 shipped-bundle-limit-exceeded; the seller must wait for
in-flight bundles to be received before shipping more. The cap is not
evaluated for a listing whose bundle is already Shipped (adding items
to an already-shipped bundle does not increase the count).
curl --request POST \
--url https://sandbox-api.instockrx.com/marketplace-listings/{id}/ship \
--header 'Content-Type: application/json' \
--header 'X-InStockRx-Api-Key: <api-key>' \
--data '
{
"gtin": "<string>",
"serialNumber": "<string>",
"lotNumber": "<string>",
"expirationDate": "2023-12-25",
"sellerNotes": "<string>"
}
'const options = {
method: 'POST',
headers: {'X-InStockRx-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
gtin: '<string>',
serialNumber: '<string>',
lotNumber: '<string>',
expirationDate: '2023-12-25',
sellerNotes: '<string>'
})
};
fetch('https://sandbox-api.instockrx.com/marketplace-listings/{id}/ship', 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}/ship"
payload = {
"gtin": "<string>",
"serialNumber": "<string>",
"lotNumber": "<string>",
"expirationDate": "2023-12-25",
"sellerNotes": "<string>"
}
headers = {
"X-InStockRx-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(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.
Body
Body for POST /marketplace-listings/{id}/ship. DSCSA pedigree fields
are required. If the bundle is cold-chain, ship-day must be Mon–Thu.
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.