MyTPEMyTPE Pay
Authentication

Sign In

Authenticate a user and obtain an access token.

Sign In

Public Endpoint

This endpoint is publicly accessible and does not require authentication.

HTTP Method and URL

POST https://dev.mytpe.app/api/signin

Authenticate a user with email and password credentials.

Authentication

Authentication: None (Public endpoint)

No authentication required for this endpoint.

Request Parameters

Path Parameters

No path parameters required.

Query Parameters

No query parameters required.

Request Body

Prop

Type

Request Example

signin.js
const response = await fetch('https://dev.mytpe.app/api/signin', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Accept': 'application/json'
  },
  body: JSON.stringify({
    email: 'user@example.com',
    password: 'your_password',
    device_name: 'My Device'
  })
});

const data = await response.json();
console.log(data);
signin.ts
interface SignInResponse {
  token: string;
  userInfo: {
    id: number;
    name: string;
    email: string;
    email_verified_at: string | null;
    created_at: string;
    updated_at: string;
  };
  roles: string[];
  permissions: string[] | null;
  date_expiration: string | null;
}

const response = await fetch('https://dev.mytpe.app/api/signin', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Accept': 'application/json'
  },
  body: JSON.stringify({
    email: 'user@example.com',
    password: 'your_password',
    device_name: 'My Device'
  })
});

const data: SignInResponse = await response.json();
console.log(data);
signin.py
import requests

response = requests.post(
    'https://dev.mytpe.app/api/signin',
    json={
        'email': 'user@example.com',
        'password': 'your_password',
        'device_name': 'My Device'
    },
    headers={
        'Content-Type': 'application/json',
        'Accept': 'application/json'
    }
)

data = response.json()
print(data)
signin.php
use Illuminate\Support\Facades\Http;

$response = Http::withHeaders([
    'Accept' => 'application/json',
])->post('https://dev.mytpe.app/api/signin', [
    'email' => 'user@example.com',
    'password' => 'your_password',
    'device_name' => 'My Device',
]);

$data = $response->json();
signin.php
<?php
$ch = curl_init();

curl_setopt_array($ch, [
    CURLOPT_URL => 'https://dev.mytpe.app/api/signin',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POST => true,
    CURLOPT_HTTPHEADER => [
        'Content-Type: application/json',
        'Accept: application/json',
    ],
    CURLOPT_POSTFIELDS => json_encode([
        'email' => 'user@example.com',
        'password' => 'your_password',
        'device_name' => 'My Device',
    ]),
]);

$response = curl_exec($ch);
curl_close($ch);

$data = json_decode($response, true);
print_r($data);
signin.cjs
const axios = require('axios');

axios.post('https://dev.mytpe.app/api/signin', {
    email: 'user@example.com',
    password: 'your_password',
    device_name: 'My Device'
  }, {
    headers: {
      'Content-Type': 'application/json',
      'Accept': 'application/json'
    }
  })
  .then(response => {
    console.log(response.data);
  })
  .catch(error => {
    console.error(error.response.data);
  });

Successful Response Example

200 OK

{
    "token": "1|xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "userInfo": {
        "id": 123,
        "name": "John Doe",
        "email": "user@example.com",
        "email_verified_at": "2025-01-15T10:30:00.000000Z",
        "created_at": "2025-01-01T00:00:00.000000Z",
        "updated_at": "2025-12-17T00:00:00.000000Z"
    },
    "roles": [
        "trader"
    ],
    "permissions": [
        "view-dashboard",
        "manage-orders"
    ],
    "date_expiration": "2026-12-17T00:00:00.000000Z"
}

Response Fields

Prop

Type

Error Responses

401 Unauthorized - Invalid Credentials

{
    "message": "The provided credentials are incorrect."
}

422 Validation Error

{
    "message": "The given data was invalid.",
    "errors": {
        "email": [
            "The email field is required."
        ],
        "password": [
            "The password field is required."
        ]
    }
}

Using the Token

After successful authentication, include the token in subsequent API requests using the Authorization header:

Authorization: Bearer {token}

Token Security

Store the token securely and never expose it in client-side code or URLs. The token provides full access to the user's account.

On this page