Wraps the Stripe payment integration: the incoming Stripe webhook, payment intents and checkout sessions, and Stripe Connect account onboarding plus subscription billing for organisations. The webhook is called by Stripe; the payment-intent routes are called by the mobile app; the /pms and /organisation routes are called by the PIMS (Practice Information Management System, the clinic-facing web app) and require organisation RBAC (role-based access control) permissions. See the Invoice API for the invoices these payments settle.
Endpoints
POST /webhook
- Body:
Buffer - Controller:
StripeController.webhook - Response:
200: keysError,400: keysError
POST /payment-intent/:appointmentId
- Auth:
requireMobileAuth - Params:
appointmentId - Controller:
StripeController.createPaymentIntent - Response:
200: keyscreatePaymentIntent,400: keyserror,message
GET /payment-intent/:paymentIntentId
- Auth:
requireMobileAuth - Params:
paymentIntentId - Controller:
StripeController.retrievePaymentIntent - Response:
200: keysretrievePaymentIntent,400: keyserror,message
GET /checkout-session/:sessionId
- Auth:
none - Params:
sessionId - Controller:
StripeController.createPaymentIntentForInvoice - Response:
200: keyscreatePaymentIntentForInvoice,400: keyserror,message
POST /pms/payment-intent/:invoiceId
- Auth:
requireWebAuth - RBAC:
withOrgPermissions, requirePermission - Params:
invoiceId - Controller:
StripeController.createPaymentIntentForInvoice - Response:
200: keyscreatePaymentIntentForInvoice,400: keyserror,message
POST /organisation/:organisationId/account
- Auth:
requireWebAuth - RBAC:
withOrgPermissions, requirePermission - Params:
organisationId - Controller:
StripeController.createOrGetConnectedAccount - Response:
200: keyscreateOrGetConnectedAccount,400: keyserror,message
GET /organisation/:organisationId/account/status
- Auth:
requireWebAuth - RBAC:
withOrgPermissions, requirePermission - Params:
organisationId - Controller:
StripeController.getAccountStatus - Response:
200: keysgetAccountStatus,400: keyserror,message
POST /organisation/:organisationId/onboarding
- Auth:
requireWebAuth - RBAC:
withOrgPermissions, requirePermission - Params:
organisationId - Controller:
StripeController.createOnboardingLink - Response:
200: keyscreateOnboardingLink,400: keyserror,message
POST /organisation/:organisationId/billing/checkout
- Auth:
requireWebAuth - RBAC:
withOrgPermissions, requirePermission - Params:
organisationId - Controller:
StripeController.createBusinessCheckout - Response:
400: keyserror,message,200: keyscreateBusinessCheckout
POST /organisation/:organisationId/billing/portal
- Auth:
requireWebAuth - RBAC:
withOrgPermissions, requirePermission - Params:
organisationId - Controller:
StripeController.createBillingPortal - Response:
200: keyscreateBillingPortal,400: keyserror,message
POST /organisation/:organisationId/billing/sync-seats
- Auth:
requireWebAuth - RBAC:
withOrgPermissions, requirePermission - Params:
organisationId - Controller:
StripeController.syncSeats - Response:
200: keyssyncSeats,400: keyserror,message