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

# Purchase Capacity

> Purchase a reserved capacity policy.



## OpenAPI

````yaml /api-reference/flex-compute/flex-api.json post /external/api/v1/flexcompute/purchase
openapi: 3.1.0
info:
  title: Cloudidr FlexCompute API
  description: API for managing compute schedule policies and capacity reservations.
  version: 1.0.0
servers:
  - url: https://public-api.cloudidr.com
    description: Production server
security:
  - bearerAuth: []
paths:
  /external/api/v1/flexcompute/purchase:
    post:
      summary: Purchase Capacity
      description: Purchase a reserved capacity policy.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - cidrId
              properties:
                cidrId:
                  type: string
                  description: Policy/Capacity ID to purchase
            example:
              cidrId: sc_1235674554
      responses:
        '200':
          description: Success - Policy purchased successfully
          content:
            application/json:
              example:
                cidrId: sc_830349911839
                policyName: Volod test policy
                cspAccountName: personal AWS
                policyStatus: ACTIVE
                policyOperatingState: QUEUED_FOR_START
                policyInstance:
                  id: 1688
                  instanceType: c5.large
                  platformCode: Linux/UNIX
                  tenancyCode: DEDICATED
                  vcpu: 2
                  memory: 4
                  gpu: 0
                  gpuMemory: 0
                  qty: 2
                cspRegion:
                  regionCode: us-west-2
                  regionType: PRIMARY
                  availabilityZoneId: usw2-az1
                createdDate: '2026-01-08T15:20:15.64868Z'
                capacityConfiguration:
                  launchDateTime: '2026-01-10T00:00:00-08:00'
                  endDateTime: '2026-01-12T23:15:00-08:00'
                  autoRenewalEnabled: false
                  frequency: null
                  vpc: default
                  securityGroups: none
                  amiImage: default
                  sshPairKey: none
                  ebsVolumeSize: 10
                pricing:
                  ourPrice: 8.48
                  cspProviderPrice: 12.11
                  savings: 3.63
                  savingsPercentage: 0.3
                  creditCardProcessingFee: null
                  bankAccountProcessingFee: null
        '401':
          description: Unauthorized - Unable to process access token
          content:
            application/json:
              example:
                error:
                  code: '401'
                  message: Unauthorized
                  details:
                    timestamp: '2025-03-04T17:01:01'
                    description: Unable to process access token
        '404':
          description: >-
            Not Found - The specified cidr_id does not correspond to any
            existing schedule policy
          content:
            application/json:
              example:
                error:
                  code: '404'
                  message: Not Found
                  details:
                    timestamp: '2025-03-04T17:15:55'
                    description: Cidr rFVrfliRmYgD1 not found
        '500':
          description: Internal Server Error - Unexpected error occurred
          content:
            application/json:
              example:
                error:
                  code: '500'
                  message: Internal Server Error
                  details:
                    timestamp: '2025-03-04T17:17:08'
                    description: Unexpected error. Our team is working on it
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````