Creates a new draft marketplace listing.
curl --request POST \
--url https://test-instockrx-api.azurewebsites.net/api/v1/draft-listings \
--header 'Content-Type: application/json' \
--header 'X-INVIEW-AUTH: <api-key>' \
--data '
{
"nationalDrugCode": "01234567890",
"expirationDate": "2026-01-15T00:00:00Z",
"lotNumber": "1234ABC",
"price": 125.5,
"quantity": 30,
"sealedPackage": true,
"originalPackage": true,
"tornPackageLabel": true,
"fullPackage": true,
"additionalPackageNotes": "patient moved away, selling for a good price.",
"gtin": "00312345678901",
"serialNumber": "ABC1234",
"showOnlyInState": false,
"sellingPharmacyNpi": 1234567890
}
'const options = {
method: 'POST',
headers: {'X-INVIEW-AUTH': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
nationalDrugCode: '01234567890',
expirationDate: '2026-01-15T00:00:00Z',
lotNumber: '1234ABC',
price: 125.5,
quantity: 30,
sealedPackage: true,
originalPackage: true,
tornPackageLabel: true,
fullPackage: true,
additionalPackageNotes: 'patient moved away, selling for a good price.',
gtin: '00312345678901',
serialNumber: 'ABC1234',
showOnlyInState: false,
sellingPharmacyNpi: 1234567890
})
};
fetch('https://test-instockrx-api.azurewebsites.net/api/v1/draft-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/draft-listings"
payload = {
"nationalDrugCode": "01234567890",
"expirationDate": "2026-01-15T00:00:00Z",
"lotNumber": "1234ABC",
"price": 125.5,
"quantity": 30,
"sealedPackage": True,
"originalPackage": True,
"tornPackageLabel": True,
"fullPackage": True,
"additionalPackageNotes": "patient moved away, selling for a good price.",
"gtin": "00312345678901",
"serialNumber": "ABC1234",
"showOnlyInState": False,
"sellingPharmacyNpi": 1234567890
}
headers = {
"X-INVIEW-AUTH": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"savedByUserId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"nationalDrugCode": "<string>",
"expirationDate": "2023-11-07T05:31:56Z",
"lotNumber": "<string>",
"price": 123,
"quantity": 123,
"sealedPackage": true,
"originalPackage": true,
"tornPackageLabel": true,
"fullPackage": true,
"images": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"savedByUserId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"path": "<string>"
}
],
"gtin": "<string>",
"serialNumber": "<string>",
"drugPackageForm": "<string>",
"drugPackageStrength": "<string>",
"labelerName": "<string>",
"nationalDrugCodeNormalized": "<string>",
"drugPackageDescription": "<string>",
"additionalPackageNotes": "<string>",
"packageName": "<string>",
"sellerPharmacyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sellerPharmacyName": "<string>",
"sellerPharmacyGln": "<string>",
"sellerPharmacyDBA": "<string>",
"branded": true,
"generic": true,
"nadacPrice": 123,
"nadacPercentage": 123,
"quantityUnitQualifier": "<string>",
"stateGroupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"showOnlyInState": true,
"isCertified": true,
"certificationFilePath": "<string>",
"certificationFileName": "<string>"
}{
"error": "<string>",
"statusCode": 123,
"message": "<string>"
}{
"error": "<string>",
"statusCode": 123,
"message": "<string>"
}{
"error": "<string>",
"statusCode": 123,
"message": "<string>"
}{
"error": "<string>",
"statusCode": 123,
"message": "<string>"
}Draft Listings
Creates a new draft marketplace listing.
Accepts details for a third-party draft listing and creates a new draft record. Validates the selling pharmacy and ensures the user has permission to create the draft.
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 | No | string | If provided, must be a valid future date in ISO 8601 format (e.g. “2025-12-31T00:00:00Z”) |
| LotNumber | No | string | If provided, must be a non-empty, non-whitespace string |
| Price | No | decimal | If provided, must be a positive number |
| FullPackage | No | bool | Affects Quantity validation when Quantity is provided |
| Quantity | No | decimal | If provided, must be positive. If FullPackage=true: must equal 1. If FullPackage=false: between 0.01 and the drug’s package size |
| SealedPackage | No | bool | - |
| OriginalPackage | Yes | bool | - |
| TornPackageLabel | No | bool | - |
| Gtin | No | string | If provided, must be a non-empty, non-whitespace string |
| 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 |
POST
/
api
/
v1
/
draft-listings
Creates a new draft marketplace listing.
curl --request POST \
--url https://test-instockrx-api.azurewebsites.net/api/v1/draft-listings \
--header 'Content-Type: application/json' \
--header 'X-INVIEW-AUTH: <api-key>' \
--data '
{
"nationalDrugCode": "01234567890",
"expirationDate": "2026-01-15T00:00:00Z",
"lotNumber": "1234ABC",
"price": 125.5,
"quantity": 30,
"sealedPackage": true,
"originalPackage": true,
"tornPackageLabel": true,
"fullPackage": true,
"additionalPackageNotes": "patient moved away, selling for a good price.",
"gtin": "00312345678901",
"serialNumber": "ABC1234",
"showOnlyInState": false,
"sellingPharmacyNpi": 1234567890
}
'const options = {
method: 'POST',
headers: {'X-INVIEW-AUTH': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
nationalDrugCode: '01234567890',
expirationDate: '2026-01-15T00:00:00Z',
lotNumber: '1234ABC',
price: 125.5,
quantity: 30,
sealedPackage: true,
originalPackage: true,
tornPackageLabel: true,
fullPackage: true,
additionalPackageNotes: 'patient moved away, selling for a good price.',
gtin: '00312345678901',
serialNumber: 'ABC1234',
showOnlyInState: false,
sellingPharmacyNpi: 1234567890
})
};
fetch('https://test-instockrx-api.azurewebsites.net/api/v1/draft-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/draft-listings"
payload = {
"nationalDrugCode": "01234567890",
"expirationDate": "2026-01-15T00:00:00Z",
"lotNumber": "1234ABC",
"price": 125.5,
"quantity": 30,
"sealedPackage": True,
"originalPackage": True,
"tornPackageLabel": True,
"fullPackage": True,
"additionalPackageNotes": "patient moved away, selling for a good price.",
"gtin": "00312345678901",
"serialNumber": "ABC1234",
"showOnlyInState": False,
"sellingPharmacyNpi": 1234567890
}
headers = {
"X-INVIEW-AUTH": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"savedByUserId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"nationalDrugCode": "<string>",
"expirationDate": "2023-11-07T05:31:56Z",
"lotNumber": "<string>",
"price": 123,
"quantity": 123,
"sealedPackage": true,
"originalPackage": true,
"tornPackageLabel": true,
"fullPackage": true,
"images": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"savedByUserId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"path": "<string>"
}
],
"gtin": "<string>",
"serialNumber": "<string>",
"drugPackageForm": "<string>",
"drugPackageStrength": "<string>",
"labelerName": "<string>",
"nationalDrugCodeNormalized": "<string>",
"drugPackageDescription": "<string>",
"additionalPackageNotes": "<string>",
"packageName": "<string>",
"sellerPharmacyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sellerPharmacyName": "<string>",
"sellerPharmacyGln": "<string>",
"sellerPharmacyDBA": "<string>",
"branded": true,
"generic": true,
"nadacPrice": 123,
"nadacPercentage": 123,
"quantityUnitQualifier": "<string>",
"stateGroupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"showOnlyInState": true,
"isCertified": true,
"certificationFilePath": "<string>",
"certificationFileName": "<string>"
}{
"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 model containing details of the draft listing to create.
Maximum string length:
15Maximum string length:
50Maximum string length:
2000Pattern:
^\d{14}$Maximum string length:
50Response
Created
Show child attributes
Show child attributes