> ## 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 Refund

> Create a refund for an existing order. The refundMerchantOrderId is used for idempotency.



## OpenAPI

````yaml POST /refund
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: []
paths:
  /refund:
    post:
      summary: Create Refund
      description: >-
        Create a refund for an existing order. The refundMerchantOrderId is used
        for idempotency.
      operationId: createRefund
      parameters:
        - $ref: '#/components/parameters/TimestampHeader'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RefundCreateApiRequest'
            examples:
              example:
                value:
                  orderId: ord_xxxxx
                  refundMerchantOrderId: refund_ref_10001
                  refundAmount: 19.99
                  refundReasonType: 2
                  remark: Customer requested refund
      responses:
        '200':
          description: Refund created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RefundGetRes'
            '*/*':
              schema:
                $ref: '#/components/schemas/RefundGetRes'
        '401':
          description: Unauthorized
          content:
            '*/*':
              schema:
                type: string
components:
  parameters:
    TimestampHeader:
      name: X-Timestamp
      in: header
      required: true
      description: >-
        Current timestamp in milliseconds since Unix epoch (required for request
        signing)
      schema:
        type: string
        example: '1783513683000'
  schemas:
    RefundCreateApiRequest:
      type: object
      description: Parameters required to create a refund by API
      required:
        - orderId
        - refundMerchantOrderId
        - refundAmount
      properties:
        orderId:
          type: string
          description: Unique identifier of the order to refund
        refundMerchantOrderId:
          type: string
          description: >-
            Merchant-provided unique refund order ID. Reusing the same value
            returns the existing refund.
        refundAmount:
          type: number
          description: Refund amount
          example: 19.99
        refundReasonType:
          type: integer
          format: int32
          description: >-
            Refund reason type: 0 duplicate payment, 1 fraudulent activity, 2
            customer initiated refund, 3 other
          enum:
            - 0
            - 1
            - 2
            - 3
        remark:
          type: string
          maxLength: 500
          description: Refund remark, up to 500 characters
    RefundGetRes:
      type: object
      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/RefundApiVo'
    RefundApiVo:
      type: object
      properties:
        createTime:
          type: integer
          example: 1754819711382
          description: Unix timestamp when the refund was created
          format: int64
        refundId:
          type: string
          example: rfd_abc123xyz
          description: Unique identifier for the refund
        orderId:
          type: string
          example: order_def456uvw
          description: Unique identifier of the original order being refunded
        customerId:
          type: string
          example: cus_ghi789rst
          description: Unique identifier of the customer receiving the refund
        refundAmount:
          type: number
          example: 19.99
          description: Amount refunded to the customer in the specified currency
        refundCurrency:
          type: string
          example: USD
          description: Three-letter ISO currency code of the refund (e.g., USD, EUR, GBP)
        status:
          type: string
          example: success
          enum:
            - created
            - success
            - failed
            - closed
            - received
            - refunding
          description: Current status of the refund process
        refundReason:
          type: string
          example: Customer Initiated Refund
          enum:
            - Duplicate payment
            - Fraudulent activity
            - Customer Initiated Refund
            - Other
          description: Explanation for why the refund was issued
        metadata:
          type: object
          additionalProperties: true
          example:
            arn: '8377252556170253'
            merchantReferenceId: sample_id
          description: Additional refund metadata, such as ARN and merchant reference ID
        paymentInstrumentId:
          type: string
          description: Payment instrument ID associated with the refund
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY
      description: >-
        Your secret API key obtained from the Clink dashboard (Developers
        section)

````