Consumer Login
curl --request POST \
--url https://api.truthlocks.com/v1/consumer/login \
--header 'Content-Type: application/json' \
--data '
{
"email": "user@example.com",
"password": "password123"
}
'const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({email: 'user@example.com', password: 'password123'})
};
fetch('https://api.truthlocks.com/v1/consumer/login', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.truthlocks.com/v1/consumer/login"
payload = {
"email": "user@example.com",
"password": "password123"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.truthlocks.com/v1/consumer/login"
payload := strings.NewReader("{\n \"email\": \"user@example.com\",\n \"password\": \"password123\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"session_token": "<string>",
"user": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"email": "<string>",
"name": "<string>",
"realm": "<string>"
}
}Consumer (B2C)
Consumer Login
Authenticates a consumer and returns a session token. No API key required.
POST
/
v1
/
consumer
/
login
Consumer Login
curl --request POST \
--url https://api.truthlocks.com/v1/consumer/login \
--header 'Content-Type: application/json' \
--data '
{
"email": "user@example.com",
"password": "password123"
}
'const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({email: 'user@example.com', password: 'password123'})
};
fetch('https://api.truthlocks.com/v1/consumer/login', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.truthlocks.com/v1/consumer/login"
payload = {
"email": "user@example.com",
"password": "password123"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.truthlocks.com/v1/consumer/login"
payload := strings.NewReader("{\n \"email\": \"user@example.com\",\n \"password\": \"password123\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"session_token": "<string>",
"user": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"email": "<string>",
"name": "<string>",
"realm": "<string>"
}
}Authenticate a consumer and receive a session cookie. The session cookie is HttpOnly and Secure. Consumers must verify their email before logging in.

