Guide
  • SDK

    • PHP
    • .NET
  • Postman

    • Postman Collection
Api Docs
Guide
  • SDK

    • PHP
    • .NET
  • Postman

    • Postman Collection
Api Docs
  • Getting Started

    • Getting Started
    • Integration process
  • Tools and libraries

    • SDK for PHP
    • SDK for .NET
    • Postman Collection
  • Fundamentals

    • Authorization
    • Errors
    • Extensions
    • Rate Limits
  • API Objects

    • Resources
    • Managing calendars
    • Online Features
    • Payments for integration bookings
    • Patient Presence
    • NFZ public healthcare (Poland)
  • Callbacks

    • Push vs Pull
    • Real-time requests
  • Mappings

    • Vendor mapping
  • Changelog

    • Changelog
DOCPLANNER INTEGRATIONS

Payments for integration bookings

Bookings you create, move and cancel through the API can now use Docplanner online payments, in the same way as bookings made on the Docplanner marketplace. This guide explains, step by step, how to implement the payment flow in your software.

Docplanner online payments now work for bookings that your software creates, moves and cancels through the API. The patient can get a payment link, a payment deadline and the same refund rules as on the Docplanner marketplace. Your software receives one notification with the full payment state of each booking.

This guide explains what changed and what your software has to do, step by step. For the full field list, see the API documentation.

What changed

The new payment flow is a set of API changes, from version 1.15.0 to 1.23.1:

  • acted_by on bookSlot, cancelBooking and moveBooking. You tell Docplanner who performed the action: the patient or the facility. All payment rules depend on this value.
  • payment_url on the booking. It is the link to the Docplanner payment page for this booking.
  • payment_deadline on the booking. It is the time by which the patient has to pay.
  • cancellation_reason: unpaid on the booking and in booking-canceled. Docplanner cancelled the booking because the patient did not pay in time.
  • no_show_protection on bookSlot. The facility can ask the patient to pay by a deadline.
  • The booking-payment-updated notification. It replaces booking-payment-status-changed and always carries the full payment state of the booking.
  • The getAddressPaymentSettings and updateAddressPaymentSettings endpoints and the address-payment-settings-changed notification. Your software can read and change the online payment settings of an address.

All new fields are optional and additive. If you change nothing, your integration keeps working as before.

Who is affected

This guide is for you if:

  • the facilities you integrate use Docplanner online payments, and
  • your software creates, moves or cancels bookings through the API, or
  • your software reads the payment status of bookings, today with booking-payment-status-changed.

If your integration only reads bookings made on the Docplanner marketplace, read Step 4 and Migrating from booking-payment-status-changed.

Key terms

TermMeaning
Patient bookingThe patient decided to book, move or cancel the visit, also when the patient asked by phone and staff entered it. You send acted_by: patient.
Facility bookingThe facility decided it on its own initiative. You send acted_by: facility.
Required paymentThe patient must pay online by the payment deadline, or the booking is cancelled.
Optional paymentThe patient may pay online. If not, the patient pays at the facility.
Book Now Pay Later (BNPL)The patient leaves a card instead of paying. The card is charged only for a no-show or a late cancellation.
Late-cancellation windowThe number of hours before the visit in which a cancellation by the patient costs a fee.

Before you start

Some parts of the flow are switched on by Docplanner for your API client. Ask your Docplanner integration contact to:

  1. Send you the booking-payment-updated notification instead of booking-payment-status-changed. Your API client receives one of the two, never both.
  2. Send you the address-payment-settings-changed notification, if you want to sync payment settings (Step 7). This is the send_address_payment_settings_changed_callbacks setting. It is off by default.

Your endpoint for push notifications must be ready. See Push vs Pull.

The flow at a glance

Your software                                Docplanner
-------------                                ----------
1. POST .../slots/{start}/book
   with acted_by (+ no_show_protection)  ->  creates the booking and decides the payment
                                         <-  booking with payment_url and payment_deadline
2. Show payment_url to the patient
                                             the patient pays, leaves a card, or does nothing
                                         <-  3. booking-payment-updated (full payment state)
                                         <-  4. booking-canceled with cancellation_reason: unpaid
                                                (only if the payment deadline passed)
5. POST .../bookings/{booking_id}/move
   with acted_by                         ->  moves the booking and its payment
                                         <-  booking-payment-updated (new deadline)
6. DELETE .../bookings/{booking_id}
   with acted_by                         ->  refunds by the rules of who cancelled
                                         <-  booking-payment-updated (refund)

Step 1. Tell us who acted: acted_by

Send acted_by on every booking, move and cancellation. It is the most important field of this flow.

The rule is the same for booking, moving and cancelling. It depends on who decided, not on who used your software.

ValueSend it whenExamples
patientThe patient decided.The patient booked in your online booking page, patient portal or app. The patient called the facility and asked staff to book, move or cancel the visit.
facilityThe facility decided on its own initiative.The doctor is not available and staff move or cancel the visit. Staff book a follow-up visit for the patient.

Why this matters

The refund rules depend on this value. For example, a patient calls 5 minutes before the visit and asks staff to cancel it. This is a late cancellation by the patient, so send patient. The patient then pays the late-cancellation fee, as on the Docplanner marketplace. If you send facility, the patient gets a full refund.

What happens without acted_by:

  • The booking gets no payment request, no payment link and no payment deadline.
  • A cancellation is refunded in full, as before.
  • A move keeps today's behaviour.

The value is fixed after the first request. If you send a different value for the same action again, Docplanner keeps the first one. A value other than patient or facility returns 400 Bad Request.

Step 2. Book the slot

Call bookSlot as you do today and add acted_by.

POST https://www.{domain}/api/v3/integration/facilities/{facility_id}/doctors/{doctor_id}/addresses/{address_id}/slots/{start}/book

A booking made by the patient

{
  "address_service_id": "113",
  "duration": 30,
  "is_returning": false,
  "patient": {
    "name": "Abraham",
    "surname": "Lincoln",
    "email": "example@example.com",
    "phone": "+48123123123"
  },
  "acted_by": "patient"
}

The response carries the payment fields when the patient has to pay or can pay online:

{
  "id": "2134124",
  "status": "booked",
  "start_at": "2026-12-10T16:00:00+01:00",
  "end_at": "2026-12-10T16:30:00+01:00",
  "duration": 30,
  "booked_by": "integration",
  "booked_at": "2026-12-01T10:18:24+01:00",
  "payment_url": "https://...",
  "payment_deadline": "2026-12-01T10:48:24+01:00"
}

What Docplanner does with a patient booking:

  • Docplanner matches the patient to a Docplanner patient account by email and phone. Send both whenever you have them.
  • If the patient is matched, the doctor's settings for patient bookings decide the payment: required, optional, Book Now Pay Later, or no payment. This is the same as on the Docplanner marketplace.
  • If the patient is not matched, the booking is handled as a facility booking. The response has no payment_url.
Payment the doctor setpayment_urlpayment_deadlineIf the patient does not pay
RequiredYesYes, 30 minutes after the bookingThe booking is cancelled at the deadline with cancellation_reason: unpaid.
Book Now Pay LaterYesYesIf the patient leaves no card by the deadline, the booking is cancelled with cancellation_reason: unpaid.
OptionalYes, until the visit startsNoNothing. The patient pays at the facility.
No paymentNoNoNothing.

An optional payment is taken to be paid at the facility. The patient can still use payment_url to pay online before the visit starts.

A booking made by the facility, with no-show protection

The facility can ask the patient to pay by a deadline. Send acted_by: facility and no_show_protection: true.

{
  "address_service_id": "113",
  "duration": 30,
  "is_returning": true,
  "patient": {
    "name": "Abraham",
    "surname": "Lincoln",
    "email": "example@example.com",
    "phone": "+48123123123"
  },
  "acted_by": "facility",
  "no_show_protection": true
}

No-show protection applies only when all of these are true:

  • acted_by is facility,
  • the visit starts more than 48 hours after the booking,
  • the facility takes online payments for this booking.

In every other case Docplanner ignores the value. Send a JSON boolean, not a string.

The payment deadline is:

  • 5 days before the visit, when the visit is 7 days or more away,
  • 24 hours after the booking, in other cases.

The response and later reads carry payment_url and payment_deadline while the payment is owed. If the facility offers Book Now Pay Later, the patient can leave a card instead of paying. A booking with no payment and no card by the deadline is cancelled with cancellation_reason: unpaid.

A facility booking without no-show protection has no payment_url and no payment_deadline, and is never cancelled for non-payment. Docplanner can still offer the patient to pay online, based on the doctor's settings for bookings made by staff.

Step 3. Show the payment link to the patient

Show payment_url to the patient right after the booking. For example, show it on your confirmation page, or send it in your confirmation email or text message. The link opens the Docplanner payment page for this booking.

Rules for payment_url:

  • Read it from the bookSlot response, or later with getBooking and getBookings.
  • It is never sent in notifications.
  • It can be missing for a short time while a payment is being processed. payment_deadline stays during that time.
  • It disappears when the booking is paid, cancelled, or no longer needs a payment.
  • It can come back. For example, it comes back when a card hold fails and the patient has to pay by a new deadline.

Step 4. Receive payment updates

Docplanner sends booking-payment-updated when the payment of a booking changes. Each notification carries the full payment state of the booking, not only the change. Replace the payment state you store for the booking with the state you receive.

Docplanner sends it when:

  • the payment status of the booking changes,
  • a payment, a refund or a Book Now Pay Later charge changes status,
  • the paid amount changes,
  • the payment deadline is set, changed or removed,
  • a booking with an open payment deadline is moved,
  • Docplanner closes the payment of a booking that was not paid in time,
  • Docplanner re-sends the current state to fix a sync problem.

Several changes at the same time produce one notification with the state after the last change.

{
  "name": "booking-payment-updated",
  "data": {
    "facility": { "id": "1", "name": "Sample hospital" },
    "doctor": { "id": "123", "name": "Sample", "surname": "Doctor 123" },
    "address": { "id": "111", "name": "Example hospital" },
    "visit_booking": {
      "id": "6263715",
      "status": "booked",
      "start_at": "2026-07-30T16:00:00+02:00",
      "end_at": "2026-07-30T16:30:00+02:00",
      "booked_by": "user",
      "canceled_by": ""
    },
    "trigger": "payment_changed",
    "visit_payment_status": {
      "online_payment_status": "not-paid",
      "is_bnpl_enabled": true,
      "no_show_fee_amount": "12.50",
      "no_show_fee_status": "charged",
      "full_amount_status": "not_attempted",
      "gross_amount": "50.00",
      "paid_amount": "12.50",
      "currency": "EUR",
      "synced_at": "2026-07-27T10:18:34.125+02:00",
      "payment_deadline": null
    },
    "transactions": [
      {
        "identifier": "8de66099-8a07-4445-8a01-574513d6ce85",
        "type": "no_show_fee.frozen",
        "amount": "12.50",
        "currency": "EUR",
        "occurred_at": "2026-07-20T12:00:00+02:00"
      },
      {
        "identifier": "8de66099-8a07-4445-8a01-574513d6ce85",
        "type": "no_show_fee.collection",
        "amount": "12.50",
        "currency": "EUR",
        "occurred_at": "2026-07-20T12:00:00+02:00"
      }
    ]
  },
  "created_at": "2026-07-27T10:18:34+02:00"
}

How to apply a notification

Notifications can arrive out of order. Use trigger and synced_at to keep the newest state:

triggerWhat to do
payment_changedApply it only if its synced_at is later than the synced_at of the last notification you applied for this booking. Otherwise ignore it.
resyncDocplanner re-sent the current state. Always apply it.
function onBookingPaymentUpdated(notification) {
  const bookingId = notification.data.visit_booking.id
  const state = notification.data.visit_payment_status
  const stored = db.getPaymentState(bookingId)

  if (notification.data.trigger === 'payment_changed'
      && stored && state.synced_at <= stored.synced_at) {
    return // older state, ignore it
  }

  db.replacePaymentState(bookingId, state, notification.data.transactions)
}

Compare synced_at as a time, with its milliseconds. The same state can arrive more than once. Applying it again must change nothing.

Payment status

online_payment_statusMeaning
not-paidNothing is paid.
waiting_for_confirmationA payment is being processed.
confirmedThe patient confirmed the booking with a card. No amount was charged, released or failed yet.
partially_paidPart of the price is paid.
paidThe price is paid in full, or the full amount of a Book Now Pay Later booking is reserved on the patient's card.
refundedThe payment was refunded.
charged_backThe patient's bank reversed the payment.

Payment status on the booking

getBooking and getBookings also return a short status in visit_payment_status, on addresses that take online payments. It has fewer values: paid, waiting_for_confirmation, not-paid, refunded and charged_back. A partial payment is shown as paid. Use it to check a single booking. Use booking-payment-updated to keep the full payment state.

Amounts and the deadline

  • gross_amount, paid_amount, no_show_fee_amount and amount are strings with 2 decimals, for example "12.50". Parse them as decimal numbers.
  • payment_deadline is always present. null means the booking has no open deadline: it is paid, its payment is closed, an insurer pays for it, or it is cancelled. Remove the deadline you store in that case.
  • Other fields can be missing when they have no value.

Book Now Pay Later fields

no_show_fee_amount, no_show_fee_status and full_amount_status are always present. They are null when is_bnpl_enabled is false. If your software does not support Book Now Pay Later, you can ignore them.

Value of no_show_fee_status and full_amount_statusMeaning
not_attemptedDocplanner did not try to reserve or charge this amount yet.
authorizedThe amount is reserved on the patient's card.
chargedThe amount is charged.
failedThe reservation or the charge failed.
releasedThe reservation was released. The patient pays nothing for it.

Transactions

transactions lists the payment operations of the booking as they are now.

  • It is not a history. Entries are not in time order.
  • Identify an entry by identifier and type together, never by identifier alone. One payment can have two entries with the same identifier, for example no_show_fee.frozen and no_show_fee.collection.
  • occurred_at is when the payment last changed. Do not use it to sort the entries.
  • amount is negative for refund and refund_failed. It is zero or positive for all other types.
typeMeaning
collectionA payment by the patient.
refundA refund to the patient.
refund_failedA refund that failed.
capture_failedA charge that failed.
no_show_fee.frozenThe no-show fee is reserved on the card.
no_show_fee.collectionThe no-show fee is charged.
no_show_fee.releasedThe no-show fee reservation is released.
remaining_amount.frozenThe rest of the price is reserved on the card.
remaining_amount.capturedThe rest of the price is charged.
remaining_amount.releasedThe reservation of the rest of the price is released.

Delivery and missed notifications

  • Return a 2xx status code to accept the notification. Failed deliveries are retried as described in Push vs Pull.
  • If Docplanner cannot prepare a notification, it does not retry it. The next change of the booking sends the current state.
  • If your payment data looks wrong, ask Docplanner support to re-send the current state. It arrives with trigger: resync.

Step 5. Handle cancellations for non-payment

When the patient does not pay by payment_deadline, Docplanner cancels the booking and sends booking-canceled:

{
  "name": "booking-canceled",
  "data": {
    "facility": { "id": "1", "name": "Sample hospital" },
    "doctor": { "id": "123", "name": "Sample", "surname": "Doctor 123" },
    "address": { "id": "111", "name": "Example hospital" },
    "visit_booking": {
      "id": "6263715",
      "status": "canceled",
      "start_at": "2026-12-10T16:00:00+01:00",
      "end_at": "2026-12-10T16:30:00+01:00",
      "booked_by": "user",
      "canceled_by": "user",
      "booked_at": "2026-12-01T10:18:24+01:00",
      "canceled_at": "2026-12-01T11:48:30+01:00",
      "visit_payment": true,
      "cancellation_reason": "unpaid"
    }
  },
  "created_at": "2026-12-01T11:48:40+01:00"
}
  • canceled_by stays user. Use cancellation_reason to tell a cancellation for non-payment from a cancellation by the patient.
  • cancellation_reason is also on the booking in getBooking and getBookings.
  • cancellation_reason is missing for every other cancellation. More values can be added later. Treat a value you do not know as "no reason given".
  • Free the slot in your software, as for any other cancellation.

Step 6. Move and cancel bookings with payments

Move

Always use moveBooking to change the time, the service, the address or the doctor of a booking in the same facility. Send acted_by here too.

POST https://www.{domain}/api/v3/integration/facilities/{facility_id}/doctors/{doctor_id}/addresses/{address_id}/bookings/{booking_id}/move
{
  "address_service_id": "113",
  "start": "2026-12-17T16:00:00+01:00",
  "duration": 30,
  "acted_by": "patient"
}

What happens to the payment:

  • The payment moves with the booking. Store the payment state under the new booking.
  • The payment deadline and the late-cancellation window are calculated again from the new start time. You receive booking-payment-updated with the new payment_deadline.
  • No-show protection stays on the booking. Its deadline is set to at most 10 minutes after the new start. A move cannot turn the protection off.
  • A patient who moves a confirmed, unpaid Book Now Pay Later booking into the late-cancellation window must confirm the visit again. The move response and later reads carry payment_url for this.

Do not cancel and create a new booking

If you cancel a booking and create a new one instead of moving it, the payment does not follow. The first booking is refunded, and the new booking starts with no payment. If you state acted_by: patient on both calls, the patient can also pay twice: a late-cancellation fee on the first booking and a new payment on the second booking.

A booking that still holds money can move only to an address that uses the same Docplanner payment account. Otherwise the move returns 422 Unprocessable Entity and nothing changes:

{
  "errors": [],
  "message": "This booking has a payment on it and the target address bills through a different payment account. Cancel the booking and create a new one instead."
}

In this case, cancel the booking and create a new one. A booking whose payment was fully refunded or charged back holds no money, so it can move.

Cancel

Send acted_by in the body of cancelBooking:

DELETE https://www.{domain}/api/v3/integration/facilities/{facility_id}/doctors/{doctor_id}/addresses/{address_id}/bookings/{booking_id}
{
  "reason": "Patient cannot come",
  "acted_by": "patient"
}

The refund depends on who cancelled:

acted_byBefore the visit startsAfter the visit starts
patientThe same rules as a patient cancellation on the Docplanner marketplace. Outside the late-cancellation window the patient gets a refund. Inside it, the late-cancellation fee or the no-show fee is kept.It is too late to cancel, so it is handled like a no-show. No automatic refund of money already paid. The patient can ask the facility for a refund.
facility or not sentFull refund. Card holds are released.No automatic refund of money already paid. Card holds are released.

After the visit starts, the facility can still refund the patient in Docplanner. You receive booking-payment-updated for every refund or released hold.

Step 7 (optional). Sync address payment settings

Your software can show and change the online payment settings of an address. Any API client integrated with the address can use these endpoints. Your API client needs the right to edit the calendar of the address. Otherwise you get 403.

Read the settings

GET https://www.{domain}/api/v3/integration/facilities/{facility_id}/doctors/{doctor_id}/addresses/{address_id}/payment-settings
{
  "online_payments": true,
  "schedule_managed_by_docplanner": false,
  "online_payments_account_active": true,
  "upfront_payment_policies": {
    "patient_bookings": {
      "new_patients": "mandatory",
      "returning_patients": "optional"
    },
    "admin_bookings": {
      "new_patients": "optional",
      "returning_patients": "inactive"
    }
  },
  "book_now_pay_later": {
    "available": true,
    "enabled": true,
    "late_cancellation_window_hours": 24,
    "no_show_fee_percentage": 100
  }
}
FieldMeaning
online_paymentsOnline payments are on for the address.
schedule_managed_by_docplannerRead-only. true when the schedule is managed in Docplanner's practice management software. It changes the write rules below.
online_payments_account_activeRead-only. true when the address has an active Docplanner payment account.
upfront_payment_policies.patient_bookingsThe policy for bookings the patient makes, for new and for returning patients.
upfront_payment_policies.admin_bookingsThe policy for bookings the facility makes, for new and for returning patients.
book_now_pay_later.availableRead-only. Book Now Pay Later can be used at this address.
book_now_pay_later.enabledBook Now Pay Later is on for the address.
late_cancellation_window_hoursA cancellation this many hours or fewer before the visit costs the no-show fee.
no_show_fee_percentageThe share of the visit price charged for a no-show or a late cancellation.

Policy values:

PolicyMeaning
inactiveThe patient is not asked to pay online.
optionalThe patient may pay online.
mandatoryThe patient pays online when booking.
book-now-pay-laterThe patient leaves a card. It is charged only for a no-show or a late cancellation. Only for patient bookings.
nullNever set. This is not the same as inactive. For patient bookings, Docplanner's default for the address applies, and it can still ask the patient to pay.

Change the settings

updateAddressPaymentSettings replaces all settings. Send every field, not only the changed ones.

PUT https://www.{domain}/api/v3/integration/facilities/{facility_id}/doctors/{doctor_id}/addresses/{address_id}/payment-settings
{
  "online_payments": true,
  "upfront_payment_policies": {
    "patient_bookings": {
      "new_patients": "book-now-pay-later",
      "returning_patients": "optional"
    },
    "admin_bookings": {
      "new_patients": "optional",
      "returning_patients": "inactive"
    }
  },
  "book_now_pay_later": {
    "enabled": true,
    "late_cancellation_window_hours": 48,
    "no_show_fee_percentage": 50
  }
}

The response returns the stored settings. New settings apply to bookings created after the response.

Rules:

  • The two patient_bookings policies cannot both be inactive.
  • admin_bookings cannot use book-now-pay-later.
  • late_cancellation_window_hours is a whole number from 24 to 120.
  • no_show_fee_percentage is more than 0 and at most 100, with at most 2 decimals.
  • The window and the fee are required while book_now_pay_later.enabled is true or a patient bookings policy is book-now-pay-later.
  • Send booleans and numbers as JSON values, not as strings. 24.0 is refused where a whole number is expected.
  • A null from the GET response is not accepted where the PUT needs a value. Choose a value first.
  • book_now_pay_later.available is read-only. Docplanner ignores it.
  • When online_payments_account_active is false, you can only switch online_payments off.
  • When schedule_managed_by_docplanner is true, Book Now Pay Later is managed in Docplanner's practice management software. book_now_pay_later.enabled must stay as it is, and a stored window or fee cannot be cleared.

Errors return 400 with the field path in camelCase:

{
  "errors": {
    "bookNowPayLater.lateCancellationWindowHours": ["This value should be between 24 and 120."]
  },
  "message": "Invalid arguments"
}
MessageWhat to do
The value must be one of: inactive, optional, mandatory, book-now-pay-later.Use a valid policy value.
The policies for new and returning patients cannot both be inactive.Set at least one patient bookings policy to another value.
Book now pay later cannot be used for admin bookings.Use another policy for admin_bookings.
This value should be between 24 and 120.Correct the late-cancellation window.
This value should be less than or equal to 100.Correct the no-show fee.
The value can have at most 2 decimal places.Round the no-show fee to 2 decimals.
The value is required while book now pay later is enabled or a patient bookings policy is book-now-pay-later.Send the window and the fee.
Payment settings cannot be changed without an active payment account for this address.The address has no active payment account. Only switching online payments off is possible.
Book now pay later is not available for this address.Do not turn Book Now Pay Later on for this address.
Book now pay later is not enabled for this address.Turn Book Now Pay Later on first, or use another policy.
Book now pay later of this address is managed in Docplanner's practice management software and cannot be changed here.Send the current value of book_now_pay_later.enabled.
This value should be of type int.Send the value as a JSON number, not a string.
The request body could not be read.Send valid JSON.

The messages of format and range errors are in the language of the market.

Get notified about changes

When the settings of an integrated address change, Docplanner sends address-payment-settings-changed. You need to ask for this notification first (see Before you start).

{
  "name": "address-payment-settings-changed",
  "data": {
    "facility": { "id": "1", "name": "Sample hospital" },
    "doctor": { "id": "123", "name": "Sample", "surname": "Doctor 123" },
    "address": { "id": "111", "name": "Example hospital" },
    "source": "saas",
    "changed_at": "2021-05-14T14:46:33.123456+00:00"
  },
  "created_at": "2021-05-14T15:46:34+01:00"
}
  • The notification does not carry the settings. Call getAddressPaymentSettings to read them. The GET always returns the latest settings, so the order of notifications does not matter.
  • source is saas for a change in Docplanner's practice management software, and partner for a change by another API client.
  • changed_at is always in UTC with microseconds. Other dates use the time zone of your API client.
  • You do not get a notification for your own PUT, or for a PUT that changes nothing.
  • No notification is sent while the address is disabled. When it is enabled again, read the settings with a GET.

Errors and edge cases

CaseWhat happensWhat to do
No acted_by sentNo payment request. Full refund on cancellation.Send acted_by on every booking, move and cancel.
acted_by with another value400 Bad Request. Nothing is saved.Send patient or facility.
Patient asks by phone to book, move or cancelThe patient decided.Send acted_by: patient, so the patient rules apply.
Patient cancels after the visit startedHandled like a no-show. No automatic refund.Tell the patient to ask the facility for a refund.
Patient not matched to a Docplanner accountThe booking is handled as a facility booking. No payment_url.Send the patient's email and phone.
Book Now Pay Later, no card left by the deadlinebooking-canceled with cancellation_reason: unpaid.Cancel the visit in your software and free the slot.
Optional paymentNo deadline. The booking is never cancelled for non-payment. payment_url stays until the visit starts.Show the link. Expect payment at the facility if the patient does not pay online.
Payment being processedpayment_url can be missing. payment_deadline stays.Read the booking again later.
Patient did not pay in timebooking-canceled with cancellation_reason: unpaid.Cancel the visit in your software and free the slot.
Card hold failed (Book Now Pay Later)The patient must pay by a new deadline. payment_url comes back.Show the link again.
Notifications out of orderAn older state arrives after a newer one.Apply payment_changed only when synced_at is newer. Always apply resync.
Same notification twiceThe same state arrives again.Apply it again. Nothing changes.
Your endpoint is downDelivery is retried.See Push vs Pull. Ask support for a resync if data is missing.
Move to an address with another payment account422. Nothing changes.Cancel and create a new booking.
Cancel and create instead of moveThe payment does not follow. Risk of a double charge.Always use moveBooking.
Partial refundpaid_amount changes and a new refund entry appears.Replace your stored state with the new one.
An insurer pays for the visitNo payment deadline.Nothing.

Testing

Coordinate the test setup with your Docplanner integration contact. Test at least these cases:

  1. A patient booking with a required payment. Pay through payment_url. Check booking-payment-updated with paid.
  2. A patient booking with a required payment. Check that payment_deadline is 30 minutes after the booking. Do not pay. Check booking-canceled with cancellation_reason: unpaid after the deadline.
  3. A patient booking with an optional payment. Check that there is no payment_deadline.
  4. A facility booking with no_show_protection: true for a visit more than 7 days away. Check that the deadline is 5 days before the visit.
  5. A move of a booking with an open deadline. Check the new payment_deadline in booking-payment-updated.
  6. A patient cancellation inside and outside the late-cancellation window. Check the refund in booking-payment-updated.
  7. A facility cancellation of a paid booking. Check the full refund.
  8. Two payment_changed notifications in the wrong order. Check that your software keeps the newer one.
  9. If you use Step 7: a GET and a PUT of the payment settings, and the address-payment-settings-changed notification after a change in Docplanner.

Migrating from booking-payment-status-changed

booking-payment-updated replaces booking-payment-status-changed. When Docplanner switches your API client, you stop receiving the old notification. You receive the new one for every change the old one covered, and for more changes:

  • a change from partially paid to paid,
  • a second partial refund,
  • a failed refund,
  • a change of a Book Now Pay Later charge,
  • a change of the payment deadline.
booking-payment-status-changedbooking-payment-updated
visit_payment_status.status_fromNot sent. Compare with the state you stored.
visit_payment_status.status_tovisit_payment_status.online_payment_status
visit_payment_status.changed_atvisit_payment_status.synced_at (with milliseconds)
paidpaid, or partially_paid when only part of the price is paid
waiting_for_confirmationwaiting_for_confirmation, or confirmed when the patient confirmed with a card
not-paidnot-paid
refundedrefunded
charged_backcharged_back
Not availabletrigger, amounts, currency, Book Now Pay Later fields, payment_deadline, transactions

Migration steps:

  1. Build the handler for booking-payment-updated (Step 4). Map the new statuses partially_paid and confirmed.
  2. Store synced_at per booking, so you can ignore older notifications.
  3. Ask your Docplanner integration contact to switch your API client to booking-payment-updated.
  4. Keep your handler for booking-payment-status-changed until the switch is done.

Implementation checklist

  • Ask Docplanner to switch your API client to booking-payment-updated, and to enable address-payment-settings-changed if you need it.
  • Send acted_by on every bookSlot, moveBooking and cancelBooking call: patient when the patient decided (also by phone), facility only when the facility decided on its own initiative.
  • Send the patient's email and phone on bookSlot.
  • Send no_show_protection: true on facility bookings when the facility wants the patient to pay by a deadline.
  • Show payment_url to the patient right after the booking, and read it again from getBooking when needed.
  • Store payment_deadline and update it from booking-payment-updated.
  • Apply booking-payment-updated by trigger and synced_at. Replace the full payment state each time.
  • Key transactions by identifier and type together.
  • Handle booking-canceled with cancellation_reason: unpaid.
  • Use moveBooking for every change of time, service, address or doctor. Do not cancel and create a new booking.
  • Handle 422 on moveBooking.
  • Optional: sync address payment settings with getAddressPaymentSettings, updateAddressPaymentSettings and address-payment-settings-changed.
Prev
Online Features
Next
Patient Presence