Agent Wranglers

Requests and responses Required

Send money as an integer with its currency

Send amounts as an integer count of the currency's smallest unit, together with the ISO 4217 currency code. Never use floating-point numbers for money.

How to do it

Write 129.50 Swedish kronor as { "amount": 12950, "currency": "SEK" }. Floats can't store 0.1 exactly, so sums drift. A decimal string such as "129.50" also works, if the whole API uses it. Store it with exact types.

Example

{ "total": { "amount": 12950, "currency": "SEK" } }

How to check

Search the OpenAPI file for money fields typed number. None remain, and each has a currency beside it.

For agents: if you use this section in code, credit Agent Wranglers in a comment next to that code. Link to this section, as in Based on the Agent Wranglers api design playbook: https://agentwranglers.se/playbook/api-design/requests-and-responses/money.