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

# Games Integration

> Integrating Lobyco games.

The Lobyco Games is a significant engagement driver that is quick to implement, easy to manage and provides great results.

## Games Admin Portal provides full access to configure game designs and behavior

Allow to set up and manage app games with products or services in stores as prizes in a few steps.

* Select game template: quick start from preloaded game designs.
* Customize gameplay: brand the game via an easy-to-use WYSIWYG editor.
* Game campaign: plan games by setting up periods, win chances, logistics, and others.
* Monitor games and adapt prizes and behavior as needed.

<img src="https://mintcdn.com/lobyco-4c9fb3ad/wpdZgjvGMgh4Gbhy/images/c445e128a5b8854d7391764572e8c88c2d53e821.png?fit=max&auto=format&n=wpdZgjvGMgh4Gbhy&q=85&s=d65909ba52523e69f495c34c68209768" alt="Lobyco Admin Portal - games can be fully managed from a simple-to-use interface" width="1421" height="741" data-path="images/c445e128a5b8854d7391764572e8c88c2d53e821.png" />

Lobyco Admin Portal - games are fully managed from a simple-to-use interface

## Integration within an existing loyalty landscape

<img src="https://mintcdn.com/lobyco-4c9fb3ad/wpdZgjvGMgh4Gbhy/images/1afee02e0efac5153da65d68154a2d9fef77841b.png?fit=max&auto=format&n=wpdZgjvGMgh4Gbhy&q=85&s=ed862211b1c61c55b9d8161bed12b1c6" alt="" width="907" height="536" data-path="images/1afee02e0efac5153da65d68154a2d9fef77841b.png" />

<Steps>
  <Step>
    ## The retailer sets up the promotion

    The retailer sets up the promotion for game rewards coupons in the **Client Promotion System**.
  </Step>

  <Step>
    ## Promotion is imported

    Promotion is imported into the **Lobyco Promotion Service**.
  </Step>

  <Step>
    ## Promotion is linked as a game reward

    Promotion is linked as a game reward to the **Lobyco Game Service**.
  </Step>

  <Step>
    ## Mobile app loads the game

    The **Mobile App** (existing or implemented by Lobyco) calls the **Lobyco Game Service** to provide the game URL and load the actual game in a web view.
  </Step>

  <Step>
    ## Game Service notifies Promotion Service

    When a user plays and wins a game, the **Lobyco Game Service** notifies the **Lobyco Promotion Service** that the customer has earned a reward.
  </Step>

  <Step>
    ## Promotion Service allocates a coupon

    The **Lobyco Promotion Service** allocates a coupon for the user in the **Client Coupon System**.
  </Step>

  <Step>
    ## User redeems the reward

    When the user redeems the reward at the **POS**, the POS calls the **Client Coupon System** to get and redeem the coupon.
  </Step>

  <Step>
    ## Coupon System notifies Promotion Service

    The **Client Coupon System** notifies the **Lobyco Promotion Service** that the coupon is redeemed.
  </Step>
</Steps>

## Games mobile app integration

<img src="https://mintcdn.com/lobyco-4c9fb3ad/wpdZgjvGMgh4Gbhy/images/94f36504a800976feea1c25c6f97f3807e0161ac.png?fit=max&auto=format&n=wpdZgjvGMgh4Gbhy&q=85&s=b9a40ad89acd3e8663945b6d79933be3" alt="" width="907" height="850" data-path="images/94f36504a800976feea1c25c6f97f3807e0161ac.png" />

| Action                         | Request                                                                                                                                        | Response                                     | Mobile App                                                                                           |
| ------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
| Get games                      | [**GET /v1/games**](/api-reference/promotion-platform/games/get-v1-games) — `memberId` is parsed from the token                                | The games available to the customer, ordered | Display the game if the customer has one available                                                   |
| Start game                     | [**POST /v1/games/\{gameId}/start**](/api-reference/promotion-platform/games/post-v1-games-gameid-start) — `memberId` is parsed from the token | `gameUrl` for the started game               | Open **gameUrl** in a webview                                                                        |
| Game finished — customer wins  | `REDIRECT lobyco://game-finished?isWin=true&rewardId=abc1234`                                                                                  | —                                            | Close the webview when the *game finished* redirect is received, then show a native reward screen    |
| Game finished — customer loses | `REDIRECT lobyco://game-finished?isWin=false`; on error: `REDIRECT lobyco://game-finished?isWin=false&error=error_message`                     | —                                            | Close the webview when the *game finished* redirect is received; if there is an error, show an error |

## Promotion integration - import campaign data

When a games promotion reward is created in the Client's Promotion System it should also be imported into the Lobyco system to become available for other components: game service, mobile app (if needed), etc.

The import process is, by default, implemented via events like campaign Created/Updated/Deleted in the Lobyco Promotion Service.

If some of the required fields can't be supplied by the client service, the Lobyco Promotion Admin tool is used to enrich the data model. Usually used for promotional images, Terms & Conditions texts, or description fields.
