> ## Documentation Index
> Fetch the complete documentation index at: https://docs.omnicommerce.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Marketplace Ads

> Draft, approve, schedule, stop and measure marketplace ads through agents, APIs, SDKs and the CLI.

Use the Marketplace Ads toolkit (`ads_toolkit`, alias `ads`) for agent access, or `client.ads` in the SDKs. These operations use the same saved campaign groups, seller allocations, store permissions and delivery services as the workspace Ads page.

## Connections and permissions

Connect a dedicated Ads app to each store in **Marketplaces → Store → Ads app**. A catalog connection alone does not authorize advertising. Connection approval happens in the marketplace's authorization screen. API keys never contain marketplace app secrets.

| Scope | Access |
| - | - |
| `ads:read` | Accounts, capabilities, campaign reads, delivery evidence, reports and report imports |
| `ads:write` | Save campaign drafts |
| `ads:approve` | Approve publishing, request stops and retry delivery within saved limits |

Grant `ads:approve` explicitly; default keys omit it. Existing keys need the selected Ads scopes enabled in API Keys settings. User-bound CLI credentials also require the signed-in user's current organization and store permissions. Agent execution grants must explicitly include Ads read, draft and approval permissions for the selected stores. Adding a toolkit does not grant those permissions. Agent lifecycle actions require human approval and cannot bypass it with an approval override.

## Available advertising

Call `ads.listAccounts()` first. Coverage includes every marketplace, with a concrete limitation for unavailable providers. Paid Ads currently supports Shopee and Lazada. TikTok Shop product, video and LIVE analytics remain separate from TikTok paid Ads authorization.

Shopee supports Product Ads automatic bidding, Product GMV Max target ROAS, Shop GMV Max automatic or target ROAS, and eligible manual keyword Product Ads. Lazada supports Sponsored Max Store automatic bidding, target ROAS/ROI and maximum CPC. Use the returned `adFormats`, `publishable` and `biddingStrategies`; marketplace eligibility and app permissions are checked again when publishing.

The current API does not expose general editing, resuming or deleting arbitrary external campaigns. Stops pause campaigns created by the selected saved plans and cancel queued launches. Budget or bidding changes require a new draft and approval. These operations do not claim complete Seller Center feature parity.

## Draft, approve and verify

One campaign group can deploy to multiple exact stores. Each deployment specifies its own marketplace format, currency, bid strategy, daily allocation and total approved limit. Product formats map the shared OmniCommerce product IDs to exact listings in each store. Store formats advertise the store. Campaign group UUIDs, plan UUIDs and external marketplace campaign IDs are different identities.

```typescript theme={null}
import { OmniClient } from "@omni-commerce/sdk";
const client = new OmniClient({ apiKey: process.env.OMNI_API_KEY });
const accounts = await client.ads.listAccounts({
  marketplaces: "shopee,lazada",
});

const draft = await client.ads.createCampaign({
  campaign: {
    name: "December launch",
    objective: "product_sales",
    schedule: { from: "2026-12-01", to: "2026-12-07" },
    productIds: [],
    deployments: [
      {
        store: {
          marketplace: "lazada",
          country: "singapore",
          storeId: "YOUR_STORE_ID",
        },
        adFormat: "lazada_sponsored_max_store",
        bidding: { strategy: "auto" },
        currency: "SGD",
        dailyBudget: "10.00",
        dailyLimit: "10.00",
        totalLimit: "70.00",
      },
    ],
  },
});
if (!draft.data.success || !draft.data.campaignId)
  throw new Error("Review draft failures");
const campaignIds = [draft.data.campaignId];
const review = await client.ads.getCampaigns({ campaignIds });
// Review every saved store, product, bid, schedule and limit before this call.
const accepted = await client.ads.actOnCampaigns({
  campaignIds,
  action: "approve",
});
const evidence = await client.ads.getPlans({ planIds: accepted.data.planIds });
```

`approve` queues durable delivery for the saved schedule; it does not mean the marketplace has verified publication. Preserve **all** returned `planIds` and read `getPlans` until the targets have terminal outcomes. Follow `nextOffset` to read further store or target details. `stop` requests verified pauses; `retry` resumes recoverable failed delivery without recreating verified targets. An ambiguous create remains a reconciliation issue rather than being retried blindly.

Money inputs are decimal strings. A product format's `dailyBudget` is per product; the store `dailyLimit` must cover the full allocation. Schedules use marketplace calendar days and span at most 30 days. Product selections support up to 5,000 IDs. Store selections have no arbitrary 20-store draft limit. Lifecycle batches accept up to 50 campaign or plan UUIDs, trim and deduplicate them, and return ordered per-target outcomes. Provider read batches are bounded separately as documented in OpenAPI.

Approved limits constrain OmniCommerce allocations. Marketplace overdelivery or changes made outside OmniCommerce can affect settled spend. Fund advertising through the marketplace's own billing account; these APIs do not charge a seller's card or top up ad credit.

## Reports

```typescript theme={null}
const queued = await client.ads.syncReports({
  stores: [
    { marketplace: "shopee", country: "singapore", storeId: "YOUR_STORE_ID" },
  ],
  from: "2026-11-01",
  to: "2026-11-07",
});
const status = await client.ads.getSyncStatus({ jobIds: queued.data.jobIds });
const reports = await client.ads.getReports({
  from: "2026-11-01",
  to: "2026-11-07",
  currency: "SGD",
  store: "shopee:singapore:YOUR_STORE_ID",
});
```

Import acceptance is separate from job completion. `getSyncStatus` returns pending, completed and failed outcomes for every requested job. Read live provider performance with `getPerformance`, or persisted normalized metrics with `getReports`. Shopee reports identify campaigns and stores; Lazada Sponsored Max overview rows are store-attributed and must not be allocated to individual ads. Currencies and attribution bases stay separate. Missing metrics remain `null`; ROAS is attributed sales divided by spend when both are known and spend is positive. Reports can revise after conversions arrive.

## Python and CLI

Both `Omni` and `AsyncOmni` expose `ads` with snake\_case methods:

```python theme={null}
from omnicommerce import Omni
client = Omni(api_key="YOUR_API_KEY")
review = client.ads.get_campaigns(campaign_ids=["CAMPAIGN_UUID"])
accepted = client.ads.act_on_campaigns(campaign_ids=["CAMPAIGN_UUID"], action="stop")
evidence = client.ads.get_plans(plan_ids=accepted["data"]["planIds"])
```

```bash theme={null}
omni ads list-accounts --marketplaces shopee,lazada
omni ads create-campaign --json @campaign.json
omni ads get-campaigns --json '{"campaignIds":["CAMPAIGN_UUID"]}'
omni ads act-on-campaigns --json '{"campaignIds":["CAMPAIGN_UUID"],"action":"stop"}'
omni ads get-plans --json '{"planIds":["PLAN_UUID"]}'
omni ads get-reports --from 2026-11-01 --to 2026-11-07 --currency SGD
```

Each CLI command supports `--dry-run` to inspect the request before sending it. Keep API keys outside source files.

## Operations

| Operation | TypeScript method | Agent tool |
| - | - | - |
| Account and format capabilities | `ads.listAccounts` | `get_ad_accounts` |
| Saved/synced listing | `ads.listCampaigns` | `browse_ad_campaigns` (`query.source: "synced"`) |
| Multi-store draft | `ads.createCampaign` | `plan_ad_campaigns` |
| Saved groups | `ads.getCampaigns` | `browse_ad_campaigns` (`query.source: "saved"`) |
| Group approve/stop/retry | `ads.actOnCampaigns` | `manage_ad_campaigns` |
| Live provider campaigns | `ads.getLiveCampaigns` | `browse_ad_campaigns` (`query.source: "live"`) |
| Live performance | `ads.getPerformance` | `read_ad_performance` (`query.source: "live"`) |
| Delivery evidence | `ads.getPlans` | `get_ad_operation_status` |
| Legacy plan approve/stop/retry | `ads.actOnPlans` | `manage_ad_plans` |
| Persisted reports | `ads.getReports` | `read_ad_performance` (`query.source: "synced"`) |
| Queue report import | `ads.syncReports` | `sync_ad_reports` |
| Import evidence | `ads.getSyncStatus` | `get_ad_sync_status` |

Saved agent and automation configurations can still call the original names for the individual campaign and performance readers.

The developer API uses dedicated `/api/v1/ads` operations, rather than invoking assistant tools. Read the generated [OpenAPI contract](https://docs.omnicommerce.ai/openapi.json) for request schemas and response statuses. HTTP acceptance and `ok` describe request handling; inspect `data.success`, counts and ordered results for partial failures.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.