Create Case with Products
POST
/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.
cv-api-key
Production
https://api.care360-next.carevalidate.com/api/v1/casesStaging
https://api-staging.care360-next.carevalidate.com/api/v1/casesParameters
Headers
cv-api-keystringrequiredYour unique API key for authentication.
Content-TypestringrequiredMust be application/json.
Example:
application/jsonRequest Body
statusstringoptionalInitial case status. Accepts OPEN or ABANDONED (case-insensitive). Default is OPEN.
Values:OPENABANDONED
isTestbooleanoptionalEnables test mode. Default is false.
forceCreatebooleanoptionalForce new case creation even if an open case exists. Default is false.
userobjectrequiredUser details for the case
Show 8 child properties
firstNamestringrequiredPatient first name
lastNamestringrequiredPatient last name
emailstringrequiredPatient email address. Must be unique.
genderstringoptionalPatient gender
Values:MALEFEMALEOTHER
phoneNumberstringrequiredPatient phone number in E.164 format
Example:
+1987654321dobstringrequiredDate of birth in YYYY-MM-DD format
Example:
1990-05-15languagePreferencesarrayoptionalISO language codes for preferred languages
Example:
["en", "es", "fr"]shippingAddressobjectoptionalShipping address for the patient
Show 6 child properties
addressLine1stringoptionalStreet address line 1
addressLine2stringoptionalStreet address line 2 (optional)
citystringoptionalCity name
statestringoptionalState abbreviation
countrystringoptionalCountry code (e.g. US)
postalCodestringoptionalPostal/ZIP code
paymentobjectoptionalTotal payment information for the case
Show 6 child properties
amountnumberrequiredTotal payment amount
currencystringrequiredISO 4217 currency code
Example:
USDdescriptionstringoptionalPayment description
statusstringoptionalUse UNPAID when no payment method is provided
promoCodestringoptionalActive promo code (matched by name or value). Pass the gross `amount`; the discount is validated and applied server-side. An invalid or inactive code returns a 400. Can also be set on a product's `payment` to discount a single product. Exception: for an Affirm hold (`providerReference.type` `PAYMENT_INTENT`), send the already-discounted amount your PaymentIntent was authorized for; the code is only attached and the amount is never reduced (see Affirm Holds).
Example:
SAVE10providerReferenceobjectrequiredPayment gateway reference
Show 2 child properties
typestringrequiredPayment reference type
Values:SETUP_INTENTPAYMENT_INTENTPAYMENT_TOKEN
idstringrequiredGateway reference ID
Example:
seti_1Sk8JiGkkQS2eXzhTHyVTDj9productsarrayrequiredProducts to attach to the case. Each case can include one or more products.
Show 3 child properties
idstring (UUID)requiredOrganization product ID
visitTypestringoptionalVisit type for this product
Values:ASYNC_TEXT_EMAILSYNC_IN_PERSONSYNC_PHONESYNC_VIDEO
formobjectoptionalHealthcare intake form
Show 3 child properties
titlestringoptionalForm title
descriptionstringoptionalForm description
questionsarrayoptionalArray of form questions. See the Question Object reference below.
Show 6 child properties
questionstringrequiredQuestion text
Example:
What is your current weight?typestringrequiredQuestion type
Values:TEXTBOOLEANSINGLESELECTMULTISELECTDATERANGE
answerstringrequiredUser response
Example:
150 lbsrequiredbooleanoptionalWhether the question is mandatory
optionsarrayoptionalSelectable options for SINGLESELECT and MULTISELECT question types
phibooleanoptionalPHI indicator
Affirm 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.
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"
}
},
"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",
},
},
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",
},
},
"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"
}
]
}
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"
}
▶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
Try itAPI Playground
▶API Version: v2.3