connect-api-examples icon indicating copy to clipboard operation
connect-api-examples copied to clipboard

ERROR: Total Money Amount Must Be Greater Than 1

Open jpnoe opened this issue 4 years ago • 1 comments

{"errors": [{ "category": "INVALID_REQUEST_ERROR", "code":"VALUE_TOO_LOW", "detail":"order.total_money.amount must be greater than 1.", "field":"order.total_money.amount" }]}

This occurs every time I try the base example CURL request from the API explorer for checkout api. I'm running the following request:

curl https://connect.squareupsandbox.com/v2/locations/LXXN2DAV5SQKY/checkouts
-H 'Authorization: Bearer EAAAEFpHnWhYlFNso_ogOvxCIjm_jNUUeCngffKLbLBk8DKeVy2sf9jtgZ8hh4zw'
-H 'Content-Type: application/json'
-d '{ "idempotency_key": "f0e3dc80-5f6d-4105-81e4-eefaebd7b81d", "order": { "idempotency_key": "c7030981-0607-4865-a69c-996f5e3ebe9d", "order": { "location_id": "LXXN2DAV5SQKY", "line_items": [ { "quantity": "2", "name": "Marketing Analytics", "base_price_money": { "amount": 900,
"currency": "USD" } } ] } } }'

jpnoe avatar Aug 11 '21 21:08 jpnoe

Hi! According to the https://developer.squareup.com/reference/square/objects/OrderLineItem#definition__property-total_money this is a r/o param and therefore must be automatically computed by the Square. But.. it seems their API explorer fails to do so. I think it is better to try the request on your own side from your terminal or a script.

arseniigorkin avatar Apr 21 '22 08:04 arseniigorkin