List webhook endpoints.
Scopes: webhooks:read webhooks:write
package main
import(
"context"
"os"
polargo "github.com/polarsource/polar-go"
"github.com/polarsource/polar-go/models/operations"
"log"
)
func main() {
ctx := context.Background()
s := polargo.New(
polargo.WithSecurity(os.Getenv("POLAR_ACCESS_TOKEN")),
)
res, err := s.Webhooks.ListWebhookEndpoints(ctx, polargo.Pointer(operations.CreateQueryParamOrganizationIDStr(
"1dbfc517-0bbf-4301-9ba8-555ca42b9737",
)), polargo.Pointer[int64](1), polargo.Pointer[int64](10))
if err != nil {
log.Fatal(err)
}
if res.ListResourceWebhookEndpoint != nil {
for {
// handle items
res, err = res.Next()
if err != nil {
// handle error
}
if res == nil {
break
}
}
}
}{
"items": [
{
"created_at": "2023-11-07T05:31:56Z",
"modified_at": "2023-11-07T05:31:56Z",
"id": "<string>",
"url": "<string>",
"format": "raw",
"secret": "<string>",
"organization_id": "<string>",
"events": [
"checkout.created"
],
"enabled": true
}
],
"pagination": {
"total_count": 123,
"max_page": 123
}
}You can generate an Organization Access Token from your organization's settings.
Filter by organization ID.
"1dbfc517-0bbf-4301-9ba8-555ca42b9737"
Page number, defaults to 1.
Size of a page, defaults to 10. Maximum is 100.
Successful Response
Show child attributes
Creation timestamp of the object.
Last modification timestamp of the object.
The ID of the object.
The URL where the webhook events will be sent.
1 - 2083The format of the webhook payload.
raw, discord, slack The secret used to sign the webhook events.
The organization ID associated with the webhook endpoint.
The events that will trigger the webhook.
checkout.created, checkout.updated, customer.created, customer.updated, customer.deleted, customer.state_changed, customer_seat.assigned, customer_seat.claimed, customer_seat.revoked, order.created, order.updated, order.paid, order.refunded, subscription.created, subscription.updated, subscription.active, subscription.canceled, subscription.uncanceled, subscription.revoked, refund.created, refund.updated, product.created, product.updated, benefit.created, benefit.updated, benefit_grant.created, benefit_grant.cycled, benefit_grant.updated, benefit_grant.revoked, organization.updated Whether the webhook endpoint is enabled and will receive events.
Was this page helpful?
package main
import(
"context"
"os"
polargo "github.com/polarsource/polar-go"
"github.com/polarsource/polar-go/models/operations"
"log"
)
func main() {
ctx := context.Background()
s := polargo.New(
polargo.WithSecurity(os.Getenv("POLAR_ACCESS_TOKEN")),
)
res, err := s.Webhooks.ListWebhookEndpoints(ctx, polargo.Pointer(operations.CreateQueryParamOrganizationIDStr(
"1dbfc517-0bbf-4301-9ba8-555ca42b9737",
)), polargo.Pointer[int64](1), polargo.Pointer[int64](10))
if err != nil {
log.Fatal(err)
}
if res.ListResourceWebhookEndpoint != nil {
for {
// handle items
res, err = res.Next()
if err != nil {
// handle error
}
if res == nil {
break
}
}
}
}{
"items": [
{
"created_at": "2023-11-07T05:31:56Z",
"modified_at": "2023-11-07T05:31:56Z",
"id": "<string>",
"url": "<string>",
"format": "raw",
"secret": "<string>",
"organization_id": "<string>",
"events": [
"checkout.created"
],
"enabled": true
}
],
"pagination": {
"total_count": 123,
"max_page": 123
}
}