What is a Cheddar note? AnswersWebhooks, service hooks, and Captain Hooks...
Data about customers, transactions, and billing activity can be shared with external services with the help of webhooks.You can easily distribute your Cheddar data to other apps in your tech stack with this feature.
All Cheddar service levels include webhook.There are no additional fees that apply.A third-party account may be required for some hooks.
Webhooks, or service hooks, are basically event notifications sent by Cheddar to external services with helpful data attached.When certain events happen in your product account, we'll automatically send webhooks to the external service that receives the data.
There are two types of listening.You can use Zapier to build integrations.To personalize Cheddar's billing behavior, use a custom URL or use your own logic.You can find more information in the Zapier and Custom URL sections.
The events are actionable via the webhooks system.During its regular duties, these events occur naturally.You can choose which events Cheddar should send to your listener when you enable a listener.
A new customer is created in Cheddar.This could happen via any one of the actions listed.
There is a Subscription Canceled event after a cancellation.As a result of non-payment, cancellation can occur automatically, but also can be initiated via the GUI.
A previously canceled subscription can be successfully reactivated.
Any transaction can cause the Transaction event.A transaction could be for a recurring invoice.The event is triggered when a transaction is executed.When a transaction is updated with settlement information, it is also triggered.
The data common to all hooks section contains more information about the data your listener will receive from a Cheddar hook.
The recurring engine causes the Subscription Billable event when an invoice becomes billable.The recurring engine will not execute the invoice immediately if a hook is registered.The opportunity to execute arbitrary actions prior to the invoice is given by the hook.After all Billable hooks are processed, the invoice will be transacted.The invoice review article has more information.
To set webhooks in your product dashboard, visit the "Configuration" menu and select Service Hooks.Pick your hook listener: Custom URL or Zapier.
If you're using a custom URL, you need to enter the URL that will receive the hook data and choose the events to send it to.You can set as many hooks as you want.After youTrademarkiaTrademarkias are configured, hit save and Cheddar will begin sending hooks.
It is possible to turn on and off custom URL listeners.When turned back on, they pick up where they left off.If you want to turn a service on or off, check the "Active" box.
If you use Zapier, you'll be able to manage hooks from your dashboard.
The Hooked Activity Log will be created once hooks are activated.Clicking on the "Activity" menu in your dashboard will allow you to view the log.
Cheddar has fault tolerance built into the hooks system that will automatically try to resend a hook if it fails to reach your configured listener, but you also have the option to manually retry the hook from the hooked activity log.The check box is next to the hooks.
There is a service that routes webhooks.Without writing any code, you can make Zaps that will automatically take hooks fired by Cheddar and direct them to a 3rd party application to perform an action based on the data that was received.
You can use this tool to build custom integrations with any of the thousands of apps supported by Zapier.This tool is used by our customers to automate actions.
Then make your first Zap!Within your account, you'll be able to create and manage Zaps.Zaps can be used to automate tasks between two applications.They are made up of 2 components.
You can use Cheddar's hookable events as atrigger, then select any of the supported apps where the action will take place.Once the Zap is live, Zapier will begin automatically performing the actions you've configured whenever atrigger is received.
To connect your product account to Zapier, you'll need your secret key, which is the email address you use to log in, and your Cheddar usernames.You can find a secret key here.
You can apply specific fields from the data to go to the action when you're configuring an action.
Let's say you want approved transactions from Cheddar to prompt an action to update the customer record in your platform.When a transaction takes place, the transactiontrigger is fired by Cheddar.
To make sure the customer update action only happens when a transaction is approved, you can use the subscription field.See the Data Common to All Hooks section for more information.
If you're looking for more in-depth documentation, check out Zapier's 'How to create a Zap Guide'.
You can create a custom hook listener if you prefer to route your webhooks yourself.The ability to send hook data to any URL is provided by Cheddar.You can add a custom hook URL to your dashboard.When the Custom URL hook is enabled, Cheddar automatically sends POST data to the URL whenever there is a triggering event.You can set an unlimited number of listeners for webhooks.
Data can be sent in either application/x-www-form-urlencoded or application.To your audience via the internet.
The data common to all hooks is included in the Subscription Changed hook.
Customer information is contained in webhooks.While hooks never include a customer's full credit card number, they do contain some payment information and personally identifiable information.Before you enable hooks, you'll want to make sure that your hook data is protected from potential security vulnerabilities.
We strongly recommend using an HTTPS URL to protect against replay attacks and to secure your hook data in transit.
Hook requests are signed.If you want to make sure that the hook is coming from Cheddar, you need to verify the request's signature.This is recommended but not required.The X-CG-SIGNATURE is included in Cheddar's Custom URL hooks.You can use your product secret key as the key to get the HMAC SHA256 key for the request body.
You can find a secret key here.A secret key is called one for a reason.It's up to you to protect your secret key.
The super global $SERVER keys are altered to be prepended with HTTP and dashes are underscores.
There is an X-CG-TOKEN in hook requests.It is provided as a convenience.The request MD5 hash value is calculated prior to transit.This value should not be used in a production environment.It is provided so that you can compare it to your own calculation of the request.A man-in-the-middle attack can be made possible by using the value of this headers for validation.
If you want to make sure that hooks are coming from Cheddar's intellectual property, you can do that too.The following are what Cheddar uses.They are subject to change.We will let you know via email, in-app message or posting on our status page if they do.
PostCatcher is one of the easiest ways to test a hook.You can cause an event to happen in your account by setting up a bin and configuring the URL.
For development purposes, it's useful to send the same hook again and again.The Hooked Activity Log can be used to stop automatic retries of individual events.
If you want to test webhook in a development environment, make sure your endpoint is available on the public internet.If you are developing on your local machine, we recommend using a tunneling service to make your endpoint public.
Hooked events are reported in your activity log.You can use the interface as a workspace for manipulating individual hooks or in bulk.
Your hook listener needs to respond with a status of 200 or more.If a hook listener does not respond with a status code of 200 or 300, the hook is considered to have failed and will be automatically renewed.
It's important to note that if your hook listener throws a 404, Cheddar will consider it failed and try again later.A dependent entity is often not found when processing the hook.It is possible that this is a normal condition and the hook processing is successful.If that is the case, your listener should return a response status of 200.
Hooks have connect and read timeouts of 10 and 30 seconds.If your hook doesn't respond within the timeout period, it will be considered a failure and you will have to try again.You might consider issuing the response before your processing is complete if you expect your listener to take more than 10 minutes to respond.Do some background processing for long jobs.Make your hook tolerant of the retries.
On an exponential backoff schedule, failed hooks are retried.The hook will be marked as "fatal" after 16 attempts.The hook will be disabled if it fails too many times.The events that occur between auto-disable and reenable cannot be rerun.
Due to the potential for retries, it is highly recommended that any logic executed in your hook listener is idempotent.If you want to not have any adverse effects of your logic running more than once, you need to make your listener logic tolerant of any retry.
You can use the hooked activity log to manually rerun a hook or cancel automatic retries.The activity log can be found here.
No matter what state the hook is in, it can be retried manually.You can cancel or stop automatic retries if you mark a hook as complete or fatal.