Best answer

Handling nested response from Stripe with Zapier webhook

  • 13 July 2021
  • 2 replies
  • 18 views

I am trying to do a simple function to retrieve Stripe balance on an hourly basis.  The Zapier integration doesn’t have this feature, so I am using a combination of Zapier Schedule and Zapier Webhook.

According to stripe, the command is simple:

 

curl https://api.stripe.com/v1/balance \ -u sk_test_your_key:


I am successfully querying and authenticating with stripe, but the Zapier error is:

 

Results list {"object": "balance", "available": [{"amount": 0, "currency": "usd", "source_types": {"card": 0}}], is malformed. A results list must hold children that are objects like [{key: value}]. We found "object" though.

Obviously, I can see that the nested values amount, currency, and source_types are causing it fits.

How do I overcome this error?

icon

Best answer by SamB 13 September 2021, 16:33

View original

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

2 replies

Userlevel 7
Badge +10

It seems not all webhooks return data that Zapier can process… https://zapier.com/help/doc/common-problems-with-webhooks#webhook-not-returning-results-for-next-steps 

It may be necessary to build a custom zapier integration (https://developer.zapier.com/) or to make your request in a code block where you will have greater control. 

Userlevel 6
Badge +8

Just wanted to follow up here as I noticed that @mebrandon reached out to our Support Team who identified that the data in the Key field of the Webhook step is what had caused the “Results list…is malformed” error.

Clearing the selected value from the Key field got rid of the error. Marking this as closed as the error no longer exists for them. :)