Create Payment Link

POST /link/generate

API Reference

Use 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_KEY

Replace YOUR_API_KEY with your actual key from the KiraPay dashboard.

Headers

Name
Value

Content-Type

application/json

x-api-key

your-api-key

Request Body Fields

Name
Type
Description
Required

currency

string

Currency type for payment. Check supported types here.

YES

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

Field
Type
Description

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
}

Last updated

Was this helpful?