Commerce Currency
Handle exchange rates and currency settings for global commerce operations.
How It Works
- Configure the base currency for the store (e.g.,
USD).
- Enable supported currencies and set exchange rates.
- Convert amounts between currencies using current rates.
- Format values with locale-appropriate symbols and decimal places.
- Report rate history and conversion audit trail.
Usage
- CLI:
stateset-currency ... or stateset "convert 100 USD to EUR"
- Writes require
--apply.
- MCP tools:
get_exchange_rate, list_exchange_rates, convert_currency, set_exchange_rate, set_base_currency, enable_currencies, format_currency.
Permissions
- Read:
get_exchange_rate, list_exchange_rates, convert_currency, format_currency — no --apply needed.
- Write:
set_exchange_rate, set_base_currency, enable_currencies — requires --apply.
Examples
stateset "convert 100 USD to EUR"
stateset --apply "set exchange rate USD/EUR 0.92"
stateset "list enabled currencies"
Status Flows
Exchange Rate: Draft -> Active -> Expired (or Superseded)
Currency: Disabled -> Enabled -> Active (or Disabled)
Output
{"amount":100.00,"from":"USD","to":"EUR","converted":92.00,"rate":0.9200,"rate_date":"2025-01-15T12:00:00Z","order_id":"ord_456","status":"converted","sku":"WIDGET-001"}
Present Results to User
- Exchange rate used, source, and timestamp.
- Converted totals with proper formatting and decimal precision.
- Any base currency changes and their downstream effects.
- Enabled currency list if modified.
Troubleshooting
- Rate missing: set a rate with
set_exchange_rate or enable the currency pair.
- Precision issues: use correct decimal places per currency (e.g., 0 for JPY, 2 for USD).
- Stale rates: verify
rate_date and update if older than acceptable threshold.
- Base currency change: existing prices and amount values are not auto-converted; recalculate manually.
Error Codes
CURRENCY_RATE_MISSING: No exchange rate found for the requested currency pair.
CURRENCY_PRECISION_INVALID: Decimal precision does not match the target currency standard.
CURRENCY_RATE_STALE: Exchange rate is older than the acceptable freshness threshold.
Related Skills
- commerce-tax — cross-border tax calculation requires currency conversion
- commerce-payments — multi-currency payment processing
- commerce-invoices — invoice amounts in customer currency
References
- references/currency-commands.md
- /home/dom/stateset-icommerce/cli/.claude/agents/currency.md
1---2name: commerce-currency3description: Manage currency settings and exchange rates. Use when running `stateset-currency`, converting amounts, or configuring multi-currency support for global commerce.4---56# Commerce Currency78Handle exchange rates and currency settings for global commerce operations.910## How It Works11121. Configure the base currency for the store (e.g., `USD`).132. Enable supported currencies and set exchange rates.143. Convert amounts between currencies using current rates.154. Format values with locale-appropriate symbols and decimal places.165. Report rate history and conversion audit trail.1718## Usage1920- CLI: `stateset-currency ...` or `stateset "convert 100 USD to EUR"`21- Writes require `--apply`.22- MCP tools: `get_exchange_rate`, `list_exchange_rates`, `convert_currency`, `set_exchange_rate`, `set_base_currency`, `enable_currencies`, `format_currency`.2324## Permissions2526- Read: `get_exchange_rate`, `list_exchange_rates`, `convert_currency`, `format_currency` — no `--apply` needed.27- Write: `set_exchange_rate`, `set_base_currency`, `enable_currencies` — requires `--apply`.2829## Examples3031```bash32stateset "convert 100 USD to EUR"33stateset --apply "set exchange rate USD/EUR 0.92"34stateset "list enabled currencies"35```3637## Status Flows3839**Exchange Rate:** Draft -> Active -> Expired (or Superseded)40**Currency:** Disabled -> Enabled -> Active (or Disabled)4142## Output4344```json45{"amount":100.00,"from":"USD","to":"EUR","converted":92.00,"rate":0.9200,"rate_date":"2025-01-15T12:00:00Z","order_id":"ord_456","status":"converted","sku":"WIDGET-001"}46```4748## Present Results to User4950- Exchange rate used, source, and timestamp.51- Converted totals with proper formatting and decimal precision.52- Any base currency changes and their downstream effects.53- Enabled currency list if modified.5455## Troubleshooting5657- Rate missing: set a rate with `set_exchange_rate` or enable the currency pair.58- Precision issues: use correct decimal places per currency (e.g., 0 for JPY, 2 for USD).59- Stale rates: verify `rate_date` and update if older than acceptable threshold.60- Base currency change: existing prices and amount values are not auto-converted; recalculate manually.6162## Error Codes6364- `CURRENCY_RATE_MISSING`: No exchange rate found for the requested currency pair.65- `CURRENCY_PRECISION_INVALID`: Decimal precision does not match the target currency standard.66- `CURRENCY_RATE_STALE`: Exchange rate is older than the acceptable freshness threshold.6768## Related Skills6970- commerce-tax — cross-border tax calculation requires currency conversion71- commerce-payments — multi-currency payment processing72- commerce-invoices — invoice amounts in customer currency7374## References75- references/currency-commands.md76- /home/dom/stateset-icommerce/cli/.claude/agents/currency.md