Skip to content

Webhooks API

POST /api/v1/webhooks
Authorization: Bearer <admin_token>
{
"url": "https://your-app.com/webhooks/rcommerce",
"events": ["order.paid", "order.shipped", "payment.succeeded"],
"secret": "your-webhook-secret"
}
GET /api/v1/webhooks
Authorization: Bearer <admin_token>
DELETE /api/v1/webhooks/:id
Authorization: Bearer <admin_token>
EventDescription
order.createdNew order placed
order.paidPayment confirmed
order.shippedFulfillment created
order.completedOrder marked complete
order.cancelledOrder cancelled
order.refundedRefund processed
payment.succeededPayment confirmed
payment.failedPayment declined
product.createdNew product added
product.updatedProduct modified
customer.createdNew customer registered
{
"event": "order.paid",
"timestamp": "2024-01-01T12:00:00Z",
"data": {
"order_id": "uuid",
"order_number": "ORD-2024-001",
"total": 150.00,
"currency": "USD"
}
}

Webhooks are signed with HMAC-SHA256. Verify the X-Webhook-Signature header:

const crypto = require('crypto');
const signature = crypto.createHmac('sha256', webhookSecret)
.update(rawBody)
.digest('hex');
// Compare with X-Webhook-Signature header

Failed webhooks are retried with exponential backoff:

  • 1st retry: 1 minute
  • 2nd retry: 5 minutes
  • 3rd retry: 30 minutes
  • Max retries: 3