Skip to content

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/services

Body ​

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
}
FieldTypeRequiredDescription
service_idintegeryesService belonging to the tenant.
user_idintegeryesActive doctor/admin responsible for the service and financial record.
amountnumberyesService amount and the amount of the automatically generated debt; minimum 0.
currencystringyesService and debt currency.
vatnumberyesVAT rate; minimum 0.
applied_atdatetimeyesApplication date in YYYY-MM-DD HH:mm format.
appointment_idintegernoAppointment belonging to the same patient.
patient_service_typeintegerno0 none, 1 diagnosis, 2 plan, 3 treatment, 4 proposal. Defaults to 3.
planned_atdatetimenoPlanned date in YYYY-MM-DD HH:mm format.
notestringnoNote with a maximum length of 1000 characters.
expensenumbernoService expense; minimum 0.
expense_currencystringnoRequired when an expense is supplied.
groupstringnoOptional service group label.
propertiesobjectnoValues for the service form.
productsarraynoStock products to consume. Each item requires id and a positive integer quantity.
paymentsarraynoPayments collected while creating the service. Payment currency must match the service currency.
payments[].amountnumberyesCollected amount; must be greater than 0.
payments[].payment_method_idintegeryes1 cash, 2 credit card, 3 wire transfer, 4 mail order, 5 check.
payments[].fulfilled_datedatetimenoCollection date in YYYY-MM-DD HH:mm format.
price_list_idintegernoPrice list used to preserve original price and expense values.
exchange_rate_typeintegerno1 fixed, 2 dynamic.
exchange_ratenumbernoExchange 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.