Transf. Interna

Requer autenticação
POST/v2/internal_transfers/payment

Move saldo entre contas BSPAY instantaneamente. Sem taxa de rede, sem intermediário. O destinatário é identificado pelo username.

Headers

Authorization: Bearer {access_token}
Content-Type:  application/json
X-Signature:   hex(hmac_sha256(timestamp + "." + nonce + "." + body, signing_key))
X-Timestamp:   <unix_seconds>
X-Nonce:       <uuid_v4>

Body

Parâmetros
usernamestringobrigatório
Username do destinatário na BSPAY.
amountnumberobrigatório
Valor a transferir (até 2 decimais para fiat, 8 para cripto).
currencystringobrigatório
Moeda: BRL, MXN, USDT, USDC, BTC, ETH, SOL.
descriptionstring
Descrição da transferência.
external_idstring
ID único no seu sistema para idempotência (máx 64 chars).

Rate limit

60 reqs/min por credencial — anti-enumeração de usernames.

Erros

CódigoHTTPDescrição
MISSING_REQUIRED_FIELD400Campo ausente — details.field (username, amount, etc.)
MISSING_SIGNATURE / INVALID_SIGNATURE401HMAC ausente ou inválido
INVALID_AMOUNT422Valor inválido
INVALID_CURRENCY422Moeda não suportada
USER_NOT_FOUND404username destino não existe
SELF_TRANSFER_BLOCKED400Não pode transferir para o próprio username
INSUFFICIENT_BALANCE422Saldo insuficiente
LIMIT_EXCEEDED409Limite diário/mensal atingido
RATE_LIMIT_EXCEEDED429Mais de 60 reqs/min
cURL
PHP
JavaScript
Python
TIMESTAMP=$(date +%s)
NONCE=$(uuidgen)
BODY='{"username":"recipient_user","amount":50.00,"currency":"BRL","description":"Pagamento parceiro","external_id":"transfer_001"}'
SIGNATURE=$(printf '%s' "$TIMESTAMP.$NONCE.$BODY" | openssl dgst -sha256 -hmac "$SIGNING_KEY" -hex | awk '{print $2}')

curl -X POST https://api.bspay.co/v2/internal_transfers/payment \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -H "X-Signature: $SIGNATURE" \
  -H "X-Timestamp: $TIMESTAMP" \
  -H "X-Nonce: $NONCE" \
  -d "$BODY"
200 OK
404 User
422 Saldo
{
  "success": true,
  "data": {
    "transaction_id": "abc123def456",
    "from_user": "seu_username",
    "to_user": "recipient_user",
    "amount": "50.00",
    "currency": "BRL",
    "status": "confirmed",
    "created_at": "2026-04-30T14:00:00Z"
  },
  "request_id": "d83a1af58da407fcc881c0af",
  "timestamp": "2026-04-30T14:00:00Z"
}

Esta página foi útil?