Executing a Quote

Executing a Fiat-to-Crypto Quote

Overview

After requesting a quote, execute it by completing the fiat deposit using the provided payment instructions. The system automatically processes the payment and delivers cryptocurrency to the recipient's wallet.

Payment Methods

PIX (Brazilian Real - BRL)

PIX is Brazil's instant payment system, available 24/7 for fast transfers.

Payment Options

  1. QR Code Payment

    • Scan the QR code using your banking app

    • Confirm the payment details

    • Authorize the transfer

  2. PIX Key Copy & Paste

    • Copy the PIX key string

    • Paste in your banking app's PIX section

    • Confirm and send payment

Deposit Instructions

The quote response includes all necessary payment details:

{
  "depositInstructions": {
    "method": "PIX",
    "amount": "527.50",
    "currency": "BRL",
    "pixQrCode": "data:image/png;base64,iVBORw0KGgoAAAANS...",
    "pixKey": "00020126580014br.gov.bcb.pix...",
    "expiresAt": "2024-01-15T10:30:00Z",
    "referenceId": "REF123456789"
  }
}

Implementation Guide

Step 1: Display Payment Instructions

// Example: Display PIX QR Code
function displayPaymentInstructions(depositInstructions) {
  if (depositInstructions.method === 'PIX') {
    // Show QR code image
    const qrImage = document.getElementById('qr-code');
    qrImage.src = depositInstructions.pixQrCode;
    
    // Show PIX key for copy
    const pixKeyElement = document.getElementById('pix-key');
    pixKeyElement.textContent = depositInstructions.pixKey;
    
    // Display amount
    const amountElement = document.getElementById('amount');
    amountElement.textContent = `${depositInstructions.currency} ${depositInstructions.amount}`;
    
    // Show expiration timer
    startExpirationTimer(depositInstructions.expiresAt);
  }
}

Step 2: Handle User Payment

// Example: Copy PIX key to clipboard
function copyPixKey(pixKey) {
  navigator.clipboard.writeText(pixKey).then(() => {
    showNotification('PIX key copied to clipboard');
  });
}

// Example: Provide payment instructions
function showPaymentSteps() {
  const steps = [
    "1. Open your banking app",
    "2. Go to PIX section",
    "3. Select 'Pay with QR Code' or 'Pay with PIX Key'",
    "4. Scan the QR code or paste the PIX key",
    "5. Confirm the amount matches exactly",
    "6. Authorize the payment"
  ];
  
  displaySteps(steps);
}

Step 3: Monitor Payment Status

After initiating payment, monitor the transaction status:

// Example: Poll for status updates
async function monitorPayment(transactionId) {
  const interval = setInterval(async () => {
    const status = await checkTransactionStatus(transactionId);
    
    updateUI(status);
    
    if (status.status === 'Completed' || status.status === 'Failed') {
      clearInterval(interval);
      handleFinalStatus(status);
    }
  }, 5000); // Check every 5 seconds
}

Payment Processing Flow

Important Considerations

Timing

  • Quote Expiration: Complete payment before quote expires (check expiresAt timestamp)

  • Processing Time:

    • PIX confirmation: Typically within seconds

    • Crypto delivery: Estimated 60 seconds after payment confirmation

    • Total estimated duration: ~1-2 minutes from payment to crypto delivery

  • Availability: PIX available 24/7, including weekends and holidays

Security

  • Verify Details: Always verify payment amount and recipient

  • Official Apps Only: Use official banking apps for payments

  • Save Reference: Keep the transaction ID and reference ID

Common Scenarios

Successful Payment

  1. User completes PIX payment

  2. System detects payment within seconds

  3. Automatic conversion to cryptocurrency

  4. Crypto sent to recipient's wallet

  5. Transaction marked as completed

Payment Issues

Quote Expired

  • Request a new quote if payment wasn't made in time

  • New quote may have different exchange rate

Incorrect Amount

  • Contact support if wrong amount was sent

  • May require manual processing or refund

Payment Not Detected

  • Allow 5-10 minutes for processing

  • Check transaction status endpoint

  • Contact support with reference ID if not processed

Transaction Status

During execution, monitor the transaction status using the status endpoint:

Status
Description

In_progress

Payment pending, received, or being processed

Completed

Cryptocurrency successfully delivered to wallet

Failed

Payment failed, rejected, or transaction error occurred

Note: These are high-level status categories. The underlying payment and blockchain operations may go through multiple intermediate states before reaching a final status.

Best Practices

  1. Clear Instructions: Provide step-by-step payment guidance

  2. Visual Feedback: Show QR code prominently for PIX

  3. Copy Functionality: Enable one-click copy for PIX key

  4. Timer Display: Show countdown for quote expiration

  5. Status Updates: Provide real-time payment status

  6. Error Recovery: Guide users through error scenarios

  7. Support Access: Provide easy access to support

Next Steps

After executing the payment:

Last updated