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

# Economy Operations

> Perform operations with the economy system (transactions, transfers, etc.).

Available actions:
- `transfer` - transfer between users (requires fromUserId, toUserId, amount).
- `deposit` - deposit money to bank (requires userId, amount).
- `withdraw` - withdraw money from bank (requires userId, amount).
- `add` - add money to user (requires userId, amount, type).
- `remove` - remove money from user (requires userId, amount, type).
- `reset` - reset user balance (requires userId).
- `resetCooldown` - reset user cooldowns (requires userId, command).

The type parameter for add/remove can be 'cash' or 'bank' (default 'cash').




## OpenAPI

````yaml en/openapi/en-economy-v2-openapi.yaml POST /moscowroleplay/civops/economy
openapi: 3.1.0
info:
  title: ER:LC Russia API V2 - Moscow RolePlay Economy API V2
  version: 2.0.0
servers:
  - url: https://api.erlcrussia.xyz/v2
    description: ER:LC Russia API V2
security: []
tags:
  - name: Moscow RolePlay Economy API V2
    description: Endpoints for managing economy and CivOps system.
paths:
  /moscowroleplay/civops/economy:
    post:
      tags:
        - Moscow RolePlay Economy API V2
      summary: Economy Operations
      description: >
        Perform operations with the economy system (transactions, transfers,
        etc.).


        Available actions:

        - `transfer` - transfer between users (requires fromUserId, toUserId,
        amount).

        - `deposit` - deposit money to bank (requires userId, amount).

        - `withdraw` - withdraw money from bank (requires userId, amount).

        - `add` - add money to user (requires userId, amount, type).

        - `remove` - remove money from user (requires userId, amount, type).

        - `reset` - reset user balance (requires userId).

        - `resetCooldown` - reset user cooldowns (requires userId, command).


        The type parameter for add/remove can be 'cash' or 'bank' (default
        'cash').
      parameters:
        - name: action
          in: query
          description: Operation type.
          required: true
          schema:
            type: string
            enum:
              - transfer
              - deposit
              - withdraw
              - add
              - remove
              - reset
              - resetCooldown
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
            examples:
              transfer:
                summary: Transfer between users.
                value:
                  fromUserId: '1027118272879009886'
                  toUserId: '1133665013794607114'
                  amount: 100000
              deposit:
                summary: Deposit money to bank.
                value:
                  userId: '1133665013794607114'
                  amount: 50000
              withdraw:
                summary: Withdraw money from bank.
                value:
                  userId: '1133665013794607114'
                  amount: 20000
              add:
                summary: Add money.
                value:
                  userId: '1133665013794607114'
                  amount: 5000
                  type: cash
              remove:
                summary: Remove money.
                value:
                  userId: '1133665013794607114'
                  amount: 2000
                  type: bank
              reset:
                summary: Reset balance.
                value:
                  userId: '1133665013794607114'
              resetCooldown:
                summary: Reset command cooldown.
                value:
                  userId: '1133665013794607114'
                  command: работать
      responses:
        '200':
          description: Operation successfully completed.
          content:
            application/json:
              schema:
                type: object
              examples:
                transfer:
                  summary: Successful transfer.
                  value:
                    success: true
                    fromUserId: '1027118272879009886'
                    toUserId: '1133665013794607114'
                    amount: 100000
                    newBalance:
                      cash: 104000
                      bank: 10000
                deposit:
                  summary: Successful deposit.
                  value:
                    success: true
                    userId: '1133665013794607114'
                    deposited: 50000
                    newBank: 150000
                    newCash: 3000
                withdraw:
                  summary: Successful withdrawal.
                  value:
                    success: true
                    userId: '1133665013794607114'
                    withdrawn: 50000
                    newBank: 53000
                    newCash: 100000
                add:
                  summary: Money added.
                  value:
                    success: true
                    userId: '1133665013794607114'
                    type: cash
                    amount: 5000
                    newBalance:
                      cash: 10000
                      bank: 10000
                remove:
                  summary: Money removed.
                  value:
                    success: true
                    userId: '1133665013794607114'
                    type: bank
                    amount: 2000
                    newBalance:
                      cash: 5000
                      bank: 8000
                reset:
                  summary: Balance reset.
                  value:
                    success: true
                    userId: '1133665013794607114'
                    newBalance:
                      cash: 0
                      bank: 0
                resetCooldown:
                  summary: Cooldown reset.
                  value:
                    success: true
                    userId: '1133665013794607114'
                    command: работать
        '400':
          description: Request error (missing required fields or unknown action).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          $ref: '#/components/responses/UnauthorizedMissingOrInvalidToken'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
      security:
        - MRPAPIKey: []
components:
  schemas:
    ErrorResponse:
      type: object
      description: Standard error format.
      required:
        - code
        - message
      properties:
        code:
          type: integer
          description: API error code.
          example: 5007
        message:
          type: string
          description: Error message/identifier.
          example: Missing Token
    UnauthorizedError:
      type: object
      description: Authentication error (missing or invalid token).
      required:
        - code
        - message
      properties:
        code:
          type: integer
          example: 5007
        message:
          type: string
          example: Missing Token
    ForbiddenError:
      type: object
      description: Access error (forbidden).
      required:
        - code
        - message
      properties:
        code:
          type: integer
          example: 5009
        message:
          type: string
          example: Forbidden
    RateLimitError:
      type: object
      description: Request limit exceeded error.
      required:
        - code
        - message
      properties:
        code:
          type: integer
          example: 6021
        message:
          type: string
          example: Rate Limit Exceeded
        retry_after:
          type: integer
          description: Time until limit reset in seconds.
          example: 30
    EconomyApiError:
      type: object
      description: Economy API error.
      required:
        - code
        - message
      properties:
        code:
          type: integer
          example: 6010
        message:
          type: string
          example: Business not found
  responses:
    UnauthorizedMissingOrInvalidToken:
      description: Authentication error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UnauthorizedError'
          examples:
            Missing Token:
              summary: No token.
              value:
                code: 5007
                message: Missing Token
            Invalid Token:
              summary: Invalid or deactivated token.
              value:
                code: 5008
                message: Invalid Token
            Invalid Master Key:
              summary: Invalid master key.
              value:
                code: 5006
                message: Invalid Master Key
    Forbidden:
      description: Access forbidden.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ForbiddenError'
          examples:
            Forbidden:
              summary: No access rights to endpoint.
              value:
                code: 5009
                message: Forbidden
            Api Version Forbidden:
              summary: Access to this API version is forbidden.
              value:
                code: 5010
                message: Api Version Forbidden
            Query Param Forbidden:
              summary: Query parameter is forbidden.
              value:
                code: 5011
                message: Query Param Forbidden
    TooManyRequests:
      description: Request limit exceeded.
      headers:
        X-RateLimit-Limit:
          description: Maximum requests per minute.
          schema:
            type: integer
            example: 60
        X-RateLimit-Remaining:
          description: Remaining number of requests.
          schema:
            type: integer
            example: 0
        Retry-After:
          description: Seconds until limit reset.
          schema:
            type: integer
            example: 30
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/RateLimitError'
          examples:
            Rate Limit Exceeded:
              summary: Request limit exceeded.
              value:
                code: 6021
                message: Rate Limit Exceeded
                retry_after: 30
    InternalServerError:
      description: Internal server error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/EconomyApiError'
          examples:
            Internal Server Error Occurred:
              summary: Economy API error.
              value:
                code: 6005
                message: Internal Server Error Occurred.
  securitySchemes:
    MRPAPIKey:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: |
        API key for accessing CivOps endpoints.

        Passed in the `Authorization: Bearer <key>` header.

        REQUIRED FOR ALL CIVOPS ENDPOINTS (except /health).

````