> ## 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 cancellations and refunds report

> Create a "cancellations and refunds" report. The generated report CSV contains the columns defined in the `CancellationsAndRefundsReportColumns` schema. Note that cancelledSales, cancelRate, and their prior period equivalents are hidden for Amazon seller channels. Use the /reports/status/{reportId} endpoint to check report status and obtain the download URL.



## OpenAPI

````yaml /api-reference/openapi.json post /reports/create/cancellationsAndRefunds
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/cancellationsAndRefunds:
    post:
      tags:
        - report
      summary: Create a cancellations and refunds report
      description: >-
        Create a "cancellations and refunds" report. The generated report CSV
        contains the columns defined in the
        `CancellationsAndRefundsReportColumns` schema. Note that cancelledSales,
        cancelRate, and their prior period equivalents are hidden for Amazon
        seller channels. Use the /reports/status/{reportId} endpoint to check
        report status and obtain the download URL.
      operationId: createCancellationsAndRefundsReport
      requestBody:
        description: Report criteria
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCancellationsAndRefundsReportRequest'
        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/CancellationsAndRefundsReportColumns'
        '400':
          description: Invalid input
          content: {}
      security:
        - api_key: []
components:
  schemas:
    CreateCancellationsAndRefundsReportRequest:
      type: object
      properties:
        channelId:
          type: string
        merchantId:
          type: string
        reportOptions:
          $ref: '#/components/schemas/CreateCancellationsAndRefundsReportOptions'
    CreateReportResponse:
      type: object
      properties:
        reportId:
          type: string
        reportType:
          type: string
        status:
          type: string
    CancellationsAndRefundsReportColumns:
      type: object
      description: >-
        Columns present in the downloadable Cancellations and Refunds report
        CSV. Note: cancelledSales, priorCancelledSales, cancelRate, and
        priorCancelRate columns are hidden for Amazon seller channels.
      properties:
        productId:
          type: string
          description: Product identifier
        asin:
          type: string
          description: Amazon Standard Identification Number
        title:
          type: string
          description: Product title
        imageUrl:
          type: string
          description: Product image URL
        linkUrl:
          type: string
          description: Product listing URL
        grossSales:
          type: number
          description: Gross sales (current period)
        priorGrossSales:
          type: number
          description: Gross sales (prior period)
        cancelledSales:
          type: number
          description: Cancelled sales value (current period, hidden for Amazon sellers)
        priorCancelledSales:
          type: number
          description: Cancelled sales value (prior period, hidden for Amazon sellers)
        cancelRate:
          type: number
          description: Cancellation rate percentage (hidden for Amazon sellers)
        priorCancelRate:
          type: number
          description: Prior period cancellation rate (hidden for Amazon sellers)
        netSales:
          type: number
          description: Net sales (current period)
        priorNetSales:
          type: number
          description: Net sales (prior period)
        grossQty:
          type: number
          description: Gross quantity ordered (current period)
        priorGrossQty:
          type: number
          description: Gross quantity ordered (prior period)
        refundedSales:
          type: number
          description: Refunded sales value (current period)
        priorRefundedSales:
          type: number
          description: Refunded sales value (prior period)
        unitsRefunded:
          type: number
          description: Number of units refunded (current period)
        priorUnitsRefunded:
          type: number
          description: Number of units refunded (prior period)
        refundRate:
          type: number
          description: Refund rate percentage (current period)
        priorRefundRate:
          type: number
          description: Refund rate percentage (prior period)
        refundRateUnits:
          type: number
          description: Refund rate by units (current period)
        priorRefundRateUnits:
          type: number
          description: Refund rate by units (prior period)
        unitsCancelled:
          type: number
          description: Number of units cancelled (current period)
        priorUnitsCancelled:
          type: number
          description: Number of units cancelled (prior period)
        currency:
          type: string
          description: Currency code (e.g. USD, GBP)
    CreateCancellationsAndRefundsReportOptions:
      allOf:
        - $ref: '#/components/schemas/CommonReportOptions'
        - type: object
          properties:
            fromDate:
              type: integer
              description: >-
                Unix epoch time (seconds) representing the start of the
                reporting period
            toDate:
              type: integer
              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
            includeTax:
              type: boolean
              description: Whether tax should be included in sales figures
    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
  securitySchemes:
    api_key:
      type: apiKey
      name: x-api-key
      in: header

````