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

# Subscription change inquiry



## OpenAPI

````yaml /api-reference/openapi.json post /api/v1/subscription/change/inquiry
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/subscription/change/inquiry:
    post:
      tags:
        - Subscription change inquiry
      summary: Subscription change inquiry
      operationId: subscriptionChangeInquiry
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubscriptionChangeInquiryRequest'
        required: true
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ResponseSubscriptionChangeInquiryResponse'
components:
  schemas:
    SubscriptionChangeInquiryRequest:
      type: object
      description: Subscription change inquiry request
      properties:
        originSubscriptionRequest:
          type: string
          description: Original subscription request id that was changed
          maxLength: 32
          minLength: 0
        subscriptionRequest:
          type: string
          description: New subscription request id after the change
          maxLength: 32
          minLength: 0
      required:
        - originSubscriptionRequest
        - subscriptionRequest
    ResponseSubscriptionChangeInquiryResponse:
      type: object
      description: response data
      properties:
        code:
          type: string
        msg:
          type: string
        data:
          $ref: '#/components/schemas/SubscriptionChangeInquiryResponse'
    SubscriptionChangeInquiryResponse:
      type: object
      description: Subscription change inquiry response
      properties:
        subscriptionRequest:
          type: string
          description: New subscription request id after the change
          maxLength: 32
          minLength: 0
        originSubscriptionRequest:
          type: string
          description: Original subscription request id that was changed
          maxLength: 32
          minLength: 0
        merchantSubscriptionId:
          type: string
          description: Merchant's new subscription plan ID assigned to this user
          maxLength: 64
          minLength: 0
        subscriptionId:
          type: string
          description: New Waffo subscription Id
        subscriptionChangeStatus:
          type: string
          description: |
            Subscription change status:
            - IN_PROGRESS (payment request initiated)
            - AUTHORIZATION_REQUIRED (user needs to authorize payment)
            - SUCCESS (subscription change completed)
            - CLOSED (subscription change failed or timeout)
        subscriptionAction:
          type: string
          description: >
            When subscriptionChangeStatus = AUTHORIZATION_REQUIRED, merchant
            follow the following: 

            "webUrl": redirect user to this URL
        remainingAmount:
          type: string
          description: >-
            Remaining amount from the original subscription applied to the new
            subscription
          maxLength: 24
          minLength: 0
        currency:
          type: string
          description: Merchant subscription currency, for example IDR
          maxLength: 12
          minLength: 0
        userCurrency:
          type: string
          description: >-
            User payment currency. This is needed when merchant order currency
            is NOT the same as user payment currency
          maxLength: 12
          minLength: 0
        requestedAt:
          type: string
          description: Merchant-side request time
        subscriptionManagementUrl:
          type: string
          description: >-
            It refers to the subscription management page for users on the
            merchant side
          maxLength: 256
          minLength: 0
        extendInfo:
          type: string
          description: Reserved. Json format e.g. {"key1":"value1", "key2":"value2"}
          maxLength: 256
          minLength: 0
        orderExpiredAt:
          type: string
          description: The order expiry time set by merchant
        productInfoList:
          type: array
          description: New subscription product information list
          items:
            $ref: '#/components/schemas/SubscriptionChangeInquiryResponse.ProductInfo'
          minItems: 1
        merchantInfo:
          $ref: '#/components/schemas/SubscriptionChangeInquiryResponse.MerchantInfo'
          description: Merchant info
        userInfo:
          $ref: '#/components/schemas/SubscriptionChangeInquiryResponse.UserInfo'
          description: User info
        goodsInfo:
          $ref: '#/components/schemas/SubscriptionChangeInquiryResponse.GoodsInfo'
          description: Merchant goods information
        addressInfo:
          $ref: '#/components/schemas/SubscriptionChangeInquiryResponse.AddressInfo'
          description: Address Information
        paymentInfo:
          $ref: '#/components/schemas/SubscriptionChangeInquiryResponse.PaymentInfo'
          description: Payment information
      required:
        - currency
        - goodsInfo
        - merchantInfo
        - merchantSubscriptionId
        - originSubscriptionRequest
        - paymentInfo
        - productInfoList
        - remainingAmount
        - requestedAt
        - subscriptionId
        - subscriptionRequest
        - userInfo
    SubscriptionChangeInquiryResponse.ProductInfo:
      type: object
      description: Subscription product information
      properties:
        description:
          type: string
          description: >-
            Subscription product description, often appearing to user when
            asking user's confirmation
          maxLength: 128
          minLength: 0
        periodType:
          type: string
          description: 'Subscription product period type: - DAILY - WEEKLY - MONTHLY'
          maxLength: 12
          minLength: 0
        amount:
          type: string
          description: Subscription amount for this product
          maxLength: 12
          minLength: 0
        periodInterval:
          type: string
          description: >-
            Period interval. If the period type is WEEKLY, the period interval
            is between 1-4. If the period type is MONTHLY, the period interval
            is between 1-12. For example if the period type is weekly, the
            period interval is 2, it means every 2 weeks time user will pay for
            the subscription amount
          maxLength: 12
          minLength: 0
        numberOfPeriod:
          type: string
          description: >-
            Specify after how many deduction period, the subscription will end.
            The value needs to be greater than 1. For example 3. If the value is
            empty, it means the subscription has no defined end period. Note:
            The Dana subscription period shall not exceed three years in total.
          maxLength: 24
          minLength: 0
        trialPeriodAmount:
          type: string
          description: >-
            The subscription amount that user pay during the trial period, for
            example 8000. The amount shall >= 0. If the value is empty, there is
            no trial period
          maxLength: 24
          minLength: 0
        numberOfTrialPeriod:
          type: string
          description: Specify after how many periods, the trial will end. For example 1894
          maxLength: 12
          minLength: 0
        trialPeriodType:
          type: string
          description: >-
            Subscription product period type: - DAILY - WEEKLY - MONTHLY. This
            field is optional when a trial period is configured. If omitted, the
            system will use periodType value by default.
          maxLength: 12
          minLength: 0
        trialPeriodInterval:
          type: string
          description: >-
            Represents the interval unit of the trial period. Same definition
            and behavior as periodInterval. If the period type is DAILY, the
            period interval is between 1-365. This field is optional when a
            trial period is configured. If omitted, the system will use
            periodInterval value by default.
          maxLength: 12
          minLength: 0
      required:
        - amount
        - description
        - periodInterval
        - periodType
    SubscriptionChangeInquiryResponse.MerchantInfo:
      type: object
      description: Merchant information
      properties:
        merchantId:
          type: string
          description: Merchant id assigned by Waffo
          maxLength: 64
          minLength: 0
        subMerchantId:
          type: string
          description: Sub merchant id assigned by Waffo
          maxLength: 64
          minLength: 0
      required:
        - merchantId
    SubscriptionChangeInquiryResponse.UserInfo:
      type: object
      description: User information
      properties:
        userId:
          type: string
          description: Merchant User id
          maxLength: 64
          minLength: 0
        userEmail:
          type: string
          description: Merchant user email
          maxLength: 64
          minLength: 0
        userTerminal:
          type: string
          description: |
            Merchant user terminal type: 
            - WEB  (user is using a PC)
            - APP (user is using a Mobile Phone)
          maxLength: 32
          minLength: 0
        userPhone:
          type: string
          description: >-
            Merchant user mobile phone number: +Country code-Mobile Number, for
            example +62-08990013157
          maxLength: 16
          minLength: 0
        userFirstName:
          type: string
          description: Merchant user's first name
          maxLength: 64
          minLength: 0
        userLastName:
          type: string
          description: Merchant user's last name
          maxLength: 64
          minLength: 0
        userCreatedAt:
          type: string
          description: Merchant user creation time
      required:
        - userEmail
        - userId
    SubscriptionChangeInquiryResponse.GoodsInfo:
      type: object
      description: Goods information
      properties:
        goodsId:
          type: string
          description: Goods item id
          maxLength: 32
          minLength: 0
        goodsName:
          type: string
          description: Goods item name
          maxLength: 64
          minLength: 0
        goodsCategory:
          type: string
          description: Goods category
          maxLength: 32
          minLength: 0
        goodsUrl:
          type: string
          description: >-
            Goods URL from merchant website, for example
            https://www.merchant123.com/goods123 (for compliance and risk
            management purpose)
          maxLength: 128
          minLength: 0
        appName:
          type: string
          description: >-
            app package name, for example com.example.app123 (for compliance and
            risk management purpose)
          maxLength: 32
          minLength: 0
        skuName:
          type: string
          description: Goods sku name
          maxLength: 32
          minLength: 0
        goodsUniquePrice:
          type: string
          description: Goods price
          maxLength: 16
          minLength: 0
        goodsQuantity:
          type: integer
          format: int32
          description: Goods quantity
      required:
        - goodsId
        - goodsName
    SubscriptionChangeInquiryResponse.AddressInfo:
      type: object
      description: Address information
      properties:
        address:
          type: string
          description: Shipping address
          maxLength: 256
          minLength: 0
        city:
          type: string
          description: Shipping city
          maxLength: 32
          minLength: 0
        region:
          type: string
          description: Shipping region / state / province
          maxLength: 32
          minLength: 0
        postcode:
          type: string
          description: Shipping postcode
          maxLength: 16
          minLength: 0
        addressCountryCode:
          type: string
          description: Shipping country code
          maxLength: 16
          minLength: 0
    SubscriptionChangeInquiryResponse.PaymentInfo:
      type: object
      description: Payment information
      properties:
        productName:
          type: string
          description: >
            Payment product:

            - SUBSCRIPTION

            Merchant can view the signed contract product via Waffo Merchant
            portal
          maxLength: 32
          minLength: 0
        payMethodType:
          type: string
          description: >
            Payment method type. e.g.

            - EWALLET

            - CREDITCARD

            - DEBITCARD

            Merchant can provide a list of pay methods type as the filtering
            logic. If not provided, Waffo will choose all eligible payment
            methods based on merchant contract


            Conditional

            (must be provided for card payments)
          maxLength: 256
          minLength: 0
        payMethodName:
          type: string
          description: >
            The actual payment method. e.g. DANA

            If payMethodName is provided, the payment request will be processed
            using this pay method directly

            Conditional

            (required for non-card payment methods)
          maxLength: 24
          minLength: 0
        payMethodProperties:
          type: string
          description: >-
            For certain pay methods, there could be certain specific info
            needed. Json format e.g. {"key1":"value1", "key2":"value2"}
          maxLength: 256
          minLength: 0
        payMethodUserAccountType:
          type: string
          description: >-
            User account type at the designated pay method: EMAIL, PHONE_NO,
            ACCOUNT_ID
          maxLength: 24
          minLength: 0
        payMethodUserAccountNo:
          type: string
          description: User account number at the designated pay method
          maxLength: 64
          minLength: 0
        payMethodUserAccessToken:
          type: string
          description: >-
            User access token is required when using MINI_PROGRAM_SUBSCRIPTION
            product. The user access token can be obtained from mini program API
          maxLength: 128
          minLength: 0
        cashierAppearance:
          type: string
          description: >-
            Defines the overall appearance configuration of the UI, including
            colors, background, and typography settings. A JSON-formatted string
            containing theme variables. These variables are injected into the UI
            rendering layer and override the default theme settings. This field
            must be a valid JSON string, not a plain object. Example:
            {"variables":{"colorPrimary":"#0570de","colorBackground":"#ffffff","colorText":"#30313d"}}
        cashierLogoId:
          type: string
          description: Cashier Logo Id
      required:
        - productName

````