Skip to content

The Webhook Object

A webhook is an HTTPS endpoint on your server that YouCan Pay calls when an event happens in your account. See Webhooks for the payload your endpoint receives and how to verify it.

Required scope (OAuth only): view-webhooks

Attributes

ParameterTypeDescription
objectstringAlways v2.webhook.
idstringThe unique identifier for the webhook.
urlstringThe HTTPS URL notifications are delivered to.
is_live_modebooleanWhether the webhook receives live notifications. Webhooks created through this API are always live.
enabled_eventsstring|nullA JSON-encoded array of the events this webhook is subscribed to. null means every event.
created_atstring|nullDate and time the webhook was created.

WARNING

enabled_events is returned as a JSON-encoded string, not an array, so it needs decoding before use.

Available Events

EventDescription
transaction.paidA transaction was paid.
transaction.failedA transaction failed.
transaction.refundedA transaction was refunded.
withdrawal.createdA withdrawal was created.

Request

Endpoint: https://youcanpay.com/api/v2/webhooks/{webhook_id}Method: GET

bash
$ curl --location -g --request GET 'https://youcanpay.com/api/v2/webhooks/9b1f2c34-5d6e-4a7b-8c9d-0e1f2a3b4c5d' \
  --header 'Accept: application/json' \
  -u 'YOUR_PRIVATE_KEY:'

Response

json
{
  "object": "v2.webhook",
  "id": "9b1f2c34-5d6e-4a7b-8c9d-0e1f2a3b4c5d",
  "url": "https://example.com/webhooks/youcan-pay",
  "is_live_mode": true,
  "enabled_events": "[\"transaction.paid\",\"transaction.refunded\"]",
  "created_at": "2026-09-09 11:04:22"
}