Webhooks
Get Webhook Headers
Get the headers for a specific webhook.
GET
/
webhooks
/
{webhook_id}
/
headers
JavaScript
import DodoPayments from 'dodopayments';
const client = new DodoPayments({
bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted
});
const header = await client.webhooks.headers.retrieve('whk_YdWqVEGKmSYKbsIyDxEab');
console.log(header.headers);import os
from dodopayments import DodoPayments
client = DodoPayments(
bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted
)
header = client.webhooks.headers.retrieve(
"whk_YdWqVEGKmSYKbsIyDxEab",
)
print(header.headers)package main
import (
"context"
"fmt"
"github.com/dodopayments/dodopayments-go"
"github.com/dodopayments/dodopayments-go/option"
)
func main() {
client := dodopayments.NewClient(
option.WithBearerToken("My Bearer Token"),
)
header, err := client.Webhooks.Headers.Get(context.TODO(), "whk_YdWqVEGKmSYKbsIyDxEab")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", header.Headers)
}package com.dodopayments.api.example;
import com.dodopayments.api.client.DodoPaymentsClient;
import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient;
import com.dodopayments.api.models.webhooks.headers.HeaderRetrieveParams;
import com.dodopayments.api.models.webhooks.headers.HeaderRetrieveResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
DodoPaymentsClient client = DodoPaymentsOkHttpClient.fromEnv();
HeaderRetrieveResponse header = client.webhooks().headers().retrieve("whk_YdWqVEGKmSYKbsIyDxEab");
}
}package com.dodopayments.api.example
import com.dodopayments.api.client.DodoPaymentsClient
import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient
import com.dodopayments.api.models.webhooks.headers.HeaderRetrieveParams
import com.dodopayments.api.models.webhooks.headers.HeaderRetrieveResponse
fun main() {
val client: DodoPaymentsClient = DodoPaymentsOkHttpClient.fromEnv()
val header: HeaderRetrieveResponse = client.webhooks().headers().retrieve("whk_YdWqVEGKmSYKbsIyDxEab")
}require "dodopayments"
dodo_payments = Dodopayments::Client.new(
bearer_token: "My Bearer Token",
environment: "test_mode" # defaults to "live_mode"
)
header = dodo_payments.webhooks.headers.retrieve("whk_YdWqVEGKmSYKbsIyDxEab")
puts(header)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Dodopayments\Client;
use Dodopayments\Core\Exceptions\APIException;
$client = new Client(
bearerToken: getenv('DODO_PAYMENTS_API_KEY') ?: 'My Bearer Token',
environment: 'test_mode',
);
try {
$header = $client->webhooks->headers->retrieve('whk_YdWqVEGKmSYKbsIyDxEab');
var_dump($header);
} catch (APIException $e) {
echo $e->getMessage();
}using System;
using DodoPayments.Client;
using DodoPayments.Client.Models.Webhooks.Headers;
DodoPaymentsClient client = new();
HeaderRetrieveParams parameters = new()
{
WebhookID = "whk_YdWqVEGKmSYKbsIyDxEab"
};
var header = await client.Webhooks.Headers.Retrieve(parameters);
Console.WriteLine(header);use dodopayments::Client;
#[tokio::main]
async fn main() -> dodopayments::Result<()> {
let client = Client::from_env()?;
let webhook_id = "webhook_id";
let result = client
.webhooks()
.headers()
.retrieve()
.webhook_id(webhook_id)
.await?;
println!("{result:?}");
Ok(())
}curl --request GET \
--url https://test.dodopayments.com/webhooks/{webhook_id}/headers \
--header 'Authorization: Bearer <token>'{
"headers": {},
"sensitive": [
"<string>"
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Webhook ID
Response
Webhook headers details retrived.
Last modified on March 25, 2026
Was this page helpful?
⌘I
JavaScript
import DodoPayments from 'dodopayments';
const client = new DodoPayments({
bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted
});
const header = await client.webhooks.headers.retrieve('whk_YdWqVEGKmSYKbsIyDxEab');
console.log(header.headers);import os
from dodopayments import DodoPayments
client = DodoPayments(
bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted
)
header = client.webhooks.headers.retrieve(
"whk_YdWqVEGKmSYKbsIyDxEab",
)
print(header.headers)package main
import (
"context"
"fmt"
"github.com/dodopayments/dodopayments-go"
"github.com/dodopayments/dodopayments-go/option"
)
func main() {
client := dodopayments.NewClient(
option.WithBearerToken("My Bearer Token"),
)
header, err := client.Webhooks.Headers.Get(context.TODO(), "whk_YdWqVEGKmSYKbsIyDxEab")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", header.Headers)
}package com.dodopayments.api.example;
import com.dodopayments.api.client.DodoPaymentsClient;
import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient;
import com.dodopayments.api.models.webhooks.headers.HeaderRetrieveParams;
import com.dodopayments.api.models.webhooks.headers.HeaderRetrieveResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
DodoPaymentsClient client = DodoPaymentsOkHttpClient.fromEnv();
HeaderRetrieveResponse header = client.webhooks().headers().retrieve("whk_YdWqVEGKmSYKbsIyDxEab");
}
}package com.dodopayments.api.example
import com.dodopayments.api.client.DodoPaymentsClient
import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient
import com.dodopayments.api.models.webhooks.headers.HeaderRetrieveParams
import com.dodopayments.api.models.webhooks.headers.HeaderRetrieveResponse
fun main() {
val client: DodoPaymentsClient = DodoPaymentsOkHttpClient.fromEnv()
val header: HeaderRetrieveResponse = client.webhooks().headers().retrieve("whk_YdWqVEGKmSYKbsIyDxEab")
}require "dodopayments"
dodo_payments = Dodopayments::Client.new(
bearer_token: "My Bearer Token",
environment: "test_mode" # defaults to "live_mode"
)
header = dodo_payments.webhooks.headers.retrieve("whk_YdWqVEGKmSYKbsIyDxEab")
puts(header)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Dodopayments\Client;
use Dodopayments\Core\Exceptions\APIException;
$client = new Client(
bearerToken: getenv('DODO_PAYMENTS_API_KEY') ?: 'My Bearer Token',
environment: 'test_mode',
);
try {
$header = $client->webhooks->headers->retrieve('whk_YdWqVEGKmSYKbsIyDxEab');
var_dump($header);
} catch (APIException $e) {
echo $e->getMessage();
}using System;
using DodoPayments.Client;
using DodoPayments.Client.Models.Webhooks.Headers;
DodoPaymentsClient client = new();
HeaderRetrieveParams parameters = new()
{
WebhookID = "whk_YdWqVEGKmSYKbsIyDxEab"
};
var header = await client.Webhooks.Headers.Retrieve(parameters);
Console.WriteLine(header);use dodopayments::Client;
#[tokio::main]
async fn main() -> dodopayments::Result<()> {
let client = Client::from_env()?;
let webhook_id = "webhook_id";
let result = client
.webhooks()
.headers()
.retrieve()
.webhook_id(webhook_id)
.await?;
println!("{result:?}");
Ok(())
}curl --request GET \
--url https://test.dodopayments.com/webhooks/{webhook_id}/headers \
--header 'Authorization: Bearer <token>'{
"headers": {},
"sensitive": [
"<string>"
]
}