# Offers definition table

For each IAP Recommendation integration, Assetario requires an Offer definition table that will be used to choose the best possible offers for customers, and a Prediction type definition table that is used to match the prediction type requested through the API (a customer can have multiple personalized and defined offer types, such as pop-up, banner, and store offers).&#x20;

Assetario can also return a variable number of offers - for example, we can only return one pop-up per user from a selection of four available, but six out of 24 available coin shop offers.

**Offer definition table (details about the offers):**

| **offer\_id \[String]** | **prediction\_type \[String]** | **price \[Float]** | **content \[String]**             | **available\_for\_prediction \[Bool]** | **start\_time (UTC +0) \[Datetime]** | **end\_time (UTC +0) \[Datetime]** | **conditions \[String]**        | **extra\_\_discount \[Int]** |
| ----------------------- | ------------------------------ | ------------------ | --------------------------------- | -------------------------------------- | ------------------------------------ | ---------------------------------- | ------------------------------- | ---------------------------- |
| 10001                   | starter\_pack                  | 1.99               | “diamonds\*20; coins\*15”         | True                                   | 2021-01-03T10:00:00+0:00             | 2025-01-05T12:00:00+0:00           | “min\_lvl > 10 AND coins < 5”   | 50                           |
| 10002                   | starter\_pack                  | 3.99               | “diamonds\*40; coins\*30”         | False                                  | 2021-01-03T10:00:00+0:00             | 2025-01-05T12:00:00+0:00           | “spend > 0”                     | 10                           |
| 10003                   | starter\_pack                  | 3.99               | "skin\_3"                         | False                                  | 2021-01-03T10:00:00+0:00             | 2025-01-05T12:00:00+0:00           | “first\_time\_user OR lvl < 10” | 20                           |
| 10004                   | starter\_pack                  | 99.99              | “diamonds\*800; coins\*500”       | False                                  | 2021-01-03T10:00:00+0:00             | 2025-01-05T12:00:00+0:00           |                                 | 0                            |
| 10010                   | banner                         | 1.99               | "skin\_4"                         | True                                   | 2021-01-04T10:00:00+0:00             | 2025-01-05T12:00:00+0:00           |                                 |                              |
| 10011                   | banner                         | 3.99               | "skin\_5"                         | True                                   | 2021-01-04T10:00:00+0:00             | 2025-01-05T12:00:00+0:00           |                                 |                              |
| 10012                   | banner                         | 3.99               | "skin\_6"                         | True                                   | 2021-01-04T10:00:00+0:00             | 2025-01-05T12:00:00+0:00           |                                 |                              |
| 10013                   | banner                         | 19.99              | "skin\_5;diamonds\*40; coins\*30" | True                                   | 2021-01-04T10:00:00+0:00             | 2025-01-05T12:00:00+0:00           |                                 |                              |

**Field description:**

1. **offer\_id \[String]:** Unique offer identifier.
   * Does not repeat in the shared offer table.
   * Has to match to offer id observed in payments and offer views.
   * This can either be a random string or a string in a format similar to:`1com.gm11.game_xxx.coin3`
2. **prediction\_type \[String]**: A group identifier.
   * Multiple offers can have one prediction\_type.
   * Should match to prediciton\_type defined in the prediction service and in the Secondary table below.
3. **price \[Float]:** the price of the offer
   * Should be in USD.
4. **content \[String]:** content the player receives after purchasing the offer
   * The format of this field is a String with special encoding, which consists of a series of semi-colon-separated pairs of content and amount. Example “content1\*value1; content2\*value2”
5. **available\_for\_prediction \[Bool]**: Whether this offer can be predicted
   * If set to True, Assetario may return this offer when personalizing. Otherwise, the offer is only used in analytics and reporting but will not be used for personalization.
6. **start\_time (UTC +0) \[Datetime]**: first time when Assetario can show the offer to players
   * If the offer is always available, leave this field empty
7. **end\_time (UTC +0) \[Datetime]**: last time when Assetario can show offers to players
   * If the offer is always available, leave this field empty
8. **conditions \[String]:** An SQL WHERE clause-like statement is used to select the offers that Assetario will predict. This statement specifies the conditions for selection. The following is an example of a conditions string:

   `"(level > 10 AND past_seven_day_spend > 100) OR (past_thirty_day_spend > 1000)"`

   This string uses three different variables

   * `level`
   * `past_seven_day_spend`
   * `past_thirty_day_spend`
9. **extra**: The client may provide additional information consisting of multiple fields. Each field must have its column in the offer table and be named **"extra\_\_{extra\_column\_name}"**. The column names and types can vary as long as they are consistent within each column. The [API call](/docs/integration/iap-personalization-setup/dynamic-offer-personalization/api-reference.md) should contain a field for each condition used.
   * **discount \[Int in \[0-100] range ]**
     * discount applied to the offer
   * **multiplier \[Int]**
     * value multiplier on the offer
   * **creative\_id \[String]**
     * what is the visual used when displaying the offer to the user
   * **is\_holiday\_offer \[Bool]**
     * flag to designate this offer as a special offer. For example, St. Patric's day offer, etc.

**Prediction type definition table (details about prediction types)**

| **prediction\_type \[String]** | **availible\_for\_prediction\[Bool]** | **returned\_offers \[Int]** | **is\_ordered \[Bool]** | **is\_nullable \[Bool]** |
| ------------------------------ | ------------------------------------- | --------------------------- | ----------------------- | ------------------------ |
| starter\_pack                  | True                                  | 3                           | True                    | False                    |
| banner                         | False                                 | 1                           | False                   | True                     |

**Field description:**

1. **prediction\_type \[String]:** field used to match with the offer table
2. **availabe\_for\_prediction \[Bool]**: whether Assetario may personalize this prediction\_type or not
3. **returned\_offers \[Int]:** how many offers to return
   * In some situations, for example, when choosing the three daily offers for a particular day, the client may want multiple offers to be returned for each call to the API.
4. **is\_ordered \[Bool]**: Assetario will also provide ordered recommended offers.
5. **is\_nullable \[Bool]:** Assetario can return nothing so the user is receiving no offer.

We ask you to share the offers' definition table and keep it updated. You can store it on your database and share it with Assetario through regular DB dumps or by sending a CSV file.

## Customer personalization strategy <a href="#client-personalization-strategy" id="client-personalization-strategy"></a>

The customer also needs to provide a description of how they are currently deciding which IAPs are seen and available to specific users. It might help to increase the performance.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.assetario.com/docs/integration/iap-personalization-setup/dynamic-offer-personalization/offers-definition-table.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
