0

i have read some issues regarding this but not clarified if they accept or not an amount with decimal value.

im a beginner to square. Please Help... Below is my error

errors : Array(1) 0 : category : "INVALID_REQUEST_ERROR" code : "EXPECTED_INTEGER" detail : "Expected an integer value." field : "amount_money.amount"

Atiris
  • 1
  • 2

1 Answers1

0

The "amount" field is always in the lowest denomination for the currency being used. If you're using USD this would be in cents, for example. If you need to charge $1.50, then for the amount you will need to supply "150" in terms of cents.

Also asked here: EXPECTED_INTEGER — Issues with Square payment portal

sjosey
  • 1,360
  • 1
  • 6
  • 7
  • thank you for the quick reply.. just for clarification, so if i have an amount of $35.9 do i need to encode this as 359? – Atiris Mar 23 '18 at 02:42
  • i think i got it.. so if i have an amount of $35.9 i need to multiply it by 100 to get the cent value is it? :) so it will become 3590 – Atiris Mar 23 '18 at 03:00
  • @Atiris that is correct! $35.90 will become 3590, and that is the value you will supply for the "amount" field. – sjosey Mar 23 '18 at 15:55