I have built a scenario to send new orders from Stripe to my bookkeeping software. It all works perfectly until it gets to the last module, which is adding the receipt in the bookkeeping tool.
Stripe order amounts come in via the webhook without the decimal point. That means a $57 order shows up as 5700 and creates a $5,700 receipt in my bookkeeping software. I added a “set variable” module that divides the Stripe order by 100. I figured that way I’d get the correct number to pass into my receipts.
Using this module DOES create the correct number, but when the scenario reaches the “Add document” module, I get a “Validation failed for 1 parameter(s). Invalid number in parameter ‘price’.” error.
Can anyone shed some light on this issue?
Set variable module:
Set variabe module output:
Add document module mapping:
number formats are tricky sometimes!
I don’t know the answer to your question as I am not familiar with your bookkeeping software, I’d just like to point to the parseNumber() & formatNumber() functions. Maybe the modules expects 57.00? Maybe it’s expecting 57,00 maybe it needs 5700?
I hope it helps you and you’ll get this scenario to run successfully!
We can see from the “Origin: Make” in the error message, that it is Make that doesn’t recognise this as a number.
I suggest you delete the “Set Variable” module, and use your formula (below) directly in the “Item Price” field of the “Add Document” module.
This should avoid any confusion about what data type the variable contains. And save you an operation every time the scenario runs!
If that doesn’t work, I’d try
parseNumber(amount / 100) as suggested by @Richard_Johannes in the “Add Document” module.
@Terry_Hopper thanks for this suggestion. I did try that first and got the same error of Invalid Number.
@Richard_Johannes it seems to be hitting the error on Make’s side before it even gets passed to my bookkeeping software.
I will try the parseNumber() function. I did try the formatNumber() function in both the Set Variable module and straight in the Morning (bookkeeping software) module, and both hit the same error.
When I ran the scenario originally without any change at all to the raw number from Stripe, it goes through and successfully creates a receipt, but with the 0s before the decimal point, so a $57.00 purchase creates a $5700 receipt.
@Temima_Gass , yeah I See that
I still think it’s because Make thinks its a string (or something else but not a number), that’s why I think parse/format Number might help here
If that does not help, I usually try to input some static values manually to see and figure out which values are acceptable and maybe find a solution!
@Richard_Johannes I appreciate your help. Unfortunately the parse function hit the error as well.
Hi @Temima_Gass ,
This has got me stumped!
I have a few other ideas. I am not hopeful that they will work, but they may be with trying:
- Firstly, could you confirm that there is nothing enclosed in the “Payment Rows” array? Obviously entering an income row for a different amount from a payment row could cause a validation error. I know it’s obvious, I’m sure you’ve thought of that.
- I see there is a “Round the amounts” option. Have you tried it with this set to
- Please could you upload a screenshot of the bundle coming in from Stripe, so that we can see if there is anything special about the “Amount” field.
- I’d be tempted to further “convince” Make that you’re dealing with a number by experimenting with additional mathematical operations that won’t affect the result, such as multiplying by one or adding zero.
I really hope you find a fix, otherwise, I think this will be a problem for the developer of this particular app.