> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.epaygames.io/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.epaygames.io/_mcp/server.

# Create Token

POST https://v1/biller/token/create

### Create Token

The **Create Token** endpoint generates a **bearer token** that is used to authenticate requests to all other API endpoints. Each bearer token is valid for **up to 60 minutes** (`3600` seconds).

#### Usage Guidelines

- Call this endpoint **no more than once every 55 minutes** to avoid unnecessary requests.
- Store the token using a **secure method** such as in-memory cache (recommended), encrypted local storage, or your system's secure key store.
- The `expires_in` parameter is measured in **seconds**. A value of `3600` means the token is valid for **60 minutes**.
- The token must be used in the **Authorization header** for subsequent requests, using the **Bearer** scheme:

```makefile
Authorization: Bearer <your_token_here>
```

#### Test Credentials

For sandbox/staging, you may use the following credentials:

- **Username:** `test-merchant`
- **Password:** `p@ssw0rd01`
- **Signature Key:** `9XAgVZzU4WhqrXA6jEvMtkF85j8wKZZhQ5RE2hsDPwa5rjPT7RpCmJceu8jNt4Wy`

Reference: https://docs.epaygames.io/epaygames-payments-disbursement-api/payments-api/create-token

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: collection
  version: 1.0.0
paths:
  /v1/biller/token/create:
    post:
      operationId: Create Token
      summary: Create Token
      description: >-
        ### Create Token


        The **Create Token** endpoint generates a **bearer token** that is used
        to authenticate requests to all other API endpoints. Each bearer token
        is valid for **up to 60 minutes** (`3600` seconds).


        #### Usage Guidelines


        - Call this endpoint **no more than once every 55 minutes** to avoid
        unnecessary requests.

        - Store the token using a **secure method** such as in-memory cache
        (recommended), encrypted local storage, or your system's secure key
        store.

        - The `expires_in` parameter is measured in **seconds**. A value of
        `3600` means the token is valid for **60 minutes**.

        - The token must be used in the **Authorization header** for subsequent
        requests, using the **Bearer** scheme:


        ```makefile

        Authorization: Bearer <your_token_here>

        ```


        #### Test Credentials


        For sandbox/staging, you may use the following credentials:


        - **Username:** `test-merchant`

        - **Password:** `p@ssw0rd01`

        - **Signature Key:**
        `9XAgVZzU4WhqrXA6jEvMtkF85j8wKZZhQ5RE2hsDPwa5rjPT7RpCmJceu8jNt4Wy`
      tags:
        - paymentsApi
      parameters:
        - name: username
          in: query
          required: false
          schema:
            type: string
        - name: password
          in: query
          required: false
          schema:
            type: string
        - name: X-Server
          in: header
          required: false
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties: {}
servers:
  - url: https:/
    description: https://{payments_api_host}

```

## Examples



**Response**

```json
"{\n    \"message\": \"Successfully authenticated.\",\n    \"data\": {\n        \"token\": \"yDElUGArkNE5ZHc23ghadZNEOcCcPuSDY1LbVGTO08c2770a\",\n        \"type\": \"Bearer\",\n        \"expires_in\": 3600\n    }\n}"
```

**SDK Code**

```python Payments API_Create Token_example
import requests

url = "https://https/v1/biller/token/create"

querystring = {"password":"p@ssw0rd01","username":"test-merchant"}

headers = {"X-Server": "1"}

response = requests.post(url, headers=headers, params=querystring)

print(response.json())
```

```javascript Payments API_Create Token_example
const url = 'https://https/v1/biller/token/create?password=p%40ssw0rd01&username=test-merchant';
const options = {method: 'POST', headers: {'X-Server': '1'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Payments API_Create Token_example
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://https/v1/biller/token/create?password=p%40ssw0rd01&username=test-merchant"

	req, _ := http.NewRequest("POST", url, nil)

	req.Header.Add("X-Server", "1")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Payments API_Create Token_example
require 'uri'
require 'net/http'

url = URI("https://https/v1/biller/token/create?password=p%40ssw0rd01&username=test-merchant")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["X-Server"] = '1'

response = http.request(request)
puts response.read_body
```

```java Payments API_Create Token_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://https/v1/biller/token/create?password=p%40ssw0rd01&username=test-merchant")
  .header("X-Server", "1")
  .asString();
```

```php Payments API_Create Token_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://https/v1/biller/token/create?password=p%40ssw0rd01&username=test-merchant', [
  'headers' => [
    'X-Server' => '1',
  ],
]);

echo $response->getBody();
```

```csharp Payments API_Create Token_example
using RestSharp;

var client = new RestClient("https://https/v1/biller/token/create?password=p%40ssw0rd01&username=test-merchant");
var request = new RestRequest(Method.POST);
request.AddHeader("X-Server", "1");
IRestResponse response = client.Execute(request);
```

```swift Payments API_Create Token_example
import Foundation

let headers = ["X-Server": "1"]

let request = NSMutableURLRequest(url: NSURL(string: "https://https/v1/biller/token/create?password=p%40ssw0rd01&username=test-merchant")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```