APITaraPay
Merchant Console

Callback notification

Signed webhook when a payment reaches a terminal outcome

Configure webhook URL in Merchant Console → Developers. Store the signing secret whsec_… (shown once).

TaraPay POSTs signed JSON to your URL with retries (about 5 attempts over ~24 hours).

Request headers (to your server)

FieldTypeReqDescription
TaraPay-SignatureStringMt=<unix>,v1=<hmac-sha256-hex>
TaraPay-Event-IdStringMUnique event id — use as idempotency key
TaraPay-Event-TypeStringMe.g. payment_intent.succeeded
Content-TypeStringMapplication/json

Verify signature

  1. Read the raw request body as UTF-8 (do not re-serialize JSON).
  2. Parse TaraPay-Signature into t and v1.
  3. Reject if |now − t| > 300 seconds.
  4. Compute HMAC-SHA256(secret, `${t}.${rawBody}`) as hex.
  5. Compare to v1 with constant-time equality.
  6. Deduplicate on TaraPay-Event-Id; return 200 on replays.
Example payload
{
  "id": "evt_…",
  "type": "payment_intent.succeeded",
  "livemode": false,
  "data": {
    "object": {
      "id": "0193a0…",
      "status": "succeeded",
      "amountMinor": "10000",
      "currency": "BDT",
      "merchantOrderRef": "qp6-dep-1001"
    }
  }
}
POST/v1/webhooks/simulateScope: payments:write (test keys only)
Simulate success (test mode)
curl -sS -X POST '$BASE/v1/webhooks/simulate' \
  -H 'Authorization: Bearer $TP_TEST_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "paymentIntentId": "0193a0…",
    "outcome": "succeeded"
  }'
Credit your customer only after verifying the signature and seeing status succeeded. Never trust a browser return URL alone.