Upsert line items
const url = 'https://portal.staging.arago-tech.com/line-items';const options = { method: 'PUT', headers: {Authorization: '<Authorization>', 'Content-Type': 'application/json'}, body: '{"line_items":[{"budget":{"amount":1000,"currency":"EUR"},"campaign_id":"63e2d42a27ad5f2b345ca123","end_date":"2021-01-31T00:00:00Z","name":"Discount on products","start_date":"2021-01-01T00:00:00Z"}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://portal.staging.arago-tech.com/line-items \ --header 'Authorization: <Authorization>' \ --header 'Content-Type: application/json' \ --data '{ "line_items": [ { "budget": { "amount": 1000, "currency": "EUR" }, "campaign_id": "63e2d42a27ad5f2b345ca123", "end_date": "2021-01-31T00:00:00Z", "name": "Discount on products", "start_date": "2021-01-01T00:00:00Z" } ] }'Creates or updates multiple line items
Authorizations
Section titled “Authorizations”Request Body
Section titled “Request Body”Creates or updates multiple line items
Creates or updates multiple line items
object
The list of line items to be upserted within the campaign
Creates or updates a line item
object
The line item unique identifier. If not provided, a new line item will be created.
Example
63e2d42a27ad5f2b345ca123The name of the line item. Must not contain only whitespace (NOT_BLANK). Length is checked before surrounding whitespace is trimmed on write; the response returns the stored name.
Example
A/B Test, version with 3D creativeThe start date and time of the line item
Example
2021-01-01T00:00:00ZThe end date and time of the line item
Example
2021-01-31T00:00:00ZThe status of the line item
Example
STATUS_PLAYINGThe campaign unique identifier of the line item
Example
63e2d42a27ad5f2b345ca123The creative unique identifiers for the line item
Example
[ "63e2d42a27ad5f2b345ca123", "63e2d42a27ad5f2b345ca124"]The targeting unique identifier for the line item
Example
63e2d42a27ad5f2b345ca123The dynamic content optimization unique identifier for the line item
Example
63e2d42a27ad5f2b345ca123The pricing policy unique identifier for the line item
Example
63e2d42a27ad5f2b345ca123The tags associated with the line item. Each tag must be 3 to 255 characters and must not contain only whitespace (NOT_BLANK). Tags are not trimmed.
Example
[ "tag1", "tag2"]The tracking unique identifier for the line item
Example
63e2d42a27ad5f2b345ca123The spending cap of the line item
object
Total budget in the given currency. It must be at least 10 USD once converted; conversion is applied server-side after submission, so the smallest accepted value depends on the selected currency. On update it cannot be set below what the line item has already spent.
Example
1000Currency ID based on ISO 4217 numeric codes. The bond market units (XBA, XBB, XBC, XBD), the supranational units of account (XUA, XSU) and the fund codes (BOV, CHE, CHW, CLF, COU, USN, UYI) are rejected: no exchange rate is published for them, so a budget denominated in one could not be converted to USD.
Example
978Example
[ { "budget": { "amount": 1000, "currency": "EUR" }, "campaign_id": "63e2d42a27ad5f2b345ca123", "end_date": "2021-01-31T00:00:00Z", "name": "Discount on products", "start_date": "2021-01-01T00:00:00Z" }]Responses
Section titled “ Responses ”A successful response.
Response containing the upserted line items
object
List of line items
Line item information
object
The unique identifier of the line item in hexadecimal format
The campaign unique identifier
The name of the line item
The UTC start date of the line item
The UTC end date of the line item
The status of the line item
The unique identifiers of the creatives of the line item
The unique identifier of the targeting of the line item
The unique identifier of the dynamic content optimization of the line item
The unique identifier of the pricing policy of the line item
The unique identifier of the banker of the line item
The UTC creation date of the line item
The UTC last updated date of the line item
The tags associated with the line item
The unique identifier of the tracking of the line item
The spending cap of the line item
object
Total budget in the given currency, as entered
Currency ID based on ISO 4217 numeric codes
The budget converted to USD at the rate in force when its amount or currency last changed, net of the platform fee
Example
{ "line_items": [ { "id": "63e2d42a27ad5f2b345ca123", "name": "Line Item 1" }, { "id": "63e2d42a27ad5f2b345ca124", "name": "Line Item 2" } ]}Bad request
object
Example
{ "error": { "code": "BAD_REQUEST", "details": [ { "code": "MAX_ITEMS", "field": "line_items", "message": "value must contain no more than 3000 item(s)", "params": { "max": "3000" } } ], "message": "Bad request" }}Unauthorized
object
Example
{ "error": { "code": "UNAUTHORIZED", "message": "Unauthorized" }}Internal server error
object
Example
{ "error": { "code": "INTERNAL_ERROR", "message": "Internal server error" }}default
Section titled “default”An unexpected error response.
object
object
Examplegenerated
{ "code": 1, "message": "example", "details": [ { "@type": "example" } ]}