Requirements
- Marketplace
- Access control
The most common integration scenario between a booking aggregator marketplace and Spacebring involves displaying room and desk availability on the marketplace, enabling users to book directly from the marketplace, and synchronizing these bookings with Spacebring to reserve the space and manage access permissions.
- Authentication. Implement OAuth2 to connect the integration.
- Multi-Location. Resources are grouped by location. Consider this structure when retrieving resources and their availability to ensure accurate and efficient data handling and presentation.
- Booking Owner. For each booking, include the real booking owner. Spacebring differentiates between members and nonmembers. The best practice is to first retrieve memberships to obtain
membershipRef, and if not found then create a nonmember by settingmembership.typevalue tononmember. - Payments. Spacebring issues an invoice for every payment it records, including payments collected outside Spacebring. Choose how to record a booking payment based on where the price is set and whether the customer needs a Spacebring invoice:
- If you collect the payment on your marketplace and the customer needs no Spacebring invoice, create the booking without a payment method. Store the reference to your payment, for example a payment intent id, in the booking
metadata. - If you charge the price set up in Spacebring for the resource, create the booking with the
externalpayment method. Pass thesucceededstatus when the payment is already collected to confirm the booking, or thependingstatus to keep the booking tentative. To settle a pending payment, taketransactionReffrom the bookingpaymentsand update the money transaction with thesucceededstatus to confirm the booking, or thecanceledstatus to cancel it. Spacebring issues and sends the invoice once the payment is confirmed. - If the price is set on your marketplace and the customer needs a Spacebring invoice, create the booking without a payment method, then create a money transaction with the
externalpayment method and a custom item with your unit amount, quantity, and tax. Spacebring issues and sends the invoice for the transaction. The transaction is not linked to the booking, so store its id in the bookingmetadata.
- If you collect the payment on your marketplace and the customer needs no Spacebring invoice, create the booking without a payment method. Store the reference to your payment, for example a payment intent id, in the booking