Get Link By Code

Retrieve the details of a payment link by its unique payment code. This is a public endpoint and does not require authentication.

  • Path Parameter:

    • code (string, required) → The short code of the payment link (e.g., abc123def4).

API Reference

Example Request (cURL)

curl -X GET "https://kirapay-api.holatech.app/api/link/abc123def4"

Example Request (Node.js)

import axios from "axios";

async function getLinkByCode(code: string) {
  const response = await axios.get(
    `https://kirapay-api.holatech.app/api/link/${code}`,
    {
      headers: {
        "x-api-key": process.env.KIRAPAY_API_KEY!,
      },
    }
  );

  console.log(response.data);
}

// Example usage
getLinkByCode("abc123def4");

Successful Response (200)

{
  "message": "success",
  "data": {
    "_id": "67a1b3f2c4d5e6f7g8h9i0j1",
    "code": "abc123def4",
    "price": 100.5,
    "tokenOut": {
      "symbol": "USDC",
      "address": "0xA0b86a33E6441b8c4C8C0C8C0C8C0C8C0C8C0C8C",
      "decimals": 6,
      "chain": "ethereum"
    },
    "receiver": "0x742d35Cc6634C0532925a3b8D4C9db96C4b4d8b6",
    "user": {
      "_id": "507f1f77bcf86cd799439011",
      "username": "merchant_user",
      "address": "0x742d35Cc6634C0532925a3b8D4C9db96C4b4d8b6",
      "isVerified": true
    },
    "name": "Order #A1209",
    "redirectUrl": "https://merchant.example.com/thank-you",
    "createdAt": "2025-01-25T10:00:00.000Z",
    "updatedAt": "2025-01-25T10:00:00.000Z",
    "url": "https://kirapay-api.holatech.app/abc123def4"
  },
  "code": 200
}

Response Fields

Field
Type
Description

message

string

Response status message. Always "success" for successful requests.

data._id

string

MongoDB ObjectId of the payment link.

data.code

string

Short code used in the payment URL.

data.price

number

Payment amount in the specified currency.

data.tokenOut

object

Token configuration object.

data.tokenOut.symbol

string

Token symbol (e.g., "USDC").

data.tokenOut.address

string

Smart contract address of the token.

data.tokenOut.decimals

number

Number of decimal places for the token.

data.tokenOut.chain

string

Blockchain network (e.g., "ethereum", "polygon").

data.receiver

string

Ethereum wallet address where payments are sent.

data.user

object

Information about the link creator.

data.user._id

string

MongoDB ObjectId of the user.

data.user.username

string

Username of the link creator.

data.user.address

string

Ethereum wallet address of the user.

data.user.isVerified

boolean

Whether the user account is verified.

data.name

string

Display name for the payment link (e.g., "Order #A1209").

data.redirectUrl

string

URL where the customer is redirected after successful payment.

data.createdAt

string

ISO 8601 timestamp when the link was created.

data.updatedAt

string

ISO 8601 timestamp when the link was last updated.

data.url

string

Complete payment link URL customers can use to make payments.

code

number

HTTP status code (200 for success).

Usage Example:

  • A merchant shares https://kirapay.focalfossa.site/abc123def4 with a customer.

  • The customer (or frontend) fetches details via this endpoint to show payment info before completing checkout.

Last updated

Was this helpful?