Skip to content

Wunder V1 Webhooks Mapping

This document provides a mapping of workflows that are triggered by webhooks from WunderV1. And will bring light on which webhooks are nneded to be migrated to WunderV2.

General Architecture

The standard flow for these webhooks is as follows:

  1. WunderV1 sends a webhook event.
  2. Hookdeck receives the webhook.
  3. Hookdeck forwards the request to our webhooks-api after filter or transformations if needed.
  4. The request to webhooks-api is authenticated using an x-api-key header and the action executed in there.

WunderV1 Webhook Triggers

Here is a list of all unique WunderV1 webhook triggers found in this document:

  • "backend\models\CreditNote::afterInsert"
  • "backend\models\Fee::afterInsert"
  • "backend\models\Invoice::afterUpdate"
  • "backend\modules\pass\models\CustomerPass::afterInsert"
  • "backend\modules\subscription\models\CustomerSubscription::afterInsert"
  • "frontend\models\Customer::afterInsert"
  • "openSuccessful"
  • "reservationEnd"
  • "reservationStart"
  • backend\models\PaymentRefund::afterInsert

Workflows

Braze notifications refunds

  • Description: Not Used -> calls the mock endpoint in Hookdeck.
  • WunderV1 Webhook Trigger: backend\models\PaymentRefund::afterInsert.
  • webhooks-api Endpoint: NA.
    • URL: NA
    • Method: POST
  • Authentication:
    • Method: Header-based API Key.
    • Header Name: x-api-key.
  • Hookdeck:

Invoice queue for fees.

  • Description: Get every new fee and trigger the adding of the customer to the invoice queue in Wunder.
  • WunderV1 Webhook Trigger: "backend\\models\\Fee::afterInsert".
  • webhooks-api Endpoint: add-to-invoice-queue.
    • URL: https://webhooks-api-wlto4pvcsq-nw.a.run.app/wunder/invoices/add-to-invoice-queue
    • Method: POST
  • Authentication:
    • Method: Header-based API Key.
    • Header Name: x-api-key.
  • Hookdeck:

Invoice queue for credit notes.

  • Description: Get every new credit note and trigger the adding of the customer to the invoice queue in Wunder.
  • WunderV1 Webhook Trigger: "backend\\models\\CreditNote::afterInsert".
  • webhooks-api Endpoint: add-to-invoice-queue.
    • URL: https://webhooks-api-wlto4pvcsq-nw.a.run.app/wunder/invoices/add-to-invoice-queue
    • Method: POST
  • Authentication:
    • Method: Header-based API Key.
    • Header Name: x-api-key.
  • Hookdeck:

Send bundle purchased events to HF-API.

  • Description: send the bundle purchased event ot HF-API for... .
  • WunderV1 Webhook Trigger: "backend\\modules\\pass\\models\\CustomerPass::afterInsert".
  • webhooks-api Endpoint: add-to-invoice-queue.
    • URL: https://api.forest.me/v1/hookdeck/bundle-purchase-event
    • Method: POST
  • Authentication:
    • Method: Header-based API Key.
    • Header Name: x-api-key.
  • Hookdeck:

Track bundle purchased to braze.

  • Description: send the bundle purchased event to webhooks-api with is sending it to braze.
  • WunderV1 Webhook Trigger: "backend\\modules\\pass\\models\\CustomerPass::afterInsert".
  • webhooks-api Endpoint: braze-events/bundle-purchase.
    • URL: https://webhooks-api-wlto4pvcsq-nw.a.run.app/braze-events/bundle-purchase
    • Method: POST
  • Authentication:
    • Method: Header-based API Key.
    • Header Name: x-api-key.
  • Hookdeck:

Track subscriptions purchased to braze.

  • Description: send the subscription purchased event to webhooks-api with is sending it to braze.
  • WunderV1 Webhook Trigger: "backend\\modules\\subscription\\models\\CustomerSubscription::afterInsert".
  • webhooks-api Endpoint: braze-events/subscription-purchase.
    • URL: https://webhooks-api-wlto4pvcsq-nw.a.run.app/braze-events/subscription-purchase
    • Method: POST
  • Authentication:
    • Method: Header-based API Key.
    • Header Name: x-api-key.
  • Hookdeck:

Credit vouchers for dynamic free minutes.

  • Description: creates the credit voucher for customers based on credits assigned to bikes.
  • WunderV1 Webhook Trigger: "openSuccessful".
  • webhooks-api Endpoint: /wunder/credit_vouchers/dynamic-free-minutes.
    • URL: https://webhooks-api-1082888434143.europe-west2.run.app/wunder/credit_vouchers/dynamic-free-minutes
    • Method: POST
  • Authentication:
    • Method: Header-based API Key.
    • Header Name: x-api-key.
  • Hookdeck:

Update reservation end time.

  • Description: Once the reservation is Open successfuly, the reservation.end_time data in Forest must be update to the new value (null after the openSuccessful event).
  • WunderV1 Webhook Trigger: "openSuccessful".
  • webhooks-api Endpoint: /wunder/reservations/update-end-time.
    • URL: https://webhooks-api-1082888434143.europe-west2.run.app/wunder/reservations/update-end-time
    • Method: POST
  • Authentication:
    • Method: Header-based API Key.
    • Header Name: x-api-key.
  • Hookdeck:

Track openSuccessful event to amplitud.

  • Description: Once the reservation is Open successfuly webhooks-api send a new event to amplitud for this action.
  • WunderV1 Webhook Trigger: "openSuccessful".
  • webhooks-api Endpoint: /amplitud-events.
    • URL: https://webhooks-api-1082888434143.europe-west2.run.app/amplitud-events
    • Method: POST
  • Authentication:
    • Method: Header-based API Key.
    • Header Name: x-api-key.
  • Hookdeck:

Track passes and Subscription events to Amplitud.

  • Description: on eny new subscription or bundle purchase send an event to Amplitud.
  • WunderV1 Webhook Trigger: ["backend\\modules\\pass\\models\\CustomerPass::afterInsert", "backend\\modules\\pass\\models\\CustomerSubscription::afterInsert"].
  • webhooks-api Endpoint: /2/httpapi.
    • URL: https://api.eu.amplitude.com/2/httpapi
    • Method: POST
  • Authentication:
    • Method: Header-based API Key.
    • Header Name: x-api-key.
  • Hookdeck:

Add vehicle type to reservation as note.

  • Description: at reservation start we add the vehicle type ot it by a note.
  • WunderV1 Webhook Trigger: "reservationStart".
  • webhooks-api Endpoint: /wunder/reservations/add-vehicle-type-to-reservation.
    • URL: https://webhooks-api-wlto4pvcsq-nw.a.run.app/wunder/reservations/add-vehicle-type-to-reservation
    • Method: POST
  • Authentication:
    • Method: Header-based API Key.
    • Header Name: x-api-key.
  • Hookdeck:

Track reservationStart event to Amplitud via webhooks-api.

  • Description: at reservation start we add the vehicle type ot it by a note.
  • WunderV1 Webhook Trigger: "reservationStart".
  • webhooks-api Endpoint: /amplitud-events.
    • URL: https://webhooks-api-1082888434143.europe-west2.run.app/amplitud-events
    • Method: POST
  • Authentication:
    • Method: Header-based API Key.
    • Header Name: x-api-key.
  • Hookdeck:

Store new reservation in Forest DB.

  • Description: at reservation start we store the reservation info in a table used to save historical data of reservations and also provides a table with current active reservations.
  • WunderV1 Webhook Trigger: "reservationStart".
  • webhooks-api Endpoint: /wunder/active_reservations_notifications/cache.
    • URL: https://webhooks-api-wlto4pvcsq-nw.a.run.app/wunder/active_reservations_notifications/cache
    • Method: POST
  • Authentication:
    • Method: Header-based API Key.
    • Header Name: x-api-key.
  • Hookdeck:

Retry failed invoice payments.

  • Description: After 1 day of delay (configured in hookdeck) the webhooks-api will receive the request to retry the payment, the events are being filtered in hookdeck aswell to only allow to pass the ones with a failed status.
  • WunderV1 Webhook Trigger: "backend\\models\\Invoice::afterUpdate".
  • webhooks-api Endpoint: /wunder/invoices/trigger-payment.
    • URL: https://webhooks-api-wlto4pvcsq-nw.a.run.app/wunder/invoices/trigger-payment
    • Method: POST
  • Authentication:
    • Method: Header-based API Key.
    • Header Name: x-api-key.
  • Hookdeck:

Update dynamic free minutes assigned to a bike.

  • Description: Once a reservation end, the bike is re-assigned with credits according to the Free Minutes Engine.
  • WunderV1 Webhook Trigger: "reservationEnd".
  • webhooks-api Endpoint: /wunder/vehicles/update-dynamic-free-minutes.
    • URL: https://webhooks-api-wlto4pvcsq-nw.a.run.app/wunder/vehicles/update-dynamic-free-minutes
    • Method: POST
  • Authentication:
    • Method: Header-based API Key.
    • Header Name: x-api-key.
  • Hookdeck:

NPA check and notify.

  • Description: Verify where a reservation is ending. if is an NPA create a notification sent to #alerts-reservation Slack channel.
  • WunderV1 Webhook Trigger: "reservationEnd".
  • webhooks-api Endpoint: /npa-check-and-notify.
    • URL: https://webhooks-api-wlto4pvcsq-nw.a.run.app/npa-check-and-notify
    • Method: POST
  • Authentication:
    • Method: Header-based API Key.
    • Header Name: x-api-key.
  • Hookdeck:

Track reservarionEnd event to amplitud.

  • Description: Sent the events to Amplitud.
  • WunderV1 Webhook Trigger: "reservationEnd".
  • webhooks-api Endpoint: /amplitud-events.
    • URL: https://webhooks-api-1082888434143.europe-west2.run.app/amplitud-events
    • Method: POST
  • Authentication:
    • Method: Header-based API Key.
    • Header Name: x-api-key.
  • Hookdeck:

Track short unsuccessful reservations.

  • Description: Verify short reservations.
  • WunderV1 Webhook Trigger: "reservationEnd".
  • webhooks-api Endpoint: /wunder/reservations/track-short-reservations.
    • URL: https://webhooks-api-wlto4pvcsq-nw.a.run.app/wunder/reservations/track-short-reservations
    • Method: POST
  • Authentication:
    • Method: Header-based API Key.
    • Header Name: x-api-key.
  • Hookdeck:

Process reservation End

  • Description: Once reservation end, the reservation is procesed to check if a refund is needed or just trigger the invoice creation for the customer.
  • WunderV1 Webhook Trigger: "reservationEnd".
  • webhooks-api Endpoint: /wunder/invoices/add-to-invoice-queue.
    • URL: https://webhooks-api-wlto4pvcsq-nw.a.run.app/wunder/invoices/add-to-invoice-queue
    • Method: POST
  • Authentication:
    • Method: Header-based API Key.
    • Header Name: x-api-key.
  • Hookdeck:

Automatic damage report

  • Description: Once reservation end cehck if it was successfully and create a report as result.
  • WunderV1 Webhook Trigger: "reservationEnd".
  • webhooks-api Endpoint: /wunder/reservations/damage-report.
    • URL: https://webhooks-api-1082888434143.europe-west2.run.app/wunder/reservations/damage-report
    • Method: POST
  • Authentication:
    • Method: Header-based API Key.
    • Header Name: x-api-key.
  • Hookdeck:

Removed cached reservation

  • Description: Once reservation end remove the resertavion from active reservations table.
  • WunderV1 Webhook Trigger: "reservationEnd".
  • webhooks-api Endpoint: /wunder/active_reservations_notifications/remove_cached_reservation.
    • URL: https://webhooks-api-wlto4pvcsq-nw.a.run.app/wunder/active_reservations_notifications/remove_cached_reservation
    • Method: POST
  • Authentication:
    • Method: Header-based API Key.
    • Header Name: x-api-key.
  • Hookdeck:

Change vehicle type for Camden Boroguh

  • Description: Once reservation end change the vehicle type if the bike ends in Candem borough.
  • WunderV1 Webhook Trigger: "reservationEnd".
  • webhooks-api Endpoint: /wunder.
    • URL: https://webhooks-api-wlto4pvcsq-nw.a.run.app/wunder
    • Method: POST
  • Authentication:
    • Method: Header-based API Key.
    • Header Name: x-api-key.
  • Hookdeck:

Create new user Dixa.

  • Description: Send a request to dixa with new customer.
  • WunderV1 Webhook Trigger: "frontend\\models\\Customer::afterInsert".
  • webhooks-api Endpoint: /wunder.
    • URL: https://dev.dixa.io/v1/endusers
    • Method: POST
  • Authentication:
    • Method: Bearer Token.
    • Header Name: Authorization.
  • Hookdeck:

Sumary as Table

Workflow Description WunderV1 Trigger Destination Endpoint Destination URL Auth Method Hookdeck Source Hookdeck Connection
Invoice queue for credit notes Get every new credit note and trigger the adding of the customer to the invoice queue in Wunder. "backend\models\CreditNote::afterInsert" add-to-invoice-queue https://webhooks-api-wlto4pvcsq-nw.a.run.app/wunder/invoices/add-to-invoice-queue Header-based x-api-key wunder-creditNote-created invoice-queue-credit-notes
Invoice queue for fees Get every new fee and trigger the adding of the customer to the invoice queue in Wunder. "backend\models\Fee::afterInsert" add-to-invoice-queue https://webhooks-api-wlto4pvcsq-nw.a.run.app/wunder/invoices/add-to-invoice-queue Header-based x-api-key wunder-fee-applied invoices-queue-for-fees
Retry failed invoice payments After 1 day of delay, retry the payment for invoices with a failed status. "backend\models\Invoice::afterUpdate" /wunder/invoices/trigger-payment https://webhooks-api-wlto4pvcsq-nw.a.run.app/wunder/invoices/trigger-payment Header-based x-api-key wunder-invoice_update retry_failed_invoice_payments
Send bundle purchased events to HF-API send the bundle purchased event ot HF-API for... . "backend\modules\pass\models\CustomerPass::afterInsert" add-to-invoice-queue https://api.forest.me/v1/hookdeck/bundle-purchase-event Header-based x-api-key wunder-bundles-purchases send-bundle-purchase-event-to-hf-api
Track bundle purchased to braze send the bundle purchased event to webhooks-api with is sending it to braze. "backend\modules\pass\models\CustomerPass::afterInsert" braze-events/bundle-purchase https://webhooks-api-wlto4pvcsq-nw.a.run.app/braze-events/bundle-purchase Header-based x-api-key wunder-bundles-purchases track-bundle-purchaces-to-braze
Track subscriptions purchased to braze send the subscription purchased event to webhooks-api with is sending it to braze. "backend\modules\subscription\models\CustomerSubscription::afterInsert" braze-events/subscription-purchase https://webhooks-api-wlto4pvcsq-nw.a.run.app/braze-events/subscription-purchase Header-based x-api-key wunder-subscriptions-purchases track-subscriptions-purchases-to-braze
Braze notifications refunds Not Used -> calls the mock endpoint in Hookdeck. backend\models\PaymentRefund::afterInsert NA NA Header-based x-api-key wunder-refunds-created braze-notification-refunds
Create new user Dixa Send a request to dixa with new customer. "frontend\models\Customer::afterInsert" /wunder https://dev.dixa.io/v1/endusers Bearer Token wunder-new_customer dixa-create-end-user
Credit vouchers for dynamic free minutes creates the credit voucher for customers based on credits assigned to bikes. "openSuccessful" /wunder/credit_vouchers/dynamic-free-minutes https://webhooks-api-1082888434143.europe-west2.run.app/wunder/credit_vouchers/dynamic-free-minutes Header-based x-api-key wunder-reservation-openSuccessful credit-voucher-dynamic-free-minutes
Update reservation end time Once the reservation is Open successfuly, the reservation.end_time data in Forest must be update to the new value (null after the openSuccessful event). "openSuccessful" /wunder/reservations/update-end-time https://webhooks-api-1082888434143.europe-west2.run.app/wunder/reservations/update-end-time Header-based x-api-key wunder-reservation-openSuccessful update-reservation-end-time
Track openSuccessful event to amplitud Once the reservation is Open successfuly webhooks-api send a new event to amplitud for this action. "openSuccessful" /amplitud-events https://webhooks-api-1082888434143.europe-west2.run.app/amplitud-events Header-based x-api-key wunder-reservation-openSuccessful track-openSuccessfull-events-to-amplitud
Update dynamic free minutes assigned to a bike Once a reservation end, the bike is re-assigned with credits according to the Free Minutes Engine. "reservationEnd" /wunder/vehicles/update-dynamic-free-minutes https://webhooks-api-wlto4pvcsq-nw.a.run.app/wunder/vehicles/update-dynamic-free-minutes Header-based x-api-key wunder-reservationEnd update-credits-assigned-to-vehicle
NPA check and notify Verify where a reservation is ending. if is an NPA create a notification sent to #alerts-reservation Slack channel. "reservationEnd" /npa-check-and-notify https://webhooks-api-wlto4pvcsq-nw.a.run.app/npa-check-and-notify Header-based x-api-key wunder-reservationEnd npa-check-and-notify
Track reservarionEnd event to amplitud Sent the events to Amplitud. "reservationEnd" /amplitud-events https://webhooks-api-1082888434143.europe-west2.run.app/amplitud-events Header-based x-api-key wunder-reservationEnd track-reservationEnd-events-to-amplitud
Track short unsuccessful reservations Verify short reservations. "reservationEnd" /wunder/reservations/track-short-reservations https://webhooks-api-wlto4pvcsq-nw.a.run.app/wunder/reservations/track-short-reservations Header-based x-api-key wunder-reservationEnd track-short-unsuccessful-reservations
Process reservation End Once reservation end, the reservation is procesed to check if a refund is needed or just trigger the invoice creation for the customer. "reservationEnd" /wunder/invoices/add-to-invoice-queue https://webhooks-api-wlto4pvcsq-nw.a.run.app/wunder/invoices/add-to-invoice-queue Header-based x-api-key wunder-reservationEnd process-reservation-end
Automatic damage report Once reservation end cehck if it was successfully and create a report as result. "reservationEnd" /wunder/reservations/damage-report https://webhooks-api-1082888434143.europe-west2.run.app/wunder/reservations/damage-report Header-based x-api-key wunder-reservationEnd automated-damage-reports
Removed cached reservation Once reservation end remove the resertavion from active reservations table. "reservationEnd" /wunder/active_reservations_notifications/remove_cached_reservation https://webhooks-api-wlto4pvcsq-nw.a.run.app/wunder/active_reservations_notifications/remove_cached_reservation Header-based x-api-key wunder-reservationEnd remove-cached-reservation
Change vehicle type for Camden Boroguh Once reservation end change the vehicle type if the bike ends in Candem borough. "reservationEnd" /wunder https://webhooks-api-wlto4pvcsq-nw.a.run.app/wunder Header-based x-api-key wunder-reservationEnd Camden-Change-Vehicle-Type
Add vehicle type to reservation as note at reservation start we add the vehicle type ot it by a note. "reservationStart" /wunder/reservations/add-vehicle-type-to-reservation https://webhooks-api-wlto4pvcsq-nw.a.run.app/wunder/reservations/add-vehicle-type-to-reservation Header-based x-api-key wunder-reservationStart add-vehicle-type-to-reservation
Track reservationStart event to Amplitud via webhooks-api at reservation start we add the vehicle type ot it by a note. "reservationStart" /amplitud-events https://webhooks-api-1082888434143.europe-west2.run.app/amplitud-events Header-based x-api-key wunder-reservationStart track-reservationStart-events
Store new reservation in Forest DB at reservation start we store the reservation info in a table used to save historical data of reservations and also provides a table with current active reservations. "reservationStart" /wunder/active_reservations_notifications/cache https://webhooks-api-wlto4pvcsq-nw.a.run.app/wunder/active_reservations_notifications/cache Header-based x-api-key wunder-reservationStart store-active-reservations-for-threshold-notifications
Track passes and Subscription events to Amplitud on eny new subscription or bundle purchase send an event to Amplitud. ["backend\modules\pass\models\CustomerPass::afterInsert", "backend\modules\pass\models\CustomerSubscription::afterInsert"] /2/httpapi https://api.eu.amplitude.com/2/httpapi Header-based x-api-key wunder-subscriptions-and-passes-purchases passes-and-subs-to-amplitud-track-events