# Gateway Webhook Log

> For the complete machine-readable documentation index, see [llms.txt](https://apidocs.chargebee.com/llms.txt).


A gateway webhook log is a record of a single webhook that a payment gateway sent to Chargebee, along with the response Chargebee returned to the gateway. Use gateway webhook logs to confirm that gateway notifications, such as asynchronous payment or refund updates, reached Chargebee, and to trace them to the related [customer](/docs/api/customers), [invoice](/docs/api/invoices), or [transaction](/docs/api/transactions).

Request and response bodies and headers are returned as stored, with sensitive values already masked. Logs are retained for 60 days.

## Sample Gateway-webhook-log

```json
{
  "gateway_webhook_log": {
    "webhook_id": "Yb3nS40BlZ7aQ1sYfG2h",
    "url": "https://acme-test.chargebee.com/adyen/webhook",
    "method": "POST",
    "status_code": "200",
    "gateway": "adyen",
    "id_at_gateway": "8835511210681327",
    "customer_handle": "__test__KyVnHhSBWlC1T2cj",
    "invoice_handle": "__demo_inv__1",
    "transaction_handle": "txn___test__KyVnHhSBWlxBX2qV",
    "payment_method_handle": "pm___test__KyVnHhSBWlC4q2cn",
    "gateway_credential_handle": "gw___test__KyVnHhSBWl6sk2bY",
    "payment_method_name": "Card",
    "request_body": "{\"live\":\"false\",\"notificationItems\":[{\"NotificationRequestItem\":{\"eventCode\":\"AUTHORISATION\",\"success\":\"true\",\"pspReference\":\"8835511210681327\",\"merchantAccountCode\":\"AcmeECOM\",\"amount\":{\"value\":2500,\"currency\":\"USD\"}}}]}",
    "response_body": "[accepted]",
    "request_headers": "{\"Content-Type\":\"application/json\",\"Authorization\":\"********\"}",
    "response_headers": "{\"Content-Type\":\"text/plain\"}",
    "received_at": 1762099260,
    "response_time": 35,
    "object": "gateway_webhook_log"
  }
}
```

## Gateway Webhook Log attributes

## Input Parameters

- `webhook_id` (optional, string, max chars=100)
  Uniquely identifies the gateway webhook log.

- `url` (optional, string, max chars=500)
  The Chargebee URL at which the webhook was received.

- `method` (optional, string, max chars=100)
  The HTTP method of the webhook request, for example `POST`.

- `status_code` (optional, string, max chars=100)
  The HTTP status code that Chargebee returned to the gateway, as a string. For example, `"200"`.

- `gateway` (optional, string, max chars=100)
  The payment gateway that sent the webhook, for example `stripe` or `adyen`.

- `id_at_gateway` (optional, string, max chars=200)
  The gateway's reference for the transaction that the webhook is about, for example Adyen's `pspReference`. Chargebee uses this value to match the webhook to a transaction.

- `customer_handle` (optional, string, max chars=100)
  The ID of the [customer](/docs/api/customers) associated with the webhook, resolved from the matching transaction or payment intent.

- `invoice_handle` (optional, string, max chars=100)
  The ID of the [invoice](/docs/api/invoices) associated with the webhook, resolved from the matching transaction.

- `transaction_handle` (optional, string, max chars=100)
  The ID of the [transaction](/docs/api/transactions) that the webhook matched, resolved from `id_at_gateway`.

- `payment_method_handle` (optional, string, max chars=100)
  The ID of the [payment source](/docs/api/payment_sources) associated with the webhook, resolved from the matching transaction.

- `gateway_credential_handle` (optional, string, max chars=100)
  The ID of the gateway account associated with the webhook, resolved from the matching transaction or payment intent.

- `payment_attempt_handle` (optional, string, max chars=100)
  The ID of the payment attempt associated with the webhook. Present when the webhook matches a payment attempt but not a transaction.

- `payment_intent_handle` (optional, string, max chars=100)
  The ID of the [payment intent](/docs/api/payment_intents) associated with the webhook, resolved from the matching payment attempt.

- `payment_method_name` (optional, string, max chars=100)
  The name of the payment method associated with the webhook.

- `request_body` (optional, string, max chars=65k)
  The body of the webhook request sent by the gateway. Sensitive values are masked.

- `response_body` (optional, string, max chars=65k)
  The body of the response that Chargebee returned to the gateway. Sensitive values are masked.

- `request_headers` (optional, string, max chars=65k)
  The HTTP headers of the webhook request sent by the gateway. Sensitive values are masked.

- `response_headers` (optional, string, max chars=65k)
  The HTTP headers of the response that Chargebee returned to the gateway. Sensitive values are masked.

- `received_at` (optional, timestamp(UTC) in seconds)
  Timestamp indicating when Chargebee received the webhook.

- `response_time` (optional, long)
  The time Chargebee took to process the webhook, in milliseconds.

