# Access to Buy

## Introduction

“Access to Buy” defines how users enter the secondary market purchase flow.  
While *Access to Sell* always starts from **My Tickets** within your platform, access to buy begins from event-level user journeys—also within your platform—such as:

- Event page  
- Sold-out primary sale page  
- Category listings  
- Experiences with an embedded map  

The integration model determines:

- How buyers see resale inventory  
- Where and how CTAs appear  
- Whether the UI is rule-based and contextual  
- How native the integration feels inside your platform  
- Whether availability, floor prices, and marketplace signals are shown  

menta supports two integration models to enable the resale purchase flow.

---

# Access to Buy — Comparison Table

{% table highlight-first=true highlight-row=2 %}
| Model | Description | When it makes sense | Benefits | Limitations |
|-------|-------------|---------------------|----------|-------------|
| **Smart Access Layer (SAL) — Buy Mode** *(Recommended)* | The platform calls SAL with event context, and SAL returns all necessary UI components | When you want a native, contextual experience | Dynamic components; rule-based UI; real-time availability | Requires component rendering and a SAL call per context |
| **Static URL / Redirect to menta** | A link sends the user to the resale page on menta | When speed to launch is the priority | Minimal implementation effort | No dynamic UI or contextual integration |
{% /table %}

{% conditionaltabs id="tabs-1765463808480" %}
{% tab label="Smart Access Layer" %}
# Smart Access Layer *(Recommended)*

## Overview

The **Smart Access Layer (SAL)** in buy mode generates **all the UI components needed** to run the resale purchase experience.

The platform makes the following request:

```
GET /v1/wrapper/accesslayer?type=buy&eventId={eventId}&showId={showId}
```

SAL evaluates:

- Resale configuration by category  
- Visibility rules  
- Floor prices, availability, and distribution  
- Marketplace signals  
- Rule-based UI behaviors  

And returns a complete structure of preconfigured components, such as:

- Purchase banner  
- Purchase modal  
- Buy button  
- Category list (with availability and CTAs)  
- Integrated venue map  

All components come ready to render and reflect, in real time, the rules configured in the dashboard.

---

## Sample SAL Response (simplified)

## How to interpret the response

The response includes a collection of UI components that the platform must render:

{% columns gap="2rem" align="start" %}

{% column width="1" valign="center" %}
```
{
    "status": 200,
    "data": [
        {
            "type": "banner",
            "class": "buyBanner",
            "buyBanner": {
                "title": "Buy Tickets Now",
                "description": "Best seats available",
                "image": "https://cdn.example.com/sal/banner.png",
                "visible": true,
                "colors": {
                    "background": "#0A1F44",
                    "text": "#FFFFFF"
                },
                "callToAction": {
                    "text": "View options",
                    "url": "http://event.mentatickets.com",
                    "enabled": true
                }
            }
        },
        {
            "type": "modal",
            "class": "buyModal",
            "buyModal": {
                "title": "Complete Your Purchase",
                "description": "Secure checkout in seconds",
                "image": "https://cdn.example.com/sal/modal.png",
                "visible": true,
                "callToAction": {
                    "text": "Continue",
                    "url": "http://event.mentatickets.com",
                    "enabled": true
                }
            }
        },
        {
            "type": "button",
            "class": "buyButton",
            "buyButton": {
                "visible": true,
                "callToAction": {
                    "text": "Buy Tickets",
                    "url": "http://event.mentatickets.com",
                    "enabled": true,
                    "colors": {
                        "background": "#F25C54",
                        "text": "#FFFFFF"
                    }
                },
                "colors": {
                    "background": "#F25C54",
                    "text": "#FFFFFF"
                }
            }
        },
        {
            "type": "list",
            "class": "categoriesList",
            "categoriesList": {
                "categories": [
                    {
                        "ticketOptionId": "17635820544251",
                        "quantityForSale": 0,
                        "floorPrice": 0,
                        "visible": true,
                        "callToAction": {
                            "text": "Check availability",
                            "url": "http://event.mentatickets.com",
                            "enabled": true,
                            "colors": {
                                "background": "#FFFFFF",
                                "text": "#0A1F44"
                            }
                        },
                        "colors": {
                            "background": "#FFFFFF",
                            "text": "#0A1F44"
                        }
                    },
                    {
                        "ticketOptionId": "17635820544252",
                        "quantityForSale": 0,
                        "floorPrice": 0,
                        "visible": true,
                        "callToAction": {
                            "text": "Check availability",
                            "url": "http://event.mentatickets.com",
                            "enabled": true,
                            "colors": {
                                "background": "#FFFFFF",
                                "text": "#0A1F44"
                            }
                        },
                        "colors": {
                            "background": "#FFFFFF",
                            "text": "#0A1F44"
                        }
                    }
                ]
            }
        },
        {
            "type": "map",
            "class": "integratedMap",
            "integratedMap": {
                "map": {
                    "config": {
                        "allowOrphanTicketSelection": true
                    },
                    "totalCount": 0,
                    "bestListing": null,
                    "results": []
                }
            }
        }
    ]
}
```
{% /column %}

{% column width="0.75" valign="top" sticky=true %}


{% codeannotation highlight-lines="4:22" %}
**Banner**

Shows availability, key messages, or marketplace status.
{% /codeannotation %}

{% codeannotation highlight-lines="11" %}
**Visibility**
Available on every component: defines whether you should show it.
{% /codeannotation %}


{% codeannotation highlight-lines="23:37" %}
**Modal**

Pop-up window to complete the purchase with highlighted information.
{% /codeannotation %}

{% codeannotation highlight-lines="38:57" %}
**"Buy resale" button**

Visible only when there is available inventory.
{% /codeannotation %}

{% codeannotation highlight-lines="58:103" %}
**Category list**

Includes:

- Title  
- Availability  
- Floor price  
- Category-specific CTA  
{% /codeannotation %}

{% codeannotation highlight-lines="103:119" %}
**Integrated Map**

Enabled only if:

- The event has seating  
- The partner chooses to show it  
- There is inventory distributed by zones  
{% /codeannotation %}

**Visibility rules**

If a category is disabled or restricted in the dashboard,  
**it will not appear in the SAL response**.

The platform **should not replicate business logic**, only render what SAL provides.
{% /column %}
{% /columns %}


---

## When this model makes sense

- You want a native experience integrated within your platform  
- You need real-time visibility of availability by category  
- The UI must automatically adapt to dashboard rules  
- The partner does not want to maintain eligibility or pricing logic  
- You want to unify primary + secondary experiences  

---

## Benefits

### 1. Fully dynamic, rule-based UI
SAL controls what appears and under which conditions.

### 2. A single endpoint for all components
Banner, buttons, categories, and map in one call.

### 3. Automatic adaptation
Dashboard changes reflect immediately without extra development.

### 4. Native, consistent experience
Users do not feel a jump between systems.

### 5. No duplicated logic
All intelligence stays centralized in menta.

---

## Limitations

- Requires rendering the components returned by SAL  
- Needs one call per purchase context  
- Does not allow custom behaviors outside the SAL model  

{% /tab %}
{% tab label="Static URL" %}
# Static URL

## Overview

The platform adds a button or link such as:

**"Buy resale tickets"**

It redirects the user to a menta domain.  
No dynamic components or contextual visibility are shown in the primary UI.

---

## URL Generation

There are two ways to generate static URLs for the purchase flow:

### 1. Via API (Recommended)

The recommended approach is to use menta's API endpoint to generate dynamic URLs with all available configuration options.

{% apiembed endpoint="get-marketplace-buyingflow-url-entrypoint" show="description,parameters,requestBody,responses" /%}

#### Main parameters

- **externalReferenceEventId**: Event identifier
- **showId**: Show identifier (required)
- **ticketOptionId**: Access category identifier (optional)
- **returnTo**: URL to redirect users after purchase (required)
- **lang**: Language code for the interface (optional)
- **loginTrust[user]**: Email or phone number of the authenticated user when using Login Trust (optional)

#### Usage example

```bash
GET /v1/marketplace/buyingflow/url/entrypoint?externalReferenceEventId=123&showId=456&returnTo=https://example.com
Authorization: Bearer {your_api_key}
```

The response includes the complete URL ready to use:

```json
{
  "status": 200,
  "data": "https://events.mentatech.io/es/123/456?ticketSellerId=1010",
  "errors": null
}
```

### 2. Manual URL

Alternatively, you can construct the URL manually following menta's standard format, though this option offers less flexibility and does not include all configuration options available via API.

---

## Authentication and registration

### Login Trust

You can add the `loginTrust[user]` parameter to any generated URL to enable transparent authentication. This allows users already authenticated on your platform to access the marketplace without needing to log in again.

For more details on Login Trust implementation, see the [authentication guide](/en/guides/auth).

{% callout type="info" %}
**Tip:** The generated URL can include Login Trust by adding the `loginTrust[user]` parameter with the authenticated user's email or phone number. This works with both API-generated URLs and manual URLs.
{% /callout %}

### Force registration without Login Force

If you don't implement Login Force but need users to be registered before they can purchase, you can configure your ticket synchronization endpoint to return an HTTP **404** status code when an unauthenticated user tries to access.

#### Implementation

In your ticket synchronization endpoint (the one menta queries to validate ticket ownership), when you detect that the user is not authenticated or doesn't have an account:

**Return HTTP status code 404**

This will make menta redirect the user to your registration or login page before allowing them to continue with the purchase.

---

## When it makes sense

- When the goal is to enable resale quickly  
- When integrating SAL is not possible for now  
- When you do not need to show availability or floor prices on the event page  
- When SAL is planned for a later phase  

---

## Benefits

- Extremely simple implementation  
- Requires only adding a link  
- Lets you enable resale in very little time  
- Flexibility to add authentication and parameters via API

---

## Limitations

### 1. No dynamic components
Availability, categories, maps, and floor prices are not shown.

### 2. No visibility logic
If resale is disabled, the primary UI will not reflect it.

### 3. No support for advanced capabilities
Future features require SAL.

{% /tab %}
{% /conditionaltabs %}
