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

# Create a campaigns report

> Create a "campaigns" report (Amazon Advertising). The download contains multiple CSV files: campaigns, ad groups, keywords, product ads, and products. See the `CampaignsReportCampaignColumns`, `CampaignsReportAdGroupColumns`, `CampaignsReportKeywordColumns`, `CampaignsReportProductAdColumns`, and `CampaignsReportProductColumns` schemas for the columns in each file. Use the /reports/status/{reportId} endpoint to check report status and obtain the download URL.



## OpenAPI

````yaml /api-reference/openapi.json post /reports/create/campaigns
openapi: 3.0.1
info:
  title: MerchantSpring Public API
  version: 1.0.0
servers:
  - url: https://mm-api.merchantspring.io
    description: Production
  - url: https://mm-api-staging.merchantspring.io
    description: Staging
security: []
tags:
  - name: channel
    x-group: Channel
  - name: content-change
    x-group: Content Change
  - name: custom-group
    x-group: Custom Group
  - name: order
    x-group: Order
  - name: report
    x-group: Report
  - name: tag
    x-group: Tag
  - name: profitability
    x-group: Profitability
paths:
  /reports/create/campaigns:
    post:
      tags:
        - report
      summary: Create a campaigns report
      description: >-
        Create a "campaigns" report (Amazon Advertising). The download contains
        multiple CSV files: campaigns, ad groups, keywords, product ads, and
        products. See the `CampaignsReportCampaignColumns`,
        `CampaignsReportAdGroupColumns`, `CampaignsReportKeywordColumns`,
        `CampaignsReportProductAdColumns`, and `CampaignsReportProductColumns`
        schemas for the columns in each file. Use the /reports/status/{reportId}
        endpoint to check report status and obtain the download URL.
      operationId: createCampaignsReport
      requestBody:
        description: Report criteria
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCampaignsReportRequest'
        required: true
      responses:
        '200':
          description: Successful operation
          headers:
            Access-Control-Allow-Origin:
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateReportResponse'
            text/csv:
              schema:
                $ref: '#/components/schemas/CampaignsReportColumns'
        '400':
          description: Invalid input
          content: {}
      security:
        - api_key: []
components:
  schemas:
    CreateCampaignsReportRequest:
      type: object
      properties:
        channelId:
          type: string
        merchantId:
          type: string
        reportOptions:
          $ref: '#/components/schemas/CommonReportOptions'
    CreateReportResponse:
      type: object
      properties:
        reportId:
          type: string
        reportType:
          type: string
        status:
          type: string
    CampaignsReportColumns:
      type: object
      description: >-
        The campaigns report generates multiple CSV files: campaigns, ad groups,
        keywords, product ads, and products. See the sub-schemas below for the
        columns in each file.
      oneOf:
        - $ref: '#/components/schemas/CampaignsReportCampaignColumns'
        - $ref: '#/components/schemas/CampaignsReportAdGroupColumns'
        - $ref: '#/components/schemas/CampaignsReportKeywordColumns'
        - $ref: '#/components/schemas/CampaignsReportProductAdColumns'
        - $ref: '#/components/schemas/CampaignsReportProductColumns'
    CommonReportOptions:
      type: object
      properties:
        fromDate:
          type: number
          description: >-
            Unix epoch time (seconds) representing the start of the reporting
            period
        toDate:
          type: number
          description: >-
            Unix epoch time (seconds) representing the end of the reporting
            period
        priorFromDate:
          type: number
          description: >-
            Unix epoch time (seconds) representing the start of the comparison
            period
        priorToDate:
          type: number
          description: >-
            Unix epoch time (seconds) representing the end of the comparison
            period
        timezone:
          type: string
          description: >-
            The timezone string you wish to see the report in (e.g.
            'America/Los_Angeles') see
            https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
    CampaignsReportCampaignColumns:
      type: object
      description: Columns in the campaigns CSV file of the Campaigns report download.
      properties:
        campaign_id:
          type: string
          description: Campaign identifier
        ad_type:
          type: string
          description: Type of ad (e.g. SP, SB, SD)
        seller_id:
          type: string
          description: Seller identifier
        marketplace_id:
          type: string
          description: Amazon marketplace code
        report_date:
          type: string
          description: Report date
        campaign_name:
          type: string
          description: Campaign name
        campaign_status:
          type: string
          description: Campaign status (e.g. active, paused, archived)
        budget:
          type: number
          description: Campaign budget (in target currency)
        budget_type:
          type: string
          description: Budget type (e.g. daily, lifetime)
        start_date:
          type: string
          description: Campaign start date
        end_date:
          type: string
          nullable: true
          description: Campaign end date
        targeting_type:
          type: string
          nullable: true
          description: Targeting method
        bidding_strategy:
          type: string
          nullable: true
          description: Bidding strategy
        impressions:
          type: number
          description: Total impressions
        clicks:
          type: number
          description: Total clicks
        cost:
          type: number
          description: Total ad spend (in target currency)
        attributed_sales:
          type: number
          description: Total sales attributed to ads (in target currency)
        attributed_sales_same_sku:
          type: number
          description: Sales attributed to the same SKU (in target currency)
        attributed_conversions:
          type: number
          description: Total conversions attributed to ads
        attributed_conversions_same_sku:
          type: number
          description: Conversions attributed to the same SKU
        attributed_units_ordered:
          type: number
          description: Total units ordered attributed to ads
        attributed_units_ordered_same_sku:
          type: number
          description: Units ordered for the same SKU
        attributed_orders_ntb:
          type: number
          description: New-to-brand orders
        attributed_orders_ntb_percentage:
          type: number
          description: New-to-brand orders as a percentage of total
        attributed_units_ordered_ntb:
          type: number
          description: New-to-brand units ordered
        attributed_units_ordered_ntb_percentage:
          type: number
          description: New-to-brand units as a percentage of total
        attributed_sales_ntb:
          type: number
          description: New-to-brand sales (in target currency)
        attributed_sales_ntb_percentage:
          type: number
          description: New-to-brand sales as a percentage of total
        attributed_detail_page_views_clicks:
          type: number
          description: Detail page view clicks attributed to ads
        acos:
          type: number
          description: Advertising Cost of Sale (percentage)
        click_through_rate:
          type: number
          description: Click-through rate (percentage)
        cost_per_click:
          type: number
          description: Average cost per click (in target currency)
        conversion_rate:
          type: number
          description: Conversion rate (percentage)
        roas:
          type: number
          description: Return on Ad Spend
    CampaignsReportAdGroupColumns:
      type: object
      description: Columns in the ad groups CSV file of the Campaigns report download.
      properties:
        campaign_id:
          type: string
          description: Parent campaign identifier
        ad_group_id:
          type: string
          description: Ad group identifier
        ad_type:
          type: string
          description: Type of ad (e.g. SP, SB, SD)
        seller_id:
          type: string
          description: Seller identifier
        marketplace_id:
          type: string
          description: Amazon marketplace code
        report_date:
          type: string
          description: Report date
        campaign_name:
          type: string
          description: Parent campaign name
        ad_group_name:
          type: string
          description: Ad group name
        ad_group_status:
          type: string
          description: Ad group status (e.g. enabled, paused)
        default_bid:
          type: number
          nullable: true
          description: Default bid amount (in target currency)
        impressions:
          type: number
          description: Total impressions
        clicks:
          type: number
          description: Total clicks
        cost:
          type: number
          description: Total ad spend (in target currency)
        attributed_sales:
          type: number
          description: Total sales attributed to ads (in target currency)
        attributed_sales_same_sku:
          type: number
          description: Sales attributed to the same SKU (in target currency)
        attributed_conversions:
          type: number
          description: Total conversions attributed to ads
        attributed_conversions_same_sku:
          type: number
          description: Conversions attributed to the same SKU
        attributed_units_ordered:
          type: number
          description: Total units ordered attributed to ads
        attributed_units_ordered_same_sku:
          type: number
          description: Units ordered for the same SKU
        attributed_orders_ntb:
          type: number
          description: New-to-brand orders
        attributed_orders_ntb_percentage:
          type: number
          description: New-to-brand orders as a percentage of total
        attributed_units_ordered_ntb:
          type: number
          description: New-to-brand units ordered
        attributed_units_ordered_ntb_percentage:
          type: number
          description: New-to-brand units as a percentage of total
        attributed_sales_ntb:
          type: number
          description: New-to-brand sales (in target currency)
        attributed_sales_ntb_percentage:
          type: number
          description: New-to-brand sales as a percentage of total
        attributed_detail_page_views_clicks:
          type: number
          description: Detail page view clicks attributed to ads
        acos:
          type: number
          description: Advertising Cost of Sale (percentage)
        click_through_rate:
          type: number
          description: Click-through rate (percentage)
        cost_per_click:
          type: number
          description: Average cost per click (in target currency)
        conversion_rate:
          type: number
          description: Conversion rate (percentage)
        roas:
          type: number
          description: Return on Ad Spend
    CampaignsReportKeywordColumns:
      type: object
      description: Columns in the keywords CSV file of the Campaigns report download.
      properties:
        campaign_id:
          type: string
          description: Parent campaign identifier
        ad_group_id:
          type: string
          description: Parent ad group identifier
        keyword_id:
          type: string
          description: Keyword identifier
        ad_type:
          type: string
          description: Type of ad (e.g. SP, SB, SD)
        seller_id:
          type: string
          description: Seller identifier
        marketplace_id:
          type: string
          description: Amazon marketplace code
        report_date:
          type: string
          description: Report date
        campaign_name:
          type: string
          description: Parent campaign name
        ad_group_name:
          type: string
          description: Parent ad group name
        keyword_text:
          type: string
          description: The keyword text
        match_type:
          type: string
          description: Keyword match type (e.g. broad, phrase, exact)
        keyword_status:
          type: string
          description: Keyword status (e.g. enabled, paused)
        bid:
          type: number
          nullable: true
          description: Keyword bid amount (in target currency)
        impressions:
          type: number
          description: Total impressions
        clicks:
          type: number
          description: Total clicks
        cost:
          type: number
          description: Total ad spend (in target currency)
        attributed_sales:
          type: number
          description: Total sales attributed to ads (in target currency)
        attributed_sales_same_sku:
          type: number
          description: Sales attributed to the same SKU (in target currency)
        attributed_conversions:
          type: number
          description: Total conversions attributed to ads
        attributed_conversions_same_sku:
          type: number
          description: Conversions attributed to the same SKU
        attributed_units_ordered:
          type: number
          description: Total units ordered attributed to ads
        attributed_units_ordered_same_sku:
          type: number
          description: Units ordered for the same SKU
        attributed_orders_ntb:
          type: number
          description: New-to-brand orders
        attributed_orders_ntb_percentage:
          type: number
          description: New-to-brand orders as a percentage of total
        attributed_units_ordered_ntb:
          type: number
          description: New-to-brand units ordered
        attributed_units_ordered_ntb_percentage:
          type: number
          description: New-to-brand units as a percentage of total
        attributed_sales_ntb:
          type: number
          description: New-to-brand sales (in target currency)
        attributed_sales_ntb_percentage:
          type: number
          description: New-to-brand sales as a percentage of total
        attributed_detail_page_views_clicks:
          type: number
          description: Detail page view clicks attributed to ads
        acos:
          type: number
          description: Advertising Cost of Sale (percentage)
        click_through_rate:
          type: number
          description: Click-through rate (percentage)
        cost_per_click:
          type: number
          description: Average cost per click (in target currency)
        conversion_rate:
          type: number
          description: Conversion rate (percentage)
        roas:
          type: number
          description: Return on Ad Spend
    CampaignsReportProductAdColumns:
      type: object
      description: Columns in the product ads CSV file of the Campaigns report download.
      properties:
        campaign_id:
          type: string
          description: Parent campaign identifier
        ad_id:
          type: string
          description: Product ad identifier
        ad_type:
          type: string
          description: Type of ad (e.g. SP, SB, SD)
        seller_id:
          type: string
          description: Seller identifier
        marketplace_id:
          type: string
          description: Amazon marketplace code
        report_date:
          type: string
          description: Report date
        campaign_name:
          type: string
          description: Parent campaign name
        ad_group_name:
          type: string
          description: Parent ad group name
        product_ad_status:
          type: string
          description: Product ad status (e.g. enabled, paused)
        product_id:
          type: string
          description: Product identifier
        product_title:
          type: string
          description: Product title
        image_url:
          type: string
          description: Product image URL
        link_url:
          type: string
          description: Product listing URL
        sku:
          type: string
          description: Seller SKU
        asin:
          type: string
          description: Amazon Standard Identification Number
        impressions:
          type: number
          description: Total impressions
        clicks:
          type: number
          description: Total clicks
        cost:
          type: number
          description: Total ad spend (in target currency)
        attributed_sales:
          type: number
          description: Total sales attributed to ads (in target currency)
        attributed_sales_same_sku:
          type: number
          description: Sales attributed to the same SKU (in target currency)
        attributed_conversions:
          type: number
          description: Total conversions attributed to ads
        attributed_conversions_same_sku:
          type: number
          description: Conversions attributed to the same SKU
        attributed_units_ordered:
          type: number
          description: Total units ordered attributed to ads
        attributed_units_ordered_same_sku:
          type: number
          description: Units ordered for the same SKU
        acos:
          type: number
          description: Advertising Cost of Sale (percentage)
        click_through_rate:
          type: number
          description: Click-through rate (percentage)
        cost_per_click:
          type: number
          description: Average cost per click (in target currency)
        conversion_rate:
          type: number
          description: Conversion rate (percentage)
        roas:
          type: number
          description: Return on Ad Spend
    CampaignsReportProductColumns:
      type: object
      description: >-
        Columns in the products CSV file of the Campaigns report download.
        Aggregated product-level advertising performance.
      properties:
        seller_id:
          type: string
          description: Seller identifier
        marketplace_id:
          type: string
          description: Amazon marketplace code
        report_date:
          type: string
          description: Report date
        product_ad_status:
          type: string
          description: Product ad status
        product_id:
          type: string
          description: Product identifier
        product_title:
          type: string
          description: Product title
        image_url:
          type: string
          description: Product image URL
        link_url:
          type: string
          description: Product listing URL
        sku:
          type: string
          description: Seller SKU
        asin:
          type: string
          description: Amazon Standard Identification Number
        impressions:
          type: number
          description: Total impressions
        clicks:
          type: number
          description: Total clicks
        cost:
          type: number
          description: Total ad spend (in target currency)
        attributed_sales:
          type: number
          description: Total sales attributed to ads (in target currency)
        attributed_sales_same_sku:
          type: number
          description: Sales attributed to the same SKU (in target currency)
        attributed_conversions:
          type: number
          description: Total conversions attributed to ads
        attributed_conversions_same_sku:
          type: number
          description: Conversions attributed to the same SKU
        attributed_units_ordered:
          type: number
          description: Total units ordered attributed to ads
        attributed_units_ordered_same_sku:
          type: number
          description: Units ordered for the same SKU
        acos:
          type: number
          description: Advertising Cost of Sale (percentage)
        click_through_rate:
          type: number
          description: Click-through rate (percentage)
        cost_per_click:
          type: number
          description: Average cost per click (in target currency)
        conversion_rate:
          type: number
          description: Conversion rate (percentage)
        roas:
          type: number
          description: Return on Ad Spend
  securitySchemes:
    api_key:
      type: apiKey
      name: x-api-key
      in: header

````