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

# Contract Detail Api

> Get detailed contract information including plan and plan items.



## OpenAPI

````yaml get /api/v1/contract/{contract_id}
openapi: 3.1.0
info:
  title: NinjaAPI
  version: 1.0.0
  description: ''
servers:
  - url: https://api.justpaid.io
security: []
paths:
  /api/v1/contract/{contract_id}:
    get:
      summary: Contract Detail Api
      description: Get detailed contract information including plan and plan items.
      operationId: loopfour_backend_contract_api_external_contract_detail_api
      parameters:
        - in: path
          name: contract_id
          schema:
            format: uuid
            title: Contract Id
            type: string
          required: true
        - name: contract_id
          in: path
          description: The UUID of the contract
          required: true
          schema:
            type: string
          example: 123e4567-e89b-12d3-a456-426614174000
      responses:
        '200':
          description: Contract details with plan and plan items
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContractOut'
              example:
                uuid: 123e4567-e89b-12d3-a456-426614174000
                title: Enterprise Agreement
                contract_status: accepted
                contract_start_date: '2024-01-01'
                contract_end_date: '2025-01-01'
                contract_amount: 120000
                currency: USD
                payment_terms: net_30
                is_evergreen: false
                customer:
                  uuid: customer-uuid
                  name: Acme Corp
                  email: contact@acme.com
                plan_items:
                  - uuid: item-uuid
                    name: API Calls
                    billing_alias: api_calls
                    prices:
                      - uuid: price-uuid
                        price: 0.001
                        price_type: usage_based_fee
                        billing_cycle: monthly
                line_items: []
                file_url: https://api.justpaid.io/files/contract.pdf
                created_at: '2024-01-01T00:00:00Z'
        '404':
          description: Contract not found
          content:
            application/json:
              example:
                detail: Contract not found
      security:
        - HttpBearerAuth: []
components:
  schemas:
    ContractOut:
      description: Detailed contract information with plan items.
      properties:
        customer:
          anyOf:
            - $ref: '#/components/schemas/CustomerBasicOut'
            - type: 'null'
          description: Customer information
        plan_items:
          default: []
          description: List of plan items associated with this contract
          items:
            $ref: '#/components/schemas/PlanItemOut'
          title: Plan Items
          type: array
        contract_status:
          description: The current status of the contract
          example: accepted
          title: Contract Status
          type: string
        file_url:
          anyOf:
            - type: string
            - type: 'null'
          description: URL to download the contract PDF
          example: https://api.justpaid.io/files/contract.pdf
          title: File Url
        uuid:
          format: uuid
          title: Uuid
          type: string
        title:
          anyOf:
            - maxLength: 255
              type: string
            - type: 'null'
          title: Title
        contract_start_date:
          anyOf:
            - format: date
              type: string
            - type: 'null'
          title: Contract Start Date
        contract_end_date:
          anyOf:
            - format: date
              type: string
            - type: 'null'
          title: Contract End Date
        contract_amount:
          anyOf:
            - pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
              type: string
            - type: 'null'
          title: Contract Amount
        currency:
          anyOf:
            - maxLength: 3
              type: string
            - type: 'null'
          default: USD
          title: Currency
        payment_terms:
          anyOf:
            - maxLength: 60
              type: string
            - type: 'null'
          title: Payment Terms
        discounted_amount:
          anyOf:
            - pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
              type: string
            - type: 'null'
          title: Discounted Amount
        discount_percent:
          anyOf:
            - pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
              type: string
            - type: 'null'
          title: Discount Percent
        is_evergreen:
          default: false
          title: Is Evergreen
          type: boolean
        invoice_start_date:
          anyOf:
            - format: date
              type: string
            - type: 'null'
          title: Invoice Start Date
        preferred_invoice_day:
          anyOf:
            - type: integer
            - type: 'null'
          title: Preferred Invoice Day
        created_at:
          format: date-time
          title: Created At
          type: string
        contract_summary:
          anyOf:
            - type: string
            - type: 'null'
          title: Contract Summary
      required:
        - contract_status
      title: ContractOut
      type: object
    CustomerBasicOut:
      description: Basic customer information for contract responses.
      properties:
        external_id:
          anyOf:
            - type: string
            - type: 'null'
          description: External identifier for the customer
          example: CUST-001
          title: External Id
        uuid:
          format: uuid
          title: Uuid
          type: string
        name:
          anyOf:
            - maxLength: 100
              type: string
            - type: 'null'
          description: Customer name
          title: Name
        email:
          anyOf:
            - maxLength: 100
              type: string
            - type: 'null'
          title: Email
      title: CustomerBasicOut
      type: object
    PlanItemOut:
      description: Plan item with pricing information.
      properties:
        billing_alias:
          anyOf:
            - type: string
            - type: 'null'
          description: The billing alias for this plan item
          example: api_calls
          title: Billing Alias
        prices:
          default: []
          description: List of prices for this plan item
          items:
            $ref: '#/components/schemas/PlanItemPriceOut'
          title: Prices
          type: array
        uuid:
          format: uuid
          title: Uuid
          type: string
        name:
          maxLength: 255
          title: Name
          type: string
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
      required:
        - name
      title: PlanItemOut
      type: object
    PlanItemPriceOut:
      description: Detailed plan item price information.
      properties:
        price:
          anyOf:
            - type: number
            - type: 'null'
          description: The price of the plan item
          example: 99.99
          title: Price
        billing_cycle:
          anyOf:
            - type: string
            - type: 'null'
          description: The billing cycle for this price
          example: monthly
          title: Billing Cycle
        price_type:
          anyOf:
            - type: string
            - type: 'null'
          description: The type of price (fixed_fee, usage_based_fee, tiered_fee, etc.)
          example: fixed_fee
          title: Price Type
        minimum_spend:
          anyOf:
            - type: number
            - type: 'null'
          description: Minimum amount to be charged for usage-based pricing
          example: 100
          title: Minimum Spend
        minimum_units:
          anyOf:
            - type: number
            - type: 'null'
          description: >-
            Minimum number of units to be billed if usage is below this
            threshold
          example: 1000
          title: Minimum Units
        allocated_units:
          anyOf:
            - type: number
            - type: 'null'
          description: Number of units allocated before overage charges apply
          example: 10000
          title: Allocated Units
        uuid:
          format: uuid
          title: Uuid
          type: string
      title: PlanItemPriceOut
      type: object
  securitySchemes:
    HttpBearerAuth:
      type: http
      scheme: bearer

````