> This page is part of EVVA for Developers (https://developers.evvahub.com), the documentation of the EVVA Partner API. The API is in developer preview and the SDK packages are not yet published: do not suggest installing them. Index: https://developers.evvahub.com/llms.txt

# Buyer pseudonyms

An application never sees a fan's account id, name, e-mail, avatar or profile link. Wherever an answer or an event
refers to a buyer, it uses a **`buyerRef`**: a pseudonym EVVA generates for your application alone.

```json
"buyerRef": "buyer_EXAMPLEaBcDeFgHiJkLmNo"
```

## What a `buyerRef` is

| Property             | What it means for you                                                                                                                                                                                                             |
| -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Format**           | `buyer_` followed by 22 URL-safe base64 characters (`^buyer_[A-Za-z0-9_-]{22}$`). Treat it as an opaque string.                                                                                                                   |
| **Pairwise**         | It is specific to one application **and** one creator. The same fan has a different `buyerRef` for every other application (including other applications of your own agency) and for every other creator your application serves. |
| **Stable**           | For a given application, creator and fan it does not change between calls, transports, retries, replays or routine key rotations. Use it as the key of your own record for that fan.                                              |
| **Not reversible**   | It cannot be computed from an account, and it cannot be turned back into one. It only identifies the fan to you.                                                                                                                  |
| **Not a permission** | Knowing a `buyerRef` grants nothing. Every request is still checked against your application's access to the creator.                                                                                                             |

> **Tip**
>
> Key your own fan records by the pair `(creatorId, buyerRef)`. A `buyerRef` on its own is only meaningful together with
> the creator it was issued for.

## Where you see it

| Where                                                                                                                          | Field                                                                                                            |
| ------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------- |
| [List conversations](https://developers.evvahub.com/api-reference/messaging/list-conversations)                                                   | `counterpart.buyerRef` on each inbox row                                                                         |
| [List messages](https://developers.evvahub.com/api-reference/messaging/list-messages) and the other message reads | `conversation.buyerRef`, and `senderBuyerRef` on every message the fan wrote (`null` on the creator's side)      |
| [Get the buyer context](https://developers.evvahub.com/api-reference/messaging/get-buyer-context)                      | `buyerRef`, with the creator's label for the fan, the subscriber flag and the spend tier                         |
| Events: [webhooks](/webhooks/overview), [realtime](/realtime) and the [event feed](/event-feed)                                | `data.buyerRef` on every creator event that concerns a conversation; `null` when the event names no conversation |

The same event carries the same `buyerRef` on all three transports, so you can deduplicate and join across them.

Operations whose answers would name a fan in any other way (for example by display name or picture) are not open to
applications.

## The buyer context

[Get the buyer context](https://developers.evvahub.com/api-reference/messaging/get-buyer-context) is the
minimal description of the fan in a conversation. It requires the `read:buyer_context` scope.

**`200 OK`**

```json title="200 OK"
{
  "buyerRef": "buyer_EXAMPLEaBcDeFgHiJkLmNo",
  "label": "Member",
  "isSubscriber": true,
  "tier": "SILVER"
}
```

| Field          | Meaning                                                                                                          |
| -------------- | ---------------------------------------------------------------------------------------------------------------- |
| `buyerRef`     | Your pseudonym for this fan.                                                                                     |
| `label`        | The creator's own nickname for the fan, or `Member` when the creator has set none. Never the fan's display name. |
| `isSubscriber` | Whether the fan currently subscribes to the creator.                                                             |
| `tier`         | The fan's spend tier: `NEW`, `BRONZE`, `SILVER` or `GOLD`.                                                       |

Name, avatar, profile link, presence and amounts are never part of the buyer context. A conversation that is not the
creator's, or does not exist, answers `404 NOT_FOUND`.

## When a `buyerRef` goes away

EVVA forgets your application's pseudonyms when:

* your application is revoked;
* your application no longer reaches the creator (the agency removed the grant, or the creator is no longer linked);
* the fan's EVVA account is deleted.

If the agency grants your application the same creator again, fans get back the pseudonyms your application already
knew. If EVVA ever has to invalidate pseudonyms for security reasons, the affected fans receive new pseudonyms the next
time your application sees them, so be ready for a `buyerRef` you have not seen before.

> **Warning**
>
> When pseudonyms cannot be issued, a read that would name a fan is refused with `503 BUYER_PSEUDONYMS_UNAVAILABLE` and
> `Retry-After: 30`. EVVA never falls back to an account id or any other identifier. Wait and retry.

## Next steps

#### [Event catalogue](/webhooks/events)

Every event type and the fields it carries, `data.buyerRef` included.

#### [Message authorship](/message-authorship)

How the messages your application sends are recorded and shown to fans.

#### [Scopes and grants](/authentication/scopes)

What `read:buyer_context` and the other scopes allow.

#### [Webhooks](/webhooks/overview)

Receive events about conversations as they happen.