Create a marketplace listing
curl --request POST \
--url https://test-instockrx-api.azurewebsites.net/api/v1/marketplace-listings \
--header 'Content-Type: application/json' \
--header 'X-INVIEW-AUTH: <api-key>' \
--data '
{
"expirationDate": "12-31-2026",
"fullPackage": true,
"originalPackage": true,
"lotNumber": "1234ABC",
"nationalDrugCode": "01234567890",
"additionalPackageNotes": "overstocked, selling this med.",
"price": 125.5,
"quantity": 30,
"sealedPackage": true,
"tornPackageLabel": true,
"gtin": "00312345678901",
"serialNumber": "ABC1234",
"sellingPharmacyNpi": 1234567890,
"dscsaCertified": true,
"showOnlyInState": false
}
'const options = {
method: 'POST',
headers: {'X-INVIEW-AUTH': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
expirationDate: '12-31-2026',
fullPackage: true,
originalPackage: true,
lotNumber: '1234ABC',
nationalDrugCode: '01234567890',
additionalPackageNotes: 'overstocked, selling this med.',
price: 125.5,
quantity: 30,
sealedPackage: true,
tornPackageLabel: true,
gtin: '00312345678901',
serialNumber: 'ABC1234',
sellingPharmacyNpi: 1234567890,
dscsaCertified: true,
showOnlyInState: false
})
};
fetch('https://test-instockrx-api.azurewebsites.net/api/v1/marketplace-listings', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://test-instockrx-api.azurewebsites.net/api/v1/marketplace-listings"
payload = {
"expirationDate": "12-31-2026",
"fullPackage": True,
"originalPackage": True,
"lotNumber": "1234ABC",
"nationalDrugCode": "01234567890",
"additionalPackageNotes": "overstocked, selling this med.",
"price": 125.5,
"quantity": 30,
"sealedPackage": True,
"tornPackageLabel": True,
"gtin": "00312345678901",
"serialNumber": "ABC1234",
"sellingPharmacyNpi": 1234567890,
"dscsaCertified": True,
"showOnlyInState": False
}
headers = {
"X-INVIEW-AUTH": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(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
Create a marketplace listing
Provides an endpoint for creating a new marketplace listing on InStockRx. Validates the pharmacy based on the provided NPI and token claims, then creates the listing if authorized.
Validation Rules
| Field | Required | Type | Rules |
|---|---|---|---|
| NationalDrugCode | Yes | string | Must correspond to a real drug identifier |
| SellingPharmacyNpi | 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 |
| Gtin | Yes | string | Non-empty string |
| SerialNumber | 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 be a whole number equal to 1. If FullPackage=false: between 0.01 and the drug’s package size |
| SealedPackage | Yes | bool | - |
| DscsaCertified | Yes | bool | Must be true. Attests that the seller is authorized to sell under the DSCSA |
| OriginalPackage | Yes | bool | - |
| TornPackageLabel | Yes | bool | - |
| 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 |
POST
/
api
/
v1
/
marketplace-listings
Create a marketplace listing
curl --request POST \
--url https://test-instockrx-api.azurewebsites.net/api/v1/marketplace-listings \
--header 'Content-Type: application/json' \
--header 'X-INVIEW-AUTH: <api-key>' \
--data '
{
"expirationDate": "12-31-2026",
"fullPackage": true,
"originalPackage": true,
"lotNumber": "1234ABC",
"nationalDrugCode": "01234567890",
"additionalPackageNotes": "overstocked, selling this med.",
"price": 125.5,
"quantity": 30,
"sealedPackage": true,
"tornPackageLabel": true,
"gtin": "00312345678901",
"serialNumber": "ABC1234",
"sellingPharmacyNpi": 1234567890,
"dscsaCertified": true,
"showOnlyInState": false
}
'const options = {
method: 'POST',
headers: {'X-INVIEW-AUTH': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
expirationDate: '12-31-2026',
fullPackage: true,
originalPackage: true,
lotNumber: '1234ABC',
nationalDrugCode: '01234567890',
additionalPackageNotes: 'overstocked, selling this med.',
price: 125.5,
quantity: 30,
sealedPackage: true,
tornPackageLabel: true,
gtin: '00312345678901',
serialNumber: 'ABC1234',
sellingPharmacyNpi: 1234567890,
dscsaCertified: true,
showOnlyInState: false
})
};
fetch('https://test-instockrx-api.azurewebsites.net/api/v1/marketplace-listings', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://test-instockrx-api.azurewebsites.net/api/v1/marketplace-listings"
payload = {
"expirationDate": "12-31-2026",
"fullPackage": True,
"originalPackage": True,
"lotNumber": "1234ABC",
"nationalDrugCode": "01234567890",
"additionalPackageNotes": "overstocked, selling this med.",
"price": 125.5,
"quantity": 30,
"sealedPackage": True,
"tornPackageLabel": True,
"gtin": "00312345678901",
"serialNumber": "ABC1234",
"sellingPharmacyNpi": 1234567890,
"dscsaCertified": True,
"showOnlyInState": False
}
headers = {
"X-INVIEW-AUTH": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(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
Custom API Key authentication. Default header: X-INVIEW-AUTH.
Body
application/jsonapplication/json-patch+jsontext/jsonapplication/*+json
The request model containing details of the listing to create.
Maximum string length:
50Maximum string length:
15Maximum string length:
2000Pattern:
^\d{14}$Maximum string length:
500Response
Created
Show child attributes
Show child attributes
Available options:
1, 2, 3, 4, 5, 6 Show child attributes
Show child attributes
Available options:
0, 1, 2, 5, 6, 7, 10 Available options:
0, 1, 2, 3, 4, 5, 6, 7, 8, 9