Skip to main content
POST/transactional-api/book-appointment

Book Appointment

Books an appointment for a patient into a specific diary slot. Use List Available Slots to obtain the diaryId, startTime, and endTime for a bookable slot.

Authorization: Bearer token (JWT). See Authentication.

Request

curl -L -X POST 'https://{tenantId}.api.england.medicus.health/transactional-api/book-appointment' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <token>' \
-d '{
"patientId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"diaryId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"appointmentServiceId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"appointmentTypeId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"startTime": "2024-07-29T15:51:28.071Z",
"endTime": "2024-07-29T15:51:28.071Z",
"reasonForAppointment": "string",
"additionalInformation": "string",
"embargoOverrideReason": "string",
"gpadReportingExceptionReasons": [
"string"
]
}'

Body parameters

FieldTypeRequiredDescription
patientIdstring<uuid>YesMedicus patient identifier.
diaryIdstring<uuid>YesDiary to book into. Returned by List Available Slots.
appointmentServiceIdstring<uuid>YesAppointment service for the booking. Must match the service associated with the diary.
appointmentTypeIdstring<uuid>YesAppointment type for the booking.
startTimestring<date-time>YesSlot start time (ISO 8601, UTC). Must match an available slot and must not be in the past.
endTimestring<date-time>YesSlot end time (ISO 8601, UTC). Must match the end time of the selected slot.
reasonForAppointmentstring (nullable)NoPatient-supplied reason for the appointment.
additionalInformationstring (nullable)NoAdditional information to include with the booking.
embargoOverrideReasonstring (nullable)NoReason for overriding a booking embargo, if the slot is embargoed. Required when the slot is embargoed.
gpadReportingExceptionReasonsarray<string> (nullable)NoGPAD reporting exception reasons, required for certain appointment types.

Responses

200 Appointment booked successfully.
{
"appointmentId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
400 Validation error.
12 possible code values
CodeDescriptionWhen
invalid-patient-idThe patientId is not a UUIDpatientId missing or not a UUID
invalid-diary-idThe diaryId is not a UUIDdiaryId missing or not a UUID
invalid-appointment-service-idThe appointmentServiceId is not a UUIDappointmentServiceId missing or not a UUID
invalid-appointment-type-idThe appointmentTypeId is not a UUIDappointmentTypeId missing or not a UUID
invalid-start-timeThe startTime is not a valid date/time formatstartTime missing or not a valid date/time
invalid-end-timeThe endTime is not a valid date/time formatendTime missing or not a valid date/time
start-time-in-the-pastThe requested startTime is in the past.startTime is before now
invalid-gpad-reporting-exception-reason'some-value' is not a recognised GPAD reporting exception reason.a value in gpadReportingExceptionReasons isn't recognised
appointment-service-mismatchThe appointmentServiceId does not match the appointment service for this diaryId.appointmentServiceId doesn't match the diary's or appointment type's actual service
embargo-override-reason-requiredThe reason for overriding the booking embargo is required.slot is embargoed and no embargoOverrideReason was supplied
gpad-reporting-exception-reasons-requiredAt least one GPAD reporting exception reason is required when booking more than 14 days in advance.startTime more than 14 days out, category eligible, no reason supplied
validation-failedThis slot is no longer available. Please choose another.the slot is already booked by another appointment
{
"errors": [
{
"code": "invalid-patient-id",
"description": "The patientId is not a UUID"
}
]
}
404 A referenced resource was not found (patient, diary, appointment type, or slot).
4 possible code values
CodeDescriptionWhen
patient-not-foundPatient not found for the id: 3fa85f64-5717-4562-b3fc-2c963f66afa6patientId doesn't exist
diary-not-foundDiary not found for this diaryId.diaryId doesn't exist
appointment-type-not-foundAppointment type not found for this appointmentTypeId.appointmentTypeId doesn't exist
slot-not-foundThe requested startTime and endTime are outside the diary's scheduled hours for diaryId.startTime/endTime fall outside the diary's hours, or don't align to a generated slot
{
"errors": [
{
"code": "patient-not-found",
"description": "Patient not found for the id: 3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
]
}