# Update the store currency

URL: https://docs.sparklayer.io/developers/api/purchasing/update-store-currency
Operation: `PUT /api/v1/store-currency` (operationId `putStoreCurrency`)
OpenAPI spec: https://docs.sparklayer.io/openapi/purchasing.yaml

Sets the store's base currency to the ISO 4217 `currency_code` you send, such as `GBP`, and returns it. Returns `409` if the base currency is already set to a different value.

`PUT /api/v1/store-currency`

**Base URLs:** `https://app.sparklayer.io` (Live), `https://test.app.sparklayer.io` (Test)

**Authentication:** send `Authorization: Bearer <access_token>` and `Site-Id: <site id>` with every request. Get the token from [Get an access token](https://docs.sparklayer.io/developers/api/core/get-an-access-token.md); see [Authentication](https://docs.sparklayer.io/developers/authentication.md).

### Example request

```bash
curl -X PUT "https://app.sparklayer.io/api/v1/store-currency" \
  -H "Authorization: Bearer $SPARKLAYER_TOKEN" \
  -H "Site-Id: $SPARKLAYER_SITE_ID" \
  -H "Content-Type: application/json" \
  -d '{
  "currency_code": "GBP"
}'
```

Set `SPARKLAYER_TOKEN` to an access token and `SPARKLAYER_SITE_ID` to your Site ID. For the test environment, use `https://test.app.sparklayer.io`.

### Header parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `Site-Id` | string | Yes | Your SparkLayer Site ID, from Settings > API in the SparkLayer Dashboard. Length: min 1. Example: `jones-climbing` |

### Request body (`application/json`) (required)

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `currency_code` | string | Yes | An ISO 4217 currency code. Length: min 3, max 3. |

```json
{
  "currency_code": "GBP"
}
```

### Responses

#### 200: Store base currency set successfully

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `currency_code` | string | Yes | Length: min 3, max 3. |

```json
{
  "currency_code": "GBP"
}
```

#### 409: Store base currency already set to a different value
