Skip to content

Webhooks ​

A webhook sends a message to your own system when a customer pays or is refunded. You can use it to sync payments with your accounting, a spreadsheet, Zapier, Make or your own code.

Get started ​

Webhooks can't be turned on in the app yet. Contact support to set them up, change them or remove them. Tell us:

  • The URL to send the webhooks to. It must start with https://
  • Which events you want: payment.succeeded, payment.refunded or both

You get a secret that starts with whsec_. Use it to check that the webhooks come from Peach. Keep the secret private.

Events ​

  • payment.succeeded: a customer paid with card, Swish, Klarna or another payment method. This includes memberships, also each renewal.
  • payment.refunded: a customer got a refund, in full or in part.

Bookings that are not paid with a payment method do not send a webhook. For example a booking with a loyalty card, a membership or a free booking.

Example ​

json
{
  "id": "Xb2kP9_Jq81sLm_succeeded",
  "type": "payment.succeeded",
  "version": 1,
  "created": "2026-11-16T09:12:44.512Z",
  "data": {
    "id": "Xb2kP9",
    "created": "2026-11-16T09:12:41.000Z",
    "currency": "SEK",
    "amount": "250.00",
    "refundedAmount": "0.00",
    "refunded": false,
    "lineItems": [
      {
        "id": "li_7Hq2",
        "type": "activity",
        "itemId": "c8Kd2",
        "description": "Morning yoga",
        "quantity": 1,
        "amount": "250.00",
        "refundedAmount": "0.00",
        "refunded": false,
        "taxRateId": "tax_SE_6"
      }
    ],
    "customer": {
      "id": "u_29Fk",
      "name": "Alex Andersson",
      "email": "alex@example.com",
      "phoneNumber": null
    }
  }
}

Fields ​

  • id: the id of the webhook. It is the same if we send the same webhook again.
  • type: payment.succeeded or payment.refunded.
  • version: the format of the webhook. It only changes if we remove or rename a field.
  • created: when the event happened.
  • data.created: when the customer paid.
  • amount and refundedAmount: text with a dot and no thousands separator, for example "1000000.00". refundedAmount is the total refunded so far.
  • refunded: true when the payment, or the line item, is refunded in full.
  • currency: for example SEK or EUR.
  • lineItems[].type: activity, product, loyaltyCard, membership or paymentRequest.
  • lineItems[].itemId: the id of the activity, product, loyalty card or membership. For an activity the page is https://peach.nu/activities/{itemId}.
  • lineItems[].taxRateId: the VAT rate, for example tax_SE_25 for 25% VAT.
  • customer: null if the payment has no customer with a name and email, for example a Tap to Pay payment.

We can add new fields, events and line item types without a new version. Make your system ignore what it does not know.

Check the signature ​

Each webhook has the headers webhook-id, webhook-timestamp and webhook-signature. They follow the Standard Webhooks format. Use a library for your language to check the signature with your secret, for example standardwebhooks.

Answer and retries ​

  • Answer with a status code 200–299 in 15 seconds.
  • If your system does not answer, we try again 7 times over about 2 hours.
  • Your system can get the same webhook more than once. Use id to find duplicates.
  • Webhooks can come in a different order than the events happened. Each webhook contains the full payment, thus you can save the latest version.

Good to know ​

  • A partial refund also sends payment.refunded. refundedAmount shows the total refunded.
  • Spreadsheets with Swedish settings can read "250.00" as text. Change the decimal separator in the import if you need it.