Create Payment Link
POST /link/generate
API ReferencePOST /link/generateUse this endpoint to generate a secure payment link. Provide details such as currency, receiver address, amount, and product name, with an optional redirect URL. The API will return a unique link that can be shared with users to complete the payment.
Authentication
All requests require authentication via the x-api-key header:
x-api-key: YOUR_API_KEYReplace YOUR_API_KEY with your actual key from the KiraPay dashboard.
Headers
Content-Type
application/json
x-api-key
your-api-key
Request Body Fields
receiver
string
Ethereum wallet address (42 characters starting with 0x) where payments will be sent
YES
price
number
Payment amount in the specified currency (must be ≥ 0)
YES
name
string
Product name
YES
redirectUrl
string
redirect on successful payment
NO
Request Body
{
"currency": "USDC",
"receiver": "0x8356D265646a397b2Dacf0e05A4973E7676597f4",
"price": 10,
"name": "Rent",
"redirectUrl": "https://www.kira-pay.com"
}Request Example (cURL)
curl -X POST "https://kirapay-api.holatech.app/api/link/generate" \
-H "x-api-key: <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"currency": "USDC",
"receiver": "0x8356D265646a397b2Dacf0e05A4973E7676597f4",
"price": 10,
"name": "Rent",
"redirectUrl": "https://www.kira-pay.com"
}'Request Example (Nodejs)
import axios from "axios";
async function createPaymentLink() {
const response = await axios.post(
"https://kirapay-api.holatech.app/api/link/generate",
{
currency: "USDC",
receiver: "0x8356D265646a397b2Dacf0e05A4973E7676597f4",
price: 10,
name: "Rent",
redirectUrl: "https://www.kira-pay.com"
},
{
headers: {
"x-api-key": process.env.KIRAPAY_API_KEY!,
"Content-Type": "application/json"
}
}
);
console.log(response.data);
}
createPaymentLink();Response Fields
message
string
Response status message, always "success" for successful requests
data.url
string
Payment link
code
number
HTTP status code
Response
{
"message": "success",
"data": {
"url":"https://kirapay-api.holatech.app/{paymentId}"
},
"code": 201
}{"statusCode": 400, "message": "INVALID_ADDRESS"}
{"statusCode": 400, "message": "ADDRESS_REQUIRED"}
{"statusCode": 400, "message": "NAME_MUST_BE_STRING"}
{"statusCode": 401, "message": "API_KEY_INVALID"}
{"statusCode": 500, "message": "Internal server error"}Last updated
Was this helpful?