> For the complete documentation index, see [llms.txt](https://apidocs.akinon.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://apidocs.akinon.com/commerce/users/currency-and-akifast-operations.md).

# Currency & Akifast Operations

### `POST` Activate Currency

Sets the active currency for the user's session. This currency will be used for pricing, discounts, and campaigns across the shop.

Commerce supports multiple currencies. By allowing customers to select their preferred currency, the system dynamically adapts product prices, discounts, campaigns, and payment processes to align with the active currency throughout their session.

The multi-currency feature can be managed in two ways: session-based or request-based. A dynamic setting called `READ_CURRENCY_FROM_HEADER` determines the behavior, with its default value set to `False`. When this setting is switched to `True`, the active currency must be provided in the request header using the key `x-currency`.

The default active currency is determined by the `DEFAULT_CURRENCY` dynamic setting and is used as a fallback when neither session-based nor request-based methods are applicable.

**Path:** `/users/activate-currency/`

**Authentication Required:** No

**Headers:**

```
Content-Type: application/json
Accept-Language: <iso_language_code>
x-csrftoken: <token>
```

**Body Parameters**

|    Property    | Data Type | Required | Description                         |
| :------------: | :-------: | :------: | ----------------------------------- |
| currency\_code |   String  |   True   | Specifies the currency to activate. |

**Request Body**

```json
{
    "currency_code": "<CURRENCY_TYPE"
}
```

The `currency_code` must be included in the `AVAILABLE_CURRENCIES` dynamic setting, which can contain the following currencies: `tr`, `eu`, `usd`, `egp`, `gbp`, `mad`, `pln`, `sar`, `ron`, `uah`, `czk`, `huf`, `rub`, `bgn`, `iqd`, `kwd`, `bhd`, `omr`, `qar`, `aed`, `ngn`, `inr`, `lei`, `kzt`, `jod`, `rsd`.

**Example Request**

```py
import requests
import json

url = "http://{commerce_url}/users/activate-currency/"

headers = {
  'Content-Type': 'application/json',
  'Accept-Language': '<iso_language_code>'
  'x-csrftoken': '<token>'
}

payload = json.dumps({
 "currency_code": "try"
})

response = requests.post(url, headers=headers, data=payload)

print(response.status_code)
print(response.text)
```

**Example Response (204 No Content)**

Successfully activated currency.

**Example Response (400 Bad Request)**

```json
{
    "currency_code": [
        "\"invalid\" is not a valid choice."
    ]
}
```

### `POST` User Create Akifast Guest User Permissions

This endpoint is used to store the necessary communication permissions for users who are using Akifast as guests on the payment screen. The entered data is initially stored in the cache and later used when creating a user record in the Commerce.

**Path:** `/users/permissions/`

**Authentication Required:** No

**Headers:**

```
Content-Type: application/json
Accept-Language: <iso_language_code>
x-csrftoken: <token>
```

**Body Parameters**

| Property       | Data Type | Required | Description                                       |
| -------------- | --------- | -------- | ------------------------------------------------- |
| uid            | String    | True     | A unique identifier (UUID).                       |
| basket         | Integer   | True     | ID of the basket (BasketStatus must be `active`). |
| sms\_allowed   | Boolean   | False    | A value indicating that SMS sending is allowed.   |
| call\_allowed  | Boolean   | False    | A value indicating that calling is allowed.       |
| email\_allowed | Boolean   | False    | A value indicating that email sending is allowed. |

**Request Body**

```json
{
    "uid": "ca6851c94d857ef40f60763",
    "basket": <Basket.id>,
    "email_allowed": <boolean>,
    "call_allowed": <boolean>,
    "sms_allowed": <boolean>,
}
```

**Example Request**

```py
import requests
import json

url = "https://{commerce_url}/users/permissions/"

headers = {
  'Content-Type': 'application/json',
  'Accept-Language': '<iso_language_code>',
  'x-csrftoken': '<token>'
}

payload = json.dumps({
    "uid": "ca6851c94d857ef40f60763",
    "basket": 3606,
    "email_allowed": True,
    "call_allowed": False,
    "sms_allowed": True,
})

response = requests.post(url, headers=headers, data=payload)
print(response.text)
```

**Example Response (200 OK)**

```json
{}
```

**Example Response (400 Bad Request)**

When a request is sent with a basket whose **status** is not `active`,

```json
{
  "basket": [
    "Invalid pk \"3606\" - object does not exist."
  ]
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://apidocs.akinon.com/commerce/users/currency-and-akifast-operations.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
