curl --request GET \
--url https://api.paywithlocus.com/api/credits/analytics/customers \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.paywithlocus.com/api/credits/analytics/customers"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.paywithlocus.com/api/credits/analytics/customers', 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.paywithlocus.com/api/credits/analytics/customers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.paywithlocus.com/api/credits/analytics/customers"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.paywithlocus.com/api/credits/analytics/customers")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paywithlocus.com/api/credits/analytics/customers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"periodStart": "2023-11-07T05:31:56Z",
"periodEndExclusive": "2023-11-07T05:31:56Z",
"total": 123,
"customers": [
{
"spenderId": "<string>",
"source": "<string>",
"customerId": "<string>",
"name": "<string>",
"url": "<string>",
"adminUrl": "<string>",
"usageUsdc": "<string>",
"calls": 123,
"providers": 123,
"firstChargeAt": "2023-11-07T05:31:56Z",
"lastChargeAt": "2023-11-07T05:31:56Z"
}
],
"sources": [
{
"source": "<string>",
"customers": 123,
"usageUsdc": "<string>",
"calls": 123
}
]
}{
"success": false,
"error": "Forbidden",
"code": "INSUFFICIENT_SCOPE",
"message": "<string>",
"requiredScopes": [
"tenant:read"
],
"presentScopes": [
"tenant:read"
]
}Every customer with spend in a window
Each (attribution.source, customerId) pair the tenant’s charges were attributed to in the window, counted exactly as analytics counts customer spend, named from the customer directory, filterable by product, searchable, and paged past the analytics row cap. sources totals every product with customer spend in the window and ignores source and q. Enterprise workspaces only.
curl --request GET \
--url https://api.paywithlocus.com/api/credits/analytics/customers \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.paywithlocus.com/api/credits/analytics/customers"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.paywithlocus.com/api/credits/analytics/customers', 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.paywithlocus.com/api/credits/analytics/customers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.paywithlocus.com/api/credits/analytics/customers"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.paywithlocus.com/api/credits/analytics/customers")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paywithlocus.com/api/credits/analytics/customers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"periodStart": "2023-11-07T05:31:56Z",
"periodEndExclusive": "2023-11-07T05:31:56Z",
"total": 123,
"customers": [
{
"spenderId": "<string>",
"source": "<string>",
"customerId": "<string>",
"name": "<string>",
"url": "<string>",
"adminUrl": "<string>",
"usageUsdc": "<string>",
"calls": 123,
"providers": 123,
"firstChargeAt": "2023-11-07T05:31:56Z",
"lastChargeAt": "2023-11-07T05:31:56Z"
}
],
"sources": [
{
"source": "<string>",
"customers": 123,
"usageUsdc": "<string>",
"calls": 123
}
]
}{
"success": false,
"error": "Forbidden",
"code": "INSUFFICIENT_SCOPE",
"message": "<string>",
"requiredScopes": [
"tenant:read"
],
"presentScopes": [
"tenant:read"
]
}Authorizations
Locus Pro dashboard session (Cognito). High-risk workspace administration requires an owner or admin role and fresh MFA/passkey step-up.
Query Parameters
Legacy form, as analytics. Cannot be combined with from/to.
7, 30, 90 Window start, inclusive. Strict ISO-8601. Requires to.
Window end, EXCLUSIVE. Strict ISO-8601. Requires from.
Only this product's customers (attribution.source), exactly as tagged. Send it empty (source=) for customers with no product tag; omit it for every product.
128Case-insensitive literal substring of the directory name, the link, or the customer id.
1200 <= x <= 21474836471 <= x <= 100Response
One page of customers, the matching total, and per-product totals