Skip to main content

Marketing API Overview

The Marketing API provides 40+ tools to create advertising campaigns, run promotions, and boost listing visibility on eBay.

Promoted Listings

Pay-per-sale advertising for higher visibility

Promotions

Create sales, discounts, and special offers

Campaign Analytics

Track campaign performance and ROI

Item Recommendations

Get AI-powered listing recommendations
Boost listing visibility with pay-per-sale advertising.
// Create a promoted listings campaign
const campaign = await mcp.useTool('marketing_createCampaign', {
  campaign_name: 'Summer Sale 2024',
  marketplace_id: 'EBAY_US',
  funding_strategy: 'COST_PER_SALE',
  campaign_criterion: {
    criterion_type: 'INVENTORY_PARTITION',
    selection_rules: [
      {
        categoryIds: ['12345'],
        inventory_items: [
          {
            inventory_reference_id: 'WIDGET-001',
            inventory_reference_type: 'INVENTORY_ITEM'
          }
        ]
      }
    ]
  }
});

console.log(`✅ Campaign created: ${campaign.campaignId}`);

// Set ad rate (percentage)
await mcp.useTool('marketing_updateAdRate', {
  campaign_id: campaign.campaignId,
  ad_rate: 8 // 8% ad rate
});

Promotions & Sales

Create discounts and special offers.
// Create a sale promotion
const promotion = await mcp.useTool('marketing_createItemPromotion', {
  marketplace_id: 'EBAY_US',
  name: 'Summer Clearance - 20% Off',
  promotion_type: 'MARKDOWN_SALE',
  start_date: '2024-06-01T00:00:00Z',
  end_date: '2024-06-30T23:59:59Z',
  discount_rules: [
    {
      discount_type: 'PERCENTAGE',
      discount_amount: '20',
      inventory_items: [
        { inventory_reference_id: 'WIDGET-001', inventory_reference_type: 'INVENTORY_ITEM' }
      ]
    }
  ]
});

console.log(`✅ Promotion created: ${promotion.promotionId}`);

Campaign Performance

// Get campaign analytics
const report = await mcp.useTool('marketing_getCampaignReport', {
  campaign_id: 'campaign_id_here',
  metric_keys: ['CLICK,IMPRESSION,SALE']
});

console.log(`Impressions: ${report.metrics.impression}`);
console.log(`Clicks: ${report.metrics.click}`);
console.log(`Sales: ${report.metrics.sale}`);
console.log(`Ad Revenue: ${report.metrics.adRevenue.value}`);

Next Steps

Resources