Create Payment
POST /v1/api/paymentsRequest body
Field
Type
Required
Description
Example
curl -X POST https://apipay.byastra.ai/v1/api/payments \
-H "Content-Type: application/json" \
-H "X-Api-Key: ap_live_your_api_key" \
-H "Idempotency-Key: order_12345" \
-d '{
"amount": 49.99,
"token": "USDC",
"network": "BASE",
"customer_email": "john@example.com",
"redirect_url": "https://yourapp.com/success",
"metadata": {
"order_id": "ORD-12345",
"plan": "pro"
}
}'const res = await fetch("https://apipay.byastra.ai/v1/api/payments", {
method: "POST",
headers: {
"X-Api-Key": "ap_live_your_api_key",
"Content-Type": "application/json",
"Idempotency-Key": "order_12345",
},
body: JSON.stringify({
amount: 49.99,
token: "USDC",
network: "BASE",
redirect_url: "https://yourapp.com/success",
metadata: { order_id: "ORD-12345" },
}),
});
const { data } = await res.json();
window.location.href = data.checkout_url;Response 201 Created
Last updated