Booking payments — createPaymentIntentForBooking mutation
Partners can now create a Stripe PaymentIntent for an existing booking and confirm payment in the browser, aligned with the online booking payment flow.
Affected mutation: createPaymentIntentForBooking
Summary
After creating a booking with createBooking, call createPaymentIntentForBooking with the booking id. The response includes:
clientSecret— pass to Stripe.js / Payment Element andconfirmPaymentpaymentIntentId— for support and follow-up API calls after confirmationstripeAccountId— the practice connected account id forloadStripewhen using Stripe Connect
The booking must belong to the authenticated practice, use a product/booking type with Require payment enabled, have a payable product price (plus tax), and have Stripe connected for the practice.
Pathway (multi-appointment) bookings are not supported in this release; use a single appointment booking.
Example
mutation CreateBookingPaymentIntent($bookingId: ID!) {
createPaymentIntentForBooking(bookingId: $bookingId) {
clientSecret
paymentIntentId
stripeAccountId
error
}
}
Partner flow
createBooking— create the appointment and note the bookingid.createPaymentIntentForBooking— obtainclientSecretandpaymentIntentId.- Mount Stripe Payment Element with the client secret and call
stripe.confirmPaymentin the browser. - After successful confirmation, call the follow-up mutation (when available) to finalise the booking in Semble.
Errors
Typical error responses (HTTP-style statusCode is not exposed on the GraphQL payload; inspect error):
| Situation | Message (summary) |
|---|---|
| Booking not found or wrong practice | Booking with id "…" not found. |
| Product does not require payment | This booking type does not require payment. |
| No price on product | Product does not have a payable price. |
| Stripe not connected | Stripe is not connected for this practice. |
| Pathway booking | Pathway bookings are not supported. |
| Already paid / pending intent | Booking has already been paid / already has a pending payment intent. |
Price
The charge amount is the linked product price plus tax. If the product has no payable price, the mutation returns an error.
Permissions
Requires the same createBookings permission as other booking mutations.
See also
- API reference:
createPaymentIntentForBooking(generated from schema) createBooking