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

# Initiate Session

> Initiate new session for a payment. This endpoint will help you get the SessionId that will be used to execute the payment later.

### Query Parameters

<ParamField body="apiKey" type="string" placeholder="API Key" required>
  The API Key of your account.
</ParamField>

<ParamField body="data" type="object" required>
  <Expandable title="properties" defaultOpen={true}>
    <ResponseField name="CustomerIdentifier" type="string|integer">
      A unique value represent the customer (your user).

      Samples: `"UID123"`, `"123"`, or `123`.
    </ResponseField>
  </Expandable>
</ParamField>

<ParamField body="test" type="boolean" initialValue={true}>
  Set this property to `true` to send the request to the development
  environment.
</ParamField>

<ResponseExample>
  ```json Success theme={null}
  {
    "SessionId": "e09da666-398d-4f0e-bc02-01346d9e3258",
    "CountryCode": "KWT",
    "CustomerTokens": []
  }
  ```

  ```json Error theme={null}
  {
    "success": false,
    "code": 1,
    "message": "Missing or invalid api key"
  }
  ```
</ResponseExample>

### Response properties

{" "}

<ResponseField name="SessionId" type="string" required>
  The created session identifier.
</ResponseField>

<ResponseField name="CountryCode" type="string" required>
  The country code (depends on your account)
</ResponseField>

## Error Codes

Here's a list of possible error codes of this endpoint.

| **Code** | **Description**                               |
| -------- | --------------------------------------------- |
| 1        | Missing or invalid api key                    |
| 2        | `CustomerIdentifier` is a required parameter. |
