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

# Create Test Clock

> Create a new test clock for a subscription



## OpenAPI

````yaml POST /subscription/test-clocks
openapi: 3.1.0
info:
  title: Clink API
  description: >-
    Official API documentation for Clink's payment processing platform. This API
    enables merchants to create and manage payment sessions, handle
    subscriptions, and process transactions.
  version: 1.0.0
servers:
  - url: https://uat-api.clinkbill.com/api/
security:
  - ApiKeyAuth: []
    timestamp: []
paths:
  /subscription/test-clocks:
    post:
      tags:
        - Test Clock
      summary: Create test clock
      description: Create a new test clock for a subscription
      operationId: createTestClock
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TestClockCreateApiRequest'
            examples:
              example:
                value:
                  name: April renewal simulation
                  subscriptionId: sub_xxxxx
                  metadata: '{"scene":"docs-demo"}'
      responses:
        '200':
          description: Test clock created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TestClockRes'
        '401':
          description: Unauthorized
          content:
            '*/*':
              schema:
                type: string
components:
  schemas:
    TestClockCreateApiRequest:
      type: object
      description: Parameters required to create a test clock
      required:
        - name
        - subscriptionId
      properties:
        name:
          type: string
          maxLength: 64
          description: Test clock name
        subscriptionId:
          type: string
          description: Unique identifier of the subscription bound to this test clock
        metadata:
          type: string
          description: Additional JSON-formatted metadata for merchant reference
    TestClockRes:
      type: object
      description: Response object returned for a single test clock
      properties:
        code:
          type: integer
          description: Response status code, 200 when success
          format: int32
          example: 200
        msg:
          type: string
          example: success
          description: Brief description of what happened, 'success' when happy case
        data:
          $ref: '#/components/schemas/TestClockApiVo'
    TestClockApiVo:
      type: object
      description: Test clock details
      properties:
        name:
          type: string
          description: Test clock name
        clockId:
          type: string
          description: Unique identifier of the test clock
        subscriptionId:
          type: string
          description: Unique identifier of the subscription bound to this test clock
        frozenTime:
          type: integer
          format: int64
          description: Current frozen timestamp in milliseconds since Unix epoch
        lastAdvancedTo:
          type: integer
          format: int64
          description: Most recent target frozen timestamp in milliseconds since Unix epoch
        status:
          type: string
          description: Current status of the test clock
          enum:
            - READY
            - ADVANCING
            - FAILED
            - COMPLETED
        livemode:
          type: boolean
          description: Whether the clock belongs to a live mode environment
        metadata:
          type: string
          description: Additional JSON-formatted metadata for merchant reference
        eventCount:
          type: integer
          format: int64
          description: Number of events generated by this test clock
        createTime:
          type: integer
          format: int64
          description: Unix timestamp when the test clock was created
        updateTime:
          type: integer
          format: int64
          description: Unix timestamp when the test clock was last updated
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY
      description: >-
        Your secret API key obtained from the Clink dashboard (Developers
        section)
    timestamp:
      type: apiKey
      in: header
      name: X-Timestamp
      description: >-
        Current timestamp in milliseconds since Unix epoch (required for request
        signing)

````