curl --request POST \
--url https://api.paywithlocus.com/api/credits/topups \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"usd": "<string>",
"successUrl": "<string>",
"cancelUrl": "<string>",
"credits": "<string>",
"externalUserId": "<string>",
"metadata": {}
}
'import requests
url = "https://api.paywithlocus.com/api/credits/topups"
payload = {
"usd": "<string>",
"successUrl": "<string>",
"cancelUrl": "<string>",
"credits": "<string>",
"externalUserId": "<string>",
"metadata": {}
}
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({
usd: '<string>',
successUrl: '<string>',
cancelUrl: '<string>',
credits: '<string>',
externalUserId: '<string>',
metadata: {}
})
};
fetch('https://api.paywithlocus.com/api/credits/topups', 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/topups",
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([
'usd' => '<string>',
'successUrl' => '<string>',
'cancelUrl' => '<string>',
'credits' => '<string>',
'externalUserId' => '<string>',
'metadata' => [
]
]),
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/topups"
payload := strings.NewReader("{\n \"usd\": \"<string>\",\n \"successUrl\": \"<string>\",\n \"cancelUrl\": \"<string>\",\n \"credits\": \"<string>\",\n \"externalUserId\": \"<string>\",\n \"metadata\": {}\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/topups")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"usd\": \"<string>\",\n \"successUrl\": \"<string>\",\n \"cancelUrl\": \"<string>\",\n \"credits\": \"<string>\",\n \"externalUserId\": \"<string>\",\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paywithlocus.com/api/credits/topups")
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 \"usd\": \"<string>\",\n \"successUrl\": \"<string>\",\n \"cancelUrl\": \"<string>\",\n \"credits\": \"<string>\",\n \"externalUserId\": \"<string>\",\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"sessionId": "<string>",
"url": "<string>",
"externalUserId": "<string>",
"quote": {
"feeMode": "pass_through",
"creditsUsd": "<string>",
"credits": "<string>",
"feeUsd": "<string>",
"totalUsd": "<string>",
"bonus": {
"bonusUsd": "<string>",
"bonusCredits": "<string>",
"bonusBps": 123
},
"nextBonusTier": {
"minUsd": "<string>",
"bonusBps": 123
}
},
"bonus": {
"bonusUsd": "<string>",
"bonusCredits": "<string>",
"bonusBps": 123
}
}{
"success": false,
"error": "<string>",
"code": "below_minimum",
"message": "<string>"
}Create a hosted checkout session
Canonical v2 contract. externalUserId present → end-user top-up. Absent → platform-pool self-top-up. Send exactly one exact-decimal usd or credits amount. There is no fixed or daily platform top-up ceiling. Evaluation funding does not activate a commercial agreement.
curl --request POST \
--url https://api.paywithlocus.com/api/credits/topups \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"usd": "<string>",
"successUrl": "<string>",
"cancelUrl": "<string>",
"credits": "<string>",
"externalUserId": "<string>",
"metadata": {}
}
'import requests
url = "https://api.paywithlocus.com/api/credits/topups"
payload = {
"usd": "<string>",
"successUrl": "<string>",
"cancelUrl": "<string>",
"credits": "<string>",
"externalUserId": "<string>",
"metadata": {}
}
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({
usd: '<string>',
successUrl: '<string>',
cancelUrl: '<string>',
credits: '<string>',
externalUserId: '<string>',
metadata: {}
})
};
fetch('https://api.paywithlocus.com/api/credits/topups', 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/topups",
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([
'usd' => '<string>',
'successUrl' => '<string>',
'cancelUrl' => '<string>',
'credits' => '<string>',
'externalUserId' => '<string>',
'metadata' => [
]
]),
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/topups"
payload := strings.NewReader("{\n \"usd\": \"<string>\",\n \"successUrl\": \"<string>\",\n \"cancelUrl\": \"<string>\",\n \"credits\": \"<string>\",\n \"externalUserId\": \"<string>\",\n \"metadata\": {}\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/topups")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"usd\": \"<string>\",\n \"successUrl\": \"<string>\",\n \"cancelUrl\": \"<string>\",\n \"credits\": \"<string>\",\n \"externalUserId\": \"<string>\",\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paywithlocus.com/api/credits/topups")
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 \"usd\": \"<string>\",\n \"successUrl\": \"<string>\",\n \"cancelUrl\": \"<string>\",\n \"credits\": \"<string>\",\n \"externalUserId\": \"<string>\",\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"sessionId": "<string>",
"url": "<string>",
"externalUserId": "<string>",
"quote": {
"feeMode": "pass_through",
"creditsUsd": "<string>",
"credits": "<string>",
"feeUsd": "<string>",
"totalUsd": "<string>",
"bonus": {
"bonusUsd": "<string>",
"bonusCredits": "<string>",
"bonusBps": 123
},
"nextBonusTier": {
"minUsd": "<string>",
"bonusBps": 123
}
},
"bonus": {
"bonusUsd": "<string>",
"bonusCredits": "<string>",
"bonusBps": 123
}
}{
"success": false,
"error": "<string>",
"code": "below_minimum",
"message": "<string>"
}Authorizations
Locus Pro dashboard session (Cognito).
Headers
Reuse for retries of the same checkout creation.
255Body
- Option 1
- Option 2
Non-negative exact decimal string with at most six fractional digits. Endpoint-specific positivity and amount limits still apply.
^\d+(?:\.\d{1,6})?$20482048Non-negative exact decimal string with at most six fractional digits. Endpoint-specific positivity and amount limits still apply.
^\d+(?:\.\d{1,6})?$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}$Serialized object is limited to 500 characters.
Show child attributes
Show child attributes
Response
Checkout session
^cs_Show child attributes
Show child attributes
Present only when this checkout session will mint a volume bonus on completion (tenant pool top-up reaching a tier).
Show child attributes
Show child attributes