Order.total_money.amount must be greater than 1

I am getting an error that order.total_money.amount. Here’s the code I am using:
“order”: {
“idempotency_key”: “******-215d-4dce-b92a-90c306eb5eba”,
“location_id”: “***C7F3RZ1S5",
“total_money”: {
“amount”: 9999,
“currency_code”: “USD”
},
“order”: {
“location_id”: "C7F3RZ1S5",
“customer_id”: “someID”
}
},
“idempotency_key”: "
-215d-4dce-b92a-90c306eb5eba”,
“ask_for_shipping_address”: false,
“merchant_support_email”: “[email protected]”,
“redirect_url”: “https://someURL.com
}

The JSON reply looks like the amount is there correctly.

Any suggestions on what I am doing wrong?

Thanks,
Gary

Hi @ghanna welcome to the forums!

With the Orders API, you do not set the amount in the request. You pass in line items (which can include variations, taxes, modifiers, discounts, etc), and the total will be set for you. This looks like an incomplete CreateCheckout request. For example, total_money is a read-only field which cannot be set. Also, as you can see in the documentation, the total_money isn’t even a top-level field, so it’s actually being ignored since it’s an invalid parameter. Otherwise, you would get an error about writing to a read-only field.

Thanks for the reply. The problem actually was that Coldfusion 2016 was not properly formating the amount and quantity value as an integer when serializing the JSON. In CF2018 and CF2021 it works fine… and it must be ignoring the total_money value.