EXPECTED_INTEGER when confirmed int being passed

I am passing the following JSON to create a payment. This works for my iPhone app, but is returning EXPECTED_INTEGER as an error for “field”: “amount_money.amount”. Any help would be much appreciated!

paymentJSon: {“sourceId”:“cnon:cnonnumber”,“idempotencyKey”:“someKEy”,“amountMoney”:{“amount”:100,“currency”:“USD”},“orderId”:“orderid”}

:wave: What’s your applicationId and the idempotencyKey that you got the error with?

Hi Bryan! Thanks for your response. The info is just below.
appId: sq0idp-nRQhibGZrciBYGFEkyC9sw
idempotencyKey: d52013bc-c174-4e73-a092-4c1fc1ed6e34

Looking at your API Logs the requests that you got this error with are blank. Also there isn’t any payment requests with that idempotency_key in our logs. Is you’re application making payment requests but not passing in a body? I’ve been trying to replicate the error but haven’t yet been successful. Do you have the steps to replicate? :slightly_smiling_face:

That’s what I was thinking. You can see some successful payment requests that are being sent from iOS, the blank ones are from my android simulator. Thanks for confirming that for me. That gives me a direction to do some more digging. I’ll reach out later if I have any other issues! Thank you!

Hi Bryan! I am still having trouble with this. I have confirmed that I am passing the correct values. However, I am still receiving the same error EXPECTED_INTEGER. Below is a portion of my log and a snippet of the json that I am sending. BTW I do understand that this is a different api than I originally asked about. But I am seeing the same issue here and there. This api is easier to hit so I am not creating payments. Thanks in advance for your help.

{“transactionAmountMoney”:{“amount”:275,“currency”:“USD”}}

400

Path

POST /v2/loyalty/programs/{program_id}/calculate

Error Code

EXPECTED_INTEGER

Square Version

2021-11-17

User Agent

Square-TypeScript-SDK/16.0.0

Timestamp

2022-01-04 22:57:10 GMT-6

According to your logs you are still passing it as a string:
Screen Shot 2022-01-05 at 8.34.23 AM

A successful request looks like the following:
Screen Shot 2022-01-05 at 8.36.35 AM
So somehow your request is setting it as a string and passing it to Square. :slightly_smiling_face: