Manage campaign configuration with targeting, scheduling, and billing through DASLineitem
Line Items
Line Items represent campaign configurations with targeting, scheduling, and billing parameters. They are the core entity for managing ad delivery in the ADP platform.
Overview
A Line Item defines:
- Targeting - Where and to whom ads are served
- Scheduling - When ads are delivered (start/end dates, dayparting)
- Billing - How campaigns are charged (CPM, CPC, CPS, etc.)
- Budget - Spending limits
- Creatives - Associated ad content
Line Item Types
| Type | Description | Use Case |
|---|---|---|
| DISPLAY | Display advertising | Banners on websites, articles, videos |
| MAILING | Email/newsletter advertising | Ads in email newsletters, mailboxes |
| TRACKING | Conversion tracking | Measuring clicks, impressions, custom events |
Query Line Items
Basic Query
query GetLineitems {
dream_adserver {
lineitems(limit: 10) {
edges {
lineitem_id
lineitem_name
lineitem_type
lineitem_status
deal_id
deal_name
}
total_count
}
}
}Filtered Query
query GetFilteredLineitems($filter: JSON, $sort: JSON) {
dream_adserver {
lineitems(
filter: $filter
sort: $sort
limit: 25
offset: 0
) {
edges {
lineitem_id
lineitem_name
lineitem_type
lineitem_status
lineitem_start_date
lineitem_end_date
lineitem_is_archived
deal_id
deal_name
}
total_count
}
}
}Variables:
{
"filter": {
"lineitem_type": {"=": "DISPLAY"},
"lineitem_is_archived": {"=": false}
},
"sort": {
"lineitem_start_date": "desc"
}
}Query with Creatives
query GetLineitemsWithCreatives {
dream_adserver {
lineitems(limit: 5) {
edges {
lineitem_id
lineitem_name
creatives(limit: 10) {
edges {
creative_id
creative_name
creative_status
}
total_count
}
}
}
}
}Critical Fields
Identification
| Field | Type | Description |
|---|---|---|
lineitem_id | Int! | Unique identifier |
lineitem_name | String! | Display name |
lineitem_type | String | Type (DISPLAY, MAILING, TRACKING) |
deal_id | Int! | Parent deal identifier |
Status & Lifecycle
| Field | Type | Description |
|---|---|---|
lineitem_status | String | Status of associated creatives |
lineitem_is_archived | Boolean | Archive flag |
lineitem_start_date | String | Delivery start (yyyy-mm-dd hh:mm:ss) |
lineitem_end_date | String | Delivery end (yyyy-mm-dd hh:mm:ss) |
Targeting & Delivery
| Field | Type | Description |
|---|---|---|
lineitem_target | DASTarget | Targeting configuration |
lineitem_capping_cnt | Int | Max events per user |
lineitem_capping_ttl | Int | Capping time window (seconds) |
lineitem_capping_type | String | Capping type (impressions/clicks) |
Financial
| Field | Type | Description |
|---|---|---|
lineitem_budget | Float | Budget limit |
lineitem_billing_models | [DASBillingModelType!] | Billing models (CPM, CPC, etc.) — plural, the rate types |
lineitem_billing_model | DASLineitemBillingModel | Common billing data independent of rate type — currently just currency. Singular, distinct from lineitem_billing_models above. null falls back to the network's default currency. |
lineitem_priority_weight | Int | Priority weight (0-100) |
lineitem_billing_model.currencymust be one of the network's configurednetwork_available_billing_model_currencies—set_lineitemrejects any other value. A network with no configured currencies rejects any value; omitting the field on write leaves the existing value unchanged.
Delivery Goals
| Field | Type | Description |
|---|---|---|
lineitem_goal_type | Int | Goal type (impressions, clicks, …) |
lineitem_goal_expected | Int | Target value for the goal |
lineitem_goal_range | Int | Look-back period for the goal calculation, in seconds (e.g. 7200 = last 2 hours) |
lineitem_goal_timezone | String | IANA timezone (e.g. Europe/Warsaw) for the goal range window — used when the range is a monthly or 24h-daily bucket. When set, it must be one of the network's configured network_available_goal_timezones. null = not set for this object; the platform then applies its system default of Europe/Warsaw. |
lineitem_goal_current | String | Current progress toward the goal |
lineitem_goal_pause_after_limit_reached | Boolean | Pause delivery once the goal target is reached |
lineitem_goal_timezonemust be one of the network's configurednetwork_available_goal_timezones. The same field (creative_goal_timezone,deal_goal_timezone) is also available on creatives and deals.
Mutations
Create/Update Line Item
mutation SetLineitem($lineitem: DASLineitemInput!) {
dream_adserver {
set_lineitem(lineitem: $lineitem) {
hit {
lineitem_id
lineitem_name
lineitem_type
lineitem_status
}
}
}
}Variables:
{
"lineitem": {
"lineitem_name": "Holiday Campaign 2025",
"lineitem_type": "DISPLAY",
"deal_id": 12345,
"lineitem_start_date": "2025-11-01 00:00:00",
"lineitem_end_date": "2025-12-31 23:59:59",
"lineitem_creative_rotate_type": "EVEN",
"lineitem_target": {
"im_adunits": [1, 2, 3]
}
}
}Required fields:
lineitem_name,lineitem_type,deal_id,lineitem_target,lineitem_start_date,lineitem_end_date,lineitem_creative_rotate_type. The mutation returnsDASSetLineitemResponsewithhitfield containing theDASLineitemobject.
Common Filter Patterns
Active Campaigns
{
"filter": {
"lineitem_is_archived": {"=": false},
"lineitem_status": {"!=": "PAUSED"}
}
}Date Range
{
"filter": {
"lineitem_start_date": {">=": "2025-01-01 00:00:00"},
"lineitem_end_date": {"<=": "2025-12-31 23:59:59"}
}
}By Deal
{
"filter": {
"deal_id": {"=": 12345}
}
}Search by Name
{
"filter": {
"lineitem_name": {"like": "%holiday%"}
}
}Multiple IDs
{
"filter": {
"lineitem_id": {"in": [101, 102, 103, 104]}
}
}Sort Examples
Newest First
{
"sort": {
"lineitem_id": "desc"
}
}By Start Date
{
"sort": {
"lineitem_start_date": "asc"
}
}Multi-Field
{
"sort": {
"lineitem_type": "asc",
"lineitem_start_date": "desc"
}
}⚠️ CRITICAL: Sort direction MUST be lowercase (
"desc", not"DESC").
Best Practices
1. Filter Before Paginating
Always filter to reduce result set size:
lineitems(
filter: $filter},
limit: 25
) {
edges { lineitem_id }
total_count
}2. Request Only Needed Fields
Don't request all 60+ fields if you only need a few:
lineitems {
edges {
lineitem_id
lineitem_name
lineitem_status
}
}3. Use Consistent Sorting for Pagination
lineitems(
sort: {"lineitem_id": "asc"},
limit: 25,
offset: 0
) {
edges { lineitem_id }
}Complete Example
query GetCampaigns($filter: JSON, $sort: JSON, $limit: Int, $offset: Int) {
dream_adserver {
lineitems(
filter: $filter
sort: $sort
limit: $limit
offset: $offset
) {
edges {
lineitem_id
lineitem_name
lineitem_type
lineitem_status
lineitem_start_date
lineitem_end_date
lineitem_budget
deal_id
deal_name
creatives(limit: 3) {
edges {
creative_id
creative_name
}
total_count
}
}
total_count
}
}
}Variables:
{
"filter": {
"lineitem_type": {"=": "DISPLAY"},
"lineitem_is_archived": {"=": false},
"lineitem_start_date": {">=": "2025-01-01 00:00:00"}
},
"sort": {
"lineitem_start_date": "desc"
},
"limit": 10,
"offset": 0
}Next Steps
- Creatives - Manage ad content for line items
- Advertisers - Manage advertiser entities
- Filtering - Master query filters
- Sorting - Learn lowercase requirement
Related
- Delivery APIs Overview - Campaign hierarchy
- Reporting - Campaign performance reports
