List API links
GET
/payment-links.php?source=apicurl "https://circus-pay.com/api/payment-links.php?source=api" \
-H "Authorization: Bearer $CIRCUSPAY_SECRET_KEY"const response = await fetch("https://circus-pay.com/api/payment-links.php?source=api", {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.CIRCUSPAY_SECRET_KEY}`
}
});
const result = await response.json();
if (!response.ok || !result.success) {
throw new Error(result.error || "API request failed");
}
console.log(result);<?php
$ch = curl_init("https://circus-pay.com/api/payment-links.php?source=api");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 20,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer " . getenv("CIRCUSPAY_SECRET_KEY"),
"Content-Type: application/json",
],
]);
$raw = curl_exec($ch);
if ($raw === false) { throw new RuntimeException(curl_error($ch)); }
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
$result = json_decode($raw, true, 512, JSON_THROW_ON_ERROR);
if ($status >= 400 || empty($result["success"])) {
throw new RuntimeException($result["error"] ?? "API request failed");
}import os, requests
response = requests.get(
"https://circus-pay.com/api/payment-links.php?source=api",
headers={"Authorization": "Bearer " + os.environ["CIRCUSPAY_SECRET_KEY"]},
timeout=20,
)
response.raise_for_status()
result = response.json()
if not result.get("success"):
raise RuntimeError(result.get("error", "API request failed"))
print(result)Select a source
| Parameter | Description |
|---|---|
source=api | Links created by an integration. |
source=dashboard | Links created in the portal. Default value. |
source=all | All sources. |
Create a link
Use POST /checkout/create.php. Store orderId and url in your system to connect the order to the checkout.