Skip to main content
POST
/
v1alpha1
/
bonuses
CreateBonus
curl --request POST \
  --url https://api.toffeepay.com/v1alpha1/bonuses \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "game_id": "<string>",
  "user_id": "<string>",
  "amount": 1,
  "key": "<string>",
  "metadata": {}
}
'
{
  "id": "<string>",
  "account_id": "<string>",
  "amount": 1,
  "created_at": "2023-11-07T05:31:56Z",
  "key": "<string>",
  "metadata": {}
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
game_id
string
required
user_id
string
required
amount
integer<int32>
required
Required range: x >= 0
currency
enum<string>
required
Available options:
USD,
GBP,
EUR
key
string | null
metadata
metadata · object

Struct represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, Struct might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language.

The JSON representation for Struct is JSON object.

Response

200 - application/json

Success

id
string
required
account_id
string
required
amount
integer<int32>
required
Required range: x >= 0
currency
enum<string>
required
Available options:
USD,
GBP,
EUR
created_at
string<date-time>
required
key
string | null
metadata
metadata · object

Struct represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, Struct might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language.

The JSON representation for Struct is JSON object.