Stripe
Base URL https://api.leadx.in/api/key/protected. Every request needs an apikey header — see Authentication.
1 endpoint.
POST /stripe
Create order.
Auth apikey · Success 200
:::note Used by the web app
pages/Billing.jsx, pages/SeatManagement.jsx
:::
Request body
| Field | Required | Default |
|---|---|---|
manualPaymentID | yes | — |
subscriptionID | yes | — |
seatsPaymentHistoryID | — | |
proof | yes | — |
cURL
curl -X POST 'https://api.leadx.in/api/key/protected/stripe' \
-H 'apikey: $LEADX_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"manualPaymentID": "",
"subscriptionID": "",
"seatsPaymentHistoryID": "",
"proof": ""
}'
fetch
// Node 18+ and every modern browser ship fetch.
const res = await fetch('https://api.leadx.in/api/key/protected/stripe', {
method: 'POST',
headers: {
apikey: process.env.LEADX_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"manualPaymentID": "",
"subscriptionID": "",
"seatsPaymentHistoryID": "",
"proof": ""
}),
});
const payload = await res.json();
if (!res.ok) {
// Errors carry { status, success, message } — not the success envelope.
throw new Error(`${res.status} ${payload.message}`);
}
console.log(payload.data);
axios
import axios from 'axios';
const leadx = axios.create({
baseURL: 'https://api.leadx.in/api/key/protected',
headers: { apikey: process.env.LEADX_API_KEY },
});
try {
const { data } = await leadx.post(
'/stripe',
{
"manualPaymentID": "",
"subscriptionID": "",
"seatsPaymentHistoryID": "",
"proof": ""
}
);
console.log(data.data);
} catch (err) {
// axios throws on 4xx/5xx; the envelope is on err.response.data.
throw new Error(`${err.response?.status} ${err.response?.data?.message ?? err.message}`);
}
Node (no deps)
import { request } from 'node:https';
// The dependency-free version, for somewhere fetch is not available.
const send = (payload) =>
new Promise((resolve, reject) => {
const req = request(
'https://api.leadx.in/api/key/protected/stripe',
{
method: 'POST',
headers: {
apikey: process.env.LEADX_API_KEY,
'Content-Type': 'application/json',
},
},
(res) => {
let raw = '';
res.on('data', (chunk) => { raw += chunk; });
res.on('end', () => {
const body = JSON.parse(raw);
if (res.statusCode >= 400) reject(new Error(`${res.statusCode} ${body.message}`));
else resolve(body);
});
},
);
req.on('error', reject);
req.write(JSON.stringify(payload));
req.end();
});
const { data } = await send({
"manualPaymentID": "",
"subscriptionID": "",
"seatsPaymentHistoryID": "",
"proof": ""
});
console.log(data);
Python
import os
import requests
res = requests.post(
"https://api.leadx.in/api/key/protected/stripe",
headers={"apikey": os.environ["LEADX_API_KEY"]},
json={
"manualPaymentID": "",
"subscriptionID": "",
"seatsPaymentHistoryID": "",
"proof": ""
},
timeout=30,
)
payload = res.json()
res.raise_for_status()
print(payload["data"])
PHP
<?php
$ch = curl_init('https://api.leadx.in/api/key/protected/stripe');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'apikey: ' . getenv('LEADX_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({
'manualPaymentID': '',
'subscriptionID': '',
'seatsPaymentHistoryID': '',
'proof': ''
}),
]);
$response = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
$payload = json_decode($response, true);
if ($status >= 400) {
throw new RuntimeException("$status {$payload['message']}");
}
print_r($payload['data']);
Errors ManualPaymentDetailsNotFound_400 · SubscriptionNotFound_400