Flash ProtocolFLASH PROTOCOL
DOCUMENTATION

Redirect Flow

Handling user returns after payment.

Overview

When you create a Payment Link, you must provide a success_url. Once the user completes the payment on our hosted page, they will see a success confirmation, and after 3 seconds, they will be automatically redirected to your URL.

This allows you to verify the payment status and show a “Thank You” page on your own domain.

Query Parameters

We append the following parameters to your success_url so you can identify the transaction:

  • payment_id: The ID of the Payment Link (e.g., pl_...).
  • source_tx_hash: The blockchain transaction hash of the original payment.
  • status: The status of the payment (always completed for success redirects).
Example Redirect URL
https://myapp.com/success?payment_id=pl_123&source_tx_hash=0xabc...&status=completed

Verification (Critical)

Do not trust the URL parameters alone. A malicious user could manually type ?status=completed in their browser to spoof a successful payment.

The recommended approach is to use webhooks to receive real-time notifications when payments complete or fail. Alternatively, verify the transaction status using our API before fulfilling the order.

Recommended Flow

  1. User completes payment and is redirected to your success_url.
  2. Your backend captures the payment_id from the query parameters.
  3. Your backend calls GET /transactions?payment_link_id=... to confirm the status is actually completed.
  4. If verified, fulfill the order.
Verification Example (Node.js)
// 1. Get payment_id from URL query
const paymentId = req.query.payment_id;

// 2. Call API to verify
const response = await fetch(`https://flash-protocol.vercel.app/api/v1/transactions?payment_link_id=${paymentId}`, {
  headers: { 'Authorization': 'Bearer ...' }
});

const { data } = await response.json();
const transaction = data[0]; // Get latest transaction

if (transaction && transaction.status === 'completed') {
  // ✅ Payment confirmed! Fulfill order.
} else {
  // ❌ Fraud attempt or pending. Do not fulfill.
}
Tip: Set up webhooks to automate order fulfillment without polling. Your server receives a signed POST when payments complete or fail.