Create Case with Products
/api/v1/casesCreates a new case with user details, payment, and products in a single request. Supports forced case creation, intake forms with PHI, and test mode.
https://api.care360-next.carevalidate.com/api/v1/caseshttps://api-staging.care360-next.carevalidate.com/api/v1/casesParameters
cv-api-keystringrequiredContent-Typestringrequiredapplication/jsonstatusstringoptionalisTestbooleanoptionalforceCreatebooleanoptionaluserobjectrequiredShow 8 child properties
firstNamestringrequiredlastNamestringrequiredemailstringrequiredgenderstringoptionalphoneNumberstringrequired+1987654321dobstringrequired1990-05-15languagePreferencesarrayoptional["en", "es", "fr"]shippingAddressobjectoptionalShow 6 child properties
addressLine1stringoptionaladdressLine2stringoptionalcitystringoptionalstatestringoptionalcountrystringoptionalpostalCodestringoptionalpaymentobjectoptionalShow 6 child properties
amountnumberrequiredcurrencystringrequiredUSDdescriptionstringoptionalstatusstringoptionalpromoCodestringoptionalSAVE10providerReferenceobjectrequiredShow 2 child properties
typestringrequiredidstringrequiredseti_1Sk8JiGkkQS2eXzhTHyVTDj9shippingobjectoptionalShow 1 child property
optionstringrequiredSAME_DAYproductsarrayrequiredShow 3 child properties
idstring (UUID)requiredvisitTypestringoptionalformobjectoptionalShow 3 child properties
titlestringoptionaldescriptionstringoptionalquestionsarrayoptionalShow 6 child properties
questionstringrequiredWhat is your current weight?typestringrequiredanswerstringrequired150 lbsrequiredbooleanoptionaloptionsarrayoptionalphibooleanoptionalAffirm Holds
Affirm can only capture the full amount it authorized — it does not support partial captures. When providerReference is a PAYMENT_INTENT that is an Affirm hold already authorized (requires_capture), the case is still created, but the payment amount behaves differently:
amountis the amount your PaymentIntent was authorized for. If you send a different amount, the request still succeeds and the payment is recorded at the authorized amount, because that is the only amount that can be captured.promoCodeis attached, not subtracted. Send the already-discounted amount your PaymentIntent was built for. The code is attached to the case and the payment, and the discount it implies is recorded on the payment for reporting; the payment amount is never reduced. Sending the gross amount does not discount it.- The amount can't be lowered later. Editing an unpaid Affirm payment to a lower amount, including by changing its promo code, is rejected with an error explaining that Affirm doesn't support partial captures. To charge a different amount, cancel the payment and create a new one.
Other payment methods, including Klarna and Afterpay, are unaffected.
Same-day and Next-day Delivery
Call Available Delivery for the patient's zip code and the cart's products at checkout. It offers SAME_DAY before the pharmacy's same-day cutoff and NEXT_DAY after it, or at any time when your organization has same-day turned off. Send shipping: { "option": "SAME_DAY" } or shipping: { "option": "NEXT_DAY" } only when it lists that option for at least one product in the cart. When any product can ship SAME_DAY, the cart's option is SAME_DAY and NEXT_DAY is rejected. When shipping.option is SAME_DAY or NEXT_DAY:
user.shippingAddress.postalCodeis required. The option is checked again for that zip code when the request arrives. If your organization no longer offers it, no product in the cart can ship it there, or Available Delivery wouldn't offer that option right now (for exampleSAME_DAYafter the cutoff), the request is rejected with a400and no case is created.- The amount must include the delivery fee. The fee is the option's
additionalPricefrom Available Delivery. If you sendpayment.amount, it must be at least the products'payment.amountvalues plus the fee, or the request is rejected with a400. If you send product amounts withoutpayment.amount, the fee is added to their total. A request with no amount at all is rejected when the fee is above 0. - The case is flagged for urgent review. A Ready for Review - Urgent task, noted Same Day or Next Day, is raised so the case is reviewed and ordered first. The pharmacy is sent both as same-day orders.
STANDARD, or no shipping, creates the case as standard delivery, with no fee and no urgent task. Any other shipping.option is rejected with a 400.
Abandoned Cart Behavior
user.firstNameanduser.lastNameare required for all requests, including whenstatusisABANDONED.- When
statusisABANDONED, the case is created withABANDONEDstatus. - Products are still attached to the case.
- Payment validation and payment processing are skipped.
- Auto-assignment is skipped, so the case is not assigned to providers.
- Case-created notifications are skipped.
Examples
- cURL
- JavaScript
- Python
curl -X POST "https://api.care360-next.carevalidate.com/api/v1/cases" \
-H "cv-api-key: <redacted>" \
-H "Content-Type: application/json" \
-d '{
"isTest": true,
"forceCreate": false,
"user": {
"firstName": "John",
"lastName": "Doe",
"email": "john.doe@example.com",
"gender": "MALE",
"phoneNumber": "+1987654321",
"dob": "1990-05-15",
"languagePreferences": ["en"],
"shippingAddress": {
"addressLine1": "2720 Providence Hills Drive",
"addressLine2": "",
"city": "New York",
"state": "NY",
"country": "US",
"postalCode": "28105"
}
},
"payment": {
"amount": 159,
"currency": "USD",
"description": "Monthly Plan",
"promoCode": "SAVE10",
"providerReference": {
"type": "SETUP_INTENT",
"id": "seti_1Sk8JiGkkQS2eXzhTHyVTDj9"
}
},
"shipping": {
"option": "STANDARD"
},
"products": [
{
"id": "9fc0d0f5-f211-4bf9-b105-485b1f29eb39",
"visitType": "ASYNC_TEXT_EMAIL",
"form": {
"title": "Healthcare Intake Form",
"description": "Patient intake form for healthcare services",
"questions": [
{
"question": "How much do you weigh?",
"answer": "138 lbs",
"phi": true,
"type": "TEXT"
},
{
"question": "What are your weight loss goals?",
"answer": "Lose 1-20lbs for good",
"type": "SINGLESELECT",
"required": true,
"options": [
"Lose 1-20lbs for good",
"Lose 21-50lbs for good",
"Lose over 50 for good",
"Maintain my healthy weight"
]
}
]
}
}
]
}'
const response = await fetch(
"https://api.care360-next.carevalidate.com/api/v1/cases",
{
method: "POST",
headers: {
"cv-api-key": "YOUR_SECRET_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({
isTest: true,
forceCreate: false,
user: {
firstName: "John",
lastName: "Doe",
email: "john.doe@example.com",
gender: "MALE",
phoneNumber: "+1987654321",
dob: "1990-05-15",
languagePreferences: ["en"],
shippingAddress: {
addressLine1: "2720 Providence Hills Drive",
addressLine2: "",
city: "New York",
state: "NY",
country: "US",
postalCode: "28105",
},
},
payment: {
amount: 159,
currency: "USD",
description: "Monthly Plan",
promoCode: "SAVE10",
providerReference: {
type: "SETUP_INTENT",
id: "seti_1Sk8JiGkkQS2eXzhTHyVTDj9",
},
},
shipping: {
option: "STANDARD",
},
products: [
{
id: "9fc0d0f5-f211-4bf9-b105-485b1f29eb39",
visitType: "ASYNC_TEXT_EMAIL",
form: {
title: "Healthcare Intake Form",
description: "Patient intake form for healthcare services",
questions: [
{
question: "How much do you weigh?",
answer: "138 lbs",
phi: true,
type: "TEXT",
},
{
question: "What are your weight loss goals?",
answer: "Lose 1-20lbs for good",
type: "SINGLESELECT",
required: true,
options: [
"Lose 1-20lbs for good",
"Lose 21-50lbs for good",
"Lose over 50 for good",
"Maintain my healthy weight",
],
},
],
},
},
],
}),
}
);
const data = await response.json();
console.log(data);
import requests
response = requests.post(
"https://api.care360-next.carevalidate.com/api/v1/cases",
headers={
"cv-api-key": "YOUR_SECRET_KEY",
"Content-Type": "application/json",
},
json={
"isTest": True,
"forceCreate": False,
"user": {
"firstName": "John",
"lastName": "Doe",
"email": "john.doe@example.com",
"gender": "MALE",
"phoneNumber": "+1987654321",
"dob": "1990-05-15",
"languagePreferences": ["en"],
"shippingAddress": {
"addressLine1": "2720 Providence Hills Drive",
"addressLine2": "",
"city": "New York",
"state": "NY",
"country": "US",
"postalCode": "28105",
},
},
"payment": {
"amount": 159,
"currency": "USD",
"description": "Monthly Plan",
"promoCode": "SAVE10",
"providerReference": {
"type": "SETUP_INTENT",
"id": "seti_1Sk8JiGkkQS2eXzhTHyVTDj9",
},
},
"shipping": {
"option": "STANDARD",
},
"products": [
{
"id": "9fc0d0f5-f211-4bf9-b105-485b1f29eb39",
"visitType": "ASYNC_TEXT_EMAIL",
"form": {
"title": "Healthcare Intake Form",
"description": "Patient intake form for healthcare services",
"questions": [
{
"question": "How much do you weigh?",
"answer": "138 lbs",
"phi": True,
"type": "TEXT",
},
{
"question": "What are your weight loss goals?",
"answer": "Lose 1-20lbs for good",
"type": "SINGLESELECT",
"required": True,
"options": [
"Lose 1-20lbs for good",
"Lose 21-50lbs for good",
"Lose over 50 for good",
"Maintain my healthy weight",
],
},
],
},
},
],
},
)
print(response.json())
Abandoned Cart Request Example
{
"status": "ABANDONED",
"user": {
"firstName": "Jane",
"lastName": "Doe",
"email": "abandoned@example.com"
},
"products": [
{
"id": "9fc0d0f5-f211-4bf9-b105-485b1f29eb39"
}
]
}
Same-day Delivery Request Example
The organization's same-day fee is 25, so payment.amount is the 100 product price plus 25.
{
"user": {
"firstName": "Jane",
"lastName": "Doe",
"email": "jane.doe@example.com",
"shippingAddress": {
"addressLine1": "1 Main St",
"city": "Houston",
"state": "TX",
"country": "US",
"postalCode": "77002"
}
},
"shipping": {
"option": "SAME_DAY"
},
"payment": {
"amount": 125,
"currency": "USD",
"description": "Treatment with same-day delivery",
"providerReference": {
"type": "SETUP_INTENT",
"id": "seti_1Sk8JiGkkQS2eXzhTHyVTDj9"
}
},
"products": [
{
"id": "9fc0d0f5-f211-4bf9-b105-485b1f29eb39"
}
]
}
Responses
▶200SuccessCase created successfully with products attached.
{
"success": true,
"data": {
"caseId": "550e8400-e29b-41d4-a716-446655440000"
}
}
▶400Bad RequestInvalid request body or parameters, e.g. an invalid or inactive payment.promoCode.
{
"success": false,
"error": "Promo code 'SAVE10' not found or inactive"
}
▶400Same-day Not Availableshipping.option is SAME_DAY or NEXT_DAY, but that option is not available for the shipping zip code right now. Other errors for these options: the shipping address is missing, or payment.amount doesn't include the delivery fee.
{
"success": false,
"error": "SAME_DAY delivery is not available for zip 77002 and the requested products"
}
▶401UnauthorizedMissing or invalid authentication token.
{
"success": false,
"message": "Unauthorized"
}
▶409ConflictCase conflict (e.g., open case already exists and forceCreate is false).
{
"success": false,
"message": "Case conflict"
}
▶422Validation FailedRequest body failed validation rules.
{
"success": false,
"message": "Validation failed"
}
▶500Internal Server ErrorUnexpected server error.
{
"success": false,
"message": "Internal server error"
}
Try It Out
API Version: v2.3