Skip to main content

PaymentRequest

Returned by readSignedInvoice and useNFCMerchant.createPaymentRequest. Represents a verified payment invoice.
interface PaymentRequest {
  paymentId: string;
  amount: string;          // USDC decimal string, e.g. "25.00"
  merchantWallet: string;  // Merchant's on-chain wallet address
  transactionId: string;   // Alias for paymentId (backwards compatibility)
  currency: 'USDC';
  network: 'base';
  timestamp: number;       // Unix timestamp in ms
  expiresAt?: number;      // Unix timestamp in ms
}

CreatePaymentRequest

Passed to the payment creation API:
interface CreatePaymentRequest {
  amount: string;      // USDC decimal string
  merchantId: string;
}

CreatePaymentResponse

Returned by the payment creation API:
interface CreatePaymentResponse {
  paymentId: string;
  merchantWallet: string;
  expiresAt: number;  // Unix timestamp in ms
}

ProcessPaymentRequest

Passed to the payment processing API:
interface ProcessPaymentRequest {
  paymentId: string;
  txHash?: string;
  customerWallet?: string;
}

ProcessPaymentResponse

Returned by the payment processing API:
interface ProcessPaymentResponse {
  transactionId?: string;
  status: PaymentStatus;
  confirmedAt?: number;  // Unix timestamp in ms
}

PaymentStatusResponse

Returned by payment status polling:
interface PaymentStatusResponse {
  status: PaymentStatus;
  txHash?: string;
  confirmedAt?: number;
  error?: string;
}

PayFromPoolRequest / Response

Used internally by POOL mode:
interface PayFromPoolRequest {
  payment_id: string;
  customer_id: string;
  amount: string;
}

interface PayFromPoolResponse {
  success: boolean;
  transactionId?: string;
  status: PaymentStatus;
  error?: string;
}