CAD Cash payment rounding


I’m trying to mark an order as paid by creating a cash payment. However, whenever total_money is not equal to a multiple of 0.05, I get an error from the api (which is logical since 5 cents is the smallest multiple of cash we have in Canada).

When I set the amount_money of the payment to the closest multiple of 0.05, however, I get an error that says the amount of the payment is not equal to that of the order.

I looked up the docs and can’t seem to find a way to get around this error. Is there an option that can round up the total of the order?

If the payment amount and order total don’t match we will return the error. What’s the amount of the order?

Say I have an order that amount to 149.97$.
If I want to pay it cash, what we do in Canada is that we round it up to 149.95$ (we do not have pennies).

Now, when I try to complete a payment in square api with 149.97$, I get an error:
total_money amount of 14997 is not divisible by CAD currency base cash unit

And when I try to complete a payment with 149.95$, I get that order and payment amounts do not match.

What is your application Id?

I’m in the sandbox: sandbox-sq0idb-DRz44-MQdt02zZXqt1bL3Q

The order total will always have to match the payment total. You can either UpdateOrder to the lesser amount that you intend to charge the customer or if you want to keep the order total but are going to accept the lesser amount of $149.95 in cash and still want to close the order you can do so by setting autocomplete to false and take the $149.95 cash payment. Then to close the order you can make another payment with the tender EXTERNAL for the remaining $0.02 with the same order_id. Once you have the two payment_ids You can call PayOrder with the payment_ids to complete the order.