{
  "ok": true,
  "app": "rokoungli-pay-relay",
  "brand": "Rokoungli",
  "stateless": true,
  "description": "Rokoungli payment relay. This service does not store transactions, orders, invoices, or callbacks.",
  "createPayment": {
    "method": "POST",
    "primaryUrl": "https://pay.rokoungli.in/payments/paytm/create",
    "providerNeutralUrl": "https://pay.rokoungli.in/payments/create",
    "legacyUrl": "https://pay.rokoungli.in/api/payments/create",
    "auth": "Use Authorization: Bearer <RELAY_SHARED_SECRET> or HMAC headers X-Relay-Timestamp and X-Relay-Signature.",
    "hmac": "hex_hmac_sha256(`${timestamp}.${rawJsonBody}`, RELAY_SHARED_SECRET)",
    "requestExample": {
      "provider": "paytm",
      "transaction_id": "RK-10001",
      "name": "Customer Name",
      "email": "customer@example.com",
      "phone": "9999999999",
      "amount": "500.00",
      "description": "Rokoungli order",
      "mode": "payment_link",
      "successUrl": "https://shop.rokoungli.in/checkout/order-received/10001/",
      "failureUrl": "https://shop.rokoungli.in/checkout/"
    },
    "responseShape": {
      "ok": true,
      "stateless": true,
      "relayOrderId": "RK-10001-ABCD12",
      "serverOrderId": "RK-10001",
      "webhookUrl": "https://pay.rokoungli.in/callback/paytm",
      "callbackUrl": "https://pay.rokoungli.in/callback/paytm",
      "payment": {
        "provider": "PAYTM",
        "mode": "payment_link",
        "amount": "500.00",
        "currency": "INR",
        "paymentUrl": "https://p.paytm.me/...",
        "qrData": null,
        "qrImageDataUrl": null,
        "paytmLinkId": "123456789",
        "paytmQrCodeId": null
      }
    }
  },
  "paytmWebhook": {
    "method": "POST",
    "urlForPaytmDashboard": "https://pay.rokoungli.in/callback/paytm",
    "legacyAlias": "https://pay.rokoungli.in/api/paytm/webhook",
    "note": "Paytm only receives the relay URL. The relay normalizes callbacks and forwards them to the private downstream callback URL with an HMAC signature."
  },
  "diagnostics": {
    "note": "In-memory diagnostics only. Resets on app restart/redeploy.",
    "retentionHours": 24,
    "eventLimit": 10000,
    "endpoints": {
      "stats": "https://pay.rokoungli.in/relay/stats",
      "events": "https://pay.rokoungli.in/relay/events?limit=100",
      "legacyStats": "https://pay.rokoungli.in/api/relay/stats",
      "legacyEvents": "https://pay.rokoungli.in/api/relay/events?limit=100"
    },
    "auth": "Same relay Authorization bearer or HMAC headers as create-payment."
  },
  "server1ForwardedCallback": {
    "url": "configured privately on relay",
    "headers": {
      "content-type": "application/json",
      "x-relay-signature": "hex_hmac_sha256(rawJsonBody, SERVER1_FORWARD_SECRET)"
    },
    "bodyShape": {
      "event": "paytm.payment.status",
      "provider": "PAYTM",
      "verified": false,
      "verificationMode": "relay_passthrough",
      "serverOrderId": "RK-10001",
      "relayOrderId": "RK-10001-ABCD12",
      "status": "TXN_SUCCESS",
      "paytmTxnId": "202005081112128XXXXXX68470101509706",
      "amount": "500.00",
      "currency": "INR",
      "paymentMode": "UPI",
      "bankTxnId": "62909899",
      "rawPaytm": {}
    }
  }
}