Webhooks
Lấy chi tiết Webhook
Lấy thông tin chi tiết về một webhook cụ thể.
GET
/
webhooks
/
{webhook_id}
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 webhookDetails = await client.webhooks.retrieve('whk_YdWqVEGKmSYKbsIyDxEab');
console.log(webhookDetails.id);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
)
webhook_details = client.webhooks.retrieve(
"whk_YdWqVEGKmSYKbsIyDxEab",
)
print(webhook_details.id)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"),
)
webhookDetails, err := client.Webhooks.Get(context.TODO(), "whk_YdWqVEGKmSYKbsIyDxEab")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", webhookDetails.ID)
}
package com.dodopayments.api.example;
import com.dodopayments.api.client.DodoPaymentsClient;
import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient;
import com.dodopayments.api.models.webhooks.WebhookDetails;
import com.dodopayments.api.models.webhooks.WebhookRetrieveParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
DodoPaymentsClient client = DodoPaymentsOkHttpClient.fromEnv();
WebhookDetails webhookDetails = client.webhooks().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.WebhookDetails
import com.dodopayments.api.models.webhooks.WebhookRetrieveParams
fun main() {
val client: DodoPaymentsClient = DodoPaymentsOkHttpClient.fromEnv()
val webhookDetails: WebhookDetails = client.webhooks().retrieve("whk_YdWqVEGKmSYKbsIyDxEab")
}require "dodopayments"
dodo_payments = Dodopayments::Client.new(
bearer_token: "My Bearer Token",
environment: "test_mode" # defaults to "live_mode"
)
webhook_details = dodo_payments.webhooks.retrieve("whk_YdWqVEGKmSYKbsIyDxEab")
puts(webhook_details)<?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 {
$webhookDetails = $client->webhooks->retrieve('whk_YdWqVEGKmSYKbsIyDxEab');
var_dump($webhookDetails);
} catch (APIException $e) {
echo $e->getMessage();
}using System;
using DodoPayments.Client;
using DodoPayments.Client.Models.Webhooks;
DodoPaymentsClient client = new();
WebhookRetrieveParams parameters = new()
{
WebhookID = "whk_YdWqVEGKmSYKbsIyDxEab"
};
var webhookDetails = await client.Webhooks.Retrieve(parameters);
Console.WriteLine(webhookDetails);use dodopayments::Client;
#[tokio::main]
async fn main() -> dodopayments::Result<()> {
let client = Client::from_env()?;
let webhook_id = "webhook_id";
let result = client
.webhooks()
.retrieve()
.webhook_id(webhook_id)
.await?;
println!("{result:?}");
Ok(())
}curl --request GET \
--url https://test.dodopayments.com/webhooks/{webhook_id} \
--header 'Authorization: Bearer <token>'{
"created_at": "<string>",
"description": "<string>",
"id": "<string>",
"metadata": {},
"updated_at": "<string>",
"url": "<string>",
"disabled": true,
"filter_types": [
"<string>"
],
"rate_limit": 1
}Ủy quyền
Send your API key as a bearer token: Authorization: Bearer <api_key>. A test mode key starts with dodo_test_, for example dodo_test_AbCd1234EfGh5678.<secret>. A live mode key starts with dodo_live_. Use a test mode key on test.dodopayments.com and a live mode key on live.dodopayments.com. Keys from before these tags have no tag and operate as before.
Phản hồi
Webhook details retrived.
Lần sửa đổi cuối 17 tháng 8, 2026
Trang này có hữu ích không?
⌘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 webhookDetails = await client.webhooks.retrieve('whk_YdWqVEGKmSYKbsIyDxEab');
console.log(webhookDetails.id);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
)
webhook_details = client.webhooks.retrieve(
"whk_YdWqVEGKmSYKbsIyDxEab",
)
print(webhook_details.id)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"),
)
webhookDetails, err := client.Webhooks.Get(context.TODO(), "whk_YdWqVEGKmSYKbsIyDxEab")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", webhookDetails.ID)
}
package com.dodopayments.api.example;
import com.dodopayments.api.client.DodoPaymentsClient;
import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient;
import com.dodopayments.api.models.webhooks.WebhookDetails;
import com.dodopayments.api.models.webhooks.WebhookRetrieveParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
DodoPaymentsClient client = DodoPaymentsOkHttpClient.fromEnv();
WebhookDetails webhookDetails = client.webhooks().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.WebhookDetails
import com.dodopayments.api.models.webhooks.WebhookRetrieveParams
fun main() {
val client: DodoPaymentsClient = DodoPaymentsOkHttpClient.fromEnv()
val webhookDetails: WebhookDetails = client.webhooks().retrieve("whk_YdWqVEGKmSYKbsIyDxEab")
}require "dodopayments"
dodo_payments = Dodopayments::Client.new(
bearer_token: "My Bearer Token",
environment: "test_mode" # defaults to "live_mode"
)
webhook_details = dodo_payments.webhooks.retrieve("whk_YdWqVEGKmSYKbsIyDxEab")
puts(webhook_details)<?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 {
$webhookDetails = $client->webhooks->retrieve('whk_YdWqVEGKmSYKbsIyDxEab');
var_dump($webhookDetails);
} catch (APIException $e) {
echo $e->getMessage();
}using System;
using DodoPayments.Client;
using DodoPayments.Client.Models.Webhooks;
DodoPaymentsClient client = new();
WebhookRetrieveParams parameters = new()
{
WebhookID = "whk_YdWqVEGKmSYKbsIyDxEab"
};
var webhookDetails = await client.Webhooks.Retrieve(parameters);
Console.WriteLine(webhookDetails);use dodopayments::Client;
#[tokio::main]
async fn main() -> dodopayments::Result<()> {
let client = Client::from_env()?;
let webhook_id = "webhook_id";
let result = client
.webhooks()
.retrieve()
.webhook_id(webhook_id)
.await?;
println!("{result:?}");
Ok(())
}curl --request GET \
--url https://test.dodopayments.com/webhooks/{webhook_id} \
--header 'Authorization: Bearer <token>'{
"created_at": "<string>",
"description": "<string>",
"id": "<string>",
"metadata": {},
"updated_at": "<string>",
"url": "<string>",
"disabled": true,
"filter_types": [
"<string>"
],
"rate_limit": 1
}