Skip to main content

Endpoint

POST https://pay.sandbox.yabetoopay.com/v1/account/{accountId}/webhooks   # Sandbox
POST https://pay.api.yabetoopay.com/v1/account/{accountId}/webhooks       # Production

Authentication

Use your secret key in the Authorization header:
Authorization: Bearer YOUR_SECRET_KEY

Path Parameters

ParameterTypeDescription
accountIdstringYour account ID

Request Body

ParameterTypeRequiredDescription
urlstringYesWebhook endpoint URL
descriptionstringNoDescription of the webhook
enabled_eventsarrayYesList of events to receive
metadataobjectNoCustom data

Example Request

curl -X POST https://pay.sandbox.yabetoopay.com/v1/account/YOUR_ACCOUNT_ID/webhooks \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_SECRET_KEY" \
  -d '{
    "url": "https://example.com/webhooks",
    "description": "Production webhook",
    "enabled_events": [
      "intent.completed",
      "disbursement.completed"
    ],
    "metadata": {
      "environment": "production"
    }
  }'

Response

200 OK

{
  "id": "whk_123456789",
  "object": "webhook",
  "url": "https://example.com/webhooks",
  "description": "Production webhook",
  "status": "active",
  "secret": "whsec_XXXXXXXXXXXXXXXXXXXXXXXX",
  "enabled_events": [
    "intent.completed",
    "disbursement.completed"
  ],
  "metadata": {
    "environment": "production"
  },
  "created_at": "2023-05-12T10:12:32Z"
}

Available Events

EventDescription
intent.completedPayment successfully received
disbursement.completedDisbursement successfully processed

400 Bad Request

{
  "errors": [
    {
      "rule": "required",
      "field": "url",
      "message": "required validation failed"
    }
  ]
}

401 Unauthorized

{
  "message": "Unauthorized"
}
Keep the webhook secret safe. It is required to verify the authenticity of received notifications.