You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Square平台是否接受十进制金额值?新手遇报错求助

Square API金额格式问题解答

Hey there! As someone who’s navigated Square’s API quirks as a newbie too, let me break this down clearly for you.

First off: Square does NOT accept decimal values for the amount_money.amount field—that’s exactly why you’re hitting the EXPECTED_INTEGER error.

Square’s API requires all monetary amounts to be passed as integers representing the smallest unit of your currency. For example:

  • If you’re charging $15.75 USD, you’d pass 1575 (since 1 dollar = 100 cents)
  • For £20.00 GBP, you’d pass 2000 (1 pound = 100 pence)

Your error message specifically calls out the amount_money.amount field expecting an integer, which means you probably sent a decimal value (like 10.99) instead of its integer equivalent (1099).

To fix this, take your intended decimal amount, multiply it by the number of subunits in your currency (usually 100 for most fiat currencies), and pass that integer instead.

Here’s a quick example of what a corrected request might look like:

{
  "amount_money": {
    "amount": 1575,
    "currency": "USD"
  }
}

That should resolve the INVALID_REQUEST_ERROR you’re seeing.

内容的提问来源于stack exchange,提问作者Atiris

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.20 12:16:49