> ## Documentation Index
> Fetch the complete documentation index at: https://docs.partnero.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Claim an app user

> Link an app user to the partner whose code or app link they used. Called from the app with your public Program ID, never your API key.

## Endpoint

```
POST https://api.partnero.com/pub/v1/mobile/{program_id}/claims
```

Creates a customer for the app user and links them to a partner, based on the code the user entered or the partner [app link](https://docs.partnero.com/guides/tracking/mobile-app.md#partner-app-links) they opened. Purchases later reported for the same app user ID, by [RevenueCat](https://docs.partnero.com/integrations/revenuecat.md) or the [transactions API](https://docs.partnero.com/api-reference/transactions/create.md), are credited to that partner.

The [Swift](https://docs.partnero.com/sdks/swift.md) and [Android](https://docs.partnero.com/sdks/android.md) SDKs call this endpoint for you. Call it directly from React Native, Flutter or other apps.

> [!NOTE]
>
> This endpoint is public. It takes no API key, only your **Program ID** from the program's **Integration** page, so it's safe to call from the app. It works for affiliate programs with **Enable mobile app claims** turned on in **Program settings** → **Tracking for mobile apps**.

## Path parameters

| Parameter | Type | Required | Description |
| - | - | - | - |
| `program_id` | string | Yes | Your Program ID, the same one as in your PartneroJS snippet |

## Request body

| Parameter | Type | Required | Description |
| - | - | - | - |
| `app_user_id` | string | Yes | Your ID for the user, the same one your purchases are reported under. Becomes the customer's key. Must be an email address, or letters, numbers, `-`, `_` and `.` |
| `code` | string | Without `click_id` | The partner's referral link key or promotion code. Up to 100 characters: letters, numbers, `.`, `_` and `-` |
| `click_id` | string | Without `code` | The click from an app link, the `partnero_click` value. Up to 32 letters and numbers. With a `code`, it's linked only if it belongs to the code's partner |
| `code_type` | string | No | `link` for a referral link key, `promotion_code` for a promotion code, or `auto` (default) to try both |
| `platform` | string | No | `ios`, `android` or `other` |
| `first_seen_at` | string | No | When the user first opened the app, as ISO 8601. Needed for the program's claim window; without it, the window isn't applied |

## Request

```bash cURL theme={"system"}
curl --location 'https://api.partnero.com/pub/v1/mobile/YOUR_PROGRAM_ID/claims' \
  --header 'Content-Type: application/json' \
  --header 'Accept: application/json' \
  --data '{
    "app_user_id": "user_8f2k",
    "code": "DANIEL20",
    "platform": "ios",
    "first_seen_at": "2026-11-04T09:30:00Z"
  }'
```

## Response

```json 200 OK theme={"system"}
{
  "status": 1,
  "data": {
    "status": "claimed",
    "app_user_id": "user_8f2k"
  }
}
```

```json 404 Not Found theme={"system"}
{
  "status": 0,
  "message": "Code not found"
}
```

```json 409 Conflict theme={"system"}
{
  "status": 0,
  "message": "Claim window closed"
}
```

`data.status` is one of:

| Value | Meaning |
| - | - |
| `claimed` | A customer was created for the app user and linked to the partner |
| `already_claimed` | The app user is already a customer. Nothing changed |

## Errors

Errors return `"status": 0` and a `message`.

| HTTP status | When |
| - | - |
| `400` | Invalid input. `errors` lists the fields, for example a missing `app_user_id` or a malformed `code` |
| `404` | No approved, active partner has this code or click, the Program ID is unknown, or mobile app claims are off. The message is `Code not found` in every case |
| `409` | `Code belongs to more than one partner`: pass `code_type` to say which kind of code the user entered. Or `Claim window closed`: the user first opened the app more days ago than the program's claim window |
| `429` | More than 30 claims a minute from one IP for the program. Try again in a minute |

## Usage notes

* **First claim wins.** A user is linked to one partner only. Later claims for the same `app_user_id`, with any code, return `already_claimed`.
* **Claim after sign-in.** Use a stable user ID. RevenueCat's anonymous IDs (`$RCAnonymousID:…`) aren't valid, because they change when the app is reinstalled.
* **Store the code until it's claimed.** If the user opens an app link before signing in, keep `partnero_code` and `partnero_click` and claim after sign-in. Retry when the request fails with a network error, a `429` or a `5xx`.
* **Rewards wait for a transaction.** Anyone with your Program ID and a partner's code can call this endpoint, so a claimed customer earns the partner nothing until a purchase is recorded for them.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.