Chat With Advisor
curl --request POST \
--url https://api.loyalty.dog/api/ai-advisor \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"message": "<string>",
"conversationHistory": [
{
"role": "<string>",
"content": "<string>"
}
],
"dateRangeOverride": {},
"userId": "<string>",
"programId": "<string>",
"transactionSummary": {},
"transactionDetails": [
{}
],
"currencyCode": "USD",
"currencySymbol": "$"
}
'import requests
url = "https://api.loyalty.dog/api/ai-advisor"
payload = {
"message": "<string>",
"conversationHistory": [
{
"role": "<string>",
"content": "<string>"
}
],
"dateRangeOverride": {},
"userId": "<string>",
"programId": "<string>",
"transactionSummary": {},
"transactionDetails": [{}],
"currencyCode": "USD",
"currencySymbol": "$"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
message: '<string>',
conversationHistory: [{role: '<string>', content: '<string>'}],
dateRangeOverride: {},
userId: '<string>',
programId: '<string>',
transactionSummary: {},
transactionDetails: [{}],
currencyCode: 'USD',
currencySymbol: '$'
})
};
fetch('https://api.loyalty.dog/api/ai-advisor', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.loyalty.dog/api/ai-advisor",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'message' => '<string>',
'conversationHistory' => [
[
'role' => '<string>',
'content' => '<string>'
]
],
'dateRangeOverride' => [
],
'userId' => '<string>',
'programId' => '<string>',
'transactionSummary' => [
],
'transactionDetails' => [
[
]
],
'currencyCode' => 'USD',
'currencySymbol' => '$'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.loyalty.dog/api/ai-advisor"
payload := strings.NewReader("{\n \"message\": \"<string>\",\n \"conversationHistory\": [\n {\n \"role\": \"<string>\",\n \"content\": \"<string>\"\n }\n ],\n \"dateRangeOverride\": {},\n \"userId\": \"<string>\",\n \"programId\": \"<string>\",\n \"transactionSummary\": {},\n \"transactionDetails\": [\n {}\n ],\n \"currencyCode\": \"USD\",\n \"currencySymbol\": \"$\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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))
}HttpResponse<String> response = Unirest.post("https://api.loyalty.dog/api/ai-advisor")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"message\": \"<string>\",\n \"conversationHistory\": [\n {\n \"role\": \"<string>\",\n \"content\": \"<string>\"\n }\n ],\n \"dateRangeOverride\": {},\n \"userId\": \"<string>\",\n \"programId\": \"<string>\",\n \"transactionSummary\": {},\n \"transactionDetails\": [\n {}\n ],\n \"currencyCode\": \"USD\",\n \"currencySymbol\": \"$\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.loyalty.dog/api/ai-advisor")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"message\": \"<string>\",\n \"conversationHistory\": [\n {\n \"role\": \"<string>\",\n \"content\": \"<string>\"\n }\n ],\n \"dateRangeOverride\": {},\n \"userId\": \"<string>\",\n \"programId\": \"<string>\",\n \"transactionSummary\": {},\n \"transactionDetails\": [\n {}\n ],\n \"currencyCode\": \"USD\",\n \"currencySymbol\": \"$\"\n}"
response = http.request(request)
puts response.read_body{
"response": "<string>",
"transactionCount": 123,
"transactionSummary": {},
"dateRange": {},
"timestamp": "<string>",
"warning": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}AI Advisor
Chat With Advisor
Handle a chat request and return a structured AI advisor response.
Uses Mistral AI with the Scout personality to provide business insights.
Returns: AIAdvisorResponse: Advisor message, transaction metrics and summary, date range, optional warning, and timestamp.
Raises: HTTPException: with status 503 if AI backend (MISTRAL_API_KEY) is not configured; with status 500 for other internal errors.
POST
/
api
/
ai-advisor
Chat With Advisor
curl --request POST \
--url https://api.loyalty.dog/api/ai-advisor \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"message": "<string>",
"conversationHistory": [
{
"role": "<string>",
"content": "<string>"
}
],
"dateRangeOverride": {},
"userId": "<string>",
"programId": "<string>",
"transactionSummary": {},
"transactionDetails": [
{}
],
"currencyCode": "USD",
"currencySymbol": "$"
}
'import requests
url = "https://api.loyalty.dog/api/ai-advisor"
payload = {
"message": "<string>",
"conversationHistory": [
{
"role": "<string>",
"content": "<string>"
}
],
"dateRangeOverride": {},
"userId": "<string>",
"programId": "<string>",
"transactionSummary": {},
"transactionDetails": [{}],
"currencyCode": "USD",
"currencySymbol": "$"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
message: '<string>',
conversationHistory: [{role: '<string>', content: '<string>'}],
dateRangeOverride: {},
userId: '<string>',
programId: '<string>',
transactionSummary: {},
transactionDetails: [{}],
currencyCode: 'USD',
currencySymbol: '$'
})
};
fetch('https://api.loyalty.dog/api/ai-advisor', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.loyalty.dog/api/ai-advisor",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'message' => '<string>',
'conversationHistory' => [
[
'role' => '<string>',
'content' => '<string>'
]
],
'dateRangeOverride' => [
],
'userId' => '<string>',
'programId' => '<string>',
'transactionSummary' => [
],
'transactionDetails' => [
[
]
],
'currencyCode' => 'USD',
'currencySymbol' => '$'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.loyalty.dog/api/ai-advisor"
payload := strings.NewReader("{\n \"message\": \"<string>\",\n \"conversationHistory\": [\n {\n \"role\": \"<string>\",\n \"content\": \"<string>\"\n }\n ],\n \"dateRangeOverride\": {},\n \"userId\": \"<string>\",\n \"programId\": \"<string>\",\n \"transactionSummary\": {},\n \"transactionDetails\": [\n {}\n ],\n \"currencyCode\": \"USD\",\n \"currencySymbol\": \"$\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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))
}HttpResponse<String> response = Unirest.post("https://api.loyalty.dog/api/ai-advisor")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"message\": \"<string>\",\n \"conversationHistory\": [\n {\n \"role\": \"<string>\",\n \"content\": \"<string>\"\n }\n ],\n \"dateRangeOverride\": {},\n \"userId\": \"<string>\",\n \"programId\": \"<string>\",\n \"transactionSummary\": {},\n \"transactionDetails\": [\n {}\n ],\n \"currencyCode\": \"USD\",\n \"currencySymbol\": \"$\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.loyalty.dog/api/ai-advisor")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"message\": \"<string>\",\n \"conversationHistory\": [\n {\n \"role\": \"<string>\",\n \"content\": \"<string>\"\n }\n ],\n \"dateRangeOverride\": {},\n \"userId\": \"<string>\",\n \"programId\": \"<string>\",\n \"transactionSummary\": {},\n \"transactionDetails\": [\n {}\n ],\n \"currencyCode\": \"USD\",\n \"currencySymbol\": \"$\"\n}"
response = http.request(request)
puts response.read_body{
"response": "<string>",
"transactionCount": 123,
"transactionSummary": {},
"dateRange": {},
"timestamp": "<string>",
"warning": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
JWT access token obtained from POST /v2/token.
Body
application/json
Required string length:
1 - 2000Maximum array length:
20Show child attributes
Show child attributes
Show child attributes
Show child attributes
Maximum array length:
100⌘I
