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

# Retrieve Contract Details

export const IntRedir = () => {
  if (typeof document === "undefined") {
    return null;
  } else {
    setTimeout(() => {
      const currentUrl = new URL(window.location.href);
      if (currentUrl.hostname === 'docs-int.wingback.com') {
        currentUrl.hostname = 'docs.wingback.com';
        window.location.replace(currentUrl.toString());
      }
    }, 1);
    return <></>;
  }
};

<IntRedir />


## OpenAPI

````yaml GET /v1/c/contract/{contract_id}
openapi: 3.0.3
info:
  title: wingback-api
  description: ''
  contact:
    name: ''
  license:
    name: commercial
  version: 0.1.0
servers:
  - url: http://127.0.0.1:8080
    description: Local server
  - url: https://api.app.test.wingback.com
    description: Testing server
security: []
paths:
  /v1/c/contract/{contract_id}:
    get:
      tags:
        - contract
      summary: Retrieve Contract by contract_id
      operationId: get_contract
      parameters:
        - name: contract_id
          in: path
          description: Id of the Contract
          required: true
          schema:
            type: string
          example: Cont_cc871a3a-2b38-4689-a32d-14bf2e62b1ae
      responses:
        '200':
          description: Contract Details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/outbound.contract.ContractDetail'
      security:
        - api-key: []
        - wb_user_cookie: []
components:
  schemas:
    outbound.contract.ContractDetail:
      type: object
      description: Contract with additional information
      required:
        - contract_summary
        - plan
        - billing_information
      properties:
        billing_information:
          $ref: '#/components/schemas/BillingInformation'
        contract_summary:
          $ref: '#/components/schemas/outbound.contract.Summary'
        discount:
          allOf:
            - $ref: '#/components/schemas/outbound.contract.ContractDiscount'
          nullable: true
        plan:
          $ref: '#/components/schemas/outbound.contract.ContractPlan'
    BillingInformation:
      type: object
      description: Detailed information about the current billing period
      properties:
        current_period:
          allOf:
            - $ref: '#/components/schemas/Period'
          nullable: true
        current_period_idx:
          type: integer
          format: int32
          description: Current billing period index (starting from 1, ascending)
          nullable: true
    outbound.contract.Summary:
      type: object
      description: Contract Summary
      required:
        - id
        - plan
        - plan_internal_name
        - plan_id
        - customer
        - customer_id
        - status
        - cycle
        - cycle_start_offset
        - strategy
        - currency
        - amount
        - billing_information
        - configuration
        - free_cycles
        - cost_estimates
      properties:
        activation:
          type: string
          format: date-time
          description: Contract Activation Date
          nullable: true
        amount:
          type: string
          description: Contract estimated price
          deprecated: true
        billing_information:
          $ref: '#/components/schemas/BillingInformation'
        configuration:
          $ref: '#/components/schemas/outbound.contract.ContractConfiguration'
        cost_estimates:
          $ref: '#/components/schemas/PriceEstimate'
        created:
          type: string
          format: date-time
          description: Date os signing
          nullable: true
        currency:
          $ref: '#/components/schemas/Currency'
        customer:
          type: string
          description: Customer Name
        customer_id:
          $ref: '#/components/schemas/Id'
        cycle:
          $ref: '#/components/schemas/Cycle'
        cycle_start_offset:
          type: integer
          description: |-
            The number of days from the cycle's natural start (i.e. the
            first day of the week/month/quarter/year) to the start of the
            cycles
          minimum: 0
        expiration:
          type: string
          format: date-time
          description: Contract Expiration Date
          nullable: true
        free_cycles:
          type: integer
          description: The number of free cycles
          minimum: 0
        free_trial_end:
          type: string
          format: date-time
          description: Date of the end of the free trial, if any
          nullable: true
        id:
          $ref: '#/components/schemas/Id'
        next_cycle_start:
          type: string
          format: date-time
          description: |-
            End date of the current cycle
            (if the contract is active)
          nullable: true
        plan:
          type: string
          description: Plan Name
        plan_external_name:
          type: string
          description: External Plan name
          nullable: true
        plan_id:
          $ref: '#/components/schemas/Id'
        plan_internal_name:
          type: string
          description: Internal Plan name
        pricing_id:
          allOf:
            - $ref: '#/components/schemas/Id'
          nullable: true
        status:
          $ref: '#/components/schemas/ContractStatus'
        strategy:
          $ref: '#/components/schemas/Strategy'
    outbound.contract.ContractDiscount:
      type: object
      description: Discount attached to a Contract
      required:
        - id
        - contract_id
        - name
        - slug
        - discount_type
        - amount
        - duration
      properties:
        amount:
          type: string
          description: Discount amount
        contract_id:
          $ref: '#/components/schemas/Id'
        discount_type:
          $ref: '#/components/schemas/DiscountType'
        duration:
          type: integer
          format: int32
          description: >-
            Discount Duration. This determines how many billing cycles will
            Discount be applied

            For example, for Monthly cycles, setting this value to 3 will mean
            that

            first 3 month of use will be discounted
        id:
          $ref: '#/components/schemas/Id'
        name:
          type: string
          description: Discount Name
        original_discount_id:
          allOf:
            - $ref: '#/components/schemas/Id'
          nullable: true
        slug:
          type: string
          description: Unique slug
    outbound.contract.ContractPlan:
      type: object
      description: Same as Plan, but attached to a Contract
      required:
        - id
        - slug
        - name
        - internal_name
        - features
        - strategy
        - free_trial_days
      properties:
        description:
          type: string
          description: Plan Description
          nullable: true
        external_name:
          type: string
          description: External name of the Plan
          nullable: true
        features:
          type: array
          items:
            $ref: '#/components/schemas/outbound.contract.ContractFeature'
          description: List of Features present in this Plan
        free_trial_days:
          type: integer
          description: |-
            Number of days the plan will be free. The contract's
            cycles will be aligned with the end of the free trial
          minimum: 0
        id:
          $ref: '#/components/schemas/Id'
        internal_name:
          type: string
          description: Internal name of the Plan
        name:
          type: string
          description: >-
            Name of the Plan. Uses `external_name` if available, otherwise
            `internal_name`
        original_plan_id:
          allOf:
            - $ref: '#/components/schemas/Id'
          nullable: true
        price:
          allOf:
            - $ref: '#/components/schemas/outbound.contract.ContractPrice'
          nullable: true
        slug:
          type: string
          description: Unique Slug
        strategy:
          $ref: '#/components/schemas/Strategy'
    Period:
      type: object
      description: >-
        Billing period of the contract. For example, for contracts that are paid
        monthly,

        a new billing period would be created each month. For Constant or Once
        contracts, a single

        period would be created with empty "end" value
      required:
        - start
        - end
      properties:
        end:
          type: string
          format: date-time
          description: End of the billing period
        start:
          type: string
          format: date-time
          description: Start of the billing period
    outbound.contract.ContractConfiguration:
      type: object
      description: Additional Contract-level billing configuration
      required:
        - automatic_payment
        - due_date_policy
        - usage_period_closing_policy
        - invoice_trigger
      properties:
        automatic_payment:
          type: boolean
          description: Should invoice amount be charged automatically or not
        due_date_policy:
          $ref: '#/components/schemas/DueDatePolicy'
        invoice_trigger:
          $ref: '#/components/schemas/InvoiceTrigger'
        usage_period_closing_policy:
          $ref: '#/components/schemas/UsagePeriodClosingPolicy'
    PriceEstimate:
      type: object
      description: Price estimate
      required:
        - recurring_price
        - one_time_price
        - on_demand_price
        - custom_cycle_charges
      properties:
        custom_cycle_charges:
          $ref: '#/components/schemas/CustomCycleCharges'
        on_demand_price:
          $ref: '#/components/schemas/Estimate'
        one_time_price:
          $ref: '#/components/schemas/Estimate'
        recurring_price:
          $ref: '#/components/schemas/Estimate'
    Currency:
      type: string
      description: |-
        A supported currency

        The format for parsing and reading is the lowercased
        ISO 4217 currency code (e.g. "usd")
      enum:
        - usd
        - eur
        - gbp
        - brl
        - ars
    Id:
      type: string
      description: >-
        Unique identifier of an object. Consists of object class prefix and a
        UUID
      example: Cust_c40bea18-c0c9-44b1-bd0c-43f5283e1670
    Cycle:
      type: string
      description: |-
        Enum that lists supported payment cycles for contracts:
        * Once - one-time payment
        * Constant - one-time payment for the duration of the contract
        * Week - contract is paid weekly
        * Month - contract is paid monthly
        * Quarter - contract is paid every quarter
        * Year - contract is paid yearly
      enum:
        - once
        - hour
        - day
        - week
        - month
        - quarter
        - year
        - constant
    ContractStatus:
      type: string
      description: >-
        Status of the contract:

        * Active - Contract is active

        * Pending - Contract is not active

        * Scheduled - Contract is scheduled to activate in the future

        * Canceled - Contract has been canceled

        * Moved - User upgraded from this contract to a different one

        * NotReady - Contract was created, but billing engine has not completed
        contract setup
      enum:
        - active
        - pending
        - scheduled
        - canceled
        - moved
        - not_ready
    Strategy:
      type: string
      description: >-
        Pricing strategy of the Plan:

        * Plan - Plan itself contains a price, and it will be used.

        * Feature - Each feature in the plan is configured with a price, and
        final price of the plan

        is the combination of prices of all its features
      enum:
        - plan
        - group
        - feature
    DiscountType:
      type: string
      description: |-
        Type of the discount:
        * Percentage - a percent of the amount, for example 10%
        * Flat - flat amount, for example $10
      enum:
        - percentage
        - flat
    outbound.contract.ContractFeature:
      type: object
      description: Same as Plan Feature, but recorded in the Contract
      required:
        - id
        - name
        - slug
        - charge_trigger
      properties:
        charge_trigger:
          $ref: '#/components/schemas/ChargeTrigger'
        id:
          $ref: '#/components/schemas/Id'
        name:
          type: string
          description: Feature Name
        original_feature_id:
          allOf:
            - $ref: '#/components/schemas/Id'
          nullable: true
        price:
          allOf:
            - $ref: '#/components/schemas/outbound.contract.ContractPrice'
          nullable: true
        slug:
          type: string
          description: Unique Slug
    outbound.contract.ContractPrice:
      type: object
      description: Information about the price of the feature in the given contract
      required:
        - amount
        - currency
        - strategy_details
      properties:
        amount:
          type: string
          description: Price
        currency:
          $ref: '#/components/schemas/Currency'
        free_cycles:
          type: integer
          description: Number of free cycles for this feature
          minimum: 0
        strategy_details:
          $ref: '#/components/schemas/outbound.contract.ContractStrategyDetails'
        tax_code:
          type: string
          description: Tax code
          nullable: true
        total_charge_estimate:
          allOf:
            - $ref: '#/components/schemas/ContractPriceCostEstimate'
          nullable: true
    DueDatePolicy:
      type: string
      description: >-
        Determines when the due_date of the invoices should be set when created:

        * StartOfPeriod - invoices are due at the beginning of the billing
        period

        * EndOfPeriod - invoices are due at the end of the billing period
      enum:
        - start_of_period
        - end_of_period
    InvoiceTrigger:
      oneOf:
        - type: string
          description: invoices are created as soon as invoice items are validated
          enum:
            - immediate
        - type: object
          required:
            - periodic
          properties:
            periodic:
              $ref: '#/components/schemas/UnboundedPeriodRule'
        - type: string
          description: invoices are created on wb_customer action
          enum:
            - manual
      description: |-
        When the invoices should be created

        Note: EveryCycle and Periodic aren't yet supported,
        they will behave as Manual
    UsagePeriodClosingPolicy:
      type: string
      description: >-
        Determines how usage period should be closed:

        * Automatic - usage period will be closed as soon as claim period ends

        * Manual -  usage period will be open until closed manually

        * Delayed - automatic with delay after the claim period ends. Valid
        delays are 15 minutes, 1 hour, 1 day
      enum:
        - automatic
        - manual
        - 15 minutes
        - 1 hour
        - 1 day
    CustomCycleCharges:
      type: object
      description: Charges for features on a custom cycle
      required:
        - periodic_daily
        - periodic_weekly
        - periodic_monthly
        - periodic_quarterly
        - periodic_yearly
      properties:
        periodic_daily:
          $ref: '#/components/schemas/Estimate'
        periodic_monthly:
          $ref: '#/components/schemas/Estimate'
        periodic_quarterly:
          $ref: '#/components/schemas/Estimate'
        periodic_weekly:
          $ref: '#/components/schemas/Estimate'
        periodic_yearly:
          $ref: '#/components/schemas/Estimate'
    Estimate:
      type: object
      description: Detailed breakdown of the estimated charges
      required:
        - cycle_start_charges
        - minimum_usage
        - extra_cycle_end_charges
      properties:
        cycle_start_charges:
          type: string
          description: Amount to be charged at the start of the given cycle
        extra_cycle_end_charges:
          type: string
          description: Amount to be charged at the end of the cycle (except usage)
        minimum_usage:
          type: string
          description: Minimum amount of usage that will be charged
    ChargeTrigger:
      type: string
      description: When the feature should be charged
      enum:
        - every_cycle
        - first_cycle
        - on_demand
        - month
        - quarter
        - year
    outbound.contract.ContractStrategyDetails:
      oneOf:
        - type: object
          required:
            - pricing_strategy
          properties:
            pricing_strategy:
              type: string
              enum:
                - flat
        - type: object
          description: >-
            Feature is priced per unit - it's possible to purchase a fixed
            amount of units
          required:
            - unit_name
            - unit_count
            - minimum_units
            - pricing_strategy
          properties:
            batch_size:
              type: integer
              format: int32
              description: >-
                If units can be only purchased in batches, this property
                specifies in what increments

                it would be possible to purchase the feature
              nullable: true
            flat_fee:
              type: string
              description: Additional flat fee added on top of the purchased units
              nullable: true
            maximum_units:
              type: string
              description: Maximum number of units that is possible to purchase
              nullable: true
            minimum_units:
              type: string
              description: Minimum number of units that is possible to purchase
            pricing_strategy:
              type: string
              enum:
                - per_unit
            unit_count:
              type: string
              description: Number of units purchased
            unit_name:
              type: string
              description: Name of the unit - seats, computers, slots, etc
            units_charged:
              type: string
              description: >-
                Number of units that are charged, taking into account max units
                and batch size
              nullable: true
            units_used:
              type: string
              description: Current reported usage. Null if not calculated
              nullable: true
        - type: object
          description: The final price will depend on the actual usage
          required:
            - unit_name
            - over_usage_charge_strategy
            - pricing_strategy
          properties:
            batch_size:
              type: integer
              format: int32
              description: >-
                If usage is in increments - this number will specify the
                increments step

                For example, if `batch_size` is 5, and actual usage is 8, usage
                will be rounded up to 10
              nullable: true
            flat_fee:
              type: string
              description: Additional flat fee added on top of the used units
              nullable: true
            maximum_units:
              type: string
              description: Maximum number of units at default price
              nullable: true
            minimum_units:
              type: string
              description: Minimum number of units that will be charged
              nullable: true
            over_usage_charge_strategy:
              $ref: '#/components/schemas/OverUsageChargeStrategy'
            over_usage_price:
              type: string
              description: >-
                Price when using over maximum amount. Defaults to main price if
                not configured
              nullable: true
            over_usage_unit_charged:
              type: string
              description: Number of units charged over max limit
              nullable: true
            pricing_strategy:
              type: string
              enum:
                - usage
            unit_name:
              type: string
              description: Name of the unit - CPU time, RAM, etc
            units_charged:
              type: string
              description: >-
                Number of units that are charged, taking into account max units
                and batch size
              nullable: true
            units_used:
              type: string
              description: Current reported usage. Null if not calculated
              nullable: true
        - type: object
          description: Per Unit with tiered pricing
          required:
            - unit_name
            - unit_count
            - tiers
            - pricing_strategy
          properties:
            batch_size:
              type: integer
              format: int32
              description: >-
                If usage is in increments - this number will specify the
                increments step

                For example, if `batch_size` is 5, and actual usage is 8, usage
                will be rounded up to 10
              nullable: true
            flat_fee:
              type: string
              description: Additional flat fee added on top of the used units
              nullable: true
            maximum_units:
              type: string
              description: Maximum number of units that is possible to purchase
              nullable: true
            minimum_units:
              type: string
              description: Minimum number of units that is possible to purchase
              nullable: true
            pricing_strategy:
              type: string
              enum:
                - unit_tiered
            tiers:
              type: array
              items:
                $ref: '#/components/schemas/TierReport'
              description: tier prices
            unit_count:
              type: string
              description: Number of units purchased
            unit_name:
              type: string
              description: Name of the unit - CPU time, RAM, etc
            units_charged:
              type: string
              description: >-
                Number of units that are charged, taking into account max units
                and batch size
              nullable: true
            units_used:
              type: string
              description: Current reported usage. Null if not calculated
              nullable: true
        - type: object
          required:
            - unit_name
            - tiers
            - pricing_strategy
          properties:
            batch_size:
              type: integer
              format: int32
              description: >-
                If usage is in increments - this number will specify the
                increments step

                For example, if `batch_size` is 5, and actual usage is 8, usage
                will be rounded up to 10
              nullable: true
            flat_fee:
              type: string
              description: Additional flat fee added on top of the used units
              nullable: true
            maximum_units:
              type: string
              description: Maximum number of units
              nullable: true
            minimum_units:
              type: string
              description: Minimum number of units
              nullable: true
            pricing_strategy:
              type: string
              enum:
                - usage_tiered
            tiers:
              type: array
              items:
                $ref: '#/components/schemas/TierReport'
              description: tier prices
            unit_name:
              type: string
              description: Name of the unit - CPU time, RAM, etc
            units_charged:
              type: string
              description: >-
                Number of units that are charged, taking into account max units
                and batch size
              nullable: true
            units_used:
              type: string
              description: Current reported usage. Null if not calculated
              nullable: true
      description: Additional details about the price that depend on the type of the price
      discriminator:
        propertyName: pricing_strategy
    ContractPriceCostEstimate:
      type: object
      description: |-
        Estimated cost. Takes into account current usage and active discounts
        Null if calculation not performed
      required:
        - total
        - subtotal
      properties:
        subtotal:
          type: string
          description: Total estimated cost before discount is applied
        total:
          type: string
          description: Total estimated cost
    UnboundedPeriodRule:
      type: object
      description: |-
        How period are generated, independently from a start
        or end
      required:
        - cycle_count
        - cycle
      properties:
        cycle:
          $ref: '#/components/schemas/TriggerCycle'
        cycle_count:
          type: integer
          description: the number of days/week/month etc. in a period
          minimum: 0
        cycle_start_offset:
          type: integer
          description: |-
            Number of full days between the cycle's natural start and
            the claims starts. For example if claims are to start on
            the morning of the 14 each month, the offset will be 13.
            This value can be null, meaning either that it's not
            specified at this level (eg in preferences) or that it's
            0 (ie a natural cycle)
          nullable: true
          minimum: 0
    OverUsageChargeStrategy:
      type: string
      description: >-
        Determines how overusage should be charged:

        * AllUsageOvercharge - when using over maximum amount, all usage is
        charged at overusage price

        * ExtraUsageOvercharge - when using over maximum amount, only the amount
        over maximum

        is charged at overusage price
      enum:
        - all_usage_overcharge
        - extra_usage_overcharge
    TierReport:
      type: object
      description: A pricing tier with optional information on current usage
      required:
        - tier_start
        - tier_end
        - amount
      properties:
        amount:
          type: string
          description: Price per unit for this tier
        tier_end:
          $ref: '#/components/schemas/TierValue'
        tier_start:
          type: string
          description: Number of units where this tier starts applying.
        units_charged:
          type: string
          description: >-
            Number of units that are charged, taking into account max units and
            batch size
          nullable: true
        units_used:
          type: string
          description: Current reported usage. Null if not calculated
          nullable: true
    TriggerCycle:
      type: string
      description: |-
        Enum that lists supported trigger cycles for periodic triggers:
        * Month - every month
        * Quarter - every quarter
        * Year - every year
      enum:
        - day
        - week
        - month
        - quarter
        - year
    TierValue:
      oneOf:
        - type: object
          required:
            - Concrete
          properties:
            Concrete:
              type: string
        - type: string
          enum:
            - Infinity
      description: Either a number of `infinity`. Must be a string
  securitySchemes:
    api-key:
      type: apiKey
      in: header
      name: wb-key
    wb_user_cookie:
      type: apiKey
      in: cookie
      name: app-session

````