Issue an independently scoped API key
curl --request POST \
--url https://api.paywithlocus.com/api/credits/tenants/me/keys \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"scopes": [],
"pricing": {
"markupBps": 5000,
"flatMarkupUsdc": "<string>",
"endpoints": {}
},
"expiresIn": 15768030
}
'import requests
url = "https://api.paywithlocus.com/api/credits/tenants/me/keys"
payload = {
"name": "<string>",
"scopes": [],
"pricing": {
"markupBps": 5000,
"flatMarkupUsdc": "<string>",
"endpoints": {}
},
"expiresIn": 15768030
}
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({
name: '<string>',
scopes: [],
pricing: {markupBps: 5000, flatMarkupUsdc: '<string>', endpoints: {}},
expiresIn: 15768030
})
};
fetch('https://api.paywithlocus.com/api/credits/tenants/me/keys', 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/tenants/me/keys",
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([
'name' => '<string>',
'scopes' => [
],
'pricing' => [
'markupBps' => 5000,
'flatMarkupUsdc' => '<string>',
'endpoints' => [
]
],
'expiresIn' => 15768030
]),
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.paywithlocus.com/api/credits/tenants/me/keys"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"scopes\": [],\n \"pricing\": {\n \"markupBps\": 5000,\n \"flatMarkupUsdc\": \"<string>\",\n \"endpoints\": {}\n },\n \"expiresIn\": 15768030\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.paywithlocus.com/api/credits/tenants/me/keys")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"scopes\": [],\n \"pricing\": {\n \"markupBps\": 5000,\n \"flatMarkupUsdc\": \"<string>\",\n \"endpoints\": {}\n },\n \"expiresIn\": 15768030\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paywithlocus.com/api/credits/tenants/me/keys")
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 \"name\": \"<string>\",\n \"scopes\": [],\n \"pricing\": {\n \"markupBps\": 5000,\n \"flatMarkupUsdc\": \"<string>\",\n \"endpoints\": {}\n },\n \"expiresIn\": 15768030\n}"
response = http.request(request)
puts response.read_bodyTenants
Issue an independently scoped API key
Creates an overlapping named credential. Requires the workspace owner with credentials:manage and MFA or passkey step-up completed in the last ten minutes. tools.enable narrows the tenant-enabled catalog for this key; pricing applies only to end-user calls and never widens tenant enablement. kind ‘sandbox’ issues a scopeless test credential (lcrsb_…) whose metered calls are simulated: no credits move and no providers are called. Unknown body fields are rejected with 400.
POST
/
credits
/
tenants
/
me
/
keys
Issue an independently scoped API key
curl --request POST \
--url https://api.paywithlocus.com/api/credits/tenants/me/keys \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"scopes": [],
"pricing": {
"markupBps": 5000,
"flatMarkupUsdc": "<string>",
"endpoints": {}
},
"expiresIn": 15768030
}
'import requests
url = "https://api.paywithlocus.com/api/credits/tenants/me/keys"
payload = {
"name": "<string>",
"scopes": [],
"pricing": {
"markupBps": 5000,
"flatMarkupUsdc": "<string>",
"endpoints": {}
},
"expiresIn": 15768030
}
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({
name: '<string>',
scopes: [],
pricing: {markupBps: 5000, flatMarkupUsdc: '<string>', endpoints: {}},
expiresIn: 15768030
})
};
fetch('https://api.paywithlocus.com/api/credits/tenants/me/keys', 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/tenants/me/keys",
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([
'name' => '<string>',
'scopes' => [
],
'pricing' => [
'markupBps' => 5000,
'flatMarkupUsdc' => '<string>',
'endpoints' => [
]
],
'expiresIn' => 15768030
]),
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.paywithlocus.com/api/credits/tenants/me/keys"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"scopes\": [],\n \"pricing\": {\n \"markupBps\": 5000,\n \"flatMarkupUsdc\": \"<string>\",\n \"endpoints\": {}\n },\n \"expiresIn\": 15768030\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.paywithlocus.com/api/credits/tenants/me/keys")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"scopes\": [],\n \"pricing\": {\n \"markupBps\": 5000,\n \"flatMarkupUsdc\": \"<string>\",\n \"endpoints\": {}\n },\n \"expiresIn\": 15768030\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paywithlocus.com/api/credits/tenants/me/keys")
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 \"name\": \"<string>\",\n \"scopes\": [],\n \"pricing\": {\n \"markupBps\": 5000,\n \"flatMarkupUsdc\": \"<string>\",\n \"endpoints\": {}\n },\n \"expiresIn\": 15768030\n}"
response = http.request(request)
puts response.read_bodyAuthorizations
Locus Pro dashboard session (Cognito).
Body
application/json
Available options:
secret, publishable, sandbox Required string length:
1 - 100Available options:
tenant:read, tenant:write, catalog:write, credits:move, credentials:manage, tokens:manage, payouts:manage, members:manage, widget:read Show child attributes
Show child attributes
Show child attributes
Show child attributes
Required range:
60 <= x <= 31536000Response
{ success, kind, key, keyMetadata } — the raw key is returned exactly once, with the stored lifecycle metadata beside it.