portal_url.curl -X POST "https://api.adrelay.dev/v1/billing/portal" \
-H "X-API-Key: $ADRELAY_API_KEY"
const response = await fetch("https://api.adrelay.dev/v1/billing/portal", {
method: "POST",
headers: { "X-API-Key": process.env.ADRELAY_API_KEY },
});
const data = await response.json();
// Redirect user to data.portal_url
import requests
response = requests.post(
"https://api.adrelay.dev/v1/billing/portal",
headers={"X-API-Key": "your-api-key-here"},
)
data = response.json()
# Redirect user to data["portal_url"]
{
"portal_url": "https://billing.stripe.com/p/session/..."
}
{
"error": "Invalid or missing API key.",
"code": "UNAUTHORIZED",
"timestamp": 1711036800,
"request_id": "req_abc123"
}
Billing
Billing Portal
Create a Stripe billing portal session for managing subscriptions and payment methods.
curl -X POST "https://api.adrelay.dev/v1/billing/portal" \
-H "X-API-Key: $ADRELAY_API_KEY"
const response = await fetch("https://api.adrelay.dev/v1/billing/portal", {
method: "POST",
headers: { "X-API-Key": process.env.ADRELAY_API_KEY },
});
const data = await response.json();
// Redirect user to data.portal_url
import requests
response = requests.post(
"https://api.adrelay.dev/v1/billing/portal",
headers={"X-API-Key": "your-api-key-here"},
)
data = response.json()
# Redirect user to data["portal_url"]
{
"portal_url": "https://billing.stripe.com/p/session/..."
}
{
"error": "Invalid or missing API key.",
"code": "UNAUTHORIZED",
"timestamp": 1711036800,
"request_id": "req_abc123"
}