# Access to Sell

## Overview

**Access to sell** defines how users enter the resale flow from your *My Tickets* section to list or manage their tickets.

The most complete integration for sell access is the **Smart Access Layer (SAL)**; for the fastest start, most platforms begin with the **static smart publish URL with one-time token**.

{% callout type="info" title="Smart Access Layer" %}
You may also see the Smart Access Layer referred to as SAL in some parts of the documentation.
{% /callout %}

With the Smart Access Layer, your platform calls a high-priority endpoint with a list of tickets and the user's identifier. menta tech responds, for each ticket, with:

- The current resale status (`SELLABLE`, `FOR_SALE`, `SOLD`, `NOT_SELLABLE`)
- The available actions as call-to-actions (e.g., sell, edit listing, view details)
- The URLs to execute those actions
- Optional UI components (e.g., sell banner)

Your UI uses this response to decide what to show for each ticket and where to send the user when they click. Ticket information is fetched on demand while the user views their tickets or starts a resale action, so menta does not add load to your primary onsales.

menta tech supports three models for Access to Sell:

- **Option 1** Smart Access Layer
- **Option 2** Static smart publish URL with one-time token (recommended)
- **Option 3** Static resale entry URL

The underlying resale rules are the same. The choice is how tightly your *My Tickets* UI should connect to those rules.

## Integration models comparison

{% table highlight-first=true highlight-row=3 %}
| Model | Description | When it makes sense | Benefits | Limitations |
|--------|-------------|----------------------|-----------|--------------|
| Smart Access Layer | Your backend calls the sell SAL endpoint with tickets and user identity, and receives per-item status and CTAs | You want native resale actions and states inside *My Tickets* | Real-time per-ticket status, contextual actions, menta rule-driven logic | Requires integrating the SAL call and wiring responses into your UI |
| Static smart publish URL with one-time token (recommended) | On each click, your backend requests a smart publish URL with an embedded one-time token and redirects the user to it | You want a single entry point with an authenticated experience and minimal integration effort | One API call per click, the user lands already authenticated, menta routes them to the best destination automatically | No per-ticket state or actions in your *My Tickets* UI |
| Static resale entry URL | A single fixed "Sell tickets" link sends users to the resale entry page on menta | You need the absolute minimal integration or a quick pilot | Very low implementation effort, no backend changes | No per-ticket state or actions in your *My Tickets* UI; the user must authenticate on menta |
{% /table %}

___

{% conditionaltabs id="tabs-1765307261094" %}
{% tab label="Smart Access Layer" %}

## Smart Access Layer

### Concept

The **Smart Access Layer** lets your *My Tickets* view ask menta, for each ticket, what can be done right now and how to do it.

For every ticket you send, menta evaluates:

- Whether the ticket is eligible for resale, based on rules configured in the menta dashboard
- Whether it is already listed or sold
- Which action makes sense (e.g., list for sale, edit listing, view listing details, no action)
- Whether the seller needs to complete payout setup

The endpoint is designed as a high-priority path capable of handling large requests efficiently, with the performance needed for critical real-time actions.

### Endpoint

```
POST https://api.mentatech.io/v1/wrapper/accesslayer
```

**Headers:**

| Header          | Required | Description                          |
|-----------------|----------|--------------------------------------|
| Authorization   | Yes      | Your API key                         |
| Content-Type    | Yes      | `application/json`                   |

### Request

You send each `ticketId` and menta returns per-ticket status and CTAs.

**Request body:**

| Field                    | Type     | Required | Description                                         |
|--------------------------|----------|----------|-----------------------------------------------------|
| user                     | string   | Yes      | Email of the user (the seller)                      |
| tickets                  | array    | Yes      | List of ticket items to evaluate                    |
| tickets[].eventId        | string   | Yes      | External event identifier                           |
| tickets[].showId         | string   | Yes      | External show identifier                            |
| tickets[].ticketId       | string   | Yes      | External ticket identifier                          |
| tickets[].ticketOptionId | string   | Yes      | Access category identifier                          |
| tickets[].priceTypeId    | string   | Optional | Price type identifier (when applicable)             |

**Request example:**

```json
POST /v1/wrapper/accesslayer
Authorization: YOUR_API_KEY

{
  "user": "seller@example.com",
  "tickets": [
    {
      "eventId": "evt-123",
      "showId": "show-456",
      "ticketId": "T001",
      "ticketOptionId": "GA"
    },
    {
      "eventId": "evt-123",
      "showId": "show-456",
      "ticketId": "T002",
      "ticketOptionId": "VIP",
      "priceTypeId": "standard"
    }
  ]
}
```

**Response example:**

```json
{
  "data": {
    "user": "seller@example.com",
    "tickets": [
      {
        "status": "SELLABLE",
        "ticketId": "T001",
        "ticketOptionId": "GA",
        "priceTypeId": "",
        "sync": true,
        "callToActions": [
          {
            "key": "SELL",
            "text": "Sell",
            "url": "https://sell-ticket.mentatickets.com/es/publish/65fdc7eb...?ticketSellerId=2&oneTimeToken=...&utm_source=sell&syncPage=true",
            "enabled": true
          }
        ]
      },
      {
        "status": "FOR_SALE",
        "ticketId": "T002",
        "ticketOptionId": "VIP",
        "priceTypeId": "standard",
        "sync": true,
        "callToActions": [
          {
            "key": "P2P",
            "text": "Peer to Peer",
            "url": "https://event.mentatickets.com/es/...?sellerId=...&ticketSellerId=2&utm_source=sell&syncPage=true",
            "enabled": true
          },
          {
            "key": "EDIT",
            "text": "Edit Listing",
            "url": "https://sell-ticket.mentatickets.com/es/list-item/...?listingId=...&ticketSellerId=2&oneTimeToken=...&utm_source=sell&syncPage=true",
            "enabled": true
          }
        ]
      }
    ],
    "components": [
      {
        "type": "banner",
        "class": "sellBanner",
        "sellBanner": {
          "title": "Sell your tickets",
          "description": "List your tickets on the marketplace",
          "image": "https://cdn.example.com/sell-banner.png",
          "visible": true,
          "colors": {
            "background": "#0A1F44",
            "text": "#FFFFFF"
          },
          "callToAction": {
            "text": "Start selling",
            "url": "https://sell-ticket.mentatickets.com/es/publish/...?ticketSellerId=2&utm_source=sell&syncPage=true",
            "enabled": true
          }
        }
      }
    ]
  },
  "errors": [],
  "status": 200
}
```

### Status reference

| Status         | Description                                                    |
|----------------|----------------------------------------------------------------|
| `SELLABLE`     | The ticket can be listed for sale. CTA: `SELL`                 |
| `NOT_SELLABLE` | The ticket cannot be listed (rules do not allow it)            |
| `FOR_SALE`     | The ticket has an active listing. CTAs: `EDIT`, `P2P`          |
| `SOLD`         | The ticket was sold through the marketplace. CTA: `DETAILS`    |

### Call-to-action reference

| Key                  | Text                  | Description                                                                |
|----------------------|-----------------------|----------------------------------------------------------------------------|
| `SELL`               | Sell                  | Link to start the listing flow for this ticket                             |
| `EDIT`               | Edit Listing          | Link to edit or view the active listing                                    |
| `DETAILS`            | View Listing Details  | Link to view sold listing details                                          |
| `P2P`                | Peer to Peer          | Share link for the listing (direct purchase link)                          |
| `PENDING_PAYOUT_INFO`| Pending Payout Info   | Seller needs to complete payout setup (appears alongside other CTAs)       |
| `MANAGE`             | Manage Tickets        | Link to the ticket management page (mixed states)                          |

### The `sync` field

Each ticket in the response includes a `sync` boolean:

- `sync: true` — the ticket is already synchronized in menta's database.
- `sync: false` — the ticket is not yet in menta's database. The CTA URL includes `syncPage=true` so the frontend triggers synchronization before listing.

{% callout type="info" title="Unknown tickets" %}
menta does not store your ticket inventory permanently — it synchronizes tickets on demand when a user wants to sell. This means a `ticketId` you send may not yet exist in menta's database.

When a ticket is not yet known to menta, the sell SAL still evaluates its sellability using the configured resale rules for that event/show/category combination. If the rules allow listing, the response returns `SELLABLE` with `sync: false` and a CTA URL that triggers synchronization automatically. Your UI does not need to handle this differently — just render the CTA as usual and menta takes care of the rest.
{% /callout %}

### Components

The response includes a `components` array with optional UI elements. Currently, the sell SAL returns:

**Sell Banner** (`type: "banner"`, `class: "sellBanner"`)

A promotional banner encouraging the user to sell their tickets. Visibility is controlled by the rules configured in the menta dashboard.

| Field                      | Description                                  |
|----------------------------|----------------------------------------------|
| `sellBanner.title`         | Banner title text                            |
| `sellBanner.description`   | Banner description text                      |
| `sellBanner.image`         | Banner image URL                             |
| `sellBanner.visible`       | Whether the banner should be rendered         |
| `sellBanner.colors`        | Optional background and text colors          |
| `sellBanner.callToAction`  | CTA with text, URL, enabled flag, and colors |

### How to use it in your UI

Your *My Tickets* page should:

1. Resolve the list of tickets for the current user.
2. Call the sell SAL endpoint with the tickets and the user's email.
3. For each ticket in the response:
   - Use `status` to display the current state (e.g., Available for sale, For Sale, Sold).
   - Render each entry in `callToActions` as an actionable button or link, using `text` as the label and `url` as the destination.
   - If `callToActions` is empty, do not show resale actions for that item.
4. If `components` contains a visible sell banner, render it in an appropriate location.

Because all eligibility logic and states are managed by rules in the menta dashboard, any change you make there is automatically reflected in SAL responses without code changes on your side.

### When this model makes sense

Use the Smart Access Layer when:

- You want resale to feel fully integrated in your *My Tickets* UI.
- You need real-time, per-ticket states like `SELLABLE`, `SOLD`, `FOR_SALE`.
- You want to control from the menta dashboard which events, shows, or categories have resale enabled.
- You prefer not to implement or maintain resale rules in your own code.
{% /tab %}

{% tab label="Static smart publish URL" %}

## Static smart publish URL with one-time token (recommended)

### Concept

**Smart Publish** is a single static entry point for reselling: you place one "Sell your tickets" call-to-action in your platform (for example in your *My Tickets* section) and menta takes care of the rest.

On every click, your backend requests a fresh smart-publish URL for the user and redirects them to it. The returned URL embeds a **one-time token**, so the user lands already authenticated — no login or extra steps — and menta automatically routes them to the best destination based on their resale inventory:

- The publish wizard, when they have tickets eligible for resale
- The listing management view, when they already have active listings
- The ticket hub for a show, or a show picker when they have inventory in several shows
- An empty state, when there is nothing to resell

If the user does not exist in menta yet, it is created automatically.

**Typical flow:**

1. Add a "Sell tickets" button or menu item in your UI.
2. On each click, your backend calls the Smart Publish endpoint with the user's email.
3. Redirect the user to the returned URL — they land authenticated and menta routes them automatically.

### Endpoint

```
GET https://api.mentatech.io/v1/marketplace/smartPublish
```

**Headers:**

| Header          | Required | Description                          |
|-----------------|----------|--------------------------------------|
| Authorization   | Yes      | Your API key                         |

**Query parameters:**

| Parameter | Required | Description                                                              |
|-----------|----------|---------------------------------------------------------------------------|
| email     | Yes      | Email of the user who wants to resell their tickets                      |
| lang      | Optional | Language for the smart-publish interface (e.g. `es`, `en`, `pt`)         |
| eventId   | Optional | ID of the event **in your system** (deep link). Redirects the user straight to that event instead of routing by their full inventory |
| showId    | Optional | ID of the show **in your system**. Only valid together with `eventId` — sending `showId` alone returns a `400` |

**Response example:**

```json
{
  "status": 200,
  "data": {
    "url": "https://sell-ticket.mentatickets.com/es/smart-publish?ticketSellerId=2&oneTimeToken=..."
  },
  "errors": null
}
```

{% callout type="warning" title="The URL is single-use" %}
The embedded one-time token is consumed when the URL is opened. Request a fresh URL on every click and never cache it or embed it statically in your UI.
{% /callout %}

### Deep link to an event or show

Pass `eventId` (and optionally `showId`) to skip the inventory-based routing and send the user straight to a specific event or show — for example, from a "Sell tickets" button on that event's page in your platform:

```
GET https://api.mentatech.io/v1/marketplace/smartPublish?email=jane@example.com&eventId=EV123&showId=SH456
```

Both IDs are the **external** ones from your system, exactly as you send them in the ticket sync. Rules:

- Sending the `eventId` + `showId` pair is recommended: show IDs can repeat across events, and the pair identifies the show unambiguously.
- If you send only `eventId` and the event has a single show, the user lands straight on that show, regardless of what the IDs look like. If your events have multiple shows, send both fields — with `eventId` alone we don't guess the show.
- If the deep link doesn't match anything the user can act on (the event doesn't exist, or they have no tickets or listings there), they land on the empty state — never on the show picker or a broken page. The empty state's refresh button keeps the deep link and re-resolves.
- Without `eventId`/`showId` the behavior is the usual one: menta routes based on the user's full inventory (single show, show picker, or empty state).

See the full endpoint documentation in the <a href='https://connect.mentatech.io/en/api/get-marketplace-smartPublish' target="_blank">API Reference: Get Smart Publish URL</a>.

### When this model makes sense

Use the static smart publish URL with one-time token when:

- You want the fastest path to production for resale.
- You can identify the user's email at click time.
- You do not need per-ticket states or actions in your own *My Tickets* UI.
- You want menta to decide the best experience for each user automatically.

### Benefits

- One backend call per click — no per-ticket integration.
- The user lands authenticated (no login friction) thanks to the one-time token.
- menta routes each user automatically to the best destination.
- Users are created automatically in menta if they don't exist yet.

### Limitations

- No per-ticket state or actions in your own *My Tickets* UI.
- The URL must be generated per click from your backend (it cannot be a hardcoded link).
{% /tab %}

{% tab label="Static resale URL" %}

## Static resale entry URL model

### Concept

The static entry model offers a single, generic entry point to resale from your platform: a fixed URL that always points to menta's resale entry page.

Today that entry page is **Smart Publish** — the same experience described in the *Static smart publish URL* tab: once the user is authenticated, menta routes them to the best destination based on their resale inventory (publish wizard, listing management, ticket hub, or empty state).

The difference with the one-time-token variant is authentication: with a fully static URL there is no embedded token, so menta authenticates the user with your chosen authentication model when they land.

**Typical flow:**

1. Add a "Sell tickets" button or menu item in your UI.
2. Point that button to the static resale entry URL provided by menta.
3. menta authenticates the user using your chosen authentication model.
4. menta routes the user to the best destination based on their resale inventory (Smart Publish).

Your *My Tickets* page does not display resale actions or states per ticket. All resale interaction happens inside the menta experience.

{% callout type="info" title="Prefer the one-time-token variant" %}
If your backend can identify the user's email at click time, use the **static smart publish URL with one-time token** instead: same single entry point, but the user lands already authenticated. See the <a href='https://connect.mentatech.io/en/api/get-marketplace-smartPublish' target="_blank">API Reference: Get Smart Publish URL</a>.
{% /callout %}

### When this model makes sense

Use a static resale URL when:

- You want the smallest possible integration to start testing resale.
- You cannot generate the URL per user from your backend (if you can, prefer the one-time-token variant).
- You do not need per-ticket resale actions in your own *My Tickets* UI.
- You are running a pilot while planning a future migration to the one-time-token variant or the SAL model.

### Benefits

- Very low implementation effort.
- No backend integration required beyond linking to the resale entry URL.
- A good starting point for small pilots or tight timelines.

### Limitations

- No per-ticket state or actions in your own UI.
- The user must authenticate on menta before continuing (there is no embedded token).
- The user always enters a generic resale flow and must choose tickets within menta.
- Your platform does not reflect ticket-level resale rules defined in the dashboard.
{% /tab %}

{% /conditionaltabs %}
