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

# Order refund



## OpenAPI

````yaml /api-reference/openapi.json post /api/v1/order/refund
openapi: 3.1.0
info:
  title: acquiring-order
  description: 接口文档
  termsOfService: https://www.waffo.com
  version: 1.0.0
servers:
  - url: https://www.waffo.com
    description: Sandbox API (auto-signed via Next.js proxy)
security: []
tags:
  - name: Order create
    description: ' Order create api description'
  - name: Subscription create
    description: Subscription create api description
  - name: Subscription inquiry
    description: Subscription inquiry api description
  - name: Order inquiry
    description: Order inquiry api description
  - name: Subscription cancel
    description: >
      Cancel an active subscription when the merchant no longer wishes to
      continue the recurring billing cycle. This endpoint can only be invoked
      when the subscription status is active
  - name: Order cancel
    description: Order cancel api description
  - name: Subscription manage
    description: >
      This API allows the merchant to request a subscription management URL from
      Waffo

      Waffo will generate a subscription management URL which merchant can
      redirect user to this URL for managing subscription details (e.g. view
      subscription detail and cancel subscription). This management URL has a
      fixed expiration time (e.g., 1 day).
  - name: Order refund
    description: Order refund api description
  - name: Subscription change
    description: >
      This API allows merchants to upgrade or downgrade a user's subscription
      plan. The change request will create a new subscription based on the
      original subscription, applying any remaining amount from the original
      subscription.


      此接口允许商户升级或降级用户的订阅计划。升降级请求将基于原订阅创建新订阅，并将原订阅的剩余金额应用到新订阅中。
  - name: Refund inquiry
    description: Refund inquiry api description
  - name: Subscription change inquiry
    description: >
      This API allows merchants to query the status of a subscription change
      (upgrade/downgrade) request.

      此接口允许商户查询订阅升降级请求的状态。
  - name: Merchant config inquiry
    description: Merchant config inquiry api description
  - name: Pay Method Config Inquiry
    description: Pay Method Config Inquiry api description
paths:
  /api/v1/order/refund:
    post:
      tags:
        - Order refund
      summary: Order refund
      operationId: orderRefund
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AcqOrderRefundRequest'
        required: true
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ResponseAcqOrderRefundResponse'
components:
  schemas:
    AcqOrderRefundRequest:
      type: object
      properties:
        refundRequestId:
          type: string
          description: >-
            Refund request id sent from Merchant. It will also be used for
            idempotent check.
          x-gen: NANOID
          maxLength: 32
          minLength: 0
        acquiringOrderId:
          type: string
          description: Waffo acquiring order Id
          example: <acquiringOrderId>
          maxLength: 32
          minLength: 0
        merchantRefundOrderId:
          type: string
          description: Merchant side refund order id
          maxLength: 64
          minLength: 0
        merchantId:
          type: string
          default: '1000000201'
          description: Merchant Id assigned by Waffo
          example: 1000000201
          maxLength: 64
          minLength: 0
        requestedAt:
          type: string
          format: date-time
          description: Merchant-side request time
          x-gen: DATETIME_ISO
        refundAmount:
          type: string
          description: Refund amount
          example: 10
          minLength: 1
        refundReason:
          type: string
          description: Refund reason
          example: replace your reason....
          maxLength: 256
          minLength: 0
        refundNotifyUrl:
          type: string
          description: >-
            The callback address to notify the merchant after the refund is
            completed / failed. 

            If not provided, Merchant can use inquiry refund API to get the
            final refund status.
          maxLength: 256
          minLength: 0
        extendInfo:
          type: string
          description: 'Reserved. Json format e.g. {"key1":"value1", "key2":"value2"} '
          maxLength: 128
          minLength: 0
        refundSource:
          type: string
        userInfo:
          $ref: '#/components/schemas/RefundOrderUserInfo'
          description: >-
            For certain pay method type (e.g. ONLINE_BANKING) the refund
            requires Merchant to provide user information to execute
      required:
        - acquiringOrderId
        - merchantId
        - refundAmount
        - refundReason
        - refundRequestId
        - requestedAt
    ResponseAcqOrderRefundResponse:
      type: object
      description: response data
      properties:
        code:
          type: string
        msg:
          type: string
        data:
          $ref: '#/components/schemas/AcqOrderRefundResponse'
    RefundOrderUserInfo:
      type: object
      description: >-
        For certain pay method type (e.g. ONLINE_BANKING) the refund requires
        Merchant to provide user information to execute
      properties:
        userType:
          type: string
          default: INDIVIDUAL
          description: |-
            User Type: 
            - **INDIVIDUAL** 
            - **BUSINESS**
          example: INDIVIDUAL
          maxLength: 12
          minLength: 0
        userFirstName:
          type: string
          description: User's first name
          maxLength: 64
          minLength: 0
        userMiddleName:
          type: string
          maxLength: 64
          minLength: 0
        userLastName:
          type: string
          description: User's last name
          maxLength: 64
          minLength: 0
        nationality:
          type: string
          maxLength: 3
          minLength: 0
        userEmail:
          type: string
          description: User's email address for refund communication
          example: test@email.com
          maxLength: 64
          minLength: 0
        userBankInfo:
          $ref: '#/components/schemas/RefundOrderUserBankInfo'
          description: |-
            it will include the following info in a json format: 
            { 
            "bankAccountNo": "XXX", 
            "bankCode": "XXX", 
            "bankCity": "XXX", 
            "bankBranch": "XXX" 
            }
        userPhone:
          type: string
          description: >-
            Merchant user mobile phone number: +Country code-Mobile Number, for
            example +62-08990013157
          maxLength: 16
          minLength: 0
        userBirthDay:
          type: string
          maxLength: 12
          minLength: 0
        userIDType:
          type: string
          description: User's Identification Type
          maxLength: 24
          minLength: 0
        userIDNumber:
          type: string
          description: User's Identification Number
          maxLength: 64
          minLength: 0
        userIDIssueDate:
          type: string
          description: The date of issue of User's ID. Format is dd/mm/yyyy
          maxLength: 12
          minLength: 0
        userIDExpiryDate:
          type: string
          description: The date of expiry of User's ID. Format is dd/mm/yyyy
          maxLength: 12
          minLength: 0
      required:
        - userType
    AcqOrderRefundResponse:
      type: object
      properties:
        refundRequestId:
          type: string
          description: >-
            Refund request id sent from Merchant. It will also be used for
            idempotent check.
        merchantRefundOrderId:
          type: string
          description: Merchant order id
        acquiringOrderId:
          type: string
          description: Waffo acquiring order Id
        acquiringRefundOrderId:
          type: string
          description: Waffo refund order Id
        refundAmount:
          type: string
          description: Refund amount
        refundStatus:
          type: string
          description: >-
            **REFUND_IN_PROGRESS** - refund request has been accepted and result
            will be sent back to merchant via refundNotifyUrl 

            **ORDER_PARTIALLY_REFUNDED** 

            **ORDER_FULLY_REFUNDED** 

            **ORDER_REFUND_FAILED**
        remainingRefundAmount:
          type: string
          description: Remaining Refund Amount that Merchant can still refund
        refundSource:
          type: string
          description: |-
            Refund Source 
            **MERCHANT** 
            **RDR** 
            **ETHOCA**
      required:
        - acquiringOrderId
        - acquiringRefundOrderId
        - refundAmount
        - refundRequestId
        - refundSource
        - refundStatus
        - remainingRefundAmount
    RefundOrderUserBankInfo:
      type: object
      properties:
        bankAccountNo:
          type: string
          maxLength: 64
          minLength: 0
        bankCode:
          type: string
          maxLength: 64
          minLength: 0
        bankName:
          type: string
          maxLength: 64
          minLength: 0
        bankCity:
          type: string
          maxLength: 64
          minLength: 0
        bankBranch:
          type: string
          maxLength: 64
          minLength: 0

````