Skip to content
Install free on Shopify

Custom webhooks

Custom webhooks post booking events as JSON to URLs you choose. For the Shopify webhooks Rentshelf receives, see Webhooks & data.

  1. Open Rentshelf → Settings → Custom webhooks.
  2. Under Add an endpoint, enter a public https:// Endpoint URL. Private, local and internal addresses are rejected and redirects are not followed.
  3. Optionally add a Description.
  4. Choose the events, then select Add endpoint.
  5. Copy the Signing secret right away. It is shown once; use Rotate secret to create a new one.
  6. Select Send test event to check your receiver.

A store can have up to 10 endpoints. Each endpoint can be edited, disabled, enabled or deleted.

EventSent when
booking.createdA rental is booked (paid checkout, manual booking or API).
booking.updatedDates, units or details change, or the booking is rescheduled.
booking.cancelledA booking is cancelled.
booking.picked_upThe customer picks up the rental (status becomes active).
booking.returnedThe rental is returned.
booking.overdueAn active rental passed its return date without being returned.

Send test event sends a ping event.

Each delivery is a POST with Content-Type: application/json and these headers:

  • Rentshelf-Signature — t=<unix seconds>,v1=<signature>
  • Rentshelf-Event — the event name
  • Rentshelf-Delivery — the delivery ID

The body contains an id (a stable evt_... event ID), type, created_at, shop and data.object with the booking. Status events also include data.previous_status. The full booking fields are in the API reference.

v1 is the hex HMAC-SHA256 of <timestamp>.<raw body> using the signing secret. Reject requests whose timestamp is more than 5 minutes old. Node.js example:

import { createHmac, timingSafeEqual } from "node:crypto";
export function verifyRentshelf(rawBody, header, secret) {
const parts = Object.fromEntries(
(header || "").split(",").map((p) => {
const i = p.indexOf("=");
return [p.slice(0, i).trim(), p.slice(i + 1).trim()];
}),
);
const timestamp = Number(parts.t);
if (!Number.isInteger(timestamp) || !parts.v1) return false;
if (Math.abs(Date.now() / 1000 - timestamp) > 300) return false;
const expected = createHmac("sha256", secret)
.update(`${timestamp}.${rawBody}`, "utf8")
.digest("hex");
const a = Buffer.from(expected);
const b = Buffer.from(parts.v1);
return a.length === b.length && timingSafeEqual(a, b);
}

Use the raw request body, not re-serialized JSON.

Respond with a 2xx status within 10 seconds. A failed delivery is retried up to 6 attempts in total, after about 1 minute, 5 minutes, 30 minutes, 2 hours and 8 hours. Deliveries can arrive more than once or out of order, so deduplicate on the event id.

After 25 consecutive failed deliveries, the endpoint is disabled automatically. Fix the receiver and select Enable. The Delivery log shows the latest 50 deliveries with status, attempts, HTTP status and the last error.