> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tunimobile.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Open / close a sales session

> Close the terminal's current session, get its summary, and open a new one.

A session groups the vouchers sold by one terminal over a period (for example one shift or one day). A terminal always has one open session: the first one is created when the terminal is registered.

This call **closes** the current session, returns its summary, and **opens** a new one. Use it for the end-of-shift report.

> [!NOTE]
>
> No body. Mind the trailing slash in the path: `/session/`.

## Headers

**api-key** `string` *required*

The [terminal API key](https://docs.tunimobile.com/basics/terminal-api-key.md).

## Response

`201`: summary of the session that was just closed (empty array `[]` if there was none).

**id** `integer`

Session id.

**startAt** `string`

Session start.

**endAt** `string`

Session end.

**terminal** `string`

Terminal id and name.

**byOperator** `object`

Sales amount in TND per operator, at the shop's selling prices, and `total`.

**byValue** `object`

Number of vouchers sold per value (`1dt`, `5dt`) and `total`.

**byValueAndOperator** `object[]`

Number of vouchers per operator and value.

**logo** `string`

Shop logo to print on the report.

## Errors

| HTTP | `error.details` | Meaning |
| - | - | - |
| `404` | `Terminal not found` | `api-key` header missing or unknown |

```bash cURL theme={null}
curl -X POST -H "api-key: 6f1c2a9e-4b7d-4e0a-9c55-2d8f3b1a7e10" \
  https://apitest.tunimobile.com/v1/session/
```

```json 201 theme={null}
{
  "status": "success",
  "code": 200,
  "message": "OK",
  "data": {
    "id": 501,
    "startAt": "2026-10-28 08:00:00",
    "endAt": "2026-10-28 18:30:12",
    "terminal": "88 - N/A",
    "byOperator": { "orange": 45, "tt": 20, "ooredoo": 10, "total": 75 },
    "byValue": { "5dt": 12, "1dt": 15, "total": 27 },
    "byValueAndOperator": [
      { "operator": "orange", "value": 5, "total": 9 },
      { "operator": "tt", "value": 1, "total": 20 }
    ],
    "logo": "https://api.tunimobile.com/images/avatars_bw/123.png"
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.