> ## Documentation Index
> Fetch the complete documentation index at: https://docs.aiderx.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Update LineItems

> 
Stores line item information in the cache.
Used during ad selection and mediation logic.




## OpenAPI

````yaml /openapi/decision.api.en-dev.json post /app/api/cache/line-items
openapi: 3.1.0
info:
  contact:
    email: a2support@aiderx.io
    name: A2 Support
    url: https://aiderx.io
  description: >+

    ### Introduction

    The Decision API is responsible for selecting and distributing ads or
    content based on user requests or contextual information, all in real time.

    Its rapid response and dynamic capabilities enable the **optimal** ad or
    recommendation to be served, ensuring users receive the highest possible
    value.


    A variety of algorithms, machine learning models, and rule-based logic can
    be applied, allowing the system to **adapt flexibly** to constantly changing
    conditions.

  title: Decision APIs
  version: dev
  x-logo:
    altText: A2 Logo
    url: >-
      https://cdn.prod.website-files.com/668de9e1f25ab5675d87758d/6690cf1bdce95af5e3522c25_a2_logo_800_250.png
servers: []
security: []
tags:
  - description: >

      Ad Serving APIs for requesting ads and configuring cache settings and
      other parameters of the ad serving modules.
    name: Ad Serving
  - description: |

      Recommendation Serving APIs for requesting recommendations.
    name: Recommendation Serving
  - description: >-

      APIs for manipulating caches of the serving server.


      ### **Important**

      If you directly manipulate the cached data related to advertising or
      recommendations on the Serving server,

      we **strongly advise** against also modifying the advertising or
      recommendation data through the Ad Manager.


      Alternatively, we **recommend** handling any advertising or recommendation
      data modifications via the Ad Manager APIs.

      Any changes made on the Serving server will **not** be reflected in the Ad
      Manager,

      which can compromise **data integrity**.
    name: Cache Management
  - description: |-

      APIs for manipulating configurations of the serving server
    name: Configuration
  - description: >

      APIs for receiving conversion, impression, and click logs related to ads
      or recommendations.
    name: Ad Log
paths:
  /app/api/cache/line-items:
    post:
      tags:
        - Cache Management
      summary: Update LineItems
      description: |

        Stores line item information in the cache.
        Used during ad selection and mediation logic.
      requestBody:
        content:
          application/json:
            schema:
              items:
                $ref: '#/components/schemas/LineItem'
              type: array
        required: true
      responses:
        '204':
          description: Success
        '400':
          content:
            text/plain:
              schema:
                type: string
          description: Failed to parse the request body as JSON
        '415':
          content:
            text/plain:
              schema:
                type: string
          description: 'Expected request with `Content-Type: application/json`'
        '422':
          content:
            text/plain:
              schema:
                type: string
          description: Failed to deserialize the JSON body into the target type
        '500':
          description: Internal Server Error.
      security:
        - '': []
components:
  schemas:
    LineItem:
      properties:
        ad_type:
          default: standard
          description: Ad type for the line item (e.g., "standard", "decision")
          type: string
        audience_segments:
          anyOf:
            - $ref: '#/components/schemas/LineItemAudienceSegment'
            - type: 'null'
          description: Optional audience segments associated with the line item
        bid_strategy:
          default: highest_volume
          description: 'Bid strategy for the line item (default: "highest_volume")'
          type: string
        budget:
          description: Total budget of the line item
          format: double
          type: number
        creative_rotation:
          allOf:
            - $ref: '#/components/schemas/CreativeRotation'
          default:
            admission_confidence_penalty: 0
            posterior_temperature: 1
            prior_weight: 100
            temperature: 1
            type: optimized
            weights: []
          description: Creative rotation strategy for the line item
        custom_targeting:
          anyOf:
            - $ref: '#/components/schemas/CustomTargeting'
            - type: 'null'
          description: Optional custom targeting conditions for the line item
        daily_budget:
          description: Optional daily budget of the line item
          format: double
          type:
            - number
            - 'null'
        description:
          description: Optional description of the line item
          type:
            - string
            - 'null'
        end_date:
          description: End date of the line item (UTC)
          format: date-time
          type: string
        ext:
          description: Optional extension for the line item
        goal:
          description: Goal of the line item (click, reach, impression, conversion)
          type: string
        id:
          description: ID of the line item (uuid7)
          format: uuid
          type: string
        max_bid:
          default: 0
          description: 'Maximum bid amount for the line item (default: 0.0)'
          format: double
          type: number
        min_daily_imp:
          default: 1000
          description: 'Minimum daily impressions for the line item (default: 1000.0)'
          format: double
          type: number
        name:
          description: Name of the line item
          type: string
        oid:
          description: ID of the parent order
          format: uuid
          type: string
        owner_id:
          description: Owner ID of the line item
          format: uuid
          type: string
        pace_method:
          default: evenly
          description: Pacing method for the line item
          type: string
        priority:
          default: 8
          description: Priority of the line item
          format: uint32
          minimum: 0
          type: integer
        schedule:
          anyOf:
            - $ref: '#/components/schemas/LineItemSchedule'
            - type: 'null'
          description: Optional schedule for the line item
        start_date:
          description: Start date of the line item (UTC)
          format: date-time
          type: string
        status:
          allOf:
            - $ref: '#/components/schemas/LineItemStatus'
          description: >-
            Status of the line item (draft, ready, preparing, delivering,
            archived)
        sub_goal:
          default: maximize_volume
          description: 'Sub-goal of the line item (default: "maximize_volume")'
          type: string
        target_cpa:
          description: Target cost per acquisition (CPA) for the line item
          format: double
          type: number
        target_cpm:
          default: 0
          description: >-
            Target cost per thousand impressions (CPM) for the line item
            (default: 0.0)
          format: double
          type: number
        target_volume:
          default: 0
          description: 'Target volume for the line item (default: 0.0)'
          format: double
          type: number
      required:
        - id
        - name
        - start_date
        - end_date
        - goal
        - budget
        - status
        - owner_id
        - target_cpa
        - oid
      type: object
    LineItemAudienceSegment:
      properties:
        method:
          description: Matching method for audience segments (e.g., "auto", "manual").
          type: string
        segment_list:
          description: List of audience segment conditions for targeting.
          items:
            $ref: '#/components/schemas/AudienceSegmentInfo'
          type: array
      required:
        - method
        - segment_list
      type: object
    CreativeRotation:
      properties:
        admission_confidence_penalty:
          default: 0
          format: float
          type: number
        creative_exposure_fatigue:
          anyOf:
            - $ref: '#/components/schemas/CreativeExposureFatigueConfig'
            - type: 'null'
        posterior_temperature:
          default: 1
          format: float
          type: number
        prior_weight:
          default: 100
          format: float
          type: number
        temperature:
          default: 1
          format: float
          type: number
        type:
          $ref: '#/components/schemas/CreativeRotationType'
        user_signal:
          anyOf:
            - $ref: '#/components/schemas/CreativeRotationUserSignal'
            - type: 'null'
        weights:
          default: []
          items:
            $ref: '#/components/schemas/CreativeRotationWeight'
          type: array
      required:
        - type
      type: object
    CustomTargeting:
      description: Custom targeting condition list. Conditions are AND'd together.
      properties:
        conditions:
          items:
            $ref: '#/components/schemas/CustomTargetingCondition'
          type: array
      required:
        - conditions
      type: object
    LineItemSchedule:
      properties:
        days_of_week:
          description: >-
            Days of the week when the line item is active (1-7, where 1 =
            Monday)
          items:
            format: uint32
            minimum: 0
            type: integer
          type: array
        time_ranges:
          description: >-
            Time ranges during which the line item is active (e.g., [{"start":
            "08:00", "end": "18:00"}])
          items:
            $ref: '#/components/schemas/TimeRange'
          type: array
        timezone:
          description: Optional timezone for the line item schedule (e.g., "Asia/Seoul")
          type:
            - string
            - 'null'
      required:
        - days_of_week
        - time_ranges
      type: object
    LineItemStatus:
      enum:
        - draft
        - ready
        - preparing
        - delivering
        - archived
      type: string
    AudienceSegmentInfo:
      properties:
        id:
          description: Unique identifier for the audience segment.
          type: string
        name:
          description: Human-readable name for the audience segment.
          type: string
      required:
        - id
        - name
      type: object
    CreativeExposureFatigueConfig:
      properties:
        head:
          default:
            - 1.1799999475479126
            - 1.0800000429153442
            - 0.9800000190734864
            - 0.8999999761581421
            - 0.8199999928474426
          items:
            format: float
            type: number
          type: array
        tail_floor:
          default: 0.6499999761581421
          format: float
          type: number
        tail_step:
          default: 0.03999999910593033
          format: float
          type: number
      type: object
    CreativeRotationType:
      enum:
        - optimized
        - softmax
        - evenly
        - weighted
        - sequential
        - thompson_sampling
        - linucb_lite
      type: string
    CreativeRotationUserSignal:
      properties:
        enabled:
          default: false
          type: boolean
        prior_weight:
          default: 40
          format: float
          type: number
        propensity_multipliers:
          additionalProperties:
            format: float
            type: number
          type:
            - object
            - 'null'
        targeting_key:
          default: signal
          type: string
        type:
          allOf:
            - $ref: '#/components/schemas/CreativeRotationUserSignalType'
          default: fingerprint
      type: object
    CreativeRotationWeight:
      properties:
        crid:
          format: uuid
          type: string
        weight:
          format: uint32
          minimum: 0
          type: integer
      required:
        - crid
        - weight
      type: object
    CustomTargetingCondition:
      description: >-
        A single custom targeting condition. `values` are OR'd within the
        condition.
      properties:
        key:
          $ref: '#/components/schemas/CustomTargetingKeyRef'
        operator:
          $ref: '#/components/schemas/CustomTargetingOperator'
        values:
          items:
            $ref: '#/components/schemas/CustomTargetingValueRef'
          type: array
      required:
        - key
        - operator
        - values
      type: object
    TimeRange:
      properties:
        end:
          description: End time of the range (e.g., "18:00")
          type: string
        start:
          description: Start time of the range (e.g., "08:00")
          type: string
      required:
        - start
        - end
      type: object
    CreativeRotationUserSignalType:
      enum:
        - fingerprint
      type: string
    CustomTargetingKeyRef:
      description: |-
        Reference to a custom targeting key. Client sends both `id` and `code`,
        but the server trusts only `id` and overwrites `code` with the looked-up
        value before storing.
      properties:
        code:
          type: string
        id:
          format: uuid
          type: string
      required:
        - id
        - code
      type: object
    CustomTargetingOperator:
      description: Match operator for a custom targeting condition.
      enum:
        - in
        - not_in
      type: string
    CustomTargetingValueRef:
      description: >-
        Reference to a custom targeting value. Client sends both `id` and
        `value`,

        but the server trusts only `id` and overwrites `value` with the
        looked-up

        value before storing.
      properties:
        id:
          format: uuid
          type: string
        match_type:
          allOf:
            - $ref: '#/components/schemas/MatchType'
          default: exact
        value:
          type: string
      required:
        - id
        - value
      type: object
    MatchType:
      enum:
        - exact
      type: string

````