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
Parameter Type Description accountIdstringYour account ID
Request Body
Parameter Type Required Description urlstringYes Webhook endpoint URL descriptionstringNo Description of the webhook enabled_eventsarrayYes List of events to receive metadataobjectNo Custom data
Example Request
cURL
JavaScript
Python
PHP
Java
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
Event Description 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.