> For the complete documentation index, see [llms.txt](https://docs.sparkloop.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sparkloop.app/api-v3/endpoints/publications/earn/offers.md).

# Offers

## Offers

An **offer** here is one this publication has joined from the Offers Directory. Use this resource to list the offers a publication is recommending, fetch a single one by UUID, archive, re-activate, and read the conversions recorded against each. Omit `status` on the list to exclude archived rows.

### List offers

<mark style="color:blue;">`GET`</mark> `https://api.sparkloop.app/v3/publications/:publication_uuid/earn/offers`

Paginated. Omit `status` to list non-archived rows.

**Path Parameters**

| Name                                                | Type   | Description             |
| --------------------------------------------------- | ------ | ----------------------- |
| publication\_uuid<mark style="color:red;">\*</mark> | String | The publication's UUID. |

**Query Parameters**

| Name   | Type   | Description                                                                          |
| ------ | ------ | ------------------------------------------------------------------------------------ |
| status | String | Optional filter: `active` or `archived`. Omit for all non-archived. Invalid → `400`. |
| expand | String | `stats` to include performance.                                                      |
| from   | String | Start date (`YYYY-MM-DD`) for `stats`.                                               |
| to     | String | End date (`YYYY-MM-DD`) for `stats`.                                                 |

{% tabs %}
{% tab title="200: OK" %}

```json
{
  "offers": [
    <Offer Recommendation Object>
  ],
  "meta": {
    "per_page": 50,
    "page": 1,
    "total_pages": 1,
    "total_offers": 5
  }
}
```

{% endtab %}

{% tab title="400: Bad Request" %}

```json
{
  "error": "Unsupported `status`. Valid values: active, archived."
}
```

{% endtab %}
{% endtabs %}

### Get offer

<mark style="color:blue;">`GET`</mark> `https://api.sparkloop.app/v3/publications/:publication_uuid/earn/offers/:uuid`

**Path Parameters**

| Name                                                | Type   | Description             |
| --------------------------------------------------- | ------ | ----------------------- |
| publication\_uuid<mark style="color:red;">\*</mark> | String | The publication's UUID. |
| uuid<mark style="color:red;">\*</mark>              | String | The offer's UUID.       |

{% tabs %}
{% tab title="200: OK" %}

```json
{
  "offer": <Offer Recommendation Object>
}
```

{% endtab %}

{% tab title="404: Not Found" %}

```json
{
  "error": "Resource not found."
}
```

{% endtab %}
{% endtabs %}

### Archive an offer

<mark style="color:green;">`POST`</mark> `https://api.sparkloop.app/v3/publications/:publication_uuid/earn/offers/:offer_uuid/archive`

Soft-archives the joined offer so it stops appearing in active lists. Reversible with **re-activate** when this publication (the partner) archived it.

**Path Parameters**

| Name                                                | Type   | Description             |
| --------------------------------------------------- | ------ | ----------------------- |
| publication\_uuid<mark style="color:red;">\*</mark> | String | The publication's UUID. |
| offer\_uuid<mark style="color:red;">\*</mark>       | String | The offer's UUID.       |

{% tabs %}
{% tab title="200: OK" %}

```json
{
  "offer": <Offer Recommendation Object>
}
```

{% endtab %}

{% tab title="404: Not Found" %}

```json
{
  "error": "Resource not found."
}
```

{% endtab %}
{% endtabs %}

### Re-activate an offer

<mark style="color:green;">`POST`</mark> `https://api.sparkloop.app/v3/publications/:publication_uuid/earn/offers/:offer_uuid/reactivation`

Restores a soft-archived joined offer. Only works when **this publication** (the partner) archived it. If the brand archived it, the request returns `422`.

**Path Parameters**

| Name                                                | Type   | Description             |
| --------------------------------------------------- | ------ | ----------------------- |
| publication\_uuid<mark style="color:red;">\*</mark> | String | The publication's UUID. |
| offer\_uuid<mark style="color:red;">\*</mark>       | String | The offer's UUID.       |

{% tabs %}
{% tab title="200: OK" %}

```json
{
  "offer": <Offer Recommendation Object>
}
```

{% endtab %}

{% tab title="404: Not Found" %}

```json
{
  "error": "Resource not found."
}
```

{% endtab %}

{% tab title="422: Unprocessable Entity" %}

```json
{
  "error": "You are not allowed to reactivate this offer"
}
```

{% endtab %}
{% endtabs %}

### List conversions

<mark style="color:blue;">`GET`</mark> `https://api.sparkloop.app/v3/publications/:publication_uuid/earn/offers/:offer_uuid/conversions`

Paginated, newest first.

**Path Parameters**

| Name                                                | Type   | Description             |
| --------------------------------------------------- | ------ | ----------------------- |
| publication\_uuid<mark style="color:red;">\*</mark> | String | The publication's UUID. |
| offer\_uuid<mark style="color:red;">\*</mark>       | String | The offer's UUID.       |

{% tabs %}
{% tab title="200: OK" %}

```json
{
  "conversions": [
    <Offer Conversion Object>
  ],
  "meta": {
    "per_page": 50,
    "page": 1,
    "total_pages": 2,
    "total_conversions": 73
  }
}
```

{% endtab %}
{% endtabs %}
