Skip to main content
GET
/
api
/
v1
/
ledger
/
transactions
/
check
/
{transaction_id}
Check Transaction Status
curl --request GET \
  --url https://api.example.com/api/v1/ledger/transactions/check/{transaction_id}
{
  "success": true
}

Overview

Verifies whether a payment transaction was successfully processed in the BOOP Network ledger. This endpoint is essential for confirming payment completion after authentication.
The transaction_id is computed as SHA256(vendor_id || context_id) where vendor_id is the vendor identifier and context_id is the authentication context.

Path Parameters

transaction_id
string
required
Transaction identifier computed as SHA256(vendor_id || context_id). Result is a 64-character hex string.

Response

success
boolean
required
Whether the transaction was successful (true) or failed due to insufficient balance (false)
{
  "success": true
}

Usage Examples

async function checkTransactionStatus(vendorId, contextId) {
  const crypto = require('crypto');

  // Calculate transaction_id
  const transactionId = crypto
    .createHash('sha256')
    .update(vendorId + contextId)
    .digest('hex');

  const response = await fetch(
    `https://dev.app.boop.it/api/v1/ledger/transactions/check/${transactionId}`,
    {
      headers: {
        'X-API-Key': 'your-api-key'
      }
    }
  );

  const { success } = await response.json();
  return success;
}

// Usage in payment flow
const paymentSuccess = await checkTransactionStatus('vendor123', contextId);
if (paymentSuccess) {
  console.log('Payment processed successfully');
} else {
  console.log('Payment failed - insufficient balance');
}

Transaction ID Calculation

The transaction ID uniquely identifies each payment transaction:
// Vendor ID + Context ID (concatenated, no separator)
const input = vendorId + contextId;
const transactionId = SHA256(input);
Example:
  • Vendor ID: vendor123
  • Context ID: 550e8400-e29b-41d4-a716-446655440000
  • Input: vendor123550e8400-e29b-41d4-a716-446655440000
  • Transaction ID: a1b2c3d4e5f6789012345678901234567890abcdef1234567890abcdef123456

Payment Flow Integration

Use this endpoint after receiving authentication results with payment:
async function handleAuthenticationResult(result, vendorId, contextId) {
  if (result.mpcResult.auth.result.code === 'ok') {
    // Check if payment was involved
    if (result.ledgerResult) {
      const paymentSuccess = await checkTransactionStatus(vendorId, contextId);

      if (paymentSuccess) {
        // Grant access - payment confirmed
        return { access: 'granted', reason: 'payment_verified' };
      } else {
        // Deny access - payment failed
        return { access: 'denied', reason: 'payment_failed' };
      }
    } else {
      // No payment involved, just authentication
      return { access: 'granted', reason: 'authenticated' };
    }
  }

  return { access: 'denied', reason: 'authentication_failed' };
}

Error Handling

StatusMeaningAction
200 + success: truePayment successfulGrant access
200 + success: falseInsufficient balanceDeny access, suggest top-up
404Transaction not foundCheck transaction ID calculation
500Server errorRetry request

Security Considerations

  • Always verify transaction status before granting access to paid services
  • Calculate transaction IDs server-side to prevent tampering
  • Implement proper error handling for failed payments
  • Use HTTPS for all transaction status checks

Rate Limits

  • 500 transaction checks per minute per API key
  • 5000 transaction checks per hour per API key