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.
https://api.ktngiftcard.katronai.com/katron-gift-card/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.
GET /api/merchant/getAccountDetails HTTP/1.1
Host: api.ktngiftcard.katronai.com
Authorization: Bearer YOUR_API_KEY
Content-Type: application/jsonQuick Start Guide
Get up and running in two simple steps. Create your merchant API profile from the API Profile page, then start making requests.
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.
Make Your First Request
Use your merchant API key to list all available gift cards:
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:
{
"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.
/api/merchant/getAccountDetailsReturns detailed information about your merchant API profile including your current balance, active status, charge type, and other account metadata.
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.
/api/merchant/giftCard/updateMerchantApiProfileGiftCardChargeType?type={type}| Parameter | Type | Required | Description |
|---|---|---|---|
type | string | Required | The new charge type. Enum: CHARGE_CARD | CHARGE_ACCOUNT_BALANCE |
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.
/api/merchant/giftCard/getActiveFeePreferenceFees are tier-based and vary by purchase amount. The response contains fixed fees for smaller amounts and a percentage-based fee for larger transactions.
curl -X GET \
"https://api.ktngiftcard.katronai.com/katron-gift-card/api/merchant/giftCard/getActiveFeePreference" \
-H "Authorization: Bearer YOUR_MERCHANT_API_KEY"Example response:
{
"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 Range | Fee Type | Field |
|---|---|---|
| $1 – $99 | Fixed ($) | feeFor1To99 |
| $100 – $250 | Fixed ($) | feeFor100To250 |
| $251 – $500 | Fixed ($) | feeFor251To500 |
| $501 – $750 | Fixed ($) | feeFor501To750 |
| $751 – $999 | Fixed ($) | feeFor751To999 |
| $1,000 – $5,000 | Percentage (%) | feePercentageFor1000To5000 |
Gift Cards
List Gift Cards
Retrieve all available gift cards that can be purchased through your merchant API profile.
/api/merchant/giftCard/listGiftCardsReturns 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.
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:
| Parameter | Type | Required | Description |
|---|---|---|---|
productId | integer (int64) | Required | Unique identifier for the gift card product. Used when purchasing. |
productName | string | Required | Display name of the gift card. |
denominationType | string | Required | FIXED (specific amounts) or RANGE (min/max range). |
fixedRecipientDenominations | number[] | Optional | Available fixed denominations (when type is FIXED). |
minRecipientDenomination | number | Optional | Minimum denomination (when type is RANGE). |
maxRecipientDenomination | number | Optional | Maximum denomination (when type is RANGE). |
recipientCurrencyCode | string | Required | Currency code for the gift card (e.g., USD, EUR). |
senderFee | number | Required | Fixed fee charged to the sender. |
senderFeePercentage | number | Required | Percentage fee charged to the sender. |
discountPercentage | number | Required | Discount percentage applied to the card. |
logoUrls | string[] | Required | Array of logo image URLs for the card. |
brand | object | Required | Brand info: { brandId, brandName }. |
category | object | Required | Category info: { id, name }. |
country | object | Required | Country info: { isoName, name, flagUrl }. |
redeemInstruction | object | Required | Redemption 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.
/api/merchant/giftCard/purchaseGiftCardSend 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
| Parameter | Type | Required | Description |
|---|---|---|---|
productId | integer (int64) | Required | The ID of the gift card product to purchase. |
unitPrice | number (float) | Required | The denomination/amount of the gift card. |
email | string | Optional | Recipient email address for gift card delivery. |
senderName | string | Required | Name of the sender/purchaser. |
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:
{
"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"
}
}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.
/api/merchant/giftCard/listAllGiftCardOrdersReturns all orders with details including order status, product information, pricing, and timestamps. Use this to reconcile purchases and track delivery status.
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.
/api/merchant/giftCard/getGiftCardCredentials?giftCardOrderId={orderId}| Parameter | Type | Required | Description |
|---|---|---|---|
giftCardOrderId | integer (int64) | Required | The ID of the gift card order. |
curl -X GET \
"https://api.ktngiftcard.katronai.com/katron-gift-card/api/merchant/giftCard/getGiftCardCredentials?giftCardOrderId=5678" \
-H "Authorization: Bearer YOUR_MERCHANT_API_KEY"Resend Gift Card Credentials
Resend the gift card credentials to the recipient's email address.
/api/merchant/giftCard/resendGiftCardCredentials?giftCardOrderId={orderId}| Parameter | Type | Required | Description |
|---|---|---|---|
giftCardOrderId | integer (int64) | Required | The ID of the gift card order to resend credentials for. |
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.
/api/merchant/giftCard/refreshOrder?giftCardOrderId={orderId}| Parameter | Type | Required | Description |
|---|---|---|---|
giftCardOrderId | integer (int64) | Required | The ID of the order to refresh. |
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.
/api/merchant/giftCard/refundOrderPayment?giftCardOrderId={orderId}| Parameter | Type | Required | Description |
|---|---|---|---|
giftCardOrderId | integer (int64) | Required | The ID of the order to refund. |
curl -X POST \
"https://api.ktngiftcard.katronai.com/katron-gift-card/api/merchant/giftCard/refundOrderPayment?giftCardOrderId=5678" \
-H "Authorization: Bearer YOUR_MERCHANT_API_KEY"Void Order Payment
Void the payment for a pending or recently placed order before it is fully processed.
/api/merchant/giftCard/voidOrderPayment?giftCardOrderId={orderId}| Parameter | Type | Required | Description |
|---|---|---|---|
giftCardOrderId | integer (int64) | Required | The ID of the order to void. |
curl -X POST \
"https://api.ktngiftcard.katronai.com/katron-gift-card/api/merchant/giftCard/voidOrderPayment?giftCardOrderId=5678" \
-H "Authorization: Bearer YOUR_MERCHANT_API_KEY"Schemas
Response Object
All API endpoints return a standardized response envelope with the following structure:
{
"status": 200, // HTTP status code (integer)
"message": "Success", // Human-readable message (string)
"data": { ... } // Response payload (object, array, or null)
}| Parameter | Type | Required | Description |
|---|---|---|---|
status | integer (int32) | Required | HTTP status code mirrored in the response body. |
message | string | Required | Human-readable status message. |
data | object | null | Required | The response payload. May be null on errors. |
MerchantApiProfileGiftCardOrderRequest
The request body schema for purchasing a gift card through the merchant API.
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
}| Parameter | Type | Required | Description |
|---|---|---|---|
productId | integer (int64) | Required | The product ID from the list gift cards response. |
unitPrice | number (float) | Required | Must match a fixed denomination or fall within the min/max range. |
email | string | Optional | Email address where the gift card credentials will be sent. |
senderName | string | Required | The 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.
| Value | Description |
|---|---|
CHARGE_CARD | Purchases are charged directly to the credit/debit card on file. Ideal for pay-as-you-go usage patterns. |
CHARGE_ACCOUNT_BALANCE | Purchases 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.
{
"status": "error",
"message": "Access Denied",
"errors": ""
}Common Error Codes
| Status | Meaning | How to Fix |
|---|---|---|
| 400 | Bad Request — Invalid or missing parameters | Check the request format, required parameters, and enum values. |
| 401 | Unauthorized — Missing or invalid API key | Ensure the Authorization header contains a valid Bearer token. |
| 403 | Forbidden — Access denied for this resource | Ensure you're using the correct endpoint and your profile is active. |
| 404 | Not Found — Resource does not exist | Verify the order ID or product ID is correct. |
| 500 | Internal Server Error | Retry after a moment. If the issue persists, contact support. |
status field in the response body, not just the HTTP status code. Some successful operations may return additional context in themessage field.Ready to integrate?
Create your Merchant API profile and start purchasing gift cards programmatically in minutes.