# Retrieve a gateway webhook log

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


[Strongly Consistent](/docs/api/v2/pcv-1/read-consistency)

Retrieves a gateway webhook log identified by its `webhook_id`.

Use this operation to inspect the full webhook that a payment gateway sent to Chargebee and the response Chargebee returned. Payloads are returned as stored, with sensitive values already masked.

### Implementation Notes

-   If no log matches the `webhook_id` for the site, or the log belongs to a business entity other than the one in context, the API returns a `resource_not_found` error.

## Sample Request

#### Chargebee CLI

```bash
chargebee gateway-webhook-log retrieve Yb3nS40BlZ7aQ1sYfG2h
```

#### cURL

```bash
curl  https://{site}.chargebee.com/api/v2/gateway_webhook_logs/Yb3nS40BlZ7aQ1sYfG2h \
     -u {site_api_key}:
```

#### .NET

```dotnet
using ChargeBee.Api;
using ChargeBee.Models;

ApiConfig.Configure("{site}","{site_api_key}");
EntityResult result = GatewayWebhookLog.Retrieve("Yb3nS40BlZ7aQ1sYfG2h").Request();

GatewayWebhookLog gatewayWebhookLog = result.GatewayWebhookLog;
```

#### Go

```go
package main
import (
    "fmt"
    "github.com/chargebee/chargebee-go/v3"
    gatewaywebhooklogAction "github.com/chargebee/chargebee-go/v3/actions/gatewaywebhooklog"
)
func main() {
    chargebee.Configure("{site_api_key}","{site}");
    res,err := gatewaywebhooklogAction.Retrieve("Yb3nS40BlZ7aQ1sYfG2h").Request()
    if err != nil {
        fmt.Println(err)
    } else {
        GatewayWebhookLog := res.GatewayWebhookLog
    }
}
```

#### Go

```go
package main

import (
  "fmt"
  "github.com/chargebee/chargebee-go/v4"
)

func main() {
  config := &chargebee.ClientConfig{
    SiteName: "{site}",
    ApiKey: "{site_api_key}",
  }    
  client := chargebee.NewClient(config)
  req := &chargebee.GatewayWebhookLogRetrieveRequest{
    Id : "Yb3nS40BlZ7aQ1sYfG2h",
}
  res, err := client.GatewayWebhookLog.Retrieve(req)
      if err != nil {
        fmt.Println(err)
    } else {
        GatewayWebhookLog := res.GatewayWebhookLog
    }
}
```

#### Java

```java
import com.chargebee.*;
import com.chargebee.ListResult;
import com.chargebee.models.*;
import com.chargebee.models.enums.*;
import java.io.IOException;

public class Sample {

    public static void main(String args[]) throws IOException, Exception {
        Environment.configure("{site}", "{site_api_key}");
        Result result = GatewayWebhookLog.retrieve("Yb3nS40BlZ7aQ1sYfG2h").request();

        GatewayWebhookLog gatewayWebhookLog = result.gatewayWebhookLog();
    }
}
```

#### Java

```java
import com.chargebee.v4.client.ChargebeeClient;
import com.chargebee.v4.models.gatewayWebhookLog.GatewayWebhookLog;
import com.chargebee.v4.models.gatewayWebhookLog.params.GatewayWebhookLogRetrieveParams;
import com.chargebee.v4.models.gatewayWebhookLog.responses.GatewayWebhookLogRetrieveResponse;

public class GatewayWebhookLogRetrieve {

    public static void main(String[] args) {
        ChargebeeClient client = ChargebeeClient.builder()
            .apiKey("{site_api_key}")
            .siteName("{site}")
            .build();

        GatewayWebhookLogRetrieveResponse response = client.gatewayWebhookLogs().retrieve("Yb3nS40BlZ7aQ1sYfG2h");

        GatewayWebhookLog gatewayWebhookLog = response.getGatewayWebhookLog();
    }
}
```

#### Node.js

```node
import Chargebee from "chargebee";

const chargebee = new Chargebee({
    site: "{site}",
    apiKey: "{site_api_key}",
});

try {
    const result = await chargebee.gatewayWebhookLog.retrieve("Yb3nS40BlZ7aQ1sYfG2h");

    console.log(result);
    const gatewayWebhookLog = result.gateway_webhook_log;
} catch (err) {
    console.log(err);
}
```

#### PHP

```php
<?php

require __DIR__ . '/vendor/autoload.php';

use Chargebee\ChargebeeClient;

$chargebee = new ChargebeeClient(options: [
    "site" => "{site}",
    "apiKey" => "{site_api_key}",
]);
$result = $chargebee->gatewayWebhookLog()->retrieve("Yb3nS40BlZ7aQ1sYfG2h");
$gatewayWebhookLog = $result->gateway_webhook_log;
```

#### Python

```python
from chargebee import Chargebee

cb_client = Chargebee(api_key="{site_api_key}", site="{site}")
response = cb_client.GatewayWebhookLog.retrieve("Yb3nS40BlZ7aQ1sYfG2h")
gateway_webhook_log = response.gateway_webhook_log
```

#### Ruby

```ruby
require 'chargebee'

ChargeBee.configure(:site => "{site}",
  :api_key => "{site_api_key}")

result = ChargeBee::GatewayWebhookLog.retrieve("Yb3nS40BlZ7aQ1sYfG2h")

gateway_webhook_log = result.gateway_webhook_log
```

## Sample Response

```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"
  }
}
```

## URL Format

**GET** https://[site].chargebee.com/api/v2/gateway_webhook_logs/{gateway-webhook-log-webhook-id}

## Returns

- `gateway_webhook_log` (Gateway webhook log object)
  Resource object representing gateway\_webhook\_log
