API Docs
Webhooks
API ReferenceWebhooksWebhook Payload Structure

Webhook Payload Structure

Understand the structure of webhook event payloads.

Payload Format

All webhook payloads are JSON-encoded and include the following fields:

{
  "merchant_id": "1234567890",
  "event_id": "evt_1234567890abcdef",
  "event_type": "payment_succeeded",
  "content": {
    "type": "payment_details",
    "object": {
      "payment_id": "pay_1234567890abcdef",
      "merchant_id": "1234567890",
      "status": "succeeded",
      "amount": 5000,
      "amount_received": 5000,
      "currency": "USD",
      "payment_method": "card",
      "created": "2024-01-22T10:30:00Z",
      "metadata": {
        "order_id": "order_123"
      }
    }
  },
  "timestamp": "2024-01-22T10:30:05Z"
}

Payload Fields

FieldTypeDescription
merchant_idstringMerchant account that owns the event.
event_idstringUnique identifier for this event.
event_typestringThe type of event (see Event Types).
contentobjectTagged event resource. Includes type and object.
content.typestringResource type for the event, such as payment_details, refund_details, dispute_details, mandate_details, payout_details, or subscription_details.
content.objectobjectThe resource payload. Its fields vary by content.type.
timestampstringISO 8601 timestamp of when the webhook was sent.

Process each event_id once. For payment events, update local orders using content.object.payment_id or your own order reference such as content.object.metadata.order_id when present.

Error Fields (Failed Payments)

When a payment fails, content.object carries additional error fields that describe why. These fields are present on failed payments (for example event_type: payment_failed with status: failed) and are null on successful payments.

Two kinds of error information are reported: flat summary fields for a quick read, and a nested error_details.issuer_details object with the raw response from the cardholder's bank.

{
  "event_type": "payment_failed",
  "content": {
    "type": "payment_details",
    "object": {
      "payment_id": "152e072a22d7406a933acdb34000a814",
      "status": "failed",

      "unified_code": "UE_9000",
      "unified_message": "Something went wrong",
      "issuer_error_code": "51",
      "issuer_error_message": "Not sufficient funds",

      "error_details": {
        "issuer_details": {
          "code": "51",
          "message": "Not sufficient funds",
          "network_details": {
            "name": "Visa",
            "advice_code": null,
            "advice_message": "Not sufficient funds"
          }
        }
      }
    }
  }
}

Which field carries the issuer (bank) decline code? Use content.object.error_details.issuer_details.code — this is the raw code returned by the cardholder's bank (for example "51" = insufficient funds). The same value is mirrored at the flat field content.object.issuer_error_code. For a human-readable reason, use error_details.issuer_details.message or error_details.issuer_details.network_details.advice_message.

Summary fields

Flat fields on content.object that give a quick summary of the failure.

FieldTypeDescription
unified_codestring | nullReliancePays's unified error category, such as UE_9000.
unified_messagestring | nullReliancePays's unified, customer-safe message.
issuer_error_codestring | nullRaw decline code from the issuing bank (mirrors error_details.issuer_details.code).
issuer_error_messagestring | nullRaw decline message from the issuing bank.

error_details.issuer_details

The response from the cardholder's issuing bank. This is where the bank's raw decline code lives.

FieldTypeDescription
codestring | nullRaw decline code from the issuing bank, such as "51".
messagestring | nullRaw decline reason from the issuing bank.
network_details.namestring | nullCard network, such as Visa or Mastercard.
network_details.advice_codestring | nullNetwork advice code guiding whether/how to retry, when available.
network_details.advice_messagestring | nullHuman-readable network advice, when available.

Headers

Webhook requests include the following headers:

HeaderDescription
Content-TypeAlways application/json
User-AgentWebhook client user agent
X-Webhook-Signature-512HMAC-SHA512 signature of the raw request body, when webhook signing is configured