Webhooks API
Manage webhook endpoints for your store.
List Webhooks
http
GET /api/external/v1/webhooksExample Request
bash
curl -X GET "https://yourstore.pixlpay.net/api/external/v1/webhooks" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Accept: application/json"Response
json
{
"success": true,
"data": [
{
"id": 1,
"url": "https://yourapp.com/webhooks/pixlpay",
"events": ["order.created", "order.paid", "order.completed"],
"is_active": true,
"created_at": "2025-01-15T10:00:00Z"
}
]
}Create Webhook
http
POST /api/external/v1/webhooksRequest Body
| Field | Type | Required | Description |
|---|---|---|---|
url | string | Yes | HTTPS endpoint URL |
events | array | Yes | Events to subscribe to |
Example Request
bash
curl -X POST "https://yourstore.pixlpay.net/api/external/v1/webhooks" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"url": "https://yourapp.com/webhooks/pixlpay",
"events": ["order.created", "order.paid", "order.completed"]
}'Response
json
{
"success": true,
"data": {
"id": 1,
"url": "https://yourapp.com/webhooks/pixlpay",
"events": ["order.created", "order.paid", "order.completed"],
"is_active": true,
"secret": "whsec_abc123def456...",
"created_at": "2025-01-20T15:00:00Z"
},
"message": "Webhook created successfully"
}Important
Save the secret immediately - it's only shown once! Use it to verify webhook signatures.
Get Single Webhook
http
GET /api/external/v1/webhooks/{id}Update Webhook
http
PUT /api/external/v1/webhooks/{id}Request Body
json
{
"url": "https://newurl.com/webhooks",
"events": ["order.created"],
"is_active": false
}Delete Webhook
http
DELETE /api/external/v1/webhooks/{id}Example Request
bash
curl -X DELETE "https://yourstore.pixlpay.net/api/external/v1/webhooks/1" \
-H "Authorization: Bearer YOUR_TOKEN"Response
json
{
"success": true,
"message": "Webhook deleted successfully"
}Test Webhook
Send a test payload to your endpoint.
http
POST /api/external/v1/webhooks/{id}/testExample Request
bash
curl -X POST "https://yourstore.pixlpay.net/api/external/v1/webhooks/1/test" \
-H "Authorization: Bearer YOUR_TOKEN"Response
json
{
"success": true,
"data": {
"delivered": true,
"response_code": 200,
"response_time_ms": 150
},
"message": "Test webhook delivered successfully"
}Webhook Object
| Field | Type | Description |
|---|---|---|
id | integer | Unique identifier |
url | string | Endpoint URL |
events | array | Subscribed events |
is_active | boolean | Whether webhook is active |
secret | string | Signing secret (only on create) |
created_at | string | ISO 8601 timestamp |
Errors
| Status | Error | Description |
|---|---|---|
| 401 | Unauthorized | Invalid or missing token |
| 403 | Forbidden | Token lacks required scope |
| 404 | Not Found | Webhook doesn't exist |
| 422 | Unprocessable | Invalid URL or events |
