# Currency convert · POST

`POST https://bemap.benomad.com/bgis/service/currency/1.0/convert`

Part of [Currency](https://benomad.com/dev/doc/bemap-api/more-services/currency.md).

> **Convert an amount to another currency.** The same conversion, with the amount and the currencies sent in a JSON body.

Convert a currency to another.

Requires the Currency option (Allow to get currency information); without it BeMap answers `400 Access Denied`.

## Request body

JSON, `Content-Type: application/json`. Schema `CurrencyConvertRequest`.

- `from` (string, required): The currency to convert from
- `value` (number (float), required): The amount to of the from currency to be converted
- `to` (string, required): The currency to convert from
- `geoserver` (string): Geoserver name.
- `swidx` (integer (int32), deprecated): Switch index.

## Response

`200`, schema `CurrencyConvertResponse`.

- `lastUpdate` (integer (int64))
- `value` (number (float))

## Errors

- `400`: Bad Request
- `302`: no credentials were sent. Do not follow the redirect.
- `401`: the account or the API key is wrong.

How to read each one: [Errors](https://benomad.com/dev/doc/bemap-api/getting-started/errors.md).

## Example

```bash
curl -X POST 'https://bemap.benomad.com/bgis/service/currency/1.0/convert' \
  -u 'YOUR_ACCOUNT:YOUR_API_KEY' \
  --fail-with-body \
  -H 'Content-Type: application/json' \
  -d '{
  "from": "USD",
  "to": "EUR",
  "value": 100
}'
```

Response captured from production:

```json
{
  "lastUpdate": 1790905053001,
  "value": 85.31106
}
```

## Reference pages

- [Currency convert](https://benomad.com/dev/doc/bemap-api/guides/services/currency-convert.md)
