---
title: Purchases, Entitlement & Coupons
slug: experience/purchases-entitlement-and-coupons
description: Learn about Purple Experience Builder and how users can access content using entitlement login, external purchases, app store/play store purchases, and coupon codes. Find step-by-step instructions for setting up a login page and integrating login and coup
docTags: 
createdAt: 2023-02-06T13:11:07.000Z
---

Purple Experience

***

## Summary

One of the core aspects of many Purple Experience Apps / Websites is that users purchase content, via single purchases or, more commonly, subscribing.

Ways how users can get access to content:

- entitlement login
- external purchases connected to entitlement
- app store / playstore purchase of issue / content
- app store / playstore purchase of "repeatable publication products" / "consumables"
- app store / playstore purchase of subscription for a publication
- coupon codes

***

## Entitlement

Entitlement allows content to be shown to only authorised users of apps and web.

[More information on entitlement and how to set it up](https://docs.purplepublish.com/setup/entitlement)

In a new view inside the `views.json` you can set up a login page following this [guide on how to set up a login page in the Experience Builder.](https://app.archbee.com/doc/cPdZNYsVesNScLmGOUIwN/wQgPmuLT05fqYi1rzbn2s)

A login button can be added to the issue component with purchaseOptions inside the `views.json`

::Image[]{src="https://api.archbee.com/api/optimize/ygR6KtT9QI_R0u3uKTJsm/pUjiKX8cLh6ImvSH4SyNq_bildschirmfoto-2023-02-08-um-181824.png" size="74" width="908" height="332" position="center" caption="issue component with purchaseOptions inside the views.json" alt="issue component with purchaseOptions inside the views.json" showCaption="true"}

Additionally a login option can be added in the app menu. This is done by adding the following lines into the `app_menu.xml` which is located inside the default folder.

```xml
	<navigationNode targetURL="purple://storefront/resource/dynamic/storefront/index.html?title_bar=false&amp;bounces=false&amp;force_status_bar=true#/login" access="ROLE_ANONYMOUS">
            <title>Login</title>
            <iconURL>menuicons/login.png</iconURL>
    </navigationNode>

	<navigationNode targetURL="purple://kiosk/entitlement/logout/perform" access="AUTHENTICATED">
            <title>Logout</title>
            <iconURL>menuicons/logout.png</iconURL>
        </navigationNode>
```

## App store purchases

### Payments

Please refer to this Docs:&#x20;

[Payments](https://confluence.sprylab.com/display/PURPLEDOC/Payments) (note section "Repeatable issue purchases")

## To test purchases in preview apps

For testing app purchases in the preview version of your app, please contact your Purple Project Manager or Purple Customer Success Agent so that we can provide you test accounts for the sandboxes for both platforms (iOS and Android).

## Coupon Codes

To activate coupons for your app, refer to: [Coupon code function](docId\:aNn42bsKmUotY_AsIZjr8)

Coupons are used to unlock issues that would otherwise be paid for in publications published over specified time periods. They may have a limited period of use and validity.

In order to integrate coupons into your app, you need to create a view for the [Coupons](docId\:j_Z4qQ5wgEYPoZZsY8zws) to be used.

You can also add a coupon button to the issue component with purchaseOptions, similarly to the login button.

To make the coupon page accessible via the app menu, add the following line to the `app_menu.xml`

```xml
<navigationNode targetURL="purple://storefront/resource/dynamic/storefront/index.html?title_bar=false&amp;bounces=false&amp;force_status_bar=true#/coupons">
            <title>Coupons</title>
            <iconURL>icons/voucher.png</iconURL>
        </navigationNode>
```





