Create Patient Service
Creates a service for a patient and automatically creates the corresponding debt record. Optional payments can be included to collect all or part of the service amount in the same transaction.
POST
/:tenantId/patients/:patientId/servicesBody
json
{
"service_id": 360020,
"user_id": 11,
"vat": 20,
"amount": 1000,
"currency": "TRY",
"applied_at": "2026-01-15 10:00",
"patient_service_type": 3,
"expense": 100,
"expense_currency": "TRY",
"note": "Initial examination",
"group": null,
"properties": {},
"appointment_id": 1,
"payments": [
{
"amount": 250,
"currency": "TRY",
"payment_method_id": 1,
"fulfilled_date": "2026-01-15 10:00",
"exchange_rate_type": 2,
"exchange_rate": 1
}
],
"price_list_id": 2926,
"exchange_rate_type": 2,
"exchange_rate": 1
}| Field | Type | Required | Description |
|---|---|---|---|
service_id | integer | yes | Service belonging to the tenant. |
user_id | integer | yes | Active doctor/admin responsible for the service and financial record. |
amount | number | yes | Service amount and the amount of the automatically generated debt; minimum 0. |
currency | string | yes | Service and debt currency. |
vat | number | yes | VAT rate; minimum 0. |
applied_at | datetime | yes | Application date in YYYY-MM-DD HH:mm format. |
appointment_id | integer | no | Appointment belonging to the same patient. |
patient_service_type | integer | no | 0 none, 1 diagnosis, 2 plan, 3 treatment, 4 proposal. Defaults to 3. |
planned_at | datetime | no | Planned date in YYYY-MM-DD HH:mm format. |
note | string | no | Note with a maximum length of 1000 characters. |
expense | number | no | Service expense; minimum 0. |
expense_currency | string | no | Required when an expense is supplied. |
group | string | no | Optional service group label. |
properties | object | no | Values for the service form. |
products | array | no | Stock products to consume. Each item requires id and a positive integer quantity. |
payments | array | no | Payments collected while creating the service. Payment currency must match the service currency. |
payments[].amount | number | yes | Collected amount; must be greater than 0. |
payments[].payment_method_id | integer | yes | 1 cash, 2 credit card, 3 wire transfer, 4 mail order, 5 check. |
payments[].fulfilled_date | datetime | no | Collection date in YYYY-MM-DD HH:mm format. |
price_list_id | integer | no | Price list used to preserve original price and expense values. |
exchange_rate_type | integer | no | 1 fixed, 2 dynamic. |
exchange_rate | number | no | Exchange rate, minimum 0.0001. |
Use ?with_financial_record=1 when the response should include financial_record_id.
Response
HTTP 201 Created
json
{
"data": {
"id": 9001,
"patient_id": 188413,
"patient_name": "Jane Doe",
"service_id": 360020,
"appointment_id": 1,
"user_id": 11,
"vat": 20,
"expense": "100.00",
"expense_currency": "TRY",
"amount": "1000.00",
"currency": "TRY",
"exchange_rate_type": 2,
"exchange_rate": 1,
"base_amount": "1000.00",
"base_currency": "TRY",
"debt_summary": {
"key": "patient_service:9001",
"is_split": false,
"financial_record_ids": [45001],
"fragments": [
{
"amount": "1000.00",
"currency": "TRY",
"base_amount": "1000.00",
"base_currency": "TRY",
"is_paid": false
}
],
"amount": "1000.00",
"currency": "TRY",
"base_amount": "1000.00",
"base_currency": "TRY"
},
"applied_at": "2026-01-15T10:00:00.000000Z",
"note": "Initial examination",
"patient_service_type": 3,
"financial_record_id": 45001,
"financial_amounts_masked": false
}
}HTTP 422 Unprocessable Content is returned for invalid tenant resources, patient/appointment mismatch, invalid amounts, or payment currency mismatch.