## Overview

The RubyPlay Seamless Wallet API is an API that has to be implemented by the Operator.

A typical RubyPlay game (which is played on the third-party GC) reports all game-related operation results to the specific GP.

To develop seamless-wallet funding principles the Operator has to implement the following API requests:

* playerInformation
* balance
* debit
* credit
* cancel


The **Credit** and **Cancel** requests have to be **idempotent**. It means the Operator has to ensure that the request with the same transaction ID is not processed twice while the response has to be the same for all duplicate requests (see the more detailed information in the Common Scenarios section of this document).

The Operator has to provide RubyPlay with the service URL for the implemented service as soon as possible, for example, https://integrator-gaming-platform.io/rest/v1/api.

API uses REST protocol with JSON serialization.

HTTP method POST is used for all requests.

HTTP header "Content-Type: application/json" must be included in all requests and responses.

### Type of Round Based on debit/credit request body

The combination of `freeRound`, `purchasedFeature`, and `promotionId` determines the round type:

| Round type | freeRound | purchasedFeature | promotionId |
|  --- | --- | --- | --- |
| Regular round | `false` | `(not sent)` | `(not sent)` |
| Free round | `true` | `(not sent)` | `"{campaignId}"` |
| Buy feature | `false` | `"{feature}"` | `not sent` |
| Awarded feature | `true` | `"{feature}"` | `"{campaignId}"` |


- **freeRound** — whether the round is free or paid
- **purchasedFeature** — the in-game feature purchased in the round (e.g. `"freespins"`)
- **promotionId** — campaign ID (could be Free round campaign ID or Awarded feature campaign ID)


`purchasedFeature` and `promotionId` are omitted from the request entirely when not applicable.