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

# Create a contract cost allocation

> Create the cost allocation for a contract.



## OpenAPI

````yaml https://api.itmc.i.moneyforward.com/public-api/docs/v1-json post /api/v1/organizations/{organizationId}/services/{serviceId}/contracts/{contractId}/contract-cost-allocations
openapi: 3.0.0
info:
  title: Admina Public API
  description: >-
    Admina API is a RESTfull API providing programmatic access to much of the
    data in the system. It provides predictable URLs for accessing resources,
    and uses built-in HTTP features to receive commands and return responses.
    This makes it easy to communicate with from a wide variety of environments,
    from command-line utilities to gadgets to the browser URL bar itself.
  version: '1.0'
  contact: {}
servers:
  - url: https://api.itmc.i.moneyforward.com
security: []
tags:
  - name: Organizations
    description: ''
  - name: Users
    description: ''
  - name: Directory
    description: ''
  - name: Departments
    description: ''
  - name: Locations
    description: ''
  - name: Companies
    description: ''
  - name: People
    description: ''
  - name: Workspaces
    description: ''
  - name: Custom Service and Workspace
    description: ''
  - name: Workspace Accounts
    description: ''
  - name: Accounts
    description: ''
  - name: Contracts
    description: ''
  - name: Devices
    description: ''
  - name: Devices (alpha)
    description: ''
  - name: Alerts
    description: ''
  - name: Spends
    description: ''
  - name: Usage Optimization
    description: ''
  - name: Services
    description: ''
  - name: Requests
    description: ''
  - name: AuditLogs
    description: ''
  - name: EventLogs
    description: ''
paths:
  /api/v1/organizations/{organizationId}/services/{serviceId}/contracts/{contractId}/contract-cost-allocations:
    post:
      tags:
        - Contracts
      summary: Create a contract cost allocation
      description: Create the cost allocation for a contract.
      operationId: publicCreateContractCostAllocation
      parameters:
        - name: organizationId
          required: true
          in: path
          schema:
            type: number
        - name: serviceId
          required: true
          in: path
          schema:
            type: number
        - name: contractId
          required: true
          in: path
          schema:
            type: number
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/PublicCreateOrUpdateContractCostAllocationRequestDto
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmptyResponseDto'
      security:
        - API-Key: []
components:
  schemas:
    PublicCreateOrUpdateContractCostAllocationRequestDto:
      type: object
      properties:
        strategy:
          example: bottom_up
          allOf:
            - $ref: '#/components/schemas/CostAllocationStrategy'
        totalAmountSource:
          example: cost_master
          allOf:
            - $ref: '#/components/schemas/TotalAmountSource'
        paymentCycleUnit:
          example: month
          allOf:
            - $ref: '#/components/schemas/PaymentCycleUnit'
        paymentCycleValue:
          type: number
          example: 1
        currency:
          example: usd
          allOf:
            - $ref: '#/components/schemas/CurrencyTypeIggre'
        billingMethod:
          example: prepaid
          allOf:
            - $ref: '#/components/schemas/BillingMethod'
        note:
          type: string
          example: Lorem ipsum dolor sit amet, consectetur adipiscing elit.
          nullable: true
        items:
          type: array
          items:
            $ref: '#/components/schemas/CostAllocationItemRequestDto'
      required:
        - strategy
        - totalAmountSource
        - paymentCycleUnit
        - paymentCycleValue
        - currency
        - billingMethod
    EmptyResponseDto:
      type: object
      properties: {}
    CostAllocationStrategy:
      type: string
      enum:
        - none
        - top_down
        - bottom_up
    TotalAmountSource:
      type: string
      enum:
        - cost_master
        - manual_input
        - dynamic_calculation
    PaymentCycleUnit:
      type: string
      enum:
        - day
        - week
        - month
        - year
    CurrencyTypeIggre:
      type: string
      enum:
        - jpy
        - usd
        - idr
      description: Currency of the cost
    BillingMethod:
      type: string
      enum:
        - prepaid
        - postpaid
    CostAllocationItemRequestDto:
      type: object
      properties:
        name:
          type: string
          example: Copilot Enterprise
          nullable: true
        price:
          type: number
          example: 1000
          nullable: true
        workspaceId:
          type: number
          nullable: true
          example: 1
        type:
          example: license
          allOf:
            - $ref: '#/components/schemas/CostAllocationItemType'
        allocationType:
          example: contract_owners
          allOf:
            - $ref: '#/components/schemas/AllocationType'
        peopleIds:
          example:
            - 1
            - 2
            - 3
          type: array
          items:
            type: number
      required:
        - type
        - allocationType
    CostAllocationItemType:
      type: string
      enum:
        - total
        - account
        - license
        - exceptional_amount
        - workspace
        - remaining_amount
        - others
    AllocationType:
      type: string
      enum:
        - contract_owners
        - people
        - account
        - nobody
        - none
  securitySchemes:
    API-Key:
      scheme: bearer
      bearerFormat: JWT
      type: http
      description: >-
        For authenticated requests, set the `Authorization: Bearer your_api_key`
        parameter in the header. <br/>You can create and manage your API Keys by
        visiting the **API Keys** tab in the **Settings** page of your
        organization in <a target='_blank'
        href='https://itmc.i.moneyforward.com/'>Admina</a>

````