> For the complete documentation index, see [llms.txt](https://docs.coda.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.coda.co/coda-webstore/web-store-integration-guides/usersync-api-request/usersync-api-key-use-cases-with-examples.md).

# UserSync API Key Use Cases with examples

### <mark style="color:purple;">**Use Cases and Benefits**</mark>

#### <mark style="color:purple;">**1. Display In-App Nicknames**</mark>

* **Objective:** Boost conversions by displaying users' familiar in-app names or nicknames.
* **Benefit:** Enhances trust and personalization, making the experience feel more engaging and recognizable.

**API Example – Display In-App Nickname**

Format JSON-RPC\
<http://www.jsonrpc.org/specification>

**Request:**

```json
{
   "id": "6164695159717629913",
   "jsonrpc": "2.0",
   "method": "syncUser",
   "params": [
       {
           "serviceProvider": "Coda",
           "purchaseOrigin": "TH",
           "user": {
               "userId": "111111",
               "zoneId": "101"
           }
       }
   ]
}
```

**Response:**

```json
{
  "id": "6164695159717629913",
  "jsonrpc": "2.0",
  "result": {
    "username": "Randy"
  }
}
```

*In this scenario, the shop displays the user's in-app nickname ("Randy") to create a familiar and personalized experience.*

***

\ <mark style="color:purple;">**2. Rule-Based SKU Discount eligibility based on Purchase History & Activity**</mark>

* **Objective:** Configure rules to display specific SKU discounts based on user's purchase history and in-game activity (e.g., New user or First-time buyer).
* **Benefit:** Targeted discounting strategy to boost new user acquistion

**API Example – Rule-Based SKU Discount Eligibility**

Format JSON-RPC\
<http://www.jsonrpc.org/specification>

**Request:**

```json
{
   "id": "6164695159717629913",
   "jsonrpc": "2.0",
   "method": "syncUser",
   "params": [
       {
           "serviceProvider": "Coda",
           "purchaseOrigin": "TH",
           "user": {
               "userId": "111111",
               "zoneId": "101"
           }
       }
   ]
}
```

**Response:**

```json
{
  "id": "6164695159717629913",
  "jsonrpc": "2.0",
  "result": 
  {
    "username": "Randy",
    "metadata": 
    {
      "inGameLevel": 1,
      "First Purchase Discount": "Yes"
    },
    "personalisedSkus": [
    {
        "skuId": "weekly_pass_coda1",
        "details":{
        "status": 1
        "pendingPurchaseLimit": 1
        }
     },
     {
        "skuId": "100_diamonds_coda2",
        "details":{
        "status": 1
        "pendingPurchaseLimit": 2
        }
     }
      {
        "skuId": "100_diamonds_coda2",
        "details":{
        "status": 2
        "pendingPurchaseLimit": 0
        }
     }
   ]
  }
}
```

*In this scenario, the shop can display discounts on specific SKUs configured for users at Level 1 with a "First Purchase Discount" eligibility along with available purchase limits.*

***

#### <mark style="color:purple;">**3. Dynamic Surprise SKUs**</mark>

* **Objective:** Fetch and display exclusive SKUs in real-time based on user engagement, re-engagement needs, or flash promotions.
* **Benefit:** Creates excitement and urgency by offering dynamically generated SKUs personalized to the user.

**API Example – Dynamic Surprise SKUs**

Format JSON-RPC\
<http://www.jsonrpc.org/specification>

**Request:**

```json
{
   "id": "6164695159717629913",
   "jsonrpc": "2.0",
   "method": "syncUser",
   "params": [
       {
           "serviceProvider": "Coda",
           "purchaseOrigin": "TH",
           "user": {
               "userId": "111111",
               "zoneId": "101"
           }
       }
   ]
}
```

**Response:**

```json
{
  "id": "6164695159717629913",
  "jsonrpc": "2.0",
  "result": {
    "username": "Randy",
    "personalisedSkus": [
      {
        "skuId": "mystery_box",
        "description": "Mystery Gift Box",
        "details": {
          "category": "special",
          "price": 5.99,
          "currency": "USD",
          "imageUrl": "https://cdn.partner.com/images/mystery-box.png"
          "pendingPurchaseLimit": 1
        }
      }
    ]
  }
}
```

*In this scenario, a surprise SKU (e.g., a mystery gift box) is displayed to the user based on their engagement history.*

***

#### <mark style="color:purple;">**4. Additional Use Cases**</mark>

* **Re-Engagement Promotions:** Trigger special offers for users who have been inactive or have not made a purchase in a while.
* **VIP & High-Spender (Whale):** Identify high-value or repeat customers and showcase exclusive SKUs or discounts encouraging continued spending and increased retention.
* **Event-Based Personalization:** Use metadata, such as the user's birthdate, to offer exclusive bonuses or discounts during special occasions
* **Complementary SKUs suggestions**: Recommend SKUs that complement a user's existing in-app inventory, enhancing their experience and increasing conversion rates

**API Example – Complementary SKUs suggestions**

Format JSON-RPC\
<http://www.jsonrpc.org/specification>

<mark style="color:purple;">**Request:**</mark>

```json
{
   "id": "6164695159717629913",
   "jsonrpc": "2.0",
   "method": "syncUser",
   "params": [
       {
           "serviceProvider": "Coda",
           "purchaseOrigin": "ID",
           "user": {
               "userId": "111111",
               "zoneId": "101"
           }
       }
   ]
}
```

<mark style="color:purple;">**Response:**</mark>

```json
{
  "id": "6164695159717629913",
  "jsonrpc": "2.0",
  "result": {
    "username": "Randy",
    "metadata": {
      "currentCatalogue": "9 Mystery Cards"
    },
    "personalisedSkus": [
      {
        "skuId": "MysteryCard_coda1",
        "description": "Buy now to unlock next level in the game",
        "details": {
        "status": 1
        "pendingPurchaseLimit": null
        }
      }
    ]
  }
}
```

*In this scenario, the user gets a recommendation on what they should purchase to enhance their in-game performance*.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.coda.co/coda-webstore/web-store-integration-guides/usersync-api-request/usersync-api-key-use-cases-with-examples.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
