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

# Retrieve profit and loss per ASIN for a vendor channel

> Vendor only. Returns the profit and loss per ASIN for a sell type.



## OpenAPI

````yaml /api-reference/openapi.json get /profitability/vendorProductProfitAndLoss
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: advertising
    x-group: Advertising
  - 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: product
    x-group: Product
  - name: report
    x-group: Report
  - name: vendor
    x-group: Vendor
  - name: tag
    x-group: Tag
  - name: search-query-performance
    x-group: Search Query Performance
  - name: client-report
    x-group: Client Report
  - name: profitability
    x-group: Profitability
  - name: targets
    x-group: Targets
  - name: seller-health
    x-group: Seller Health
paths:
  /profitability/vendorProductProfitAndLoss:
    get:
      tags:
        - profitability
      summary: Retrieve profit and loss per ASIN for a vendor channel
      description: Vendor only. Returns the profit and loss per ASIN for a sell type.
      operationId: getVendorProductProfitAndLoss
      parameters:
        - name: channelId
          in: query
          description: Channel (store) ID. Must be an Amazon Vendor channel.
          required: true
          schema:
            type: string
        - name: merchantId
          in: query
          description: >-
            Merchant ID that owns the channel. URL-encode values containing
            spaces or '@'.
          required: true
          schema:
            type: string
        - name: fromDate
          in: query
          description: >-
            Start of the range as Unix epoch seconds. Defaults to 30 days before
            now.
          required: false
          schema:
            type: integer
        - name: toDate
          in: query
          description: >-
            End of the range as Unix epoch seconds. Defaults to now. Must not be
            before fromDate, and the range must not exceed 31 calendar days in
            the request timezone.
          required: false
          schema:
            type: integer
        - name: timezone
          in: query
          description: IANA timezone string, for example Australia/Sydney.
          required: true
          schema:
            type: string
        - name: sellType
          in: query
          description: >-
            SELL_OUT reports Amazon's sales of your products to its customers.
            SELL_IN reports your sales to Amazon through purchase orders.
          required: true
          schema:
            type: string
            enum:
              - SELL_IN
              - SELL_OUT
        - name: snsUnitsInterval
          in: query
          description: >-
            Reporting period for snsUnits. Amazon reports Subscribe & Save units
            by whole week or whole month. Only affects snsUnits, so it is
            ignored for SELL_IN.
          required: false
          schema:
            type: string
            default: week
            enum:
              - week
              - month
        - name: searchText
          in: query
          description: Optional text to match product titles or ASINs.
          required: false
          schema:
            type: string
        - name: sortKey
          in: query
          description: >-
            Field to sort by (default shippedCogs for SELL_OUT, netReceipts for
            SELL_IN). shippedCogs and shippedUnits are SELL_OUT only;
            netReceipts, receivedUnits, cancelledUnits, rejectedUnits,
            cancelledValue and rejectedValue are SELL_IN only. A key for the
            other sell type returns 400.
          required: false
          schema:
            type: string
            enum:
              - shippedCogs
              - shippedUnits
              - netReceipts
              - receivedUnits
              - cancelledUnits
              - rejectedUnits
              - cancelledValue
              - rejectedValue
              - advertisingSpend
              - inventoryQuantity
              - chargebacks
              - cogs
              - deductions
              - totalExpenses
              - totalProfit
        - name: sortOrder
          in: query
          description: Sort direction (default desc).
          required: false
          schema:
            type: string
            enum:
              - asc
              - desc
            default: desc
        - name: pageIndex
          in: query
          description: Zero-based page index (default 0).
          required: false
          schema:
            type: integer
            minimum: 0
            default: 0
        - name: pageSize
          in: query
          description: Number of ASINs per page (default 20, max 50).
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 50
            default: 20
      responses:
        '200':
          description: Successful operation
          headers:
            Access-Control-Allow-Origin:
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetVendorProductProfitAndLossResponse'
              examples:
                sellOut:
                  summary: SELL_OUT
                  value:
                    data:
                      - asin: B0XXXXXXXX
                        title: Classic Eau de Toilette for Men
                        linkUrl: https://amazon.com/dp/B0XXXXXXXX
                        imageUrl: https://m.media-amazon.com/images/I/XXXX.jpg
                        shippedCogs: 12400
                        shippedUnits: 480
                        snsUnits: 35
                        advertisingSpend: 900
                        cogs: 6100
                        deductions: 420
                        chargebacks: 15
                        totalExpenses: 7435
                        totalProfit: 4965
                        inventoryQuantity: 1200
                    pagination:
                      pageIndex: 0
                      pageSize: 20
                      count: 123
                    meta:
                      currency: USD
                      sellType: SELL_OUT
                sellIn:
                  summary: SELL_IN
                  value:
                    data:
                      - asin: B0XXXXXXXX
                        title: Classic Eau de Toilette for Men
                        linkUrl: https://amazon.com/dp/B0XXXXXXXX
                        imageUrl: https://m.media-amazon.com/images/I/XXXX.jpg
                        netReceipts: 15800
                        requestedValue: 18000
                        acceptedValue: 16200
                        cancelledValue: -1200
                        rejectedValue: -600
                        shortageValue: -400
                        receivedUnits: 610
                        requestedUnits: 700
                        acceptedUnits: 630
                        cancelledUnits: 45
                        rejectedUnits: 25
                        advertisingSpend: 900
                        cogs: 7700
                        deductions: 530
                        chargebacks: 15
                        totalExpenses: 9145
                        totalProfit: 6655
                        inventoryQuantity: 1200
                    pagination:
                      pageIndex: 0
                      pageSize: 20
                      count: 123
                    meta:
                      currency: USD
                      sellType: SELL_IN
        '400':
          description: Invalid input
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                invalidChannel:
                  summary: channelId / merchantId not found or not accessible
                  value:
                    status: error
                    error: Invalid channelId / merchantId
                notVendorChannel:
                  summary: Channel exists but is not an Amazon Vendor channel
                  value:
                    status: error
                    error: This endpoint is only supported for vendor channels
                dateRangeTooLong:
                  summary: Range exceeds the 31-day maximum
                  value:
                    status: error
                    error: toDate and fromDate must be no greater than 31 days apart
                sortKeyWrongSellType:
                  summary: sortKey belongs to the other sell type
                  value:
                    status: error
                    error: sortKey netReceipts is not available for sellType SELL_OUT
      security:
        - api_key: []
components:
  schemas:
    GetVendorProductProfitAndLossResponse:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/VendorProductProfitAndLossRow'
        pagination:
          type: object
          properties:
            pageIndex:
              type: integer
              description: Zero-based page index
            pageSize:
              type: integer
              description: Number of ASINs per page
            count:
              type: integer
              description: >-
                Total ASINs matching the request across all pages. 0 when
                pageIndex is past the last page.
          required:
            - pageIndex
            - pageSize
            - count
        meta:
          $ref: '#/components/schemas/VendorProfitAndLossMeta'
      required:
        - data
        - pagination
        - meta
    ErrorResponse:
      type: object
      properties:
        status:
          type: string
          enum:
            - error
        error:
          type: string
          description: >-
            Human-readable message. Validation failures list every failing rule,
            comma-separated.
      example:
        status: error
        error: Invalid request parameters
    VendorProductProfitAndLossRow:
      type: object
      description: >-
        One ASIN. Same field meanings as VendorProfitAndLossFigures, for this
        ASIN only. Fields marked SELL_OUT only or SELL_IN only are omitted for
        the other sell type.
      properties:
        asin:
          type: string
        title:
          type: string
          nullable: true
        linkUrl:
          type: string
          nullable: true
        imageUrl:
          type: string
          nullable: true
        shippedCogs:
          type: number
          description: SELL_OUT only.
        shippedUnits:
          type: integer
          description: SELL_OUT only.
        snsUnits:
          type: integer
          description: SELL_OUT only.
        netReceipts:
          type: number
          description: SELL_IN only.
        requestedValue:
          type: number
          description: SELL_IN only.
        acceptedValue:
          type: number
          description: SELL_IN only.
        cancelledValue:
          type: number
          description: SELL_IN only.
        rejectedValue:
          type: number
          description: SELL_IN only.
        shortageValue:
          type: number
          description: SELL_IN only.
        receivedUnits:
          type: integer
          description: SELL_IN only.
        requestedUnits:
          type: integer
          description: SELL_IN only.
        acceptedUnits:
          type: integer
          description: SELL_IN only.
        cancelledUnits:
          type: integer
          description: >-
            SELL_IN only. Units Amazon cancelled. Cancellations can come after
            you accepted the order.
        rejectedUnits:
          type: integer
          description: >-
            SELL_IN only. Units you rejected when acknowledging the purchase
            orders.
        advertisingSpend:
          type: number
          description: Amazon Ads spend on this ASIN's product ads.
        cogs:
          type: number
        deductions:
          type: number
          description: Trade-term deductions allocated to this ASIN.
        chargebacks:
          type: number
        totalExpenses:
          type: number
        totalProfit:
          type: number
        inventoryQuantity:
          type: integer
          description: >-
            Sellable units in Amazon's inventory on the latest inventory report
            date inside the range. 0 if there is no report in the range.
      required:
        - asin
        - title
        - linkUrl
        - imageUrl
        - advertisingSpend
        - cogs
        - deductions
        - chargebacks
        - totalExpenses
        - totalProfit
        - inventoryQuantity
    VendorProfitAndLossMeta:
      type: object
      properties:
        currency:
          type: string
          description: Currency of all monetary values (native marketplace currency)
        sellType:
          type: string
          enum:
            - SELL_IN
            - SELL_OUT
      required:
        - currency
        - sellType
  securitySchemes:
    api_key:
      type: apiKey
      name: x-api-key
      in: header

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.