Place orders for a case
/api/v1/cases/:caseIdPlaces a medication order for a case. Includes prescription items, prescriber information, and optional patient health details.
https://api.care360-next.carevalidate.com/api/v1/cases/:caseIdhttps://api-staging.care360-next.carevalidate.com/api/v1/cases/:caseIdPath Parameters
caseIdstringrequiredThe unique identifier of the case.
Headers
cv-api-keystringrequiredAPI key for organization authentication.
Content-TypestringrequiredMust be application/json.
application/jsonRequest Body
actionstringrequiredThe action to be performed.
idempotencyKeystringoptionalOptional unique key to prevent duplicate order creation. Scoped per organization.
orderobjectrequiredObject containing order details.
Show 9 child properties
shippingAddressobjectoptionalShipping address for the order. If not provided, uses the patient's address from the case.
Show 6 child properties
addressLine1stringrequiredStreet address line 1.
addressLine2stringoptionalStreet address line 2.
citystringrequiredCity name.
statestringrequiredValid US state abbreviation (e.g., CA, NY, TX).
countrystringrequiredCountry code. Must be exactly 2 characters. Automatically converted to uppercase.
postalCodestringrequiredMust be exactly 5 digits, numeric only.
patientHealthInfoobjectoptionalOptional patient health details.
Show 3 child properties
allergiesstringoptionalKnown allergies.
healthConditionsstringoptionalCurrent health conditions.
currentMedicationsstringoptionalCurrent medications.
prescriberobjectrequiredPrescriber information.
Show 9 child properties
firstNamestringrequiredPrescriber's first name.
lastNamestringrequiredPrescriber's last name.
titlestringoptionalProfessional title (e.g., "Dr.").
titleSuffixstringoptionalTitle suffix (e.g., "MD", "DO").
npistringrequiredNational Provider Identifier.
deastringoptionalDrug Enforcement Administration number.
emailstringrequiredPrescriber's email address. Must be a valid email format.
phoneNumberstringrequiredContact phone number. Must be a valid phone number format.
addressobjectrequiredPrescriber's address.
Show 6 child properties
addressLine1stringrequiredStreet address line 1.
addressLine2stringoptionalStreet address line 2.
citystringrequiredCity name.
statestringrequiredValid US state abbreviation.
countrystringrequiredCountry code (2 characters).
postalCodestringrequiredPostal code (5 digits).
diagnosisstringrequiredMedical diagnosis for the prescription.
pharmacyIdstringrequiredTarget pharmacy identifier.
dateWrittenstringoptionalDate prescription was written.
dateSignedstringoptionalDate prescription was signed.
datePrescribedstringoptionalDate prescription was prescribed.
prescriptionItemsarray of objectsrequiredArray of prescription items (at least one required).
Show 6 child properties
drugIdstringrequiredUnique identifier for the medication.
directionstringoptionalDosage instructions.
quantitystringrequiredQuantity to be prescribed.
refillCountnumberoptionalNumber of refills allowed.
supplyDaysnumberoptionalDays of supply.
customFieldsobjectoptionalAdditional custom fields as key-value pairs.
Validation Rules
- State: Must be a valid US state abbreviation (e.g., "CA", "NY", "TX")
- Country: Must be exactly 2 characters; automatically converted to uppercase
- Postal Code: Must be exactly 5 digits, numeric only
- Email: Must be a valid email format
- Phone Number: Must be a valid phone number format
Notes
- Case Ownership: The case must belong to the organization associated with the provided API key.
- Order Processing: Orders are processed asynchronously and may take time to complete.
- Prescription Download: Upon successful order creation, prescription documents are automatically downloaded and stored.
- Address Handling: If no shipping address is provided, the system will use the patient's address from the case.
- Notifications: Case activity notifications are sent upon successful order creation via webhooks.
Request Examples
- cURL
- JavaScript
- Python
curl -X POST "https://api.care360-next.carevalidate.com/api/v1/cases/123e4567-e89b-12d3-a456-426614174000" \
-H "Content-Type: application/json" \
-H "cv-api-key: YOUR_SECRET_KEY" \
-d '{
"action": "PLACE_ORDER",
"idempotencyKey": "unique-order-key-123",
"order": {
"shippingAddress": {
"addressLine1": "123 Main St",
"city": "San Francisco",
"state": "CA",
"country": "US",
"postalCode": "94105"
},
"patientHealthInfo": {
"allergies": "Penicillin",
"healthConditions": "Hypertension",
"currentMedications": "Lisinopril 10mg daily"
},
"prescriber": {
"firstName": "John",
"lastName": "Smith",
"title": "Dr.",
"titleSuffix": "MD",
"npi": "1234567890",
"email": "john.smith@example.com",
"phoneNumber": "+1234567890",
"address": {
"addressLine1": "456 Medical Center Dr",
"city": "San Francisco",
"state": "CA",
"country": "US",
"postalCode": "94102"
}
},
"diagnosis": "Hypertension",
"pharmacyId": "pharmacy-123",
"dateWritten": "2024-01-15",
"prescriptionItems": [
{
"drugId": "drug-456",
"direction": "Take 1 tablet daily with food",
"quantity": "30",
"refillCount": 3,
"supplyDays": 30
}
]
}
}'
const caseId = '123e4567-e89b-12d3-a456-426614174000';
const response = await fetch(
`https://api.care360-next.carevalidate.com/api/v1/cases/${caseId}`,
{
method: 'POST',
headers: {
'Content-Type': 'application/json',
'cv-api-key': 'YOUR_SECRET_KEY',
},
body: JSON.stringify({
action: 'PLACE_ORDER',
idempotencyKey: 'unique-order-key-123',
order: {
shippingAddress: {
addressLine1: '123 Main St',
city: 'San Francisco',
state: 'CA',
country: 'US',
postalCode: '94105',
},
patientHealthInfo: {
allergies: 'Penicillin',
healthConditions: 'Hypertension',
currentMedications: 'Lisinopril 10mg daily',
},
prescriber: {
firstName: 'John',
lastName: 'Smith',
title: 'Dr.',
titleSuffix: 'MD',
npi: '1234567890',
email: 'john.smith@example.com',
phoneNumber: '+1234567890',
address: {
addressLine1: '456 Medical Center Dr',
city: 'San Francisco',
state: 'CA',
country: 'US',
postalCode: '94102',
},
},
diagnosis: 'Hypertension',
pharmacyId: 'pharmacy-123',
dateWritten: '2024-01-15',
prescriptionItems: [
{
drugId: 'drug-456',
direction: 'Take 1 tablet daily with food',
quantity: '30',
refillCount: 3,
supplyDays: 30,
},
],
},
}),
}
);
const data = await response.json();
console.log(data);
import requests
case_id = "123e4567-e89b-12d3-a456-426614174000"
url = f"https://api.care360-next.carevalidate.com/api/v1/cases/{case_id}"
headers = {
"Content-Type": "application/json",
"cv-api-key": "YOUR_SECRET_KEY",
}
payload = {
"action": "PLACE_ORDER",
"idempotencyKey": "unique-order-key-123",
"order": {
"shippingAddress": {
"addressLine1": "123 Main St",
"city": "San Francisco",
"state": "CA",
"country": "US",
"postalCode": "94105",
},
"patientHealthInfo": {
"allergies": "Penicillin",
"healthConditions": "Hypertension",
"currentMedications": "Lisinopril 10mg daily",
},
"prescriber": {
"firstName": "John",
"lastName": "Smith",
"title": "Dr.",
"titleSuffix": "MD",
"npi": "1234567890",
"email": "john.smith@example.com",
"phoneNumber": "+1234567890",
"address": {
"addressLine1": "456 Medical Center Dr",
"city": "San Francisco",
"state": "CA",
"country": "US",
"postalCode": "94102",
},
},
"diagnosis": "Hypertension",
"pharmacyId": "pharmacy-123",
"dateWritten": "2024-01-15",
"prescriptionItems": [
{
"drugId": "drug-456",
"direction": "Take 1 tablet daily with food",
"quantity": "30",
"refillCount": 3,
"supplyDays": 30,
}
],
},
}
response = requests.post(url, headers=headers, json=payload)
data = response.json()
print(data)
Responses
▶200SuccessOrder created successfully.
{
"status": 200,
"success": true,
"message": "Order created successfully",
"data": {
"order": {
"id": "<order_id>"
}
}
}
▶400Bad RequestMissing required fields, invalid field formats, invalid state codes, invalid email format, invalid postal code format, or missing API key.
{
"status": 400,
"success": false,
"message": "Invalid request",
"error": "firstName is required"
}
▶401UnauthorizedInvalid or missing API key, or organization not found.
{
"status": 401,
"success": false,
"message": "Invalid request",
"error": "Unauthorized"
}
▶403ForbiddenCase does not belong to the organization or permission denied.
{
"status": 403,
"success": false,
"message": "Invalid request",
"error": "Permission denied"
}
▶409ConflictA record with the provided idempotencyKey already exists for this organization.
{
"status": 409,
"success": false,
"code": "IDEMPOTENCY_ERROR",
"description": "A record with the provided idempotencyKey already exists for this organization."
}