Step 3. Enable purchase
Congratulations! You've successfully set up your paywall to display product data from Adapty, including the product title and price.
Now, let's move on to the final step – letting users make a purchase through the paywall.
Step 3.1. Enable users to make purchases
-
Double-click the buy button on your paywall page. In the right panel, open the Actions section if it's not already open.
-
Open the Action Flow Editor.

- In the Select Action Trigger window, choose On Tap.
- In the No Actions Created window, click Add Action. Search for the
makePurchase
action and choose it.

- In the Set Actions Arguments section, choose
getPaywallProductsResult
variable created earlier. - Fill in the fields as follows:
- Available Options: Data Structure Field
- Select Field: value
- Available Options: Item at Index
- List Index Options: First

- Click
subscriptionUpdateParameters
, search forAdaptySubscriptionUpdateParameters
and select it. Click Confirm.infoBy default, you can leave all the object fields empty. You would need to fill them in to replace one subscription with another in Android apps. Read more here.
- Click Confirm.
- In the Action Output Variable Name, create a new variable and name it
makePurchaseResult
- this will be used later to confirm the purchase was successful.

Step 3.2. Check if the purchase was successful
Now, let's set up a check to see if the purchase went through.
- Click + and click Add Conditional.
- In Set Condition for Action, select the
makePurchaseResult
variable. - In the Set Variable window, fill in the fields as follows:
- Available Options: Has Field
- Select Field: profile

- Click Confirm.
Step 3.3. Open paid content
If the purchase is successful, you can unlock the paid content. Here’s how to set that up:
- Click + under the TRUE label and click Add Action.
- In the Define Action field, search for and select the page you want to open from the Navigate To list. In this example, the page is Questions.

Step 3.4 Show error message if purchase failed
If the purchase fails, let's display an alert to the user.
- Add an Informational Dialog action to the FALSE label.
- In the Title field, enter the text you want for the dialog title, such as Purchase Failed.

-
Click Value in the Message box. In the Set from Variable window, search for
makePurchaseResult
and choose it. Fill in the fields as follows:- Available Options: Data Structure Field
- Select Field: error
- Available Options: Data Structure Field
- Select Field: errorMessage
-
Click Confirm.
-
Add a Terminate action to the FALSE flow.

- Finally, click Close in the top-right corner.
Congratulations! Your users can now purchase your products. As an extra step, let's set up a check for user access to paid content elsewhere to decide whether to display paid content or the paywall to them.