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

# Adicionar custos

> Adiciona custos (comissão fixa, comissão variável e/ou valor por entrega) a um ou mais influenciadores. Valida sobreposição de período entre custos com comissão. Requer o escopo `influencers.write`.



## OpenAPI

````yaml post /influencers/costs
openapi: 3.1.0
info:
  title: Solomon Admin API
  description: API aberta para integração com a Solomon
  license:
    name: MIT
  version: 1.1.0
servers:
  - url: https://admin-api.sandbox.solomon.com.br/admin/v1
  - url: https://admin-api.solomon.com.br/admin/v1
security:
  - ApiKeyAuth: []
paths:
  /influencers/costs:
    post:
      summary: Adicionar custos a influenciadores
      description: >-
        Adiciona custos (comissão fixa, comissão variável e/ou valor por
        entrega) a um ou mais influenciadores. Valida sobreposição de período
        entre custos com comissão. Requer o escopo `influencers.write`.
      operationId: createInfluencerCosts
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateInfluencerCosts'
            example:
              influencers:
                - name: Duda Raiz
                  influencer_cost_id: Ro7ckB
                  campaign_id: N93ys5
                  costs:
                    - fixed_fee: 200
                      var_fee: 10
                      value: 0
                      start_date: '2026-09-01'
                      end_date: '2026-09-30'
                      is_campaign_cost: true
                      is_coupon_cost: false
      responses:
        '200':
          description: Custos criados
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InfluencerCostsMutationResponse'
        '400':
          description: Erro de validação ou conflito de período
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Erro interno do servidor
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    CreateInfluencerCosts:
      type: object
      required:
        - influencers
      properties:
        influencers:
          type: array
          minItems: 1
          items:
            type: object
            required:
              - name
              - costs
            properties:
              name:
                type: string
              influencer_cost_id:
                type: string
                description: Opcional; reusado/gerado quando ausente.
              campaign_id:
                type: string
              campaign:
                type: string
              costs:
                type: array
                minItems: 1
                items:
                  $ref: '#/components/schemas/CostInput'
    InfluencerCostsMutationResponse:
      type: object
      properties:
        success:
          type: boolean
        data:
          type: object
          properties:
            data:
              type: object
              description: Mapa `cost_id` → custo criado.
              additionalProperties:
                $ref: '#/components/schemas/CostEntry'
        request_id:
          type: string
        timestamp:
          type: string
    Error:
      type: object
      properties:
        success:
          type: boolean
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
        request_id:
          type: string
        timestamp:
          type: string
    CostInput:
      type: object
      required:
        - start_date
      description: >-
        Custo de influenciador. Deve ter ao menos uma taxa diferente de zero
        (`fixed_fee`, `var_fee` ou `value`).
      properties:
        fixed_fee:
          type: number
          description: Comissão fixa (R$)
        var_fee:
          type: number
          description: Comissão variável (%)
        value:
          type: number
          description: >-
            Valor por entrega (R$). Quando > 0, exige `frequency` e entra nos
            custos de marketing.
        start_date:
          type: string
          format: date
          description: Data inicial (obrigatória)
        end_date:
          type: string
          format: date
          description: Data final (opcional)
        frequency:
          type: string
          enum:
            - specific
            - daily
            - weekly
            - monthly
        is_campaign_cost:
          type: boolean
          description: >-
            true = custo de campanha (exige `campaign_id`); false = custo de
            nível influenciador.
        is_coupon_cost:
          type: boolean
          description: true = atribuição por cupom; false = por cupom + link.
    CostEntry:
      type: object
      description: Um custo adicional como armazenado.
      properties:
        name:
          type: string
        date:
          type: string
          description: Data inicial (ISO `YYYY-MM-DD`)
        end_date:
          type: string
          description: Data final (ISO `YYYY-MM-DD`) ou vazio
        status:
          type: string
          enum:
            - active
            - inactive
        type:
          type: string
          example: marketing
        value:
          type: number
          example: 3500
        utm_source:
          type: string
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      description: API Key para autenticação

````