Core API Documentation
Overview
This documentation covers the Core API, a RESTful service providing access to Enrollment123.com's core business data and functionality. The API provides endpoints for agents, members, products, transactions, schedules, contracts, and payables.
Authentication
Authentication in the Core API is handled in two steps:
- Obtain a User Access Token (UAT)
- Exchange the UAT for a JWT token for subsequent API calls
User Access Token Endpoint
POST /auth/getUserToken
Request Body:
{
"corp_id": 123,
"username": "username",
"password": "password"
}
Response:
{
"statuscode": 200,
"rows": [
{
"userToken": "a1b2c3d4-e5f6-g7h8-i9j0-k1l2m3n4o5p6"
}
],
"_meta": {},
"_links": {}
}
Login with User Token Endpoint
POST /auth/login
Request Body:
{
"userToken": "a1b2c3d4-e5f6-g7h8-i9j0-k1l2m3n4o5p6"
}
Response:
{
"statuscode": 200,
"rows": [
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}
],
"_meta": {},
"_links": {}
}
For subsequent API calls, include the JWT token in the Authorization header:
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
Standard Request Parameters
All GET endpoints support the following standard query parameters:
| Parameter | Type | Description | Default |
|---|---|---|---|
| search | string | Value to search for | |
| search_fields | string | Comma-separated list of fields to search in | |
| search_type | string | Type of search: "exact" or "partial" | "exact" |
| search_cond | string | Condition for multiple fields: "and" or "or" | "and" |
| order_by | string | Field to sort by | "name" |
| order_dir | string | Sort direction: "asc" or "desc" | "asc" |
| limit | integer | Number of records per page | 10 |
| page | integer | Page number | 1 |
| start | integer | Starting record (alternative to page) | 0 |
| date_context | string | Field to apply date filters to | |
| min_date | string | Start date (in ISO 8601 format) | |
| max_date | string | End date (in ISO 8601 format) | |
| id | integer | Specific ID to filter by |
Common Response Format
All API responses follow this standard format:
{
"statuscode": 200,
"rows": [...],
"_meta": {
"limit": 10,
"page": 1,
"start": 0,
"total": 5,
"rows": 25,
"pages": 3
},
"_links": {
"self": "/endpoint?limit=10&page=1",
"next": "/endpoint?limit=10&page=2",
"prev": "/endpoint?limit=10&page=1",
"first": "/endpoint?limit=10&page=1",
"last": "/endpoint?limit=10&page=3"
}
}
For errors, the response format is:
{
"statuscode": 400,
"message": "Error message",
"detail": "Error details"
}
Agents
Get Agent
GET /agents/{id}
Response:
{
"statuscode": 200,
"rows": [
{
"id": 123,
"corp_id": 456,
"firstname": "John",
"lastname": "Doe",
"knownname": "John Doe",
"username": "johndoe",
"email": "john.doe@example.com",
"phone": "5551234567",
"niprnumber": "12345678",
"createdDate": "2023-01-15T10:30:00.000Z",
"updatedDate": "2023-05-20T14:45:00.000Z",
"parent_id": 100,
"children": 5
}
],
"_meta": {},
"_links": {}
}
Search Agents
GET /agents
Additional query parameters:
| Parameter | Type | Description |
|---|---|---|
| nipr_npn | string | NIPR/NPN number |
| parent_id | integer | Parent agent ID |
| string | Agent email | |
| phone | string | Agent phone number |
| bActive | integer | Active status (0 or 1) |
Members
Get Member
GET /members/{id}
Response:
{
"statuscode": 200,
"rows": [
{
"id": 123,
"memberid": "MEM12345",
"firstname": "Jane",
"lastname": "Smith",
"state": "CA",
"createdDate": "2023-02-10T09:15:00.000Z",
"updatedDate": "2023-06-15T16:30:00.000Z",
"products": [
{
"up_id": 456,
"policynumber": "POL-123456",
"pd_id": 789,
"ccid": 101,
"maReplacement": 1,
"dtEffective": "2023-03-01T00:00:00.000Z",
"dtCancelled": null,
"bHold": 0,
"dtHoldCreated": null,
"fees": [
{
"upfid": 202,
"feetype": "PREMIUM",
"commissionableAmount": 99.50,
"feeamount": 99.50,
"benefitid": 303,
"periodid": 1
}
]
}
]
}
],
"_meta": {},
"_links": {}
}
Search Members
GET /members
Products
Get Product
GET /products/{id}
Response:
{
"statuscode": 200,
"rows": [
{
"id": 123,
"corp_id": 456,
"carrier_id": "",
"product_type_id": "",
"name": "",
"description": "Health Insurance Plan",
"label_display": "Health Insurance Plan",
"label_admin": "HIP2023",
"code": "HIP001",
"sku": "",
"ean": "",
"isbn": "",
"asin": "",
"rfid": "",
"nsn": "",
"gtin": "",
"upc": "",
"created_at": "",
"updated_at": "",
"deleted_at": "",
"category": "Health",
"category2": "Provider A",
"category3": "Individual",
"category4": "Bronze"
}
],
"_meta": {},
"_links": {}
}
Search Products
GET /products
Additional query parameters:
| Parameter | Type | Description |
|---|---|---|
| label_display | string | Product display label |
| label_admin | string | Product admin label |
| code | string | Product code |
| description | string | Product description |
Transactions
Get Transaction
GET /transactions/{id}
Response:
{
"statuscode": 200,
"rows": [
{
"trans_id": 123,
"trans_date": "2023-07-10T14:30:00.000Z",
"trans_amount": 199.99,
"bAuthorized": 1,
"bCompleted": 1,
"bRefund": 0,
"bRefunded": 0,
"bChargeback": 0,
"bChargedBack": 0,
"bVoided": 0,
"parentid": 0,
"corp_id": 456,
"user_id": 789,
"bSettled": 1,
"dtSettled": "2023-07-11T10:00:00.000Z",
"detail": [
{
"td_id": 101,
"trans_id": 123,
"up_id": 456,
"pd_id": 789,
"ccid": 202,
"maReplacement": 1,
"dtPaidThroughStart": "2023-07-01T00:00:00.000Z",
"dtPaidThroughEnd": "2023-07-31T00:00:00.000Z",
"paymentNumber": 1,
"fees": [
{
"tdfid": 303,
"trans_id": 123,
"td_id": 101,
"upfid": 404,
"pp_id": 505,
"type": "PREMIUM",
"currency": "USD",
"amount": 199.99,
"commissionableAmount": 199.99,
"benefit_id": 606
}
]
}
]
}
],
"_meta": {},
"_links": {}
}
Schedules
Add Schedule
POST /schedules
Request Body:
{
"corp_id": 456,
"dtStart": "2023-01-01",
"dtEnd": "2023-12-31"
}
Response:
{
"statuscode": 200,
"rows": [
{
"id": 123
}
],
"_meta": {},
"_links": {}
}
Update Schedule
PUT /schedules/{id}
Request Body:
{
"corp_id": 456,
"dtStart": "2023-02-01",
"dtEnd": "2023-12-31"
}
Delete Schedule
DELETE /schedules/{id}
Add Schedule Products
POST /schedules/{schedid}/products
Request Body:
{
"products": [
{
"pd_id": 123,
"dtStart": "2023-01-01",
"dtEnd": "2023-12-31"
}
]
}
Update Schedule Product
PUT /schedules/{schedid}/products/{id}
Request Body:
{
"products": [
{
"pd_id": 123,
"dtStart": "2023-02-01",
"dtEnd": "2023-12-31"
}
]
}
Delete Schedule Product
DELETE /schedules/{schedid}/products/{id}
Contracts
Add Contract
POST /contracts
Request Body:
{
"contracts": [
{
"parent_ccid": 0,
"corp_id": 456,
"broker_id": 789,
"csid": 123,
"dtStart": "2023-01-01",
"dtEnd": "2023-12-31"
}
]
}
Update Contract
PUT /contracts/{id}
Request Body:
{
"contracts": [
{
"parent_ccid": 0,
"corp_id": 456,
"broker_id": 789,
"csid": 123,
"dtStart": "2023-02-01",
"dtEnd": "2023-12-31"
}
]
}
Delete Contract
DELETE /contracts/{id}
Payables
Add Payable
POST /payables
Request Body:
{
"broker_id": 123,
"dtPosted": "2023-07-15T10:00:00.000Z",
"system": "EARNED",
"type": "COMM",
"subtype": "COMMISSION",
"credit": 0,
"debit": 100.00,
"note": "Monthly commission",
"payoutAmount": 100.00,
"payoutAmountType": "DOLLAR",
"payoutCommissionAmount": 100.00,
"payoutCommissionAmountType": "DOLLAR",
"relatedTransactionID": 456,
"relatedProductDefaultID": 789,
"relatedUserProductID": 101,
"relatedAPIDs": [],
"dtCoverageStart": "2023-07-01T00:00:00.000Z",
"dtCoverageEnd": "2023-07-31T00:00:00.000Z",
"currentBalance": 500.00,
"previousBalance": 400.00,
"bRulesCheck": 1,
"advancedMonths": "",
"detail": [],
"externalID": "EXTID-123456"
}
Response:
{
"statuscode": 200,
"rows": [
{
"id": 123
}
],
"_meta": {},
"_links": {}
}
Error Codes
| Status Code | Description |
|---|---|
| 200 | OK - Request succeeded |
| 400 | Bad Request - Invalid parameters or validation error |
| 401 | Unauthorized - Authentication required |
| 403 | Forbidden - Valid authentication but insufficient permissions |
| 404 | Not Found - Resource not found |
| 500 | Internal Server Error - Unexpected server error |