Question

Why is it recommended to go through the REST API even if we only want to synchronize common fields in the webhook?

  • 7 December 2023
  • 2 replies
  • 58 views

Badge

Thanks for developing and operating a great product.

 

Syncing Subscription Status

Webhooks are commonly used to sync a customer's subscription status across multiple systems. Because different webhook events contain unique information, we recommend calling the GET /subscribers REST API endpoint after receiving any webhook. That way, the customer's information is always in the same format and is easily synced to your database. This approach is simpler than writing custom logic to handle each webhook event, and has the added benefit of making your system more robust and scalable.

 

The webhook documentation recommends calling the REST API after receiving a webhook.
The reason for this is to avoid having to create custom logic, etc.

 

However, when we want to receive only the common fields of the webhook event and synchronize it with our own DB, we think that the REST API processing is unnecessary.

 

This is because the json data received by the webhook is sufficient.

 

Even if we only plan to use the common fields of the webhook, is it better to retrieve the data via REST API?

 

If so, what is the recommended reason?

 

Best regards.


2 replies

Userlevel 3
Badge +8

Hi,

Happy to help here. Nope, if you just want to use the fields in the webhook, you don’t need to call the API.

As you mentioned, we only recommend that so that you don’t need to build custom logic for each webhook (initial_purchase, cancellation, etc., which may contain different fields).

Badge

Thank you for your response.

You have helped me a lot.

Reply