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

# Update Unit COGS

> Update Unit COGS



## OpenAPI

````yaml /api-reference/openapi.json post /profitability/directCosts
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:
  /profitability/directCosts:
    post:
      tags:
        - profitability
      summary: Update Unit COGS
      description: Update Unit COGS
      operationId: updateDirectCosts
      requestBody:
        description: Input required to update Unit COGS
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateDirectCostsRequest'
        required: true
      responses:
        '200':
          description: Successful operation
          headers:
            Access-Control-Allow-Origin:
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateDirectCostsResponse'
        '400':
          description: Invalid input
          content: {}
      security:
        - api_key: []
components:
  schemas:
    UpdateDirectCostsRequest:
      type: object
      properties:
        channelId:
          type: string
        merchantId:
          type: string
        fromDate:
          type: number
          example: '1609459200'
          description: Unix epoch time (seconds) representing the effective from date
        directCosts:
          type: array
          items:
            type: object
            properties:
              sellerSku:
                type: string
              cogs:
                type: number
              cogsCurrency:
                type: string
                description: 'Valid 3 letter currency code, for ex: USD, AUD, etc'
              shippingCost:
                type: number
                description: (Optional)
              shippingCostCurrency:
                type: string
                description: '(Optional) Valid 3 letter currency code, for ex: USD, AUD, etc'
      required:
        - channelId
        - merchantId
        - fromDate
        - directCosts
      description: Input data for request to update the Unit COGS
    UpdateDirectCostsResponse:
      type: object
      properties:
        jobId:
          type: string
      description: Response for request to update the Unit COGS
  securitySchemes:
    api_key:
      type: apiKey
      name: x-api-key
      in: header

````