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

# Create Bonus

> Add bonus to user's wallet account



## OpenAPI

````yaml Post /v1alpha1/bonuses
openapi: 3.1.0
info:
  title: ToffeePay API
  description: Public API for game partners
  version: 0.1.1
servers:
  - url: https://api.toffeepay.com
    description: Production
  - url: https://api.sandbox.toffeepay.com
    description: Sandbox
security:
  - BearerAuth: []
paths:
  /v1alpha1/bonuses:
    post:
      summary: CreateBonus
      description: Add bonus to user's wallet account
      operationId: BonusService_CreateBonus
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/wallet.v1alpha1.CreateBonusRequest'
        required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/wallet.v1alpha1.Bonus'
                title: bonus
components:
  schemas:
    wallet.v1alpha1.CreateBonusRequest:
      type: object
      properties:
        key:
          type:
            - string
            - 'null'
          title: key
        game_id:
          type: string
          title: game_id
        user_id:
          type: string
          title: user_id
        amount:
          type: integer
          title: amount
          minimum: 0
          format: int32
        currency:
          type: string
          title: currency
          enum:
            - USD
            - GBP
            - EUR
        metadata:
          oneOf:
            - $ref: '#/components/schemas/google.protobuf.Struct'
            - type: 'null'
          title: metadata
      title: CreateBonusRequest
      required:
        - game_id
        - user_id
        - amount
        - currency
      additionalProperties: false
    wallet.v1alpha1.Bonus:
      type: object
      properties:
        id:
          type: string
          title: id
        key:
          type:
            - string
            - 'null'
          title: key
        account_id:
          type: string
          title: account_id
        amount:
          type: integer
          title: amount
          minimum: 0
          format: int32
        currency:
          type: string
          title: currency
          enum:
            - USD
            - GBP
            - EUR
        metadata:
          oneOf:
            - $ref: '#/components/schemas/google.protobuf.Struct'
            - type: 'null'
          title: metadata
        created_at:
          $ref: '#/components/schemas/google.protobuf.Timestamp'
          title: created_at
      title: Bonus
      required:
        - id
        - account_id
        - amount
        - currency
        - created_at
      additionalProperties: false
    google.protobuf.Struct:
      type: object
      additionalProperties:
        $ref: '#/components/schemas/google.protobuf.Value'
      description: |-
        `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.
    google.protobuf.Timestamp:
      type: string
      format: date-time
    google.protobuf.Value:
      oneOf:
        - type: 'null'
        - type: number
        - type: string
        - type: boolean
        - type: array
        - type: object
          additionalProperties: true
      description: |-
        `Value` represents a dynamically typed value which can be either
         null, a number, a string, a boolean, a recursive struct value, or a
         list of values. A producer of value is expected to set one of these
         variants. Absence of any variant indicates an error.

         The JSON representation for `Value` is JSON value.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````