Skip to content

createEnrollment

Mutation

Create a new enrollment with the provided applicant information. Returns the enrollment ID on success, or validation errors on failure.

Mutation Signature

mutation {
createEnrollment(input: CreateEnrollmentInput!): CreateEnrollmentResponse!
}

Example Request

mutation CreateEnrollment($input: CreateEnrollmentInput!) {
createEnrollment(input: $input) {
# Add fields you want to retrieve
}
}

Example Variables:

{
"input": {
"ogId": "0195e1d8-7f3a-7000-8000-000000000001",
"leadId": "lead-67890",
"planDetails": {
"income": {
"gross": 5000,
"business": 0,
"pension": 0,
"otherIncome": 200
},
"expenses": {
"housing": 1500,
"transportation": 400,
"personal": 150,
"health": 200,
"groceries": 500,
"misc": 100,
"dependents": 0,
"loans": 300,
"tax": 500,
"involuntary": 100,
"insurance": 150,
"court": 0,
"charitableContributions": 50
},
"details": {
"jobClassification": "W_2"
}
},
"contactInfo": {
"language": "1",
"notes": [
{
"content": "Client prefers communication via email"
}
]
}
}
}

Example Response

{
"data": {
"createEnrollment": {
"data": {
"enrollmentId": "enroll-abc123xyz"
},
"errors": null
}
}
}

Arguments

ArgumentTypeDescription
inputCreateEnrollmentInput!Input for creating a new enrollment.

Input Types

CreateEnrollmentInput

Input for creating a new enrollment.

Required Fields:

FieldTypeDescription
ogIdString!Offer generation ID from the offer-generation-service
leadIdString!The leadId also known as the Third-party identifier (can contain non-numeric characters)
planDetailsPlanDetailsInput!Income and expense details required for enrollment plan creation

Optional Fields:

FieldTypeDescription
contactInfoContactInfoInputContact information for the enrollment (optional)

ContactInfoInput

Input for contact information. Note: Main applicant and co-applicant PII fields are sourced from UW data.

Optional Fields:

FieldTypeDescription
languageStringPreferred language: 1 for English, 2 for Spanish (optional, defaults to English)
customFields[CustomFieldInput]Custom fields for additional data (optional)
budgetFields[BudgetFieldInput]Budget fields for income/expense data (optional)
documents[DocumentInput]Associated documents (optional)
notes[NoteInput]Notes associated with the contact (optional)
CustomFieldInput

Input for custom field data

Required Fields:

FieldTypeDescription
fieldIdString!Unique identifier for the custom field
valueString!Value of the custom field (serialized as JSON string if complex)

Optional Fields:

FieldTypeDescription
labelStringLabel of the custom field
typeStringType of the custom field
BudgetFieldInput

Input for budget field data

Required Fields:

FieldTypeDescription
fieldIdString!Unique identifier for the budget field

Optional Fields:

FieldTypeDescription
typeStringType of the budget field
valueStringValue of the budget field
DocumentInput

Input for document information

Required Fields:

FieldTypeDescription
fileNameString!Name of the file
fileUrlString!URL where the file is stored
descriptionString!Description of the document
docTypeString!Type of document (e.g., ID, proof of income)
contentTypeString!MIME content type (e.g., application/pdf, image/jpeg)

Optional Fields:

FieldTypeDescription
associatedDebtIdStringAssociated debt ID if document relates to a specific debt (optional)
metadataStringAdditional metadata as JSON string (optional)
NoteInput

Input for note information

Required Fields:

FieldTypeDescription
contentString!Content of the note

PlanDetailsInput

Income, expense, and additional details required for enrollment plan creation.

Required Fields:

FieldTypeDescription
incomeIncomeInput!Income fields for budget
expensesExpensesInput!Expense fields for budget
detailsDetailsInput!Additional details including job classification
IncomeInput

Income fields for budget. All fields are required and represent monthly dollar amounts.

Required Fields:

FieldTypeDescription
grossFloat!Monthly Combined Gross Household Income
businessFloat!Business Net Income
pensionFloat!Retirement Pension
otherIncomeFloat!Other Income (Including alimony, child support etc.)
ExpensesInput

Expense fields for budget. All fields are required and represent monthly dollar amounts.

Required Fields:

FieldTypeDescription
housingFloat!Housing & Utilities (Rent / Mortgage)
transportationFloat!Transportation (Auto Expense/Gas/Maintenance)
personalFloat!Clothing and Personal Care
healthFloat!Health Care
groceriesFloat!Groceries / Dining
miscFloat!Miscellaneous
dependentsFloat!Child/Elder Care
loansFloat!Other Loans / Secured Debts
taxFloat!Income Tax Payroll Deductions (Monthly)
involuntaryFloat!Involuntary Deductions (Mandatory payroll deductions like retirement plans, union dues, etc.)
insuranceFloat!Insurance Payments & HSA (Term life, disability, and HSA payments)
courtFloat!Court-Ordered Payments (Alimony, child support, settlements, tax debts)
charitableContributionsFloat!Charitable Contributions
DetailsInput

Additional details required for enrollment plan creation.

Required Fields:

FieldTypeDescription
jobClassificationJobClassification!Employee classification (W-2, 1099, or Fixed Income) - Required

Response Type

Returns: CreateEnrollmentResponse!

CreateEnrollmentResponse

Response type for createEnrollment mutation

FieldTypeDescription
dataEnrollmentEnrollment data on success
errors[EnrollmentError]List of validation or processing errors

Enrollment

Enrollment entity representing a created enrollment

FieldTypeDescription
enrollmentIdString!Unique enrollment identifier

EnrollmentError

Error type for enrollment operations

FieldTypeDescription
messageStringError message describing the issue

Additional Enums

JobClassification

Employee classification type for job classification field

ValueDescription
W_2TBD
W_1099TBD
FIXED_INCOMETBD

Error Types

The response may include the following error types:

EnrollmentError

Error type for enrollment operations

FieldTypeDescription
messageStringError message describing the issue

Error Details

Input Validation Errors

Error CodeDescriptionResolution
MISSING_OG_IDThe ogId field is requiredProvide a valid ogId from the offer-generation-service
MISSING_TP_IDThe leadId field is requiredProvide the lead ID from your internal system
INVALID_OG_IDThe ogId must be a valid UUID formatEnsure ogId is the valid UUID returned from createOffer

Data Validation Errors

Error CodeDescriptionResolution
MISSING_DATA: {field}Required field is missing from underwriting dataEnsure the underwriting result has all required applicant data

Service Errors

Error CodeDescriptionResolution
OFFER_NOT_FOUNDThe specified offer could not be foundVerify the ogId exists and the offer was successfully created
INTERNAL_SERVER_ERRORAn unexpected server error occurredRetry the request; contact support if the issue persists