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

# Criar Saque Crypto

> Cria um novo saque em criptomoeda (USDT BEP20).

Cria um novo saque em criptomoeda (USDT na rede BEP20). O valor será debitado do saldo disponível e convertido para USDT.

## Informações Importantes

<Info>
  **Taxa:** `6% do valor + R$ 2,00 fixo por saque`\
  **Valor mínimo:** `R$ 20,00`\
  **Valor máximo:** `R$ 3.000,00`\
  **Rede:** `BEP20 (Binance Smart Chain)`\
  **Moeda:** `USDT (Tether)`
</Info>

<Warning>
  A wallet deve ser um endereço válido na rede BEP20, no formato `0x` seguido de 40 caracteres hexadecimais.
</Warning>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST 'https://api.eyowallet.ru/api/v1/withdraw/crypto' \
    -H 'X-API-Key: sua_api_key' \
    -H 'Content-Type: application/json' \
    -d '{
      "amount": 100.00,
      "wallet": "0x1234567890123456789012345678901234567890",
      "description": "Saque para minha wallet"
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json Success theme={null}
  {
    "success": true,
    "message": "Saque crypto adicionado à fila de processamento",
    "data": {
      "id": "withdraw_abc123",
      "type": "CRYPTO_BEP20",
      "currency": "USDT",
      "network": "BEP20",
      "value": 10000,
      "valueInReais": 100,
      "fee": 800,
      "feeInReais": 8,
      "wallet": "0x1234567890123456789012345678901234567890",
      "status": "QUEUED",
      "createdAt": "2024-01-15T10:30:00Z"
    }
  }
  ```
</ResponseExample>

### Parâmetros

<ParamField body="amount" type="number" required>
  Valor do saque em reais. Valor mínimo: R\$ 20,00. Valor máximo: R\$ 3.000,00.
</ParamField>

<ParamField body="wallet" type="string" required>
  Endereço da wallet BEP20 do destinatário. Formato: `0x` seguido de 40 caracteres hexadecimais.
</ParamField>

<ParamField body="description" type="string">
  Descrição opcional do saque.
</ParamField>

<Warning>
  O saldo do usuário será debitado imediatamente ao criar o saque. Certifique-se de que há saldo suficiente (valor + taxa) antes de criar um saque.
</Warning>

### Cálculo da Taxa

A taxa é calculada da seguinte forma:

```
Taxa = (Valor × 6%) + R$ 2,00
```

**Exemplo:** Para um saque de R\$ 100,00:

* Taxa percentual: `R$ 100 × 6% = R$ 6,00`
* Taxa fixa: `R$ 2,00`
* **Taxa total:** `R$ 8,00`
* **Total debitado:** `R$ 108,00`

### Status do Saque

| Status       | Descrição                                        |
| ------------ | ------------------------------------------------ |
| `QUEUED`     | Saque adicionado à fila de processamento         |
| `PROCESSING` | Saque sendo processado                           |
| `COMPLETED`  | Saque concluído com sucesso                      |
| `FAILED`     | Saque falhou (saldo é devolvido automaticamente) |


## OpenAPI

````yaml POST /api/v1/withdraw/crypto
openapi: 3.1.0
info:
  title: Eyo Wallet API
  description: >-
    API para integração com a Eyo Wallet - Plataforma de pagamentos PIX para
    desenvolvedores e empresas
  version: 1.0.0
  contact:
    name: Eyo Wallet
    url: https://eyowallet.ru
servers:
  - url: https://api.eyowallet.ru
    description: Servidor de Produção
security:
  - apiKeyAuth: []
tags:
  - name: Payments
    description: Endpoints para criar e gerenciar pagamentos PIX
  - name: Withdraws
    description: Endpoints para criar e gerenciar saques via PIX
  - name: Transfers
    description: Endpoints para transferências internas entre contas Eyo Wallet
  - name: User
    description: Endpoints para informações do usuário e configurações
paths:
  /api/v1/withdraw/crypto:
    post:
      tags:
        - Withdraws
      summary: Criar Saque Crypto
      description: Cria um novo saque em criptomoeda (USDT BEP20).
      operationId: createCryptoWithdraw
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCryptoWithdrawRequest'
      responses:
        '201':
          description: Saque crypto adicionado à fila
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateCryptoWithdrawResponse'
        '400':
          description: Erro de validação, saldo insuficiente ou wallet inválida
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    CreateCryptoWithdrawRequest:
      type: object
      required:
        - amount
        - wallet
      properties:
        amount:
          type: number
          description: 'Valor do saque em reais. Mínimo: R$ 20,00. Máximo: R$ 3.000,00'
          minimum: 20
          maximum: 3000
        wallet:
          type: string
          description: >-
            Endereço da wallet BEP20 (formato: 0x seguido de 40 caracteres
            hexadecimais)
          pattern: ^0x[a-fA-F0-9]{40}$
        description:
          type: string
          description: Descrição opcional do saque
    CreateCryptoWithdrawResponse:
      type: object
      properties:
        success:
          type: boolean
        message:
          type: string
        data:
          type: object
          properties:
            id:
              type: string
              description: ID único do saque
            type:
              type: string
              enum:
                - CRYPTO_BEP20
              description: Tipo do saque
            currency:
              type: string
              enum:
                - USDT
              description: Moeda
            network:
              type: string
              enum:
                - BEP20
              description: Rede blockchain
            value:
              type: integer
              description: Valor em centavos
            valueInReais:
              type: number
              description: Valor em reais
            fee:
              type: integer
              description: Taxa em centavos (6% + R$ 2,00)
            feeInReais:
              type: number
              description: Taxa em reais
            wallet:
              type: string
              description: Endereço da wallet BEP20
            status:
              type: string
              enum:
                - QUEUED
                - PROCESSING
                - COMPLETED
                - FAILED
              description: Status do saque
            jobId:
              type: string
              description: ID do job na fila de processamento
            createdAt:
              type: string
              format: date-time
    Error:
      type: object
      properties:
        success:
          type: boolean
          const: false
        error:
          type: string
          description: Mensagem de erro
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: API Key obtida no painel da Eyo Wallet

````