# Gateway Request Log

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


A gateway request log is a record of a single request that Chargebee sent to a payment gateway, such as a payment, refund, or payment method verification call, along with the gateway's response. Use gateway request logs to investigate payment failures, reconcile Chargebee records with your gateway dashboard, or audit the calls made for a specific [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 such as card details and credentials already masked. Logs are retained for 60 days.

## Sample Gateway-request-log

```json
{
  "gateway_request_log": {
    "log_id": "Xk2pR40BlZ7aQ1sYdE9f",
    "url": "https://api.stripe.com/v1/payment_intents",
    "status_code": "200",
    "method": "POST",
    "request_body": "{amount=2500, currency=usd, customer=cus_QxSaMpLe1, payment_method=pm_************4242, confirm=true}",
    "response_body": "{\"id\":\"pi_SaMpLe1\",\"object\":\"payment_intent\",\"status\":\"succeeded\",\"amount\":2500,\"currency\":\"usd\"}",
    "request_headers": "{\"Authorization\":\"********\"}",
    "response_headers": "{\"Content-Type\":\"application/json\",\"Request-Id\":\"req_SaMpLe123\"}",
    "gateway": "stripe",
    "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",
    "operation_name": "PAYMENT",
    "operation_type": "PAYMENT",
    "source": "API",
    "invocation_time": 1762099200,
    "response_received_at": 1762099201,
    "response_time": 842,
    "object": "gateway_request_log"
  }
}
```

## Gateway Request Log attributes

## Input Parameters

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

- `url` (optional, string, max chars=500)
  The gateway URL that Chargebee sent the request to.

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

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

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

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

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

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

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

- `customer_handle` (optional, string, max chars=100)
  The ID of the [customer](/docs/api/customers) associated with the request.

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

- `transaction_handle` (optional, string, max chars=100)
  The ID of the [transaction](/docs/api/transactions) associated with the request.

- `payment_method_handle` (optional, string, max chars=100)
  The ID of the [payment source](/docs/api/payment_sources) used in the request.

- `gateway_credential_handle` (optional, string, max chars=100)
  The ID of the gateway account used for the request.

- `payment_attempt_handle` (optional, string, max chars=100)
  The ID of the payment attempt associated with the request.

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

- `payment_method_name` (optional, string, max chars=100)
  The name of the payment method used in the request.

- `operation_name` (optional, string, max chars=200)
  The gateway operation performed in the request, in uppercase. For example, `PAYMENT`, `REFUND`, `AUTHORIZE`, or `CREATE_PAYMENT_METHOD`.

- `operation_type` (optional, string, max chars=200)
  The category of the gateway operation performed in the request. One of `PROFILE`, `PAYMENT_METHOD`, `PAYMENT`, `REFUND`, `AUTHORIZE`, `VOID`, or `CAPTURE`.

- `action_type` (optional, string, max chars=500)
  The action performed in the request.

- `source` (optional, string, max chars=100)
  The origin of the Chargebee request that triggered this gateway call, for example `API`, `ADMIN_CONSOLE`, or `SYSTEM`. The value is `UNKNOWN_SOURCE` when the origin isn't recorded. This attribute is omitted when the log has no source.

- `trace_id_hash` (optional, string, max chars=300)
  A hashed trace identifier for the request.

- `invocation_time` (optional, timestamp(UTC) in seconds)
  Timestamp indicating when Chargebee sent the request to the gateway.

- `response_received_at` (optional, timestamp(UTC) in seconds)
  Timestamp indicating when Chargebee received the response from the gateway.

- `response_time` (optional, long)
  The time the gateway took to respond to the request, in milliseconds.

