Skip to content

Upsert line items

PUT
/line-items
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

Creates or updates multiple line items

Media typeapplication/json
Upsert line items

Creates or updates multiple line items

object
line_items
required
Line Items

The list of line items to be upserted within the campaign

Array<object>
>= 1 items <= 3000 items
LineItem

Creates or updates a line item

object
id
Line item ID

The line item unique identifier. If not provided, a new line item will be created.

string
Example
63e2d42a27ad5f2b345ca123
name
required
Name

The 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.

string
>= 1 characters <= 255 characters
Example
A/B Test, version with 3D creative
start_date
required
Start date

The start date and time of the line item

string format: date-time
Example
2021-01-01T00:00:00Z
end_date
required
End date

The end date and time of the line item

string format: date-time
Example
2021-01-31T00:00:00Z
status
Status

The status of the line item

string
default: STATUS_UNSPECIFIED
Allowed values: STATUS_UNSPECIFIED STATUS_PAUSED STATUS_PLAYING
Example
STATUS_PLAYING
campaign_id
required
Campaign ID

The campaign unique identifier of the line item

string
Example
63e2d42a27ad5f2b345ca123
creative_ids
Creative IDs

The creative unique identifiers for the line item

Array<string>
Example
[
"63e2d42a27ad5f2b345ca123",
"63e2d42a27ad5f2b345ca124"
]
targeting_id
Targeting ID

The targeting unique identifier for the line item

string
Example
63e2d42a27ad5f2b345ca123
dynamic_content_optimization_id
Dynamic content optimization ID

The dynamic content optimization unique identifier for the line item

string
Example
63e2d42a27ad5f2b345ca123
pricing_policy_id
Pricing policy ID

The pricing policy unique identifier for the line item

string
Example
63e2d42a27ad5f2b345ca123
tags
Tags

The 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.

Array<string>
Example
[
"tag1",
"tag2"
]
tracking_id
Tracking ID

The tracking unique identifier for the line item

string
Example
63e2d42a27ad5f2b345ca123
budget
required
Budget

The spending cap of the line item

object
amount
required
Amount

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.

number format: double
Example
1000
currency
required
Currency

Currency 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.

string
default: CURRENCY_UNSPECIFIED
Allowed values: CURRENCY_UNSPECIFIED ALL DZD ARS AUD BSD BHD BDT AMD BBD BMD BTN BOB BWP BZD SBD BND MMK BIF KHR CAD CVE KYD LKR CLP CNY COP KMF CRC HRK CUP CZK DKK DOP SVC ETB ERN FKP FJD DJF GMD GIP GTQ GNF GYD HTG HNL HKD HUF ISK INR IDR IRR IQD ILS JMD JPY KZT JOD KES KPW KRW KWD KGS LAK LBP LSL LVL LRD LYD LTL MOP MWK MYR MVR MRO MUR MXN MNT MDL MAD OMR NAD NPR ANG AWG VUV NZD NIO NGN NOK PKR PAB PGK PYG PEN PHP QAR RUB RWF SHP STD SAR SCR SLL SGD VND SOS ZAR SSP SZL SEK CHF SYP THB TOP TTD AED TND UGX MKD EGP GBP TZS USD UYU UZS WST YER ZMK TWD SLE VES CUC ZWL BYN TMT GHS VEF SDG UYI RSD MZN AZN RON CHE CHW TRY XAF XCD XOF XPF XBA XBB XBC XBD XAU XDR XAG XPT XPD XUA ZMW SRD MGA COU AFN TJS AOA BYR BGN CDF BAM EUR MXV UAH GEL BOV PLN BRL CLF XSU USN JEP IMP GGP BTC
Example
978
Example
[
{
"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"
}
]

A successful response.

Media typeapplication/json
UpsertLineItemsResponse

Response containing the upserted line items

object
line_items
Line Items

List of line items

Array<object>
LineItem

Line item information

object
id
Line Item ID

The unique identifier of the line item in hexadecimal format

string
campaign_id
Campaign ID

The campaign unique identifier

string
name
Name

The name of the line item

string
start_date
Start Date

The UTC start date of the line item

string format: date-time
end_date
End Date

The UTC end date of the line item

string format: date-time
status
Status

The status of the line item

string
default: STATUS_UNSPECIFIED
Allowed values: STATUS_UNSPECIFIED STATUS_PAUSED STATUS_PLAYING
creative_ids
Creative IDs

The unique identifiers of the creatives of the line item

Array<string>
targeting_id
Targeting ID

The unique identifier of the targeting of the line item

string
dynamic_content_optimization_id
Dynamic Content Optimization ID

The unique identifier of the dynamic content optimization of the line item

string
pricing_policy_id
Pricing Policy ID

The unique identifier of the pricing policy of the line item

string
banker_id
Banker ID

The unique identifier of the banker of the line item

string
created_at
Created At

The UTC creation date of the line item

string format: date-time
updated_at
Updated At

The UTC last updated date of the line item

string format: date-time
tags
Tags

The tags associated with the line item

Array<string>
tracking_id
Tracking ID

The unique identifier of the tracking of the line item

string
budget
Budget

The spending cap of the line item

object
amount
Amount

Total budget in the given currency, as entered

number format: double
currency
Currency

Currency ID based on ISO 4217 numeric codes

string
default: CURRENCY_UNSPECIFIED
Allowed values: CURRENCY_UNSPECIFIED ALL DZD ARS AUD BSD BHD BDT AMD BBD BMD BTN BOB BWP BZD SBD BND MMK BIF KHR CAD CVE KYD LKR CLP CNY COP KMF CRC HRK CUP CZK DKK DOP SVC ETB ERN FKP FJD DJF GMD GIP GTQ GNF GYD HTG HNL HKD HUF ISK INR IDR IRR IQD ILS JMD JPY KZT JOD KES KPW KRW KWD KGS LAK LBP LSL LVL LRD LYD LTL MOP MWK MYR MVR MRO MUR MXN MNT MDL MAD OMR NAD NPR ANG AWG VUV NZD NIO NGN NOK PKR PAB PGK PYG PEN PHP QAR RUB RWF SHP STD SAR SCR SLL SGD VND SOS ZAR SSP SZL SEK CHF SYP THB TOP TTD AED TND UGX MKD EGP GBP TZS USD UYU UZS WST YER ZMK TWD SLE VES CUC ZWL BYN TMT GHS VEF SDG UYI RSD MZN AZN RON CHE CHW TRY XAF XCD XOF XPF XBA XBB XBC XBD XAU XDR XAG XPT XPD XUA ZMW SRD MGA COU AFN TJS AOA BYR BGN CDF BAM EUR MXV UAH GEL BOV PLN BRL CLF XSU USN JEP IMP GGP BTC
amount_in_usd
Amount in USD

The budget converted to USD at the rate in force when its amount or currency last changed, net of the platform fee

number format: double
Example
{
"line_items": [
{
"id": "63e2d42a27ad5f2b345ca123",
"name": "Line Item 1"
},
{
"id": "63e2d42a27ad5f2b345ca124",
"name": "Line Item 2"
}
]
}

Bad request

Media typeapplication/json
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

Media typeapplication/json
object
Example
{
"error": {
"code": "UNAUTHORIZED",
"message": "Unauthorized"
}
}

Internal server error

Media typeapplication/json
object
Example
{
"error": {
"code": "INTERNAL_ERROR",
"message": "Internal server error"
}
}

An unexpected error response.

Media typeapplication/json
object
code
integer format: int32
message
string
details
Array<object>
object
@type
string
key
additional properties
any
Examplegenerated
{
"code": 1,
"message": "example",
"details": [
{
"@type": "example"
}
]
}