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.) |
lineitem_priority_weight | Int | Priority weight (0-100) |
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
