> ## Documentation Index
> Fetch the complete documentation index at: https://www.spacebring.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Guides

> Guides for certifying your integration with Spacebring

To ensure a smooth and compliant integration, all partners must follow Spacebring's [Terms of Use](https://www.spacebring.com/terms) and adhere to the relevant integration guidelines outlined below.

## Requirements

<Tabs>
  <Tab title="Marketplace">
    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.

    1. **Authentication.** Implement [OAuth2](/docs/api-reference/authentication#oauth2) to connect the integration.
    2. **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.
    3. **Booking Owner.** For each booking, include the real booking owner. Spacebring differentiates between members and nonmembers. The best practice is to first [retrieve memberships](/docs/api-reference/community/retrieve-memberships) to obtain `membershipRef`, and if not found then create a nonmember by setting `membership.type` value to `nonmember`.
       <Tip>Assigning all bookings to the account of the administrator who connected Spacebring to your app is prohibited and results in a degraded user experience.</Tip>
    4. **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](/docs/api-reference/resources/create-a-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 `external` payment method. Pass the `succeeded` status when the payment is already collected to confirm the booking, or the `pending` status to keep the booking tentative. To settle a pending payment, take `transactionRef` from the booking `payments` and [update the money transaction](/docs/api-reference/transactions/update-a-money-transaction) with the `succeeded` status to confirm the booking, or the `canceled` status 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](/docs/api-reference/transactions/create-a-money-transaction) with the `external` payment 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 booking `metadata`.
  </Tab>

  <Tab title="Access control">
    The most common integration scenario between an access control solution and Spacebring is to grant door access based on subscriptions, room and desk bookings.

    1. **Authentication.** Implement [OAuth2](/docs/api-reference/authentication#oauth2) to connect the integration.
    2. **Mapping.** Implement logic enabling administrators to associate locations and resources on Spacebring with corresponding sites and access groups within your system.
    3. **Access Conditions.** Take into consideration the following:
       * Users may have an individual subscription or belong to a company with a subscription.
       * Bookings may vary in duration, from as short as 5 minutes up to 24 hours. Users may create multiple bookings for the same resource (e.g., book a meeting room several times in a row.)
       * Access to a meeting room for a nonmember may require opening several locks on the way to the room, for example the main door, elevator, and meeting room door.
  </Tab>
</Tabs>

## Certification

Once your integration is complete, please contact us at [api@spacebring.com](mailto:api@spacebring.com) to initiate the certification process. Please provide all necessary details we might require to test your integration.
