GET
https://api.myidvirtual.com
/
transactions
/
bpix
/
payment
/
{ext_id}
Buscar Pagamento Bitpix
curl --request GET \
  --url https://api.myidvirtual.com/transactions/bpix/payment/{ext_id} \
  --header 'Authorization: <authorization>'
{
  "ext_id": "bpix_abc123xyz",
  "transaction_id": "transaction_001",
  "payment_type": "bitpix",
  "is_cripto": true,
  "status": "COMPLETED",
  "coin_amount": 20,
  "type": "SIGNATURE",
  "crypto_details": {
    "currency": "BTC",
    "amount_crypto": "0.00045",
    "wallet_address": "bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh",
    "confirmations": 3,
    "network": "bitcoin"
  },
  "qr_code": "data:image/png;base64,...",
  "payment_url": "https://payment.bitpix.com/...",
  "createdAt": "2024-01-15T10:30:00.000Z",
  "completedAt": "2024-01-15T11:15:00.000Z",
  "expires_at": "2024-01-15T12:30:00.000Z"
}

Buscar Pagamento Bitpix

Endpoint para recuperar detalhes de um pagamento específico processado pelo Bitpix, seja em criptomoeda ou PIX tradicional.

Autenticação

Authorization
string
required
Bearer token JWT do usuário autenticado

Path Parameters

ext_id
string
required
ID externo da transação no Bitpix (external ID)

Response

{
  "ext_id": "bpix_abc123xyz",
  "transaction_id": "transaction_001",
  "payment_type": "bitpix",
  "is_cripto": true,
  "status": "COMPLETED",
  "coin_amount": 20,
  "type": "SIGNATURE",
  "crypto_details": {
    "currency": "BTC",
    "amount_crypto": "0.00045",
    "wallet_address": "bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh",
    "confirmations": 3,
    "network": "bitcoin"
  },
  "qr_code": "data:image/png;base64,...",
  "payment_url": "https://payment.bitpix.com/...",
  "createdAt": "2024-01-15T10:30:00.000Z",
  "completedAt": "2024-01-15T11:15:00.000Z",
  "expires_at": "2024-01-15T12:30:00.000Z"
}

Exemplo de Requisição

cURL
curl -X GET 'https://api.myidvirtual.com/transactions/bpix/payment/bpix_abc123xyz' \
  -H 'Authorization: Bearer SEU_TOKEN_AQUI'
JavaScript
const getBitpixPayment = async (extId) => {
  const token = localStorage.getItem('access_token');

  const response = await fetch(`https://api.myidvirtual.com/transactions/bpix/payment/${extId}`, {
    method: 'GET',
    headers: {
      'Authorization': `Bearer ${token}`
    }
  });

  const data = await response.json();
  return data;
};

// Uso
const pagamento = await getBitpixPayment('bpix_abc123xyz');

if (pagamento.is_cripto) {
  console.log('Pagamento em cripto:', pagamento.crypto_details.currency);
  console.log('Confirmações:', pagamento.crypto_details.confirmations);
} else {
  console.log('Pagamento PIX:', pagamento.pix_details.amount_brl);
}

Diferenças entre Cripto e PIX

Pagamento em Criptomoeda (is_cripto: true)

Retorna informações adicionais em crypto_details:
  • currency - Moeda utilizada (BTC, ETH, USDT, etc)
  • amount_crypto - Valor em criptomoeda
  • wallet_address - Endereço da carteira
  • confirmations - Número de confirmações na blockchain
  • network - Rede blockchain utilizada

Pagamento PIX (is_cripto: false)

Retorna informações adicionais em pix_details:
  • pix_code - Código PIX copia e cola
  • qr_code - QR Code em base64
  • amount_brl - Valor em reais

Status do Pagamento

StatusDescriçãoAção
PENDINGAguardando pagamentoVerificar periodicamente
COMPLETEDPagamento confirmadoLiberar acesso/créditos
FAILEDPagamento falhouSolicitar novo pagamento
EXPIREDPagamento expiradoCriar nova transação

Uso Comum

Este endpoint é útil para:
  • Verificar status de pagamento após redirecionamento do Bitpix
  • Sincronizar dados entre sistema e gateway
  • Debugging de problemas de pagamento
  • Auditoria de transações Bitpix
Para pagamentos em criptomoeda, considere o pagamento confirmado após pelo menos 3 confirmações na blockchain para evitar double-spend.
O ext_id é retornado ao criar a transação. Armazene-o para consultas futuras e reconciliação de pagamentos.