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

# Покупка криптовалюты (Вывод)

> Создает заявку на вывод криптовалюты. Конвертация через USDT. Заявки обрабатываются в порядке очереди.



## OpenAPI

````yaml /APIs/crypto-cash-openapi.json post /merchant/api/v1/balance/actions/buy/crypto/
openapi: 3.1.0
info:
  title: CryptoCash Merchant API
  description: >-
    API для работы с криптовалютными платежами. Все запросы требуют
    аутентификации через подпись. Тело запроса содержит: data (JSON-объект в
    base64) и signature (SHA256(SECRET_KEY + data) в base64).
  version: 1.0.0
servers:
  - url: https://api.crypto-cash.world
    description: Production server
security: []
tags:
  - name: Balance
    description: Операции с балансом
  - name: Actions
    description: 'Действия: покупка, продажа, возврат'
  - name: Transactions
    description: Работа с транзакциями
  - name: Reference
    description: Справочная информация
externalDocs:
  description: Внешние курсы валют
  url: https://rates.crypto-cash.world/api/v1/market/rates/export/json
paths:
  /merchant/api/v1/balance/actions/buy/crypto/:
    post:
      tags:
        - Actions
      summary: Покупка криптовалюты (Вывод)
      description: >-
        Создает заявку на вывод криптовалюты. Конвертация через USDT. Заявки
        обрабатываются в порядке очереди.
      operationId: buyCrypto
      requestBody:
        required: true
        description: |-
          Параметры данных:
          - **publicKey** (обязательный)
          - **address** (обязательный)
          - **memo** (опционально)
          - **amount** (обязательный)
          - **currency** (опционально если передан ticker)
          - **network** (опционально если передан ticker)
          - **ticker** (опционально если переданы currency+network)
          - **externalId** (обязательный)
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SignedRequest'
        x-data-schema:
          $ref: '#/components/schemas/BuyCryptoRequest'
      responses:
        '200':
          description: Успешный ответ
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                    example: 200
                  data:
                    type: object
                    properties:
                      item:
                        $ref: '#/components/schemas/BuyCryptoResponse'
                      queued:
                        type: boolean
                        description: Флаг постановки в очередь
                      scheduledAt:
                        type: string
                        format: date-time
                        description: Запланированное время выполнения
        '400':
          description: Ошибка запроса
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    SignedRequest:
      type: object
      required:
        - data
        - signature
      properties:
        data:
          type: string
          description: JSON-объект с параметрами запроса, закодированный в base64
        signature:
          type: string
          description: Подпись SHA256(SECRET_KEY + data), закодированная в base64
    BuyCryptoResponse:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Внутренний ID транзакции
        externalId:
          type: string
          description: Внешний ID
    Error:
      type: object
      properties:
        errors:
          type: array
          items:
            type: integer
          description: Список кодов ошибок
      example:
        errors:
          - 1000

````