Payment Callback URL

Set up a webhook endpoint to receive real-time payment notifications when users complete payments through AISA Pay SDK. Our server will send POST requests to this URL with payment details including transaction ID, amount, status, and merchant information.

How it works:
When a payment is successfully processed via AISA Pay SDK, our server will automatically send a POST request to your callback URL with the payment details. This allows you to update your application state, fulfill orders, or trigger any custom business logic in real-time.

Callback Request Format

When a payment is completed, our server will send a POST request to your callback URL with the following JSON payload:

Example 1: Crypto Payment (Base/Solana/Polygon/BNB)

{
  "merchant_uuid": "AISA",
  "transaction_id": "8",
  "order_id": null,
  "amount": 0.1,
  "currency": "USDC",
  "payment_method": "base",
  "status": "success",
  "blockchain_tx_hash": "0xe638b5dad2503940f5b5ad6f1e7c0b0c56cd6a0c677c3a9c87cbc4e0597c489f",
  "blockchain_tx_link": "https://basescan.org/tx/0xe638b5dad2503940f5b5ad6f1e7c0b0c56cd6a0c677c3a9c87cbc4e0597c489f",
  "timestamp": 1763904825,
  "metadata": {
    "payment_mode": "x402",
    "network": "base",
    "aisa_session": "aisa_session_1763904795037_5f4da6be9f5d26c4ea1301016046ab22"
  },
  "signature": "4db3b286745c0b805e51ed70dbe7dfcdf1d81752a876d822434b0878df892f7d"
}

Example 2: Stripe Payment

{
  "merchant_uuid": "AISA",
  "transaction_id": "9",
  "order_id": null,
  "amount": 10,
  "currency": "USD",
  "payment_method": "stripe",
  "status": "success",
  "blockchain_tx_hash": null,
  "blockchain_tx_link": null,
  "timestamp": 1763904900,
  "metadata": {
    "session_id": "cs_test_a1vwQ8MjHpyEso49ASoORTcW0WACS9MDHbGun5mERdGPSEIBjcvvyCy2XQ",
    "payment_intent": "pi_3SWdRA2XSjqP8IFU1dGRiSU0",
    "customer_email": "jiaoqiang8@gmail.com",
    "aisa_session": "aisa_session_1763904795037_5f4da6be9f5d26c4ea1301016046ab22"
  },
  "signature": "02e1ebb8e2fa07db36b97a8d1dde6d5127226490002f743a41e502f4a4dd61c9"
}

Field Descriptions:

  • merchant_uuid: Your unique merchant identifier
  • transaction_id: Internal transaction ID (matches ai_payment_records.id)
  • order_id: Optional order ID from your system
  • amount: Payment amount
  • currency: Currency code (USD, USDC, etc.)
  • payment_method: solana | base | ethereum | polygon | bnb | stripe | lightning
  • status: success | failed | timeout
  • blockchain_tx_hash: Transaction hash (crypto only, null for Stripe)
  • blockchain_tx_link: Block explorer link (crypto only)
  • timestamp: Unix timestamp (seconds)
  • metadata: Additional data (varies by payment method)
  • signature: HMAC-SHA256 signature for verification
Security: Verify the signature field using your AISA Payment Token as the HMAC-SHA256 key to ensure the request is authentic. Calculate HMAC-SHA256 of the entire payload (excluding the signature field) and compare it with the provided signature.
Response: Your endpoint should respond with HTTP 200 OK within 5 seconds. If we receive a non-200 response or timeout, we'll retry up to 3 times with exponential backoff (5s, 15s, 45s).
Key Differences:
  • Crypto payments: Include blockchain_tx_hash and blockchain_tx_link, currency is typically USDC
  • Stripe payments: blockchain fields are null, includes session_id and payment_intent in metadata
  • Both: Always include signature for verification and timestamp for request timing