Supplier API Overview

Supplier API

The Supplier API is designed for game developers and distributors to enable seamless integration with the Niropa platform. By leveraging this API, gaming content can be effortlessly offered to Niropa's network of partner operators.

Request signing logic for Supplier API

chrome-application-clear

Before the integration, the game Supplier generates a private/public key pair and sends the public key to Niropa. Niropa sends its public key to the game Supplier. The body of all requests will be signed with RSA-SHA256 using the respective private key and encoded to BASE64. The signature will be placed in the X-Niropa-Signature header. Niropa and the game Supplier need to verify all Wallet API requests are using the public key provided. The game Supplier verifies all Games API requests using the public key provided by Niropa.

Example:

  • Request body:

    {"user":"3nYTOSjdlF6UTz9Ir","country":"XX","currency":"EUR","operator_id":1,"token":"cd6bd8560f3bb8f84325152101adeb45","platform":"GPL_DESKTOP","game_code":"ctl_dragonrising","lang":"en","lobby_url":"https://exampleplatform.io","ip":"::ffff:10.0.0.39"}
  • Private key example for signing the example request:

    
    -----BEGIN RSA PRIVATE KEY-----
    MIIEowIBAAKCAQEAx3IRpSri/9SjA7f9me35v6LtJzn8drb1vg/UeGaPPFR16KsU
    OPqbGJ2r1pRPJMedqqbO7Agt/HavWDcQhNZlc9VrVQcWK/w2HD9PflQYv0oQMiPK
    5Mut/eIdFOpwwwaRAU4s6WOkJdSmP9F4cfr/amTZZoY59/t3SZWYjgZ9/LDI2X8S
    3uLW/JPiH+6dm2bU8ykhxoWwLE/piJxynS73EzM0tgjHyTUMkarhK9qRVZk581/k
    zmtJLLBZQl9XrQQcIfQ+zFZj7ijddOptxpxqCmq8gQNohB56p34yjVH3uAJAaFvI
    Vg5mEkprrvNVDJwGonHSaaq7AICmzrF6h/r5dwIDAQABAoIBAFNIGIIlpGA7hE57
    N9RdANq6x9iHaBqST48rwQb9nHYOtqWPOoSIcNcYj7ase1faWsX1nZYF3F39mT52
    z9kIRZjW11jL+sAnMtkcvq77otHNtXGabJCZVHAdSROAydFGHqqy4CIcz2BUqY8g
    gvDlZF4i+nzLM82PHcKGSwuTPmyTED37RqtscSxd7cGQkuL6OnohSFpW+5tvZcGZ
    Ui4oVRrX4oVXz//3TDESRfondwQVKPoqQr7aiyYSKOJJMngIXmCvJ6p3XNiEW+dP
    uXxm5N9QRkkX00v3vPTdsuwUjt3wepDJhR9BecRERRYNJIrqsgNxkJTJEDlsGqi5
    kIKPb/ECgYEA8nKLPCfIaZ4G/7pUXQ64MMemS7qH17aU7Eb+mqDpFRt2bNr/yw12
    qIhUkb6XyI/ZwOF2gdhPzte25CuZzNsMu3GqlEQ77AR1XCyu1AY8oiJS4TSmRovJ
    x86BK8C8OY75myYcmRIvsusxviZfUCunDaexVGOqIKMRNrgJ2i8194UCgYEA0pgp
    nzxI4H/Ej+5KOmEw9P2xstIXpW+CcEDbrh5pqW+PwNP/TUxC445Rn4R8AVXFVnbH
    6DLrW35A9KBcA7Ve37vkVUILxPC+S967+gdRAd3BQTuUmi31+7cBjmNLKJMMC8Fl
    DZ5S8zwRuVrU6o3bbPUbC5gDb/cN/7GVtb/D18sCgYEA2ma+8LCxxBr8GRAkATRK
    Tn77WgqtZm/uVa5amrbLYR09IDBj7umw837kF+qGVsDnGu6/z5Ypxp3h/kccpELL
    hGuPi0KwbBtUEXWbBBqeMjwTRxYjlzdDzP9Es0JLDNq0FcROTMHqQBXI2I8+mzzH
    nvBqOSgS0JW04wMEtQyEY/UCgYBNMDKJR9paVtpf+vJABaGhGl+IcJL0MzP3Gv6q
    CkGmNdrVzZ5U4a/eoipusmuVPa/P6keJZyh254a9Yw122oKEtOSTD1sq+yZ0vpXd
    pdLeQT51P3ZPMKtpcIFkhCZnH8aZhHAalr5GouzIKG/D7OzROeGI1VXlMwNxhdCe
    xkPtEwKBgG8IJGHMuzBGDtykqPwOdz7llWwzl3GgWiEDqt6kbIEr8F7CbbnlvrhJ
    HRmd9tFEtYz2/3x9VTv9NCjd8FiWyPcivkd4dvMInfgBoCBJxw0I+nyjqQpiLuhx
    x4xyX1tFKW+sAN+Mb9dO+ZHGpcz2FpPz5uXv6oCzTG9BLcgg0mwx
    -----END RSA PRIVATE KEY-----
  • Correct signature:

    FFdiceKlsnmrBMhWopZYQXrJSMqxJWkynbaiOnuUE1p4mrg2UydlSAdKbOWQZ7o5USbA3SHPum3XuRCa9INWbcp+fdcOhjz0S0JLKF6uXJR2T8zlF+L+8v2lkBzPOvLg6yRuUyspxtcHB6Vlyd0Sj4v8vk5HxoVv1ZV7EpJglzHs7xKchuifjjhUwkX7AAZwvJCNKo/VZrhtfxHd/k8aq7+9h7AztiiiLO7CXbEbo8snDqMqoB/tBAImv45NcAuReBZGb3QY37MbRoOT/uQGj+9ae5VRNpJ74qs3COraDqZ5kqzsa5SjN1cML2foP13Deqp0FTY0Ek521d8CPWQY6A==

Request consistency

Wallet APIrequests have to be idempotent. All requests contain a request_uuid field. Niropa will ensure that requests with the same request_uuid are not processed twice while the response will be the same for all duplicate requests, excluding the /supplier/generic/v2/user/balance call.

Gameplay overview

Once you meet the prerequisites, the process on high-level as follows.

  1. Niropa will obtain a game URL from the game supplier on behalf of the user and Operator.

  2. Redirect the operator's user to the URL provided by the Game Provider.

  3. Respond to in-game events by forwarding wallet requests to the operator and forwarding their responses.

The high level gameplay corresponds to the core communications flow between Supplier and Operator APIs.

Demo gameplay

Below is an example of the interaction flow to open a game in DEMO mode:

  1. Niropa makes a call to the Supplier's Game API /game/url endpoint to obtain the game launch URL. You'll know that it's a DEMO mode call, as Niropa will pass "currency":"XXX" and parameters token and user will be omitted.

  2. When the game URL is returned, the Operator uses it to direct the user to the game (for example, launch it in iframe or redirect the user to the URL).

In DEMO mode, Niropa doesn't expect any calls to Wallet API.

Real gameplay

Below is an example of the interaction flow between the User, Operator, Niropa, and the game Supplier in REAL mode:

  1. Niropa generates and stores a unique game session token.

  2. Niropa makes a call to Supplier's Game API /game/url endpoint and passes the generated token along with the other request parameters.

  3. Supplier is expected to respond with a valid game URL. When the game URL is returned, the Operator uses it to direct the user to the game (for example, launch it in an iframe or redirect the Operator to the URL).

  4. When the game URL is loaded in the browser, the game Supplier's server makes a Wallet API call to Niropa/supplier/generic/v2/user/balance endpoint.

  5. Niropa verifies the token against the stored token and returns the user's balance. The user can then place a reward.

  6. When the user attempts to place a reward, a Wallet API call /supplier/generic/v2/transaction/reward must be triggered on Niropa server by the game Supplier.

  7. Niropa verifies the token, forwards the request to the Operator, who ensures that the user has enough money to place this reward. The Operator decreases the user's balance by the reward amount, and returns the updated user balance, which is forwarded as a response to the game Supplier.

  8. If the user wins, the game Supplier is expected to trigger a /supplier/generic/v2/transaction/win call to Niropa server using the Wallet API.

  9. Niropa verifies the token, forwards the request to the Operator, who ensures an increase in the user's balance by the win amount and returns the updated user balance, which is forwarded as a response to the game Supplier.

  10. Behavior in case of user's loss depends on game Supplier's internal logic. Possible options:

    • Nothing is sent;

    • Sent win with amount 0.