EXAMPLE: Create Patient

ENDPOINT: POST /v1/patients/invite

Below is an example JSON call of how to create a new patient in the system using the Invite API.

As an example, {{test-user-external-user-id}} would be swapped out with something of your choosing, like "test-user-id-123":
				
					{
  "externalId": "{{test-user-external-user-id}}",
  "phoneNumber": "{{test-user-phone-number}}",
  "supportProgramId": "{{partners-support-program-id}}",
  "firstName": "{{test-user-first-name}}",
  "lastName": "{{test-user-last-name}}",
  "requiredConsent": false,
  "isCaregiver": true,
  "skipOnboarding": false,
  "additionalData": [
    {
      "key": "patient.first.name",
      "value": "{{test-user-first-name}}",
      "editable": false
    },
    {
      "key": "patient.last.name",
      "value": "{{test-user-last-name}}",
      "editable": false
    },
    {
      "key": "patient.dob",
      "value": "1988-08-23T00:00:00+00:00",
      "editable": true
    },
    {
      "key": "patient.gender",
      "value": "male",
      "editable": true
    },
    {
      "key": "patient.phone.number",
      "value": "+12029999999",
      "editable": false
    },
    {
      "key": "patient.contact.method",
      "value": "Phone",
      "editable": true
    },
    {
      "key": "patient.prefLanguage",
      "value": "English",
      "editable": true
    },
    {
      "key": "patient.email",
      "value": "test@gmail.com",
      "editable": true
    },
    {
      "key": "patient.callTime",
      "value": "Morning",
      "editable": true
    },
    {
      "key": "caregiver.first.name",
      "value": "test",
      "editable": true
    },
    {
      "key": "caregiver.last.name",
      "value": "test",
      "editable": true
    },
    {
      "key": "caregiver.relationship",
      "value": "Parent",
      "editable": true
    },
    {
      "key": "caregiver.phone.number",
      "value": "+12099999999",
      "editable": true
    },
    {
      "key": "caregiver.email",
      "value": "test@gmail.com",
      "editable": true
    },
    {
      "key": "address.street",
      "value": "test",
      "editable": true
    },
    {
      "key": "address.apt",
      "value": "12",
      "editable": true
    },
    {
      "key": "address.city",
      "value": "test",
      "editable": true
    },
    {
      "key": "address.state",
      "value": "AL",
      "editable": true
    },
    {
      "key": "address.zip",
      "value": "12345",
      "editable": true
    },
    {
      "key": "insurance.carrier",
      "value": "test",
      "editable": true
    },
    {
      "key": "insurance.memberId",
      "value": "123",
      "editable": true
    },
    {
      "key": "insurance.groupNum",
      "value": "ds43",
      "editable": true
    },
    {
      "key": "insurance.cardname",
      "value": "test",
      "editable": true
    },
    {
      "key": "insurance.cardDob",
      "value": "2020-08-23T06:25:00+00:00",
      "editable": true
    },
    {
      "key": "insurance.secondary.status",
      "value": "active",
      "editable": true
    },
    {
      "key": "insurance.secondary.carrier",
      "value": "test2",
      "editable": true
    },
    {
      "key": "insurance.secondary.memberid",
      "value": "234234",
      "editable": true
    },
    {
      "key": "insurance.secondary.groupNum",
      "value": "hg89",
      "editable": true
    },
    {
      "key": "insurance.secondary.cardname",
      "value": "test2",
      "editable": true
    },
    {
      "key": "insurance.secondary.cardDob",
      "value": "2020-08-23T06:25:00+00:00",
      "editable": true
    }
  ]
}
				
			

Standard HTTP Response Codes

StatusCodeMessageDescription
200N/A{
"data": {
"supportProgramId": "{{support_program_id}}",
"phoneNumber": "{{patient_phone_number}}",
"patientId": "{{patientId}}"
},
"status": 200
}
Patient successfully created in the RxWare system and responds with a patientId
4001004Support program with id: {{support_program_id}} not foundInvalid Support Program ID was submitted.
4001008The property supportProgramId is requiredInvalid Support Program ID was submitted.
4000The given data was invalid. Can't invite patients less than 18 independently.Patient is under 18, must include a Caregiver in the request.
4000The given data was invalid. Caregiver name and relationship are required in this case.Please include the Caregiver name and their relationship to the patient.
4000The given data was invalid. The phone number in the invite request is not aligned with the caregiver's phone number and the patient is less than 18 years.
4001008patient.phoneNumber is not valid format.Please resubmit the patient.phoneNumber using the E.164 format
4001008Does not match the regex pattern (^\+\d{11}$)|(^\+\d{12}$)Please resubmit the patient.phoneNumber using the E.164 format
4001002patient.dob is not valid format.Please resubmit the patient.dob using a valid format.
Example: 1988-08-23T00:00:00+00:00
4001005JWT is not valid for this programCheck your bearer token and resubmit the request.
4001006Token disabledPlease reach out to support@rxware.io to request a new token.
4001010The given data was invalid. The phone number in the invite request is not aligned with the caregiver's phone number and the patient is less than 18 years.The caregiver's phone number does not match what was submitted in the request and the patient is less than 18 years of age.
4010UnauthorizedIncorrect credentials. Check your auth token and bearer token.
403N/AForbiddenIncorrect credentials. Check your auth token and bearer token.
4221015{
"error": {
"message": "patient already created\\/invited.",
"code": 1015,
"data": {
"externalId": "externaltest001",
"phoneNumber": "{{patient_phone_number}}",
"_id": "{{patientId}}"
}
},
"status": 422
}
Patient already invited/created in the RxWare system.
EXAMPLE: Create a Patient
Skip to content