Skip to main content
The requestor flow is used when you want to receive a payment — as a merchant accepting a purchase or a person requesting money from a friend.

Overview

  1. Create a Payment Intent with your wallet as the requestor
  2. Share the intent with the fulfiller via SonicPay audio, deep link, or QR code
  3. The fulfiller reviews, signs, and submits the transaction
  4. You receive a webhook or SSE event when the payment is confirmed

Step 1: Create the intent

Create a Payment Intent server-side or client-side via the SDK:
curl -X POST https://api.cherp.dev/v1/intents \
  -H "Authorization: Bearer pk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "chain": "solana:5eykt4UsFv8P8NJdTREpY1vzqKq2Kvdp",
    "token": "USDC",
    "amount": "10.50",
    "requestor": "7xKXtg2...",
    "idempotencyKey": "order_982734",
    "metadata": { "orderId": "982734" }
  }'

Step 2: Share with the fulfiller

There are three ways to share the intent:

SonicPay audio broadcast

The SDK broadcasts the intent via near-ultrasonic audio. Any fulfiller within ~1–5m can decode it:
const broadcast = sdk.broadcast(intent);
// broadcast.stop() — call explicitly when done
The broadcast loops automatically until the fulfiller acknowledges receipt or the intent’s TTL expires. Generate a deep link for sharing via messaging, email, or other channels:
const link = sdk.getDeepLink(intent);
// "yourapp://pay?intent_id=pi_abc123"

QR code

Generate a QR code payload for display on screen or print:
const qrPayload = sdk.getQRPayload(intent);

Step 3: Watch for fulfillment

Track the payment status using the onStatusChange callback:
sdk.onStatusChange(intent, (status, context) => {
  // status: IntentState
  // context: { estimatedWaitSeconds, isDelayed, expiresAt, pendingAtExpiry }

  if (status === 'confirmed') {
    // Payment complete — update your UI
  }
});
Or listen via webhooks for server-side handling.