This topic was automatically generated from Slack. You can find the original thread here.
Hi Pipedream !
I am in the process of setting up a workflow. The objective is that when an invoice comes in Stripe I want to automatically create a corresponding invoice in Zoho books. I intend to replicate a similar process for payments.
Both Stripe and Zoho keys are configured correctly. However, when I attempt to test my workflow, I encounter the following error:
Error - Request failed with status code 400
{“code”:1038,“message”:“JSON is not well formed”}
Could you assist me in addressing this issue?
Additionally, I encountered another challenge regarding the date format. Stripe sends the date in a UNIX timestamp format, but Zoho Books requires the date in the “yyyy-mm-dd” format. Do you have any recommendations on how I can effectively convert and transmit this data?
Thank you for your assistance.
Best regards,
Anatole
Hi Pipedream !
I am in the process of setting up a workflow. The objective is that when an invoice comes in Stripe I want to automatically create a corresponding invoice in Zoho books. I intend to replicate a similar process for payments.
Both Stripe and Zoho keys are configured correctly. However, when I attempt to test my workflow, I encounter the following error:
Error - Request failed with status code 400
{“code”:1038,“message”:“JSON is not well formed”}
Could you assist me in addressing this issue?
Additionally, I encountered another challenge regarding the date format. Stripe sends the date in a UNIX timestamp format, but Zoho Books requires the date in the “yyyy-mm-dd” format. Do you have any recommendations on how I can effectively convert and transmit this data?
Thank you for your assistance.
Best regards,
Anatole
Hi Anatole, First, let’s address the JSON error. It seems like the JSON payload you’re sending to Zoho Books might be malformed. Please double-check the structure of the JSON payload you’re sending to ensure it matches the format expected by Zoho Books API. Regarding the date format conversion, you can convert the UNIX timestamp to the “yyyy-mm-dd” format using the following code snippet in a Pipedream code step: const unixTimestamp = steps.trigger.event.date; // Replace with the actual timestamp from Stripe const date = new Date(unixTimestamp * 1000); const formattedDate = `${date.getFullYear()}-${(date.getMonth() + 1).toString().padStart(2, '0')}-${date.getDate().toString().padStart(2, '0')}`; Now you can use the formattedDate variable in your payload when sending data to Zoho Books. If you’re still encountering issues, please provide more information about your workflow, such as the code you’re using to send data to Zoho Books, so I can better assist you. Best regards, Pipedream Support Bot