# epx currencies

> Read, create, change and delete currencies.

## epx currencies

Reads the tenant's currencies.

Its reads need no OAuth scope.
Its writes require the currency.currency_manage scope.

**Command:** `epx currencies [flags]`, `epx currencies [command]`

**Flags:** only the [global flags](https://commerce-cloud-integrations.github.io/emporix-cli/commands#global-flags).

**Subcommands**

- [`epx currencies create`](#epx-currencies-create)\
  Create a currency.
- [`epx currencies delete`](#epx-currencies-delete)\
  Delete a currency.
- [`epx currencies get`](#epx-currencies-get)\
  Show one currency.
- [`epx currencies list`](#epx-currencies-list)\
  List currencies.
- [`epx currencies update`](#epx-currencies-update)\
  Rename a currency.

## epx currencies create

Create a currency.

Creates a currency from the JSON in `--file`: its code (ISO 4217) and name, e.g.
`{"code": "CHF", "name": {"en": "Swiss franc", "de": "Schweizer Franken"}}`, in languages
that the tenant has. Emporix answers with the code; a code that exists already is a
conflict (exit 5).

Localized text in the body, such as a name, is a map of translations, e.g.
`{"en": "gram", "de": "Gramm"}`, as `-o json` of a read prints it, or with `--content-language`
LANGUAGE a string in that language, e.g. `"gram"` with `--content-language` en.

Changes data: on a terminal, epx asks before it sends POST. `--yes` sends without
asking (required without a terminal, or with `--file` -); `--dry-run` prints the request
instead of sending it.

Requires the currency.currency_manage scope.

**Command:** `epx currencies create [flags]`

**Flags**

- `--content-language <LANGUAGE>`\
  The LANGUAGE of localized text in the body, or \* for maps of translations. Default: `*`.
- `--dry-run`\
  Print the request instead of sending it (excludes `-o`).
- `--file <PATH>`\
  JSON request body in PATH, sent byte for byte (- reads standard input; sending it then needs `--yes`; required).
- `-o, --output <format>`\
  Format of the response: json or yaml. Default: `json`.
- `--yes`\
  Send without asking (required without a terminal, or with `--file` -).

Also takes the [global flags](https://commerce-cloud-integrations.github.io/emporix-cli/commands#global-flags).

## epx currencies delete

Delete a currency.

Deletes the currency CODE; it sends no body. The reference says Emporix also deletes the
prices in the currency, asynchronously (not checked here). The exchange rates stay, and a site
that lists the currency keeps listing it. It sends no forceDelete, which the reference documents
(default false) without saying what it changes.
Emporix answers an unknown CODE as one that it deleted (204 No Content).

Deletes data, which cannot be undone.
On a terminal, epx sends DELETE only once you type CODE at its prompt.
`--yes` sends without asking (required without a terminal);
`--dry-run` prints the request instead of sending it.

Requires the currency.currency_manage scope.

**Command:** `epx currencies delete CODE [flags]`

**Flags**

- `--dry-run`\
  Print the request instead of sending it (excludes `-o`).
- `-o, --output <format>`\
  Format of the response: json or yaml. Default: `json`.
- `--yes`\
  Send without asking (required without a terminal).

Also takes the [global flags](https://commerce-cloud-integrations.github.io/emporix-cli/commands#global-flags).

## epx currencies get

Show one currency.

Reads the tenant's currencies.

No OAuth scope is needed.

**Command:** `epx currencies get CODE [flags]`

**Flags**

- `--columns <names>`\
  Print only these columns of table and csv, in this order: comma-separated names (any case) among CODE, NAME.
- `--language <language>`\
  Language of localized table text; a missing translation shows another, labeled (`-o json` prints all). Default: `en`.
- `--no-headers`\
  Print table and csv without the header row.
- `-o, --output <format>`\
  Output format: table, json, yaml or csv (csv: the table's rows; json and yaml: the whole response). Default: `table`.

Also takes the [global flags](https://commerce-cloud-integrations.github.io/emporix-cli/commands#global-flags).

## epx currencies list

List currencies.

Reads the tenant's currencies.

No OAuth scope is needed.

**Command:** `epx currencies list [flags]`

**Flags**

- `--columns <names>`\
  Print only these columns of table and csv, in this order: comma-separated names (any case) among CODE, NAME.
- `--language <language>`\
  Language of localized table text; a missing translation shows another, labeled (`-o json` prints all). Default: `en`.
- `--limit <n>`\
  Print at most n items; paged reads stop early where they safely can (0: every item).
- `--no-headers`\
  Print table and csv without the header row.
- `-o, --output <format>`\
  Output format: table, json, yaml or csv (csv: the table's rows; json and yaml: the whole response). Default: `table`.
- `--sort <order>`\
  Emporix sort order, passed as given, e.g. code or name.en:desc,code; fields mostly as in `-o json` (Emporix may ignore an unknown one).
- `--stream`\
  Print items as JSON Lines as soon as they are checked, page by page on paged lists, reading up to 10000 pages where a list without it stops after 1000: a check failing on a later page exits 1 after the pages before it (excludes `-o`, `--columns` and `--no-headers`).

Also takes the [global flags](https://commerce-cloud-integrations.github.io/emporix-cli/commands#global-flags).

## epx currencies update

Rename a currency.

Replaces the name of the currency CODE with the one in the JSON of `--file`, which also
needs the currency's metadata.version as read ([`epx currencies get CODE -o json`](https://commerce-cloud-integrations.github.io/emporix-cli/commands/currencies#epx-currencies-get)), e.g.
`{"name": {"en": "Swiss franc"}, "metadata": {"version": 1}}`; the code cannot change. A
stale version and an unknown CODE are both not found (exit 4): Emporix answers 404 to both.

Localized text in the body, such as a name, is a map of translations, e.g.
`{"en": "gram", "de": "Gramm"}`, as `-o json` of a read prints it, or with `--content-language`
LANGUAGE a string in that language, e.g. `"gram"` with `--content-language` en.

Changes data: on a terminal, epx asks before it sends PUT. `--yes` sends without
asking (required without a terminal, or with `--file` -); `--dry-run` prints the request
instead of sending it.

Requires the currency.currency_manage scope.

**Command:** `epx currencies update CODE [flags]`

**Flags**

- `--content-language <LANGUAGE>`\
  The LANGUAGE of localized text in the body, or \* for maps of translations. Default: `*`.
- `--dry-run`\
  Print the request instead of sending it (excludes `-o`).
- `--file <PATH>`\
  JSON request body in PATH, sent byte for byte (- reads standard input; sending it then needs `--yes`; required).
- `-o, --output <format>`\
  Format of the response: json or yaml. Default: `json`.
- `--yes`\
  Send without asking (required without a terminal, or with `--file` -).

Also takes the [global flags](https://commerce-cloud-integrations.github.io/emporix-cli/commands#global-flags).
