curl --request DELETE \
--url https://api.paywithlocus.com/api/credits/end-users/{externalUserId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.paywithlocus.com/api/credits/end-users/{externalUserId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.paywithlocus.com/api/credits/end-users/{externalUserId}', 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/end-users/{externalUserId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
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/end-users/{externalUserId}"
req, _ := http.NewRequest("DELETE", 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.delete("https://api.paywithlocus.com/api/credits/end-users/{externalUserId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paywithlocus.com/api/credits/end-users/{externalUserId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"externalUserId": "<string>",
"retired": true,
"alreadyRetired": true,
"accountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"revokedTokens": 1,
"revokedAgentConnections": 1,
"canceledApprovals": 1,
"policyReset": true
}Retire a test or integration end user without deleting financial history
Workspace owner or admin with fresh MFA/passkey step-up only. Fails closed unless the balance is zero and every reservation, top-up attempt, external purchase, and refund is terminal. Revokes end-user tokens and scoped agent credentials, cancels outstanding approvals, resets the operational policy, freezes the credit account, and marks the identity inactive. Ledger, funding, settlement, replay, and audit rows are retained. Repeating a completed retirement is safe.
curl --request DELETE \
--url https://api.paywithlocus.com/api/credits/end-users/{externalUserId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.paywithlocus.com/api/credits/end-users/{externalUserId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.paywithlocus.com/api/credits/end-users/{externalUserId}', 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/end-users/{externalUserId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
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/end-users/{externalUserId}"
req, _ := http.NewRequest("DELETE", 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.delete("https://api.paywithlocus.com/api/credits/end-users/{externalUserId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paywithlocus.com/api/credits/end-users/{externalUserId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"externalUserId": "<string>",
"retired": true,
"alreadyRetired": true,
"accountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"revokedTokens": 1,
"revokedAgentConnections": 1,
"canceledApprovals": 1,
"policyReset": true
}Authorizations
Locus Pro dashboard session (Cognito). High-risk workspace administration requires an owner or admin role and fresh MFA/passkey step-up.
Headers
Short-lived raw MFA/passkey step-up token bound to the authenticated Cognito subject. Send it alongside the dashboard Bearer token for workspace-administrator mutations when the base session does not itself prove MFA within the last ten minutes. Never send it with a tenant secret key.
Path Parameters
Case-sensitive immutable ID in the tenant namespace. Prefer an identity-provider subject, not an email address.
1 - 200^[A-Za-z0-9][A-Za-z0-9._:@/-]{0,199}$Response
Retirement converged
Case-sensitive immutable ID in the tenant namespace. Prefer an identity-provider subject, not an email address.
1 - 200^[A-Za-z0-9][A-Za-z0-9._:@/-]{0,199}$x >= 0x >= 0x >= 0