curl --request POST \
--url https://ucsyxzpdbnuyehizezvb.supabase.co/functions/v1/doglytdc-pay/v1/webhooks \
-u "$DPAY_CLIENT_ID:$DPAY_CLIENT_SECRET" \
-H "Content-Type: application/json" \
-d '{"url":"https://minhaloja.com/webhooks/doglytdc","events":["purchase_approved"]}'
{
"data": {
"id": "c7d8e9f0-1a2b-4c3d-8e9f-0a1b2c3d4e5f",
"name": "Minha loja",
"url": "https://minhaloja.com/webhooks/doglytdc",
"events": [
"purchase_approved"
],
"active": true,
"created_at": "2026-11-06T18:10:00Z"
},
"secret": "whsec_8f3b…"
}
{ "error": "unauthorized", "message": "Chave de API inválida." }
{ "error": "insufficient_scope", "message": "Esta chave precisa dos escopos: write, webhooks." }
API reference
Create Webhook
Creates a webhook for the chosen events.
POST
/
functions
/
v1
/
doglytdc-pay
/
v1
/
webhooks
curl --request POST \
--url https://ucsyxzpdbnuyehizezvb.supabase.co/functions/v1/doglytdc-pay/v1/webhooks \
-u "$DPAY_CLIENT_ID:$DPAY_CLIENT_SECRET" \
-H "Content-Type: application/json" \
-d '{"url":"https://minhaloja.com/webhooks/doglytdc","events":["purchase_approved"]}'
{
"data": {
"id": "c7d8e9f0-1a2b-4c3d-8e9f-0a1b2c3d4e5f",
"name": "Minha loja",
"url": "https://minhaloja.com/webhooks/doglytdc",
"events": [
"purchase_approved"
],
"active": true,
"created_at": "2026-11-06T18:10:00Z"
},
"secret": "whsec_8f3b…"
}
{ "error": "unauthorized", "message": "Chave de API inválida." }
{ "error": "insufficient_scope", "message": "Esta chave precisa dos escopos: write, webhooks." }
Scope
write webhooks
What it does
Creates a webhook for the chosen events. The signingsecret is returned only in this response.
Use cases
- Receive approved sales in your system
- Automate product delivery
One or more of:
purchase_approved, pix_generated, purchase_refunded, subscription_created, subscription_renewed, subscription_canceled, withdrawal_paid, withdrawal_failed, affiliate_approved.Response
Errors
| Status | Description |
|---|---|
400 | invalid_url (must be public https) or invalid_events. |
401 | Invalid or revoked key. |
403 | Missing scopes (insufficient_scope). |
429 | Rate limit exceeded (rate_limited). |
curl --request POST \
--url https://ucsyxzpdbnuyehizezvb.supabase.co/functions/v1/doglytdc-pay/v1/webhooks \
-u "$DPAY_CLIENT_ID:$DPAY_CLIENT_SECRET" \
-H "Content-Type: application/json" \
-d '{"url":"https://minhaloja.com/webhooks/doglytdc","events":["purchase_approved"]}'
{
"data": {
"id": "c7d8e9f0-1a2b-4c3d-8e9f-0a1b2c3d4e5f",
"name": "Minha loja",
"url": "https://minhaloja.com/webhooks/doglytdc",
"events": [
"purchase_approved"
],
"active": true,
"created_at": "2026-11-06T18:10:00Z"
},
"secret": "whsec_8f3b…"
}
{ "error": "unauthorized", "message": "Chave de API inválida." }
{ "error": "insufficient_scope", "message": "Esta chave precisa dos escopos: write, webhooks." }

