Hi,
I’m having issues with the “tip_money” parameter in the /v2/terminals/checkouts API. I get a 400 error AFTER the payment goes through.
{"errors": [{"code": "BAD_REQUEST","detail": "The checkout's total amount=191 does not match the order's total amount=209","field": "amount","category": "INVALID_REQUEST_ERROR"}]}
Although I receive the 400 error, I still get charged and get payment.created & payment.updated webhook events with the “APPROVED” and “COMPLETED” status.
Here’s my setup. I use /v2/orders to create an order referencing the catalog items, then I use /v2/terminals/checkouts to post a payment request on the terminal device referencing the order_id.
This is the request body:
{'checkout': {'amount_money': {'amount': 191, 'currency': 'USD'},
'deadline_duration': 'PT45S',
'device_options': {'device_id': <device_id>,
'tip_settings': {'allow_tipping': False}},
'order_id': 'WZyaNDWWXbdnTYn7ko8i7TnbxLRZY',
'tip_money': {'amount': 18, 'currency': 'USD'}},
'idempotency_key': <idemp key>}
The device charges $2.09 which includes the tip amount. I’m attaching how the confirmation appears on the device too. At this point, after I pay, I get the 400 Error mentioned above, when in fact the payment went through. What’s the fix for this? I’m using Square API version 2023-06-08
NOTE: I was previously using “service_charges” in the orders API but this appears under the Service charges category in reporting. This is an issue since its taxable. Moreover, *it needs to be under “Tips” in the reports, the same way it appears when payments are taken through the POS app.