Stay-to-Play Integration Guide
Overview
For the stay-to-play product, we provide an embedded component for the admin side. There is no embedded component for the customer side as they are not presented with anything and the actions are done in the background of the booking workflow.
For the admin perpsective, the goal is to simply allow housing companies to either enable or disable stay-to-play coverage during the event setup workflow.
For the user perspective, during the booking workflow, your platform will need to handle calling the quote and purchase APIs for stay-to-play.
Event Setup Flow Configuration
To install the embedded component within your platform, please see the Embedded Stay-to-Play documentation.
Event ID's
Using this component will result in the creation of an event_id which you will want to store as part of your event record
during your event creation workflow.
Booking Flow Configuration
If the stay-to-play product is enabled for a specific event (e.g. you have saved an event_id from the process outlined above), when someone
adds a booking to their cart, you will issue a quote request to our stay-to-play quote API.
The insurable_amount for this request should be the calculated value of the commission amount, the rebate amount, or both inclusive, that
the stay-to-play contract is setup for. This is an agreement that the housing company will already have in place.
You will also need to include the above event_id in the request that you stored as part of the event setup workflow.
{
"policy_attributes": {
"insurable_amount": <calculated by the platform>,
"event_id": "<id stored during the creation flow>",
// ... other attributes
}
}The quote response will include a total amount. You will want to ensure this is added to the booking fee that the housing company will receive as
part of the booking. The quote response will also include a quote_id which will be used during the purchase step.
Purchase
Once the user has confirmed a booking and completed the checkout, you will then need to issue a purchase request with the quote_id received from the
quote API call. See our purchase API documentation here.