Payments for integration bookings
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_byon bookSlot, cancelBooking and moveBooking. You tell Docplanner who performed the action: the patient or the facility. All payment rules depend on this value.payment_urlon the booking. It is the link to the Docplanner payment page for this booking.payment_deadlineon the booking. It is the time by which the patient has to pay.cancellation_reason: unpaidon the booking and inbooking-canceled. Docplanner cancelled the booking because the patient did not pay in time.no_show_protectionon bookSlot. The facility can ask the patient to pay by a deadline.- The
booking-payment-updatednotification. It replacesbooking-payment-status-changedand always carries the full payment state of the booking. - The getAddressPaymentSettings and updateAddressPaymentSettings endpoints and the
address-payment-settings-changednotification. 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
| Term | Meaning |
|---|---|
| Patient booking | The 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 booking | The facility decided it on its own initiative. You send acted_by: facility. |
| Required payment | The patient must pay online by the payment deadline, or the booking is cancelled. |
| Optional payment | The 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 window | The 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:
- Send you the
booking-payment-updatednotification instead ofbooking-payment-status-changed. Your API client receives one of the two, never both. - Send you the
address-payment-settings-changednotification, if you want to sync payment settings (Step 7). This is thesend_address_payment_settings_changed_callbackssetting. 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.
| Value | Send it when | Examples |
|---|---|---|
patient | The 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. |
facility | The 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 set | payment_url | payment_deadline | If the patient does not pay |
|---|---|---|---|
| Required | Yes | Yes, 30 minutes after the booking | The booking is cancelled at the deadline with cancellation_reason: unpaid. |
| Book Now Pay Later | Yes | Yes | If the patient leaves no card by the deadline, the booking is cancelled with cancellation_reason: unpaid. |
| Optional | Yes, until the visit starts | No | Nothing. The patient pays at the facility. |
| No payment | No | No | Nothing. |
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_byisfacility,- 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_deadlinestays 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:
trigger | What to do |
|---|---|
payment_changed | Apply it only if its synced_at is later than the synced_at of the last notification you applied for this booking. Otherwise ignore it. |
resync | Docplanner 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_status | Meaning |
|---|---|
not-paid | Nothing is paid. |
waiting_for_confirmation | A payment is being processed. |
confirmed | The patient confirmed the booking with a card. No amount was charged, released or failed yet. |
partially_paid | Part of the price is paid. |
paid | The price is paid in full, or the full amount of a Book Now Pay Later booking is reserved on the patient's card. |
refunded | The payment was refunded. |
charged_back | The 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_amountandamountare strings with 2 decimals, for example"12.50". Parse them as decimal numbers.payment_deadlineis always present.nullmeans 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_status | Meaning |
|---|---|
not_attempted | Docplanner did not try to reserve or charge this amount yet. |
authorized | The amount is reserved on the patient's card. |
charged | The amount is charged. |
failed | The reservation or the charge failed. |
released | The 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
identifierandtypetogether, never byidentifieralone. One payment can have two entries with the sameidentifier, for exampleno_show_fee.frozenandno_show_fee.collection. occurred_atis when the payment last changed. Do not use it to sort the entries.amountis negative forrefundandrefund_failed. It is zero or positive for all other types.
type | Meaning |
|---|---|
collection | A payment by the patient. |
refund | A refund to the patient. |
refund_failed | A refund that failed. |
capture_failed | A charge that failed. |
no_show_fee.frozen | The no-show fee is reserved on the card. |
no_show_fee.collection | The no-show fee is charged. |
no_show_fee.released | The no-show fee reservation is released. |
remaining_amount.frozen | The rest of the price is reserved on the card. |
remaining_amount.captured | The rest of the price is charged. |
remaining_amount.released | The reservation of the rest of the price is released. |
Delivery and missed notifications
- Return a
2xxstatus 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_bystaysuser. Usecancellation_reasonto tell a cancellation for non-payment from a cancellation by the patient.cancellation_reasonis also on the booking in getBooking and getBookings.cancellation_reasonis 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-updatedwith the newpayment_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_urlfor 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_by | Before the visit starts | After the visit starts |
|---|---|---|
patient | The 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 sent | Full 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
}
}
| Field | Meaning |
|---|---|
online_payments | Online payments are on for the address. |
schedule_managed_by_docplanner | Read-only. true when the schedule is managed in Docplanner's practice management software. It changes the write rules below. |
online_payments_account_active | Read-only. true when the address has an active Docplanner payment account. |
upfront_payment_policies.patient_bookings | The policy for bookings the patient makes, for new and for returning patients. |
upfront_payment_policies.admin_bookings | The policy for bookings the facility makes, for new and for returning patients. |
book_now_pay_later.available | Read-only. Book Now Pay Later can be used at this address. |
book_now_pay_later.enabled | Book Now Pay Later is on for the address. |
late_cancellation_window_hours | A cancellation this many hours or fewer before the visit costs the no-show fee. |
no_show_fee_percentage | The share of the visit price charged for a no-show or a late cancellation. |
Policy values:
| Policy | Meaning |
|---|---|
inactive | The patient is not asked to pay online. |
optional | The patient may pay online. |
mandatory | The patient pays online when booking. |
book-now-pay-later | The patient leaves a card. It is charged only for a no-show or a late cancellation. Only for patient bookings. |
null | Never 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_bookingspolicies cannot both beinactive. admin_bookingscannot usebook-now-pay-later.late_cancellation_window_hoursis a whole number from 24 to 120.no_show_fee_percentageis more than 0 and at most 100, with at most 2 decimals.- The window and the fee are required while
book_now_pay_later.enabledistrueor a patient bookings policy isbook-now-pay-later. - Send booleans and numbers as JSON values, not as strings.
24.0is refused where a whole number is expected. - A
nullfrom the GET response is not accepted where the PUT needs a value. Choose a value first. book_now_pay_later.availableis read-only. Docplanner ignores it.- When
online_payments_account_activeisfalse, you can only switchonline_paymentsoff. - When
schedule_managed_by_docplanneristrue, Book Now Pay Later is managed in Docplanner's practice management software.book_now_pay_later.enabledmust 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"
}
| Message | What 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.
sourceissaasfor a change in Docplanner's practice management software, andpartnerfor a change by another API client.changed_atis 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
| Case | What happens | What to do |
|---|---|---|
No acted_by sent | No payment request. Full refund on cancellation. | Send acted_by on every booking, move and cancel. |
acted_by with another value | 400 Bad Request. Nothing is saved. | Send patient or facility. |
| Patient asks by phone to book, move or cancel | The patient decided. | Send acted_by: patient, so the patient rules apply. |
| Patient cancels after the visit started | Handled like a no-show. No automatic refund. | Tell the patient to ask the facility for a refund. |
| Patient not matched to a Docplanner account | The 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 deadline | booking-canceled with cancellation_reason: unpaid. | Cancel the visit in your software and free the slot. |
| Optional payment | No 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 processed | payment_url can be missing. payment_deadline stays. | Read the booking again later. |
| Patient did not pay in time | booking-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 order | An older state arrives after a newer one. | Apply payment_changed only when synced_at is newer. Always apply resync. |
| Same notification twice | The same state arrives again. | Apply it again. Nothing changes. |
| Your endpoint is down | Delivery is retried. | See Push vs Pull. Ask support for a resync if data is missing. |
| Move to an address with another payment account | 422. Nothing changes. | Cancel and create a new booking. |
| Cancel and create instead of move | The payment does not follow. Risk of a double charge. | Always use moveBooking. |
| Partial refund | paid_amount changes and a new refund entry appears. | Replace your stored state with the new one. |
| An insurer pays for the visit | No payment deadline. | Nothing. |
Testing
Coordinate the test setup with your Docplanner integration contact. Test at least these cases:
- A patient booking with a required payment. Pay through
payment_url. Checkbooking-payment-updatedwithpaid. - A patient booking with a required payment. Check that
payment_deadlineis 30 minutes after the booking. Do not pay. Checkbooking-canceledwithcancellation_reason: unpaidafter the deadline. - A patient booking with an optional payment. Check that there is no
payment_deadline. - A facility booking with
no_show_protection: truefor a visit more than 7 days away. Check that the deadline is 5 days before the visit. - A move of a booking with an open deadline. Check the new
payment_deadlineinbooking-payment-updated. - A patient cancellation inside and outside the late-cancellation window. Check the refund in
booking-payment-updated. - A facility cancellation of a paid booking. Check the full refund.
- Two
payment_changednotifications in the wrong order. Check that your software keeps the newer one. - If you use Step 7: a GET and a PUT of the payment settings, and the
address-payment-settings-changednotification 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-changed | booking-payment-updated |
|---|---|
visit_payment_status.status_from | Not sent. Compare with the state you stored. |
visit_payment_status.status_to | visit_payment_status.online_payment_status |
visit_payment_status.changed_at | visit_payment_status.synced_at (with milliseconds) |
paid | paid, or partially_paid when only part of the price is paid |
waiting_for_confirmation | waiting_for_confirmation, or confirmed when the patient confirmed with a card |
not-paid | not-paid |
refunded | refunded |
charged_back | charged_back |
| Not available | trigger, amounts, currency, Book Now Pay Later fields, payment_deadline, transactions |
Migration steps:
- Build the handler for
booking-payment-updated(Step 4). Map the new statusespartially_paidandconfirmed. - Store
synced_atper booking, so you can ignore older notifications. - Ask your Docplanner integration contact to switch your API client to
booking-payment-updated. - Keep your handler for
booking-payment-status-changeduntil the switch is done.
Implementation checklist
- Ask Docplanner to switch your API client to
booking-payment-updated, and to enableaddress-payment-settings-changedif you need it. - Send
acted_byon every bookSlot, moveBooking and cancelBooking call:patientwhen the patient decided (also by phone),facilityonly when the facility decided on its own initiative. - Send the patient's email and phone on bookSlot.
- Send
no_show_protection: trueon facility bookings when the facility wants the patient to pay by a deadline. - Show
payment_urlto the patient right after the booking, and read it again from getBooking when needed. - Store
payment_deadlineand update it frombooking-payment-updated. - Apply
booking-payment-updatedbytriggerandsynced_at. Replace the full payment state each time. - Key transactions by
identifierandtypetogether. - Handle
booking-canceledwithcancellation_reason: unpaid. - Use moveBooking for every change of time, service, address or doctor. Do not cancel and create a new booking.
- Handle
422on moveBooking. - Optional: sync address payment settings with getAddressPaymentSettings, updateAddressPaymentSettings and
address-payment-settings-changed.