> For the complete documentation index, see [llms.txt](https://docs.payengine.co/payengine-api-v2.5/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.payengine.co/payengine-api-v2.5/merchant-sessions/create-a-merchant-session.md).

# Create/Refresh a merchant session

Creates or Refreshes a new merchant session

<mark style="color:green;">`POST`</mark> `/api/merchant/:merchantId/sessions`

**Headers**

<table><thead><tr><th width="317.333251953125">Name</th><th>Value</th></tr></thead><tbody><tr><td>Content-Type</td><td><code>application/json</code></td></tr><tr><td>Authorization</td><td><code>Basic &#x3C;API KEY></code></td></tr></tbody></table>

**Request**

<table><thead><tr><th width="203.2760009765625">Property</th><th width="114.739501953125">Type</th><th>Description</th></tr></thead><tbody><tr><td>access_token</td><td>string</td><td>Optional: If provided, invalidates existing token and provides a new one</td></tr><tr><td>expires_in</td><td>int</td><td>Optional: the value in seconds for the token expiration. default is 900 (15 min)</td></tr><tr><td>scope</td><td>string</td><td><p>Optional: <code>readonly</code> | <code>default</code></p><p>Setting scope to <code>readonly</code> restricts actions like hiding the Refund button in the transaction widget.<br><br>Note: if not provided, <code>default</code> will be applied.</p></td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  access_token: "<Access Token>",
  expires_in: "<Duration>",
  scope: "default",
  type: "Session"
}
```

{% endtab %}
{% endtabs %}
