{"metadata":{"image":[],"title":"","description":""},"api":{"url":"/rest/line_item","auth":"required","results":{"codes":[{"status":200,"language":"json","code":"{\n    \"success\": true,\n    \"message\": \"line_item created with ID = 1\",\n    \"payload\": {\n        \"id\": 1\n    }\n}","name":""}]},"settings":"","examples":{"codes":[{"code":"curl -X POST \"[host]/rest/line_item\" -b cookies.txt -d '{\"line_item_name\":\"new LI\", \"advertiser_id\":1, \"line_item_type_id\":0, \"campaign_id\":1, \"start_date\":\"12/31/2015\", \"line_item_budget\":1000, \"bidding\":{\"bidding_strategy\":\"cpm\",\"values\":{\"cpm_bid\":1.12},\"pacing\":\"none\"}, \"creative_weighting_method\":\"WEIGHTED\", \"frequency_cap\":[{\"duration\":500,\"impressions\":1}], \"user_timezones\":[\"America/New_York\"], \"active\":0}'","language":"curl"}]},"method":"post","params":[{"name":"campaign_id","type":"int","default":"","desc":"Must be a valid and active Campaign","required":true,"in":"body","ref":"","_id":"56fbf3200256470e0052538a"},{"name":"advertiser_id","type":"int","default":"","desc":"Must be active","required":true,"in":"body","ref":"","_id":"56c38f9c2d97560d00e23cba"},{"name":"alternative_id","type":"string","default":"","desc":"An alternative id to lookup the  Line Item, if desired","required":false,"in":"body","ref":"","_id":"56c38f9c2d97560d00e23cb9"},{"name":"line_item_type_id","type":"int","default":"","desc":"The type of the Line Item. `0`=banner, `1`=video, `2`=native","required":true,"in":"body","ref":"","_id":"56fbf3200256470e00525389"},{"name":"targeting_template_id","type":"int","default":"","desc":"The ID of the associated Targeting Template, must be a valid and active Targeting Template.","required":false,"in":"body","ref":"","_id":"56fbf3200256470e00525388"},{"name":"line_item_name","type":"string","default":"","desc":"Name of the Line Item, e.g. \"Winter lead generation\"","required":true,"in":"body","ref":"","_id":"56c39b11e1e4190d003429b7"},{"name":"line_item_budget","type":"double","default":"","desc":"Maximum amount to spend on this Line Item","required":true,"in":"body","ref":"","_id":"56c39b11e1e4190d003429b6"},{"name":"daily_budget","type":"double","default":"","desc":"Maximum amount to spend or deliver in a day, cannot exceed `campaign_budget` or be so low as to prevent `campaign_budget` from being reached over the length of the campaign.","required":false,"in":"body","ref":"","_id":"56c39b11e1e4190d003429b5"},{"name":"budget_type","type":"int","default":"0","desc":"Type of budget, `0`=spend, `1`=impressions, `2`=spend with vendor fees","required":true,"in":"body","ref":"","_id":"56c39b11e1e4190d003429b4"},{"name":"revenue_type","type":"string","default":"","desc":"Supported revenue types:  `CPM`, `CPC`, `CPCV`, `CPI`, `CPA`","required":false,"in":"body","ref":"","_id":"56c39b11e1e4190d003429b3"},{"name":"revenue_amount","type":"double","default":"","desc":"If a revenue_type is set, this is field is the basis of calculation. For example, if revenue_type is `CPM` and `revenue_amount` is 5.12, revenue will be calculated as a $5.12 CPM.","required":false,"in":"body","ref":"","_id":"56cf74c86c5d7a13005eeb84"},{"name":"pacing","type":"int","default":"0","desc":"DEPRECATED","required":false,"in":"body","ref":"","_id":"56cf74c86c5d7a13005eeb83"},{"name":"bid_modifier_id","type":"int","default":"","desc":"ID of a Bid Modifier object to associate with the Line Item. If set, `max_bid` must also be set.","required":false,"in":"body","ref":"","_id":"5a8c8fea50b7dd003d708c0a"},{"name":"delivery_modifier_id","type":"int","default":"","desc":"ID of the Delivery Modifier to associate with this Line Item","required":false,"in":"body","ref":"","_id":"5e39911faea785001bc52be9"},{"name":"max_bid","type":"double","default":"","desc":"Maximum bid after taking into consideration any Bid Modifiers.","required":false,"in":"body","ref":"","_id":"5a8c8fea50b7dd003d708c09"},{"name":"bidding","type":"object","default":"","desc":"Bidding Strategy JSON. See below for example.","required":true,"in":"body","ref":"","_id":"56fbf3200256470e00525387"},{"name":"creative_weighting_method","type":"string","default":"RANDOM","desc":"Either `RANDOM` or `WEIGHTED`","required":false,"in":"body","ref":"","_id":"5be2ed7bf4efa1003104b665"},{"name":"test_group_id","type":"int","default":"","desc":"When using `Experiments` the group to use for segregating users. The `test_group_id` must belong to the `test_plan_id` assigned to the Campaign. If a `test_plan_id` is set at the Campaign level, the `test_group_id` may not be `null`.","required":false,"in":"body","ref":"","_id":"5dda9ff04eb14a0011361cfa"},{"name":"start_date","type":"datetime","default":"","desc":"Start date of the Line Item.","required":true,"in":"body","ref":"","_id":"56cf74c86c5d7a13005eeb82"},{"name":"end_date","type":"datetime","default":"","desc":"End date of the Line Item.","required":false,"in":"body","ref":"","_id":"56cf74c86c5d7a13005eeb81"},{"name":"currency","type":"string","default":"","desc":"Currency in which to bid. Inherited from Campaign, so no need to set here.","required":false,"in":"body","ref":"","_id":"58504c9b9d4f700f00e9db86"},{"name":"frequency_cap","type":"array_object","default":"","desc":"Frequency cap JSON.","required":false,"in":"body","ref":"","_id":"56cf74c86c5d7a13005eeb80"},{"name":"user_timezones","type":"array_string","default":"The account's timezone","desc":"When targeting by `user_time_of_week`, this field should include a list of timezones you expect the ad to serve within. If not set properly, pacing will be uneven.","required":false,"in":"body","ref":"","_id":"5e8253989242cb002ee2fbf2"},{"name":"notes","type":"string","default":"","desc":"Notes about the Line Item, up to 255 chars","required":false,"in":"body","ref":"","_id":"56c39b11e1e4190d003429b2"},{"name":"active","type":"boolean","default":"0","desc":"Is the Line Item active? Must be set to 0 on POST since no Creatives are yet assigned.","required":true,"in":"body","ref":"","_id":"56c39b11e1e4190d003429b1"}]},"next":{"description":"","pages":[]},"title":"line_item","type":"endpoint","slug":"line_item","excerpt":"","body":"","updates":["591e1dd1c7ed711b00a6981e","5c702ca199eeb60031169bf1"],"order":112,"isReference":true,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"56fbf3200256470e00525386","user":"56c39c05bc41330d009f25d7","version":{"version":"0.5","version_clean":"0.5.0","codename":"","is_stable":true,"is_beta":false,"is_hidden":false,"is_deprecated":false,"categories":["56c35c57c0c4630d004e8650","56c7b9e5379b311700ed8fe3","56c7bab4606ee717003c4766","56c7bb3613e5400d001e8cbd","56cf3f5a5267d70b00494c4b","56cf3f866c5d7a13005ee894","56fd3956caad892200847bce","599da256e7742b002588bb02"],"_id":"56c35c56c0c4630d004e864f","createdAt":"2016-02-16T17:28:54.864Z","project":"56c35c56c0c4630d004e864c","releaseDate":"2016-02-16T17:28:54.864Z","__v":8},"parentDoc":null,"editedParams":true,"project":"56c35c56c0c4630d004e864c","__v":22,"category":{"sync":{"isSync":false,"url":""},"pages":["56cf5bb88629f91300fd97c5","56cf5bf68629f91300fd97c7","56cf5fd2287eb20b009f9f37","56cf631a44c5700b0095c1c8","56cf63ae6c5d7a13005eeb58","56cf6408287eb20b009f9f40","56cf643a287eb20b009f9f43","56cf65ba336aa60b0086a435","56cf66df336aa60b0086a440","56cf69b344c5700b0095c1cf","56cf6a3d44c5700b0095c1d3","56cf6ac6336aa60b0086a44e","56cf6b298acacb13008148c9","56cf6cd68629f91300fd97e3","56cf6e048acacb13008148cd","56cf6eac336aa60b0086a455","56cf6edf287eb20b009f9f5a","56cf6f6b336aa60b0086a462","56cf704e8629f91300fd97f0","56cf70bf6c5d7a13005eeb6f","56cf72c6287eb20b009f9f76","56cf74c86c5d7a13005eeb7f","56cf75f5336aa60b0086a496","56cf76b68629f91300fd9801","56cf76da8629f91300fd9805","56cf776c8acacb13008148dc","56cf77ca6c5d7a13005eeb92","56cf788044c5700b0095c1fe","56cf78c28acacb13008148e5","56cf7a9544c5700b0095c207","56cf7b9b44c5700b0095c20c","56cf7c268629f91300fd980f","56cf7c456c5d7a13005eeba4","56d097b1376b040b005b3029","56d0992940d36e1d00bc13dd","56d099ed167e1e1b008079d2","56d09afa376b040b005b3032","56d09ba01ecc471500f1794a","56d09c13376b040b005b3034","56d09cde167e1e1b008079d7","56d09f30167e1e1b008079e2","56d0a00b376b040b005b303d","56d0a063167e1e1b008079e6","56d0a11a7c2e100b000af929","56d0b072167e1e1b00807a2e","56d0b0fb7c2e100b000af98b","56d0b16d1ecc471500f179af","56d0b1ee7c2e100b000af991","56d0b2407c2e100b000af998","56d0b2e640d36e1d00bc1456","56d0b3511ecc471500f179bc","56d0b3aab2cb7013004de65b","56d0b3d1b2cb7013004de65e","56d0b3fe7c2e100b000af9a1","56d0b4d67c2e100b000af9a5","56d0b52fb2cb7013004de666","56d0b59db2cb7013004de66c","56d0b621167e1e1b00807a4c","56d0b787167e1e1b00807a54","56d0b82d167e1e1b00807a55","56d0b8a8167e1e1b00807a5d","56d0b8fe167e1e1b00807a60","56d0b9951ecc471500f179c7","56d0ba55376b040b005b30a1","56d0bac31ecc471500f179cc","56d0bb6e167e1e1b00807a64","56d0bc95167e1e1b00807a6a"],"title":"Buzz API Reference","slug":"buzz-api-reference","order":1,"from_sync":false,"reference":true,"_id":"56cf3f866c5d7a13005ee894","__v":67,"project":"56c35c56c0c4630d004e864c","version":"56c35c56c0c4630d004e864f","createdAt":"2016-02-25T17:53:10.154Z"},"githubsync":"","createdAt":"2016-03-30T15:39:12.057Z","editedParams2":true}

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Body Params

campaign_id:
required
integer
Must be a valid and active Campaign
advertiser_id:
required
integer
Must be active
alternative_id:
string
An alternative id to lookup the Line Item, if desired
line_item_type_id:
required
integer
The type of the Line Item. `0`=banner, `1`=video, `2`=native
targeting_template_id:
integer
The ID of the associated Targeting Template, must be a valid and active Targeting Template.
line_item_name:
required
string
Name of the Line Item, e.g. "Winter lead generation"
line_item_budget:
required
double
Maximum amount to spend on this Line Item
daily_budget:
double
Maximum amount to spend or deliver in a day, cannot exceed `campaign_budget` or be so low as to prevent `campaign_budget` from being reached over the length of the campaign.
budget_type:
required
integer0
Type of budget, `0`=spend, `1`=impressions, `2`=spend with vendor fees
revenue_type:
string
Supported revenue types: `CPM`, `CPC`, `CPCV`, `CPI`, `CPA`
revenue_amount:
double
If a revenue_type is set, this is field is the basis of calculation. For example, if revenue_type is `CPM` and `revenue_amount` is 5.12, revenue will be calculated as a $5.12 CPM.
pacing:
integer0
DEPRECATED
bid_modifier_id:
integer
ID of a Bid Modifier object to associate with the Line Item. If set, `max_bid` must also be set.
delivery_modifier_id:
integer
ID of the Delivery Modifier to associate with this Line Item
max_bid:
double
Maximum bid after taking into consideration any Bid Modifiers.
bidding:
required
object
Bidding Strategy JSON. See below for example.
creative_weighting_method:
stringRANDOM
Either `RANDOM` or `WEIGHTED`
test_group_id:
integer
When using `Experiments` the group to use for segregating users. The `test_group_id` must belong to the `test_plan_id` assigned to the Campaign. If a `test_plan_id` is set at the Campaign level, the `test_group_id` may not be `null`.
start_date:
required
datetime
Start date of the Line Item.
end_date:
datetime
End date of the Line Item.
currency:
string
Currency in which to bid. Inherited from Campaign, so no need to set here.
frequency_cap:
array of objects
Frequency cap JSON.
user_timezones:
array of stringsThe account's timezone
When targeting by `user_time_of_week`, this field should include a list of timezones you expect the ad to serve within. If not set properly, pacing will be uneven.
notes:
string
Notes about the Line Item, up to 255 chars
active:
required
boolean0
Is the Line Item active? Must be set to 0 on POST since no Creatives are yet assigned.

Examples


Result Format