Skip to main content
GET
/
v2
/
products
/
{id}

Get Product

Retrieve information about a product, including current HSA/FSA eligibility status.

Authentication

Authorization: Bearer glm_test_YOUR_API_KEY

Path Parameters

ParameterTypeRequiredDescription
idintegerYesProduct ID

Request

GET /v2/products/{id}

Response

{
  "id": 12345,
  "name": "Digital Blood Pressure Monitor",
  "tagline": "FDA-approved automatic BP monitor",
  "description": "Clinically validated blood pressure monitor with Bluetooth connectivity. Features automatic inflation, irregular heartbeat detection, and memory for 200 readings. Includes carrying case and 4 AAA batteries.",
  "price": {
    "cents": 4995,
    "dollars": 49.95,
    "currency": "USD",
    "formatted": "$49.95"
  },
  "merchant_product_id": "BP-MONITOR-001",
  "upc_code_or_gtin": "14567890123456",
  "status": "active",
  "eligibility": {
    "hsa_fsa_eligible": true,
    "eligibility_type": "auto_substantiation",
    "reason": "SIGIS verified - Medical device",
    "checked_at": "2025-10-18T14:30:00Z"
  },
  "images": [
    {
      "id": 567,
      "url": "https://cdn.example.com/bp-monitor-front.jpg",
      "is_primary": true
    },
    {
      "id": 568,
      "url": "https://cdn.example.com/bp-monitor-side.jpg",
      "is_primary": false
    }
  ],
  "metadata": {
    "category": "medical_devices",
    "brand": "HealthTech Pro",
    "weight": "0.5 lbs"
  },
  "created_at": "2025-10-18T14:30:00Z",
  "updated_at": "2025-10-18T14:30:00Z"
}
See Product Object for complete field descriptions.

Examples

Basic Retrieval

curl https://api.withgale.com/v2/products/12345 \
  -H "Authorization: Bearer glm_test_YOUR_API_KEY"

With JavaScript

const getProduct = async (productId) => {
  const response = await fetch(
    `https://api.withgale.com/v2/products/${productId}`,
    {
      headers: {
        'Authorization': `Bearer ${process.env.GALE_API_KEY}`
      }
    }
  );

  if (!response.ok) {
    throw new Error('Product not found');
  }

  return await response.json();
};

// Usage
const product = await getProduct(12345);
console.log(`${product.name}: $${product.price.dollars}`);
console.log(`HSA/FSA Eligible: ${product.eligibility.hsa_fsa_eligible}`);

Check Eligibility Status

const checkProductEligibility = async (productId) => {
  const product = await getProduct(productId);

  return {
    productName: product.name,
    isEligible: product.eligibility.hsa_fsa_eligible,
    eligibilityType: product.eligibility.eligibility_type,
    reason: product.eligibility.reason,
    lastChecked: product.eligibility.checked_at
  };
};

Use Cases

Display Product Details

// Render product page with HSA/FSA badge
const renderProductPage = async (productId) => {
  const product = await getProduct(productId);

  return {
    title: product.name,
    tagline: product.tagline,
    description: product.description,
    price: product.price.formatted,
    images: product.images.map(img => img.url),
    hsaEligible: product.eligibility.hsa_fsa_eligible,
    eligibilityBadge: product.eligibility.hsa_fsa_eligible
      ? 'HSA/FSA Eligible'
      : null
  };
};

Sync Product Data

// Sync Gale product with local database
const syncProductToDatabase = async (galeProductId) => {
  const galeProduct = await getProduct(galeProductId);

  await db.products.upsert({
    id: galeProduct.id,
    name: galeProduct.name,
    price: galeProduct.price.cents,
    hsaEligible: galeProduct.eligibility.hsa_fsa_eligible,
    eligibilityType: galeProduct.eligibility.eligibility_type,
    updatedAt: galeProduct.updated_at
  });
};
// Ensure product exists before creating payment link
const createPaymentLinkForProduct = async (productId, quantity) => {
  const product = await getProduct(productId);

  if (product.status !== 'active') {
    throw new Error('Product is not active');
  }

  const link = await createPaymentLink({
    amount_cents: product.price.cents * quantity,
    currency: product.price.currency,
    description: `${quantity}x ${product.name}`,
    products: [{
      merchant_product_id: product.merchant_product_id,
      name: product.name,
      quantity: quantity,
      price_cents: product.price.cents
    }],
    success_url: 'https://yoursite.com/success'
  });

  return link;
};

Check Stock Availability

// Use metadata to track inventory
const checkAvailability = async (productId, requestedQty) => {
  const product = await getProduct(productId);

  const stock = parseInt(product.metadata?.inventory || 0);

  return {
    available: stock >= requestedQty,
    inStock: stock,
    requested: requestedQty,
    productName: product.name
  };
};

Product Status

StatusDescription
activeAvailable for sale
inactiveTemporarily unavailable
archivedRemoved from catalog (soft deleted)

Errors

Status CodeError CodeDescription
401unauthorizedInvalid or missing API key
404not_foundProduct not found
429rate_limit_exceededToo many requests
Example error:
{
  "error": {
    "code": "not_found",
    "message": "Product not found",
    "param": "id"
  }
}

Best Practices

Cache Product Data

Cache product info to reduce API calls

Check Status

Verify status === 'active' before selling

Display Eligibility

Show HSA/FSA badge when hsa_fsa_eligible === true

Use Webhooks

Listen for product updates via webhooks