Overview

Firmhouse uses webhooks to allow you to communicate with different applications and share data smoothly. You can specify the information you want to send when each event happens using liquid templates. To set up a webhook on the Firmhouse Portal, check out this guide.

In this guide, we will use JSON payloads as it's the most common format for webhooks. However, you can use any other format that you can create a template for with Liquid, such as XML or YAML.

For each event group, there are specific variables that you can use in liquid templates.

Asset

You can use these variables in your templates for all asset events.

Asset assigned

This event is triggered when an asset is assigned to a customer. You can check out this guide to see how you can assign an asset to a customer on Firmhouse Portal.

Example Template
{
  "event": "asset_assigned",
  "asset": {
    "id": "{{asset.id}}",
    "productId": "{{asset.product.id}}",
    "internalNumber": "{{asset.internal_number}}",
    "externalNumber": "{{asset.external_number}}",
    "status": "{{asset.status}}",
    "purchasePrice": {{asset.purchase_price | default: 0}}
  },
  "subscription": {
    "id": "{{subscription.id}}",
    "email": "{{subscription.email}}",
    "name": "{{subscription.name}}",
    "lastName": "{{subscription.last_name}}",
    "phoneNumber": "{{subscription.phone_number}}",
    "address": "{{subscription.address}}",
    "houseNumber": "{{subscription.house_number}}",
    "city": "{{subscription.city}}",
    "state": "{{subscription.state}}",
    "zipcode": "{{subscription.zipcode}}",
    "country": "{{subscription.country}}"
  }
}

As shown in the example template above, you can use the liquid filter default: to set a default value for a field. You can also use any other filter supported by liquid. Check out the list here.


Contract term

You can use these variables in your templates for contract term events.

Billing cycle skipped

This event is triggered when a customer fails to pay for a billing cycle.

Example Template

As you can see in the example above, you can use tags like capture and for .. in to extract values from arrays easily. You can also use other tags supported by liquid. You can check the full list here.


Collection Case

You can use these variables in your templates for extra field events.

Collection Case Closed

This event is triggered when the status of collection case is changed to closed.

Example Template

Collection Case Created

This event is triggered when a collection case is created for an invoice.

Example Template

Collection Case Open

This event is triggered when the status of collection case is changed to open.

Example Template

Extra field answer

If you added extra fields to your project, you can use these events to monitor when they are changed. Please check out this guide for instructions on setting up extra fields on Firmhouse Portal.

You can use these variables in your templates for extra field events.

  • extra_field

    • This field contains all extra_fields you configured for the project. You can access each with `{{extra_field.field_name}}. The field names here are using snake_case. If you have an extra field with the name "Custom Message", you can access that with {{extra_field.custom_message}} tag.

Extra field answer updated

This event is triggered when one of the extra fields you defined for your project is updated on a subscription.

Example Template

{% code lineNumbers="true" %} ``

`liquid { "event": "extra_field_answer_updated", "extra_field": { "how_did_you_hear_about_us": "{{extra_field.how_did_you_hear_about_us}}", "custom_message": "{{extra_field.custom_message}}" }, "subscription": { "id": "{{subscription.id}}" } }

Invoice paid

This event is triggered when the payment for an invoice is paid successfully.

Example Template

Order

You can use these variables in your templates for all order events.

Order confirmed

This event is triggered when an order gets confirmed.

Example Template

Order fulfilled

This event is triggered when an order status becomes fulfilled.

Example Template

Order pending

This event is triggered when an order status changes to pending.

Example Template

Ordered product

You can use these variables in your templates for all ordered product events.

Ordered product created

This event is triggered when a customer adds a new product to cart. This corresponds to createOrderedProduct mutation on our GraphQL API. Note that if the same product added more than one times, since it's only a quantity update, Ordered product updated event will be triggered.

Example Template

Ordered product updated

This event is triggered when a product in cart is updated. This corresponds to updateOrderedProduct and updateOrderedProductQuantity mutations on our GraphQL API or when its automatically updated due to order state or shipment information change.

Example Template

Ordered product deleted

This event is triggered when a customer removed product from a cart. This corresponds to destroyOrderedProduct mutation on our GraphQL API. ordered_product variable in this even corresponds to the product removed from cart

Example Template

Payment

You can use these variables in your templates for all payment events.

Payment failed

This event is triggered when a payment is failed.

Example Template

Payment succeeded

This event is triggered when a payment successfully completes.

Example Template

Return order

You can use these variables in your templates for all return order events.

Return order cancelled

This event is triggered when a return order is cancelled.

Example Template

Return order created

This event is triggered when a return order is created.

Example Template

Subscription acceptance check pending

This event is triggered when an acceptance check is created with pending status. It will only be triggered for these acceptance check types: Manual, Identity Verification, Focum acceptance check with "As part of the signup on submitting the signup form."

Example template

Subscription acceptance check accepted

This event is triggered when the status of an acceptance check changes to accepted.

This will happen immediately on signup if the check passes when its created for these events: duplication, or Focum acceptance check with "As part of the signup on submitting the signup form" option. For other acceptance check types it will happen when the value is set to accepted.

Example template

Subscription acceptance check rejected

This event is triggered when the status of an acceptance check changes to rejected.

The triggering timeline is similar to Subscription acceptance check accepted. The only difference is that it occurs when the checks fail or when it is manually set to rejected.

Example template

Subscription

You can use these variables in your templates for all subscription events.

Subscription activated

This event is triggered when a subscription is activated. Depending on your project settings this could happen either after successful initial payment or when the subscription is manually activated.

Example Template

Subscription Stopped

This event is triggered when a subscription is stopped. This happens automatically when the maximum commitment of a subscription is reached.

Example Template

Subscription address changed

This event is triggered when subscription details are updated. Note that, updates to subscriptions with draft status won't trigger this event.

Example Template

Subscription cancellation initiation

This event is triggered when a cancellation request is submitted.

Example Template

Last updated

Was this helpful?