Docs / Capability guide

Direct campaigns and creative delivery

Set up an order, line items, and creatives for a direct campaign.

All capabilities · Related guide · Agent prompt for this capability

When to use this example

A campaign can have a budget and uploaded creative yet still be unable to serve. Use this workflow when preparing a launch to check the order, line items, flight dates and creative readiness together.

What the example gives you

The inspector reads advertisers, campaign orders, line items and creatives as JSON. Those records are the starting point for a launch review; the example does not create or activate the campaign.

Before you start

Campaign write permission in a sandbox; an agreed currency, budget, campaign schedule, and approved media you own.

Run the example

Download integration-recipes

Extract the archive and follow README.md for setup, commands, and expected results. Start with workspace_inspect.py. Local tests use sample data.

Python tools accept --help. To connect to your workspace, supply the deployment URLs, credentials and resource IDs required by the tool.

Connect it to your application

  1. Create the advertiser, then its CampaignOrder with decimal budget and explicit start/end times. Use distinct Idempotency-Key values per intended mutation and reuse the same key only when retrying that mutation.

  2. Create a direct or house line item under the order. Configure goal, rate, pacing and rotation using the LineItemCreate schema. Inspect the order and item state before activation.

  3. Create or upload a creative, wait for pipeline readiness, obtain review approval where required and attach it to the line item. Use getLineItemEligibility and getLineItemDeliveryState before probing a matching sandbox request.

Check the result

An eligible request can select the attached creative; a request outside the flight cannot. Report spend as a decimal in the order currency. Check delivery separately after creating the resources.

API operations