Skip to main content
Solved

Klaviyo webhook in review flow


Forum|alt.badge.img+1
  • Contributor II
  • 4 replies

I’m investigating if it is possible to move from reviews.io to Klaviyo reviews. But I still have one issue I can’t get solved. I hope someone here can help me with this, as Klaviyo support tells me webhooks are out of their scope, as it’s also about 3rd party software. 

When someone leaves a review on reviews.io. I use this as a trigger in Shopify Flow to assign store credit to the costumers store credit account. To achieve this, I use a 3rd party app called CreditsYard. The platform has a basic API. I try to trigger this API true a webhook in Klaviyo. But I keep getting errors. 

My flow setup: 

Trigger: When smoeone Submitted review

Action: Webhook. 

 

Webhook Settings: 

Destination URL: https://creditsyard.com/api/common/credits/adjust
Headers: 

Key: Content-Type Value: application/x-www-form-urlencoded

Key: X-Shop-Api-Key Value: MYAPI

 

JSON Body:
{
  "customer_email": "{{ event.email }}",
  "amount": 10,
  "reason": "New review",
  "send_email_notification": 1
}

 

When I preview the Webhook, I keep getting an error. Preview data source is profile. I use my own test profile in Klaviyo. 

Error I get: “Error: status code 404 received when sending webhook.Dismiss”.

I tried different headers. I also got 403 error. But never a working result. I can’t find any more details on how I can get this to work. I hope someone can point me in the right direction. 

 

Thanks

Jonas

 

Best answer by Smets

Got it working! 

https://creditsyard.com/api/common/credits/adjust

Key: Content-Type Value: application/json

Key: X-Shop-Api-Key Value: API KEY

{
  "customer_email": "{{ person.email }}",
  "amount": 15,
  "reason": "New review",
  "send_email_notification": 1
}

View original
Did this topic or the replies in the thread help you find an answer to your question?

8 replies

Forum|alt.badge.img+6
  • Problem Solver IV
  • 29 replies
  • January 13, 2025

Your headers seem correct, but ensure that the Content-Type is set to application/json instead of application/x-www-form-urlencoded, as your payload is in JSON format. This mismatch could cause the API to reject the request .

The JSON body appears correct, but ensure that the {{ event.email }} variable is properly populated. If the preview data source is a profile, Klaviyo might not be able to resolve event.email correctly. Instead, use {{ profile.email }} to reference the email from the profile data .

Test the payload directly with the CreditsYard API using a tool like Postman to ensure it works outside of Klaviyo. This will help isolate whether the issue is with the API or the Klaviyo webhook setup.

 

Klaviyo webhooks can only be triggered by specific events, such as "Placed Order" or "Subscribed to List." Ensure that the "Submitted Review" event is supported as a flow trigger in Klaviyo. If not, you may need to use a different trigger or workaround

Klaviyo automatically retries webhooks for certain errors (e.g., 429, 500, 503) but skips non-retryable errors like 404 and 403. If the issue persists, Klaviyo will not retry the request, so you need to resolve the underlying issue

https://developers.klaviyo.com/en/docs/rate_limits_and_error_handling


Forum|alt.badge.img+1
  • Author
  • Contributor II
  • 4 replies
  • January 13, 2025

@pranay thanks for the help! Ad changed the Value to; 

application/json

And the variable to {

{{ profile.email }}

But the error stays the same: 

Error: status code 404 received when sending webhook.

I found the information about the triggers in the Klaviyo help files, but the When Someone Submitted a review is a trigger build by Klaviyo. I think, as reviews are a recent thing for Klaviyo, this is not yet mentioned in the help files.

 

When I test the API in Postman it works like a charm. 


Forum|alt.badge.img+6
  • Problem Solver IV
  • 29 replies
  • January 13, 2025
Smets wrote:

@pranay thanks for the help! Ad changed the Value to; 

application/json

And the variable to {

{{ profile.email }}

But the error stays the same: 

Error: status code 404 received when sending webhook.

I found the information about the triggers in the Klaviyo help files, but the When Someone Submitted a review is a trigger build by Klaviyo. I think, as reviews are a recent thing for Klaviyo, this is not yet mentioned in the help files.

 

When I test the API in Postman it works like a charm. 

Bummer. Start with a minimal payload (e.g., only the customer_email field) and gradually add more fields to identify if a specific field is causing the issue.

If the API works in Postman but not in Klaviyo, reach out to CreditsYard to ensure there are no restrictions or additional requirements for integrating with Klaviyo.


Forum|alt.badge.img+1
  • Author
  • Contributor II
  • 4 replies
  • January 13, 2025

Even with the bare minimal payload, I get the same error. CreditsYard support can’t help me. They pointed me to the Postman result. This works. So the problem is not with their API. So they sent me to Klaviyo Support. Who sends me back to CreditsYard… Hope someone else picks up this topic. 


DavidV
Partner - Platinum
Forum|alt.badge.img+30
  • 2025 Champion
  • 207 replies
  • January 13, 2025

Hi ​@Smets ,

Welcome to the Klaviyo Community and thank you for your question. 

Hmm this is a tricky one - I wonder if CreditsYard is declining the `X-Klaviyo-Flow-ID` that is added into the header. Are they able to at least provide the log on why this isn’t working?

The other option you have to double check all your inputs are correct would be to send the request to Napkin.io. Napkin is a nifty tool owned by Klaviyo and it will allow you (amongst other things) to quickly spin up an endpoint so you can see the logs that are coming out of the tool.

For future troubleshooting just adding in these 2 links:

Webhook in flow - Klaviyo documentation 

CreditsYard documentation

I haven’t personally used CreditsYard but looking through their documentation this should be accepted. 

I would try receive your input from Napkin to see exactly what headers take place. You could also potentially use Napkin to rewrite the request to be formatted correctly though it does add an additional redundancy.

The other option would be to write an inbound query into Shopify Flow and use that to send the request as Shopify Flow has a larger library of supported API methods. 

Hope that helps!

Thanks
David


Forum|alt.badge.img+1
  • Author
  • Contributor II
  • 4 replies
  • January 14, 2025

@DavidV Thanks for the reply! I think this is getting over my head. I normally manage this type of thing by trial and error. But I’m far from a dev. I hope Klaviyo support can help me out. As the API call works fine in Postman. But as long as I don’t understand why it's not working from Klaviyo and there are no logs, there is not much I can do. 


Forum|alt.badge.img+1
  • Author
  • Contributor II
  • 4 replies
  • Answer
  • January 16, 2025

Got it working! 

https://creditsyard.com/api/common/credits/adjust

Key: Content-Type Value: application/json

Key: X-Shop-Api-Key Value: API KEY

{
  "customer_email": "{{ person.email }}",
  "amount": 15,
  "reason": "New review",
  "send_email_notification": 1
}


DavidV
Partner - Platinum
Forum|alt.badge.img+30
  • 2025 Champion
  • 207 replies
  • January 16, 2025

Great to hear ​@Smets!

And so sorry to go straight into technical depth haha - I assumed based on your mention of Postman you were a developer!