API v3.0 ยท REST ยท JSON

Introduction

The MyCardLiaison API is a RESTful JSON API for checking gift card balances, detecting fraud, and managing white-label portals. All requests are made over HTTPS to https://api.mycardliaison.com/v3.

Base URL
https://api.mycardliaison.com/v3

// All responses are JSON with Content-Type: application/json
// All requests must include the X-API-Key header

Authentication

Authenticate by passing your API key in the X-API-Key request header. Keys are scoped to your account and can be rotated from the dashboard at any time.

Authentication header
X-API-Key: mcl_live_sk_your_key_here

// For sandbox (testing), use your test key:
X-API-Key: mcl_test_sk_your_test_key

Check Card Balance

POST/cards/check

Check the live balance, status, and fraud score of a single gift card. This is the core endpoint for most integrations.

Request Parameters

ParameterTypeRequiredDescription
card_numberstringrequiredThe full gift card number
pinstringoptionalCard PIN (required for some networks)
networkstringrequiredNetwork ID from GET /networks
currencystringoptionalISO 4217 code. Defaults to USD
idempotency_keystringoptionalUnique key for safe retries

Code Examples

balance_check.js
import { CardLiaison } from '@mycardliaison/sdk';
const client = new CardLiaison({ apiKey: process.env.MCL_API_KEY });

const result = await client.cards.check({
  cardNumber: '6006-4913-0000-0011',
  pin: '1234',
  network: 'visa_gift'
});

console.log(result.balance);    // 47.50
console.log(result.status);     // "active"
console.log(result.fraudScore); // 0.02

Response Schema

200 OK
{
  "id":           "chk_9f4a3b2c1d",
  "status":        "active",          // active | inactive | expired | invalid
  "balance":       47.50,
  "currency":      "USD",
  "expiry":        "2027-03",
  "network":       "visa_gift",
  "fraud_score":   0.02,             // 0.00 (clean) โ†’ 1.00 (high risk)
  "ai_verified":   true,
  "checked_at":    "2026-03-26T10:22:01Z",
  "latency_ms":    71
}

Error Handling

All errors return a consistent JSON body with a machine-readable code and a human-readable message.

Error response
{
  "error": {
    "code":    "card_invalid",
    "message": "The card number provided is not valid for this network.",
    "status":  422
  }
}
CodeHTTPDescription
auth_invalid401API key missing or invalid
quota_exceeded429Monthly check quota reached
card_invalid422Card number format invalid for network
network_unavailable503Card network temporarily unreachable
rate_limited429Too many requests โ€” back off and retry

Webhooks

Register a HTTPS endpoint to receive real-time event notifications. Configure webhooks from your dashboard or via the Webhooks API.

Webhook verification
// Verify the signature on every incoming webhook
const event = client.webhooks.construct(
  request.rawBody,
  request.headers['mcl-signature'],
  process.env.MCL_WEBHOOK_SECRET
);

switch (event.type) {
  case 'fraud.detected':
    await flagCard(event.data.card_id); break;
  case 'check.completed':
    await saveResult(event.data); break;
}
Get API Key โ†’