Get Paywall
POST/paywalls
After a profile has been created, call Get Paywall at any time to retrieve the paywall predicted by Botsi’s AI Pricing model. The response determines which paywall configuration to display to the user.
Follow the notes below for a successful request:-
You must identify the user by providing either
profileIdorcustomerUserId, and specify theplacementIdconfigured on the Botsi dashboard. -
If optional fields are omitted when sending the request, Botsi will automatically fall back to the values stored on the user profile.
Performance and timingThe Get Paywall API uses AI models to determine the best paywall for a user, which introduces specific latency considerations. You must implement this endpoint strategically to ensure a seamless experience within your application.
The response typically takes about 500 ms but can take up to 5 seconds depending on the AI prediction speed. To maintain a smooth user interface, follow these implementation guidelines:
-
Avoid calling this endpoint synchronously at render time.
-
Trigger the request early in the user journey, such as immediately after a profile is created.
-
Ensure the response is received and cached before the user reaches the point where the paywall must be displayed.
-
A successful request returns the selected paywall and metadata indicating whether it was served by the AI Pricing model.
Key properties you may want to store or forward to later steps include:
-
data.id- The internal paywall ID in Botsi. -
data.externalId- The external paywall ID used in your app and the AI Pricing model. It can be added manually when configuring the Paywall in Botsi. -
data.isExperiment- A boolean that indicates if the paywall was returned by the AI Pricing model. -
data.aiPricingModelId- The ID of the AI Pricing model that served the paywall.
Request
Responses
- 200
Paywall retrieved.