Merchant APIv1.0 Stable

KTN Gift Card
API Documentation

Integrate gift card purchasing directly into your applications. List cards, manage orders, retrieve credentials — all with simple Bearer token auth.

Secure

Bearer token auth

Fast

Low latency responses

RESTful

JSON over HTTPS

Introduction

The KTN Gift Card Merchant API is a RESTful service that lets you programmatically list available gift cards, purchase them, manage orders, retrieve gift card credentials, and handle refunds. All communication happens over HTTPS with JSON request and response bodies.

Base URL

All API requests should be made to the following base URL. All communication is over HTTPS.

text
https://api.ktngiftcard.katronai.com/katron-gift-card
All endpoints in this documentation are relative to the base URL above. For example,/api/merchant/getAccountDetails resolves to https://api.ktngiftcard.katronai.com/katron-gift-card/api/merchant/getAccountDetails.

Authentication

The API uses Bearer Token authentication. When you create a Merchant API profile, an API key (JWT token) is sent to your registered email address. Include this token in theAuthorization header of every request.

http
GET /api/merchant/getAccountDetails HTTP/1.1
Host: api.ktngiftcard.katronai.com
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
Keep your API key secret. Do not share it in public repositories, client-side code, or any insecure location. If your key is compromised, regenerate it immediately from your API Profile page or by calling the reissue token endpoint.

Quick Start Guide

Get up and running in two simple steps. Create your merchant API profile from the API Profile page, then start making requests.

1

Retrieve Your API Key

After creating your profile from the API Profile page, your API key (Bearer token) is sent to your registered email address. This token is used for all subsequent calls to /api/merchant/* endpoints.

Tip: Check your spam/junk folder if you don't receive the email. You can regenerate your token at any time from the API Profile page.
2

Make Your First Request

Use your merchant API key to list all available gift cards:

bash
curl -X GET \
  "https://api.ktngiftcard.katronai.com/katron-gift-card/api/merchant/giftCard/listGiftCards" \
  -H "Authorization: Bearer YOUR_MERCHANT_API_KEY" \
  -H "Content-Type: application/json"

Example successful response:

json
{
  "status": 200,
  "message": "Success",
  "data": [
    {
      "productId": 1234,
      "productName": "Amazon Gift Card",
      "denominationType": "FIXED",
      "recipientCurrencyCode": "USD",
      "fixedRecipientDenominations": [25, 50, 100],
      "logoUrls": ["https://..."],
      "brand": { "brandId": 1, "brandName": "Amazon" },
      "category": { "id": 1, "name": "Shopping" },
      "country": { "isoName": "US", "name": "United States" }
    }
  ]
}

Account

Get Account Details

Retrieve your merchant account information including profile status, balance, and configuration.

GET/api/merchant/getAccountDetails

Returns detailed information about your merchant API profile including your current balance, active status, charge type, and other account metadata.

bash
curl -X GET \
  "https://api.ktngiftcard.katronai.com/katron-gift-card/api/merchant/getAccountDetails" \
  -H "Authorization: Bearer YOUR_MERCHANT_API_KEY"

Update Charge Type

Change how your API purchases are billed.

POST/api/merchant/giftCard/updateMerchantApiProfileGiftCardChargeType?type={type}
ParameterTypeRequiredDescription
typestringRequiredThe new charge type.
Enum: CHARGE_CARD | CHARGE_ACCOUNT_BALANCE
bash
curl -X POST \
  "https://api.ktngiftcard.katronai.com/katron-gift-card/api/merchant/giftCard/updateMerchantApiProfileGiftCardChargeType?type=CHARGE_ACCOUNT_BALANCE" \
  -H "Authorization: Bearer YOUR_MERCHANT_API_KEY"

Get Active Fee Preference

Retrieve the current fee schedule that applies to your merchant API transactions.

GET/api/merchant/giftCard/getActiveFeePreference

Fees are tier-based and vary by purchase amount. The response contains fixed fees for smaller amounts and a percentage-based fee for larger transactions.

bash
curl -X GET \
  "https://api.ktngiftcard.katronai.com/katron-gift-card/api/merchant/giftCard/getActiveFeePreference" \
  -H "Authorization: Bearer YOUR_MERCHANT_API_KEY"

Example response:

json
{
  "status": 200,
  "message": "Success",
  "data": {
    "giftCardFeeType": "FEE_TYPE_MERCHANT_API",
    "feeFor1To99": 2.50,
    "feeFor100To250": 3.50,
    "feeFor251To500": 5.00,
    "feeFor501To750": 6.50,
    "feeFor751To999": 8.00,
    "feePercentageFor1000To5000": 1.5
  }
}
Amount RangeFee TypeField
$1 – $99Fixed ($)feeFor1To99
$100 – $250Fixed ($)feeFor100To250
$251 – $500Fixed ($)feeFor251To500
$501 – $750Fixed ($)feeFor501To750
$751 – $999Fixed ($)feeFor751To999
$1,000 – $5,000Percentage (%)feePercentageFor1000To5000

Gift Cards

List Gift Cards

Retrieve all available gift cards that can be purchased through your merchant API profile.

GET/api/merchant/giftCard/listGiftCards

Returns a comprehensive list of gift cards including product details, denominations, pricing, brand information, country availability, and redemption instructions. Each card has eitherFIXED orRANGE denomination types.

bash
curl -X GET \
  "https://api.ktngiftcard.katronai.com/katron-gift-card/api/merchant/giftCard/listGiftCards" \
  -H "Authorization: Bearer YOUR_MERCHANT_API_KEY"

Response fields per gift card:

ParameterTypeRequiredDescription
productIdinteger (int64)RequiredUnique identifier for the gift card product. Used when purchasing.
productNamestringRequiredDisplay name of the gift card.
denominationTypestringRequiredFIXED (specific amounts) or RANGE (min/max range).
fixedRecipientDenominationsnumber[]OptionalAvailable fixed denominations (when type is FIXED).
minRecipientDenominationnumberOptionalMinimum denomination (when type is RANGE).
maxRecipientDenominationnumberOptionalMaximum denomination (when type is RANGE).
recipientCurrencyCodestringRequiredCurrency code for the gift card (e.g., USD, EUR).
senderFeenumberRequiredFixed fee charged to the sender.
senderFeePercentagenumberRequiredPercentage fee charged to the sender.
discountPercentagenumberRequiredDiscount percentage applied to the card.
logoUrlsstring[]RequiredArray of logo image URLs for the card.
brandobjectRequiredBrand info: { brandId, brandName }.
categoryobjectRequiredCategory info: { id, name }.
countryobjectRequiredCountry info: { isoName, name, flagUrl }.
redeemInstructionobjectRequiredRedemption instructions: { concise, verbose }.

Purchase Gift Card

Purchase a gift card through your merchant API profile. The purchase will be charged according to your configured charge type.

POST/api/merchant/giftCard/purchaseGiftCard

Send a JSON request body with the gift card details. The productId can be obtained from the list gift cards endpoint. The unitPrice must match one of the available denominations for the selected gift card.

Request Body

ParameterTypeRequiredDescription
productIdinteger (int64)RequiredThe ID of the gift card product to purchase.
unitPricenumber (float)RequiredThe denomination/amount of the gift card.
emailstringOptionalRecipient email address for gift card delivery.
senderNamestringRequiredName of the sender/purchaser.
bash
curl -X POST \
  "https://api.ktngiftcard.katronai.com/katron-gift-card/api/merchant/giftCard/purchaseGiftCard" \
  -H "Authorization: Bearer YOUR_MERCHANT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "productId": 1234,
    "unitPrice": 50.00,
    "email": "recipient@example.com",
    "senderName": "Acme Corp"
  }'

Example response:

json
{
  "status": 200,
  "message": "Gift card purchased successfully",
  "data": {
    "orderId": 5678,
    "productId": 1234,
    "productName": "Amazon Gift Card",
    "unitPrice": 50.00,
    "status": "COMPLETED",
    "email": "recipient@example.com"
  }
}
FIXED denomination cards: The unitPrice must exactly match one of the values in fixedRecipientDenominations.

RANGE denomination cards: The unitPrice must be between minRecipientDenomination and maxRecipientDenomination.

Orders

List All Orders

Retrieve a list of all gift card orders placed through your merchant API profile.

GET/api/merchant/giftCard/listAllGiftCardOrders

Returns all orders with details including order status, product information, pricing, and timestamps. Use this to reconcile purchases and track delivery status.

bash
curl -X GET \
  "https://api.ktngiftcard.katronai.com/katron-gift-card/api/merchant/giftCard/listAllGiftCardOrders" \
  -H "Authorization: Bearer YOUR_MERCHANT_API_KEY"

Get Gift Card Credentials

Retrieve the actual gift card details (activation code, PIN, URL, etc.) for a completed order.

GET/api/merchant/giftCard/getGiftCardCredentials?giftCardOrderId={orderId}
ParameterTypeRequiredDescription
giftCardOrderIdinteger (int64)RequiredThe ID of the gift card order.
bash
curl -X GET \
  "https://api.ktngiftcard.katronai.com/katron-gift-card/api/merchant/giftCard/getGiftCardCredentials?giftCardOrderId=5678" \
  -H "Authorization: Bearer YOUR_MERCHANT_API_KEY"
Gift card credentials typically include an activation code, PIN, and/or a redemption URL depending on the card brand. Some cards may take a few moments to be fulfilled — use the Refresh Order endpoint if the credentials are not yet available.

Resend Gift Card Credentials

Resend the gift card credentials to the recipient's email address.

POST/api/merchant/giftCard/resendGiftCardCredentials?giftCardOrderId={orderId}
ParameterTypeRequiredDescription
giftCardOrderIdinteger (int64)RequiredThe ID of the gift card order to resend credentials for.
bash
curl -X POST \
  "https://api.ktngiftcard.katronai.com/katron-gift-card/api/merchant/giftCard/resendGiftCardCredentials?giftCardOrderId=5678" \
  -H "Authorization: Bearer YOUR_MERCHANT_API_KEY"

Refresh Order

Refresh the status of a gift card order. Useful if the order is still processing or if credentials haven't been delivered yet.

POST/api/merchant/giftCard/refreshOrder?giftCardOrderId={orderId}
ParameterTypeRequiredDescription
giftCardOrderIdinteger (int64)RequiredThe ID of the order to refresh.
bash
curl -X POST \
  "https://api.ktngiftcard.katronai.com/katron-gift-card/api/merchant/giftCard/refreshOrder?giftCardOrderId=5678" \
  -H "Authorization: Bearer YOUR_MERCHANT_API_KEY"

Refund Order Payment

Request a refund for a gift card order. Refund eligibility depends on the card brand and order status.

POST/api/merchant/giftCard/refundOrderPayment?giftCardOrderId={orderId}
ParameterTypeRequiredDescription
giftCardOrderIdinteger (int64)RequiredThe ID of the order to refund.
bash
curl -X POST \
  "https://api.ktngiftcard.katronai.com/katron-gift-card/api/merchant/giftCard/refundOrderPayment?giftCardOrderId=5678" \
  -H "Authorization: Bearer YOUR_MERCHANT_API_KEY"
Refund availability varies by card provider. Some gift cards are non-refundable once fulfilled. The endpoint will return an error if the order is not eligible for a refund.

Void Order Payment

Void the payment for a pending or recently placed order before it is fully processed.

POST/api/merchant/giftCard/voidOrderPayment?giftCardOrderId={orderId}
ParameterTypeRequiredDescription
giftCardOrderIdinteger (int64)RequiredThe ID of the order to void.
bash
curl -X POST \
  "https://api.ktngiftcard.katronai.com/katron-gift-card/api/merchant/giftCard/voidOrderPayment?giftCardOrderId=5678" \
  -H "Authorization: Bearer YOUR_MERCHANT_API_KEY"
Voiding a payment is different from a refund. A void cancels a pending transaction before it has fully settled, while a refund reverses a completed transaction. Use void for recent orders that haven't been processed yet.

Schemas

Response Object

All API endpoints return a standardized response envelope with the following structure:

json
{
  "status": 200,         // HTTP status code (integer)
  "message": "Success",  // Human-readable message (string)
  "data": { ... }        // Response payload (object, array, or null)
}
ParameterTypeRequiredDescription
statusinteger (int32)RequiredHTTP status code mirrored in the response body.
messagestringRequiredHuman-readable status message.
dataobject | nullRequiredThe response payload. May be null on errors.

MerchantApiProfileGiftCardOrderRequest

The request body schema for purchasing a gift card through the merchant API.

typescript
interface MerchantApiProfileGiftCardOrderRequest {
  productId: number;   // int64 — Gift card product ID
  unitPrice: number;   // float — Denomination amount
  email?: string;      // Recipient email for delivery
  senderName: string;  // Required — Sender/purchaser name
}
ParameterTypeRequiredDescription
productIdinteger (int64)RequiredThe product ID from the list gift cards response.
unitPricenumber (float)RequiredMust match a fixed denomination or fall within the min/max range.
emailstringOptionalEmail address where the gift card credentials will be sent.
senderNamestringRequiredThe name displayed as the sender of the gift card.

ChargeType Enum

The charge type determines how gift card purchases are billed to your merchant account. Set during profile creation and updateable via the update charge type endpoint.

ValueDescription
CHARGE_CARDPurchases are charged directly to the credit/debit card on file. Ideal for pay-as-you-go usage patterns.
CHARGE_ACCOUNT_BALANCEPurchases are deducted from the pre-loaded merchant account balance. Ideal for high-volume, prepaid usage.

Error Handling

Error Response Format

When an error occurs, the API returns a consistent error envelope. The HTTP status code is mirrored in the response body for convenience.

json
{
  "status": "error",
  "message": "Access Denied",
  "errors": ""
}

Common Error Codes

StatusMeaningHow to Fix
400Bad Request — Invalid or missing parametersCheck the request format, required parameters, and enum values.
401Unauthorized — Missing or invalid API keyEnsure the Authorization header contains a valid Bearer token.
403Forbidden — Access denied for this resourceEnsure you're using the correct endpoint and your profile is active.
404Not Found — Resource does not existVerify the order ID or product ID is correct.
500Internal Server ErrorRetry after a moment. If the issue persists, contact support.
Best practice: Always check the status field in the response body, not just the HTTP status code. Some successful operations may return additional context in themessage field.
Get Started

Ready to integrate?

Create your Merchant API profile and start purchasing gift cards programmatically in minutes.