Skip to main content
POST
/
v2
/
products

Create Product

Create a new product in your catalog. Gale automatically checks HSA/FSA eligibility via the SIGIS database using the product’s UPC code or name.

Authentication

Authorization: Bearer glm_test_YOUR_API_KEY

Request Body

{
  "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,
  "currency": "USD",
  "merchant_product_id": "BP-MONITOR-001",
  "upc_code_or_gtin": "14567890123456",
  "images": [
    "https://cdn.example.com/bp-monitor-1.jpg",
    "https://cdn.example.com/bp-monitor-2.jpg"
  ],
  "metadata": {
    "category": "medical_devices",
    "brand": "HealthTech Pro",
    "weight": "0.5 lbs"
  }
}

Parameters

ParameterTypeRequiredDescription
namestringYesProduct name (max 255 chars)
taglinestringNoShort description (max 255 chars)
descriptionstringNoFull product description (supports markdown)
price_centsintegerYesPrice in cents
currencystringYesISO 4217 currency code (e.g., “USD”)
merchant_product_idstringNoYour reference ID for this product
upc_code_or_gtinstringNoUPC or GTIN barcode (used for eligibility check)
imagesarrayNoArray of image URLs (max 10)
metadataobjectNoCustom key-value pairs

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-1.jpg",
      "is_primary": true
    },
    {
      "id": 568,
      "url": "https://cdn.example.com/bp-monitor-2.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 Product

curl -X POST https://api.withgale.com/v2/products \
  -H "Authorization: Bearer glm_test_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Digital Thermometer",
    "description": "Fast and accurate digital thermometer",
    "price_cents": 2995,
    "currency": "USD"
  }'

Complete Product with UPC

curl -X POST https://api.withgale.com/v2/products \
  -H "Authorization: Bearer glm_test_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Premium Blood Pressure Monitor",
    "tagline": "Professional-grade BP monitoring",
    "description": "Clinically validated automatic blood pressure monitor with advanced features.",
    "price_cents": 4995,
    "currency": "USD",
    "merchant_product_id": "BP-MONITOR-PRO",
    "upc_code_or_gtin": "14567890123456",
    "images": [
      "https://cdn.example.com/bp-monitor-1.jpg",
      "https://cdn.example.com/bp-monitor-2.jpg"
    ],
    "metadata": {
      "category": "medical_devices",
      "brand": "HealthTech",
      "features": "bluetooth,memory,irregular_detection"
    }
  }'

With JavaScript

const createProduct = async (productData) => {
  const response = await fetch('https://api.withgale.com/v2/products', {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${process.env.GALE_API_KEY}`,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      name: productData.name,
      description: productData.description,
      price_cents: productData.price * 100, // Convert dollars to cents
      currency: 'USD',
      merchant_product_id: productData.sku,
      upc_code_or_gtin: productData.upc,
      images: productData.imageUrls,
      metadata: {
        category: productData.category,
        inventory: productData.stock
      }
    })
  });

  if (!response.ok) {
    throw new Error('Failed to create product');
  }

  const product = await response.json();
  console.log(`Product created with ID: ${product.id}`);
  console.log(`HSA/FSA eligible: ${product.eligibility.hsa_fsa_eligible}`);
  return product;
};

// Usage
const newProduct = await createProduct({
  name: 'Yoga Mat',
  description: 'Premium non-slip yoga mat',
  price: 79.95,
  sku: 'YOGA-MAT-001',
  upc: '12345678901234',
  imageUrls: ['https://cdn.example.com/yoga-mat.jpg'],
  category: 'fitness',
  stock: 50
});

Automatic Eligibility Detection

When you create a product, Gale automatically checks HSA/FSA eligibility using:
  1. UPC Code (if provided) - Most accurate method
  2. Product Name - If no UPC provided

Eligibility Response

{
  "eligibility": {
    "hsa_fsa_eligible": true,
    "eligibility_type": "auto_substantiation",
    "reason": "SIGIS verified - Medical device",
    "checked_at": "2025-10-18T14:30:00Z"
  }
}

Eligibility Types

TypeDescription
auto_substantiationAutomatically eligible (no documentation needed)
visionVision care products
rxPrescription products
dual_purposeEligible with LMN (doctor’s note)
prescriptionRequires prescription
medical_mccMedical merchant category code

Product Images

Image Upload

Images must be publicly accessible URLs. Gale does not host images.
{
  "images": [
    "https://cdn.yoursite.com/product-1.jpg",
    "https://cdn.yoursite.com/product-2.jpg",
    "https://cdn.yoursite.com/product-3.jpg"
  ]
}
The first image is automatically set as primary.

Image Requirements

  • Format: JPG, PNG, or WebP
  • Size: Max 5MB per image
  • Dimensions: Recommended 1000x1000px minimum
  • Limit: Maximum 10 images per product

Use Cases

Sync from E-commerce Platform

// Sync products from Shopify to Gale
const syncShopifyProducts = async () => {
  const shopifyProducts = await fetchShopifyProducts();

  for (const shopifyProduct of shopifyProducts) {
    const galeProduct = await createProduct({
      name: shopifyProduct.title,
      description: shopifyProduct.body_html,
      price_cents: Math.round(shopifyProduct.variants[0].price * 100),
      currency: 'USD',
      merchant_product_id: `shopify-${shopifyProduct.id}`,
      upc_code_or_gtin: shopifyProduct.variants[0].barcode,
      images: shopifyProduct.images.map(img => img.src),
      metadata: {
        shopify_id: shopifyProduct.id,
        vendor: shopifyProduct.vendor,
        product_type: shopifyProduct.product_type
      }
    });

    console.log(`Synced: ${galeProduct.name} (Eligible: ${galeProduct.eligibility.hsa_fsa_eligible})`);
  }
};

Bulk Product Import

// Import products from CSV
const importProductsFromCSV = async (csvData) => {
  const products = parseCSV(csvData);
  const results = [];

  for (const product of products) {
    try {
      const galeProduct = await createProduct({
        name: product.name,
        description: product.description,
        price_cents: parseInt(product.price_cents),
        currency: 'USD',
        merchant_product_id: product.sku,
        upc_code_or_gtin: product.upc,
        metadata: {
          import_batch: Date.now(),
          source: 'csv_import'
        }
      });

      results.push({
        success: true,
        product: galeProduct
      });
    } catch (error) {
      results.push({
        success: false,
        sku: product.sku,
        error: error.message
      });
    }
  }

  return results;
};

Create with Eligibility Check

// Create product and log eligibility
const createProductWithEligibilityCheck = async (productData) => {
  const product = await createProduct(productData);

  // Log eligibility for marketing
  if (product.eligibility.hsa_fsa_eligible) {
    console.log(`${product.name} is HSA/FSA eligible!`);
    console.log(`   Type: ${product.eligibility.eligibility_type}`);
    console.log(`   Reason: ${product.eligibility.reason}`);

    // Tag for marketing
    await tagForHSAMarketing(product.id);
  } else {
    console.log(`${product.name} is not HSA/FSA eligible`);
  }

  return product;
};

Webhooks

Product creation triggers the following webhook event:
{
  "type": "product.created",
  "data": {
    "id": 12345,
    "name": "Digital Blood Pressure Monitor",
    "eligibility": {
      "hsa_fsa_eligible": true,
      "eligibility_type": "auto_substantiation"
    }
  }
}
See Webhooks Reference for details.

Errors

Status CodeError CodeDescription
400invalid_requestMissing or invalid parameters
400invalid_pricePrice must be positive integer
400invalid_currencyUnsupported currency code
401unauthorizedInvalid or missing API key
422validation_errorField validation failed
429rate_limit_exceededToo many requests
Example error:
{
  "error": {
    "code": "validation_error",
    "message": "Invalid product data",
    "details": [
      {
        "field": "name",
        "message": "Name is required"
      },
      {
        "field": "price_cents",
        "message": "Price must be a positive integer"
      }
    ]
  }
}

Best Practices

Include UPC Codes

Provide UPC codes for accurate eligibility detection

Use Descriptive Names

Clear product names improve eligibility matching

Add Product Images

Include high-quality images for better checkout experience

Track with Metadata

Use metadata to link products to your internal systems