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

# Create Subscription Preview

## Endpoint Overview

**POST** `https://api.unibee.dev/merchant/subscription/create_preview`

Create Subscription Preview

***

## Authorization

All UniBee Merchant API requests require authentication via API key.

| Header          | Required | Description                           |
| --------------- | -------- | ------------------------------------- |
| `Authorization` | Yes      | Bearer `<your_api_key>`               |
| `Content-Type`  | Yes      | `application/json` (for request body) |

***

## Parameters

Parameters for this endpoint are listed below. The schema is also shown in the Try it panel.

### Request body

| Name                     | Type    | Required | Description                                                                                                                                                       |
| ------------------------ | ------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `addonParams`            | array   | No       | Optional. List of addon plan parameters to be attached to this subscription.                                                                                      |
| `applyPromoCredit`       | boolean | No       | Optional. Whether to apply available promo credit to this preview calculation.                                                                                    |
| `applyPromoCreditAmount` | integer | No       | Optional. Maximum promo credit amount to apply. If omitted and applyPromoCredit is true, the system auto-computes the usable amount.                              |
| `currency`               | string  | No       | Optional. Currency code for pricing (e.g. USD, EUR). If empty, plan default currency is used.                                                                     |
| `discountCode`           | string  | No       | Optional. Discount or coupon code applied to this preview.                                                                                                        |
| `email`                  | string  | No       | Optional. End-user email. Required when creating a new user via ExternalUserId\&Email if userId is not provided.                                                  |
| `externalUserId`         | string  | No       | Optional. Merchant-side unique user identifier. Use together with email when userId is not provided.                                                              |
| `freeInInitialPeriod`    | boolean | No       | Optional. If true, the first billing period is treated as free or trial, taking precedence over trialEnd.                                                         |
| `freeTimeEnd`            | integer | No       | Optional. Custom free period end time when freeInInitialPeriod is true, as UTC timestamp (seconds). Can shorten or extend the default first-period-free behavior. |
| `gatewayId`              | integer | No       | Optional. Payment gateway ID to be used for this subscription preview. If omitted, default gateway selection rules apply.                                         |
| `gatewayPaymentType`     | string  | No       | Optional. Payment type for the selected gateway, such as card, wallet, etc.                                                                                       |
| `planId`                 | integer | Yes      | Required. ID of the subscription plan to be purchased.                                                                                                            |
| `quantity`               | integer | No       | Optional. Number of units for the plan. Defaults to 1 if not specified.                                                                                           |
| `taxPercentage`          | integer | No       | Optional. External tax percentage override, in basis points (e.g. 1000 = 10%%). Only available for OpenAPI calls.                                                 |
| `trialEnd`               | integer | No       | Optional. Custom trial end time as UTC timestamp (seconds). Overrides plan default trial configuration when greater than now.                                     |
| `user`                   | string  | No       |                                                                                                                                                                   |
| `userId`                 | integer | No       | Optional. Internal user ID in UniBee. If provided, it must match the email/user object when they are also provided.                                               |
| `vatCountryCode`         | string  | No       | Optional. ISO country code for VAT calculation. If provided together with vatNumber, they must be consistent.                                                     |
| `vatNumber`              | string  | No       | Optional. Customer VAT number used for VAT validation and tax calculation.                                                                                        |

***

## Request examples

### cURL

```bash theme={null}
curl -X POST "https://api.unibee.dev/merchant/subscription/create_preview" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "addonParams": [],
  "applyPromoCredit": false,
  "applyPromoCreditAmount": 0,
  "currency": "",
  "discountCode": "",
  "email": "user@example.com",
  "externalUserId": "id_example",
  "freeInInitialPeriod": false,
  "freeTimeEnd": 0,
  "gatewayId": 0,
  "gatewayPaymentType": "",
  "planId": 0,
  "quantity": 0,
  "taxPercentage": 0,
  "trialEnd": 0,
  "user": "",
  "userId": 0,
  "vatCountryCode": "",
  "vatNumber": ""
}'
```

### Sandbox

```bash theme={null}
curl -X POST "https://api-sandbox.unibee.top/merchant/subscription/create_preview" \
  -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "addonParams": [],
  "applyPromoCredit": false,
  "applyPromoCreditAmount": 0,
  "currency": "",
  "discountCode": "",
  "email": "user@example.com",
  "externalUserId": "id_example",
  "freeInInitialPeriod": false,
  "freeTimeEnd": 0,
  "gatewayId": 0,
  "gatewayPaymentType": "",
  "planId": 0,
  "quantity": 0,
  "taxPercentage": 0,
  "trialEnd": 0,
  "user": "",
  "userId": 0,
  "vatCountryCode": "",
  "vatNumber": ""
}'
```

***

## Response

Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success.

| Field                                 | Type    | Description                                                                                        |
| ------------------------------------- | ------- | -------------------------------------------------------------------------------------------------- |
| `code`                                | integer | Response code. `0` = success                                                                       |
| `data`                                | object  | Response payload                                                                                   |
| `data.addonParams`                    | array   | Addon parameters used to compute the preview.                                                      |
| `data.addons`                         | array   | Resolved addon plan details included in this preview.                                              |
| `data.applyPromoCredit`               | boolean | Whether promo credit is effectively applied in this preview.                                       |
| `data.currency`                       | string  | Currency used for this preview.                                                                    |
| `data.discount`                       | object  |                                                                                                    |
| `data.discountAmount`                 | integer | Total discount amount applied in this preview, including promo credit if applicable.               |
| `data.discountMessage`                | string  | Human-readable message describing discount application result.                                     |
| `data.email`                          | string  | Resolved user email used in this preview.                                                          |
| `data.gateway`                        | object  |                                                                                                    |
| `data.invoice`                        | object  |                                                                                                    |
| `data.originAmount`                   | integer | Original invoice amount before discounts and promo credit, in minor units.                         |
| `data.otherActiveSubscriptionId`      | string  | other active or incomplete subscription id                                                         |
| `data.otherPendingCryptoSubscription` | object  |                                                                                                    |
| `data.plan`                           | object  |                                                                                                    |
| `data.quantity`                       | integer | Quantity of the plan used in preview.                                                              |
| `data.subscriptionAmountExcludingTax` | integer | Total subscription amount excluding tax for the previewed invoice, in minor units.                 |
| `data.taxAmount`                      | integer | Total tax amount for the previewed invoice, in minor units.                                        |
| `data.taxPercentage`                  | integer | Effective tax percentage applied in this preview, in basis points (e.g. 1000 = 10%%).              |
| `data.totalAmount`                    | integer | Final payable amount for the previewed invoice, including tax and after discounts, in minor units. |
| `data.trialEnd`                       | integer | trial\_end, utc time                                                                               |
| `data.userId`                         | integer | Resolved user ID used in this preview.                                                             |
| `data.vatCountryCode`                 | string  | Country code used for VAT calculation.                                                             |
| `data.vatCountryName`                 | string  | Country name used for VAT calculation, when available.                                             |
| `data.vatNumber`                      | string  | VAT number used in this preview, if any.                                                           |
| `data.vatNumberValidate`              | object  |                                                                                                    |
| `data.vatNumberValidateMessage`       | string  | Human-readable message for VAT number validation result.                                           |
| `message`                             | string  | Human-readable message                                                                             |
| `requestId`                           | string  | Request ID for support                                                                             |

***

## Error handling

| HTTP status | Meaning                                                                   |
| ----------- | ------------------------------------------------------------------------- |
| 400         | Bad request — invalid or missing parameters. Check `message` in the body. |
| 401         | Unauthorized — missing or invalid API key.                                |
| 404         | Not found — invalid path or resource.                                     |
| 500         | Server error — retry with backoff.                                        |

When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support.


## OpenAPI

````yaml post /merchant/subscription/create_preview
openapi: 3.0.0
info:
  description: UniBee Api Server
  license:
    name: Apache-2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
  title: OpenAPI UniBee
  version: daily,buildtime:202603161017
servers:
  - url: https://api.unibee.dev
  - url: https://api-sandbox.unibee.top
security:
  - Authorization: []
paths:
  /merchant/subscription/create_preview:
    post:
      tags:
        - Subscription
      summary: Create Subscription Preview
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/unibee.api.merchant.subscription.CreatePreviewReq
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  code:
                    format: int
                    properties: {}
                    type: integer
                  data:
                    properties:
                      addonParams:
                        description: Addon parameters used to compute the preview.
                        format: '[]*bean.PlanAddonParam'
                        items:
                          $ref: '#/components/schemas/unibee.api.bean.PlanAddonParam'
                        properties: {}
                        type: array
                      addons:
                        description: Resolved addon plan details included in this preview.
                        format: '[]*bean.PlanAddonDetail'
                        items:
                          $ref: '#/components/schemas/unibee.api.bean.PlanAddonDetail'
                        properties: {}
                        type: array
                      applyPromoCredit:
                        description: >-
                          Whether promo credit is effectively applied in this
                          preview.
                        format: bool
                        properties: {}
                        type: boolean
                      currency:
                        description: Currency used for this preview.
                        format: string
                        properties: {}
                        type: string
                      discount:
                        $ref: >-
                          #/components/schemas/unibee.api.bean.MerchantDiscountCode
                      discountAmount:
                        description: >-
                          Total discount amount applied in this preview,
                          including promo credit if applicable.
                        format: int64
                        properties: {}
                        type: integer
                      discountMessage:
                        description: >-
                          Human-readable message describing discount application
                          result.
                        format: string
                        properties: {}
                        type: string
                      email:
                        description: Resolved user email used in this preview.
                        format: string
                        properties: {}
                        type: string
                      gateway:
                        $ref: '#/components/schemas/unibee.api.bean.detail.Gateway'
                      invoice:
                        $ref: '#/components/schemas/unibee.api.bean.Invoice'
                      originAmount:
                        description: >-
                          Original invoice amount before discounts and promo
                          credit, in minor units.
                        format: int64
                        properties: {}
                        type: integer
                      otherActiveSubscriptionId:
                        description: 'other active or incomplete subscription id '
                        format: string
                        properties: {}
                        type: string
                      otherPendingCryptoSubscription:
                        $ref: >-
                          #/components/schemas/unibee.api.bean.detail.SubscriptionDetail
                      plan:
                        $ref: '#/components/schemas/unibee.api.bean.Plan'
                      quantity:
                        description: Quantity of the plan used in preview.
                        format: int64
                        properties: {}
                        type: integer
                      subscriptionAmountExcludingTax:
                        description: >-
                          Total subscription amount excluding tax for the
                          previewed invoice, in minor units.
                        format: int64
                        properties: {}
                        type: integer
                      taxAmount:
                        description: >-
                          Total tax amount for the previewed invoice, in minor
                          units.
                        format: int64
                        properties: {}
                        type: integer
                      taxPercentage:
                        description: >-
                          Effective tax percentage applied in this preview, in
                          basis points (e.g. 1000 = 10%%).
                        format: int64
                        properties: {}
                        type: integer
                      totalAmount:
                        description: >-
                          Final payable amount for the previewed invoice,
                          including tax and after discounts, in minor units.
                        format: int64
                        properties: {}
                        type: integer
                      trialEnd:
                        description: trial_end, utc time
                        format: int64
                        properties: {}
                        type: integer
                      userId:
                        description: Resolved user ID used in this preview.
                        format: int64
                        properties: {}
                        type: integer
                      vatCountryCode:
                        description: Country code used for VAT calculation.
                        format: string
                        properties: {}
                        type: string
                      vatCountryName:
                        description: Country name used for VAT calculation, when available.
                        format: string
                        properties: {}
                        type: string
                      vatNumber:
                        description: VAT number used in this preview, if any.
                        format: string
                        properties: {}
                        type: string
                      vatNumberValidate:
                        $ref: '#/components/schemas/unibee.api.bean.ValidResult'
                      vatNumberValidateMessage:
                        description: >-
                          Human-readable message for VAT number validation
                          result.
                        format: string
                        properties: {}
                        type: string
                    type: object
                  merchantId:
                    format: int64
                    properties: {}
                    type: integer
                  message:
                    format: string
                    properties: {}
                    type: string
                  redirect:
                    format: string
                    properties: {}
                    type: string
                  requestId:
                    format: string
                    properties: {}
                    type: string
                type: object
          description: ''
components:
  schemas:
    unibee.api.merchant.subscription.CreatePreviewReq:
      properties:
        addonParams:
          description: >-
            Optional. List of addon plan parameters to be attached to this
            subscription.
          format: '[]*bean.PlanAddonParam'
          items:
            $ref: '#/components/schemas/unibee.api.bean.PlanAddonParam'
          properties: {}
          type: array
        applyPromoCredit:
          description: >-
            Optional. Whether to apply available promo credit to this preview
            calculation.
          format: '*bool'
          properties: {}
          type: boolean
        applyPromoCreditAmount:
          description: >-
            Optional. Maximum promo credit amount to apply. If omitted and
            applyPromoCredit is true, the system auto-computes the usable
            amount.
          format: '*int64'
          properties: {}
          type: integer
        currency:
          description: >-
            Optional. Currency code for pricing (e.g. USD, EUR). If empty, plan
            default currency is used.
          format: string
          properties: {}
          type: string
        discountCode:
          description: Optional. Discount or coupon code applied to this preview.
          format: string
          properties: {}
          type: string
        email:
          description: >-
            Optional. End-user email. Required when creating a new user via
            ExternalUserId&Email if userId is not provided.
          format: string
          properties: {}
          type: string
        externalUserId:
          description: >-
            Optional. Merchant-side unique user identifier. Use together with
            email when userId is not provided.
          format: string
          properties: {}
          type: string
        freeInInitialPeriod:
          description: >-
            Optional. If true, the first billing period is treated as free or
            trial, taking precedence over trialEnd.
          format: '*bool'
          properties: {}
          type: boolean
        freeTimeEnd:
          description: >-
            Optional. Custom free period end time when freeInInitialPeriod is
            true, as UTC timestamp (seconds). Can shorten or extend the default
            first-period-free behavior.
          format: '*int64'
          properties: {}
          type: integer
        gatewayId:
          description: >-
            Optional. Payment gateway ID to be used for this subscription
            preview. If omitted, default gateway selection rules apply.
          format: '*int64'
          properties: {}
          type: integer
        gatewayPaymentType:
          description: >-
            Optional. Payment type for the selected gateway, such as card,
            wallet, etc.
          format: string
          properties: {}
          type: string
        planId:
          description: Required. ID of the subscription plan to be purchased.
          format: int64
          properties: {}
          type: integer
        quantity:
          description: >-
            Optional. Number of units for the plan. Defaults to 1 if not
            specified.
          format: int64
          properties: {}
          type: integer
        taxPercentage:
          description: >-
            Optional. External tax percentage override, in basis points (e.g.
            1000 = 10%%). Only available for OpenAPI calls.
          format: '*int64'
          properties: {}
          type: integer
        trialEnd:
          description: >-
            Optional. Custom trial end time as UTC timestamp (seconds).
            Overrides plan default trial configuration when greater than now.
          format: int64
          properties: {}
          type: integer
        user:
          $ref: '#/components/schemas/unibee.api.bean.NewUser'
        userId:
          description: >-
            Optional. Internal user ID in UniBee. If provided, it must match the
            email/user object when they are also provided.
          format: int64
          properties: {}
          type: integer
        vatCountryCode:
          description: >-
            Optional. ISO country code for VAT calculation. If provided together
            with vatNumber, they must be consistent.
          format: string
          properties: {}
          type: string
        vatNumber:
          description: >-
            Optional. Customer VAT number used for VAT validation and tax
            calculation.
          format: string
          properties: {}
          type: string
      required:
        - planId
      type: object
    unibee.api.bean.PlanAddonParam:
      properties:
        addonPlanId:
          description: AddonPlanId
          format: int64
          properties: {}
          type: integer
        quantity:
          description: Quantity，Default 1
          format: int64
          properties: {}
          type: integer
      type: object
    unibee.api.bean.PlanAddonDetail:
      properties:
        addonPlan:
          $ref: '#/components/schemas/unibee.api.bean.Plan'
        quantity:
          description: Quantity
          format: int64
          properties: {}
          type: integer
      type: object
    unibee.api.bean.MerchantDiscountCode:
      properties:
        advance:
          description: >-
            AdvanceConfig, 0-false,1-true, will enable all advance config if set
            true
          format: bool
          properties: {}
          type: boolean
        billingType:
          description: billing_type, 1-one-time, 2-recurring
          format: int
          properties: {}
          type: integer
        code:
          description: code
          format: string
          properties: {}
          type: string
        createTime:
          description: create utc time
          format: int64
          properties: {}
          type: integer
        currency:
          description: currency of discount, available when discount_type is fixed_amount
          format: string
          properties: {}
          type: string
        cycleLimit:
          description: the count limitation of subscription cycle , 0-no limit
          format: int
          properties: {}
          type: integer
        discountAmount:
          description: amount of discount, available when discount_type is fixed_amount
          format: int64
          properties: {}
          type: integer
        discountPercentage:
          description: >-
            percentage of discount, 100=1%, available when discount_type is
            percentage
          format: int64
          properties: {}
          type: integer
        discountType:
          description: discount_type, 1-percentage, 2-fixed_amount
          format: int
          properties: {}
          type: integer
        endTime:
          description: end of discount available utc time, 0-invalid
          format: int64
          properties: {}
          type: integer
        id:
          description: Id
          format: int64
          properties: {}
          type: integer
        isDeleted:
          description: 0-UnDeleted，> 0, Deleted, the deleted utc time
          format: int
          properties: {}
          type: integer
        merchantId:
          description: merchantId
          format: int64
          properties: {}
          type: integer
        metadata:
          additionalProperties:
            $ref: '#/components/schemas/interface'
          format: map[string]interface {}
          properties: {}
          type: object
        name:
          description: name
          format: string
          properties: {}
          type: string
        planApplyGroup:
          $ref: '#/components/schemas/unibee.api.bean.GroupPlanSelector'
        planApplyType:
          description: >-
            plan apply type, 0-apply for all, 1-apply for plans specified,
            2-exclude for plans specified, 3-Apply to Plans by Groups(Billing
            Period Included), 4-Apply to Plans except by Groups(Billing Period
            Included)
          format: int
          properties: {}
          type: integer
        planIds:
          description: >-
            Ids of plan which discount code can effect, default effect all plans
            if not set
          format: '[]int64'
          items:
            format: int64
            properties: {}
            type: integer
          properties: {}
          type: array
        quantity:
          description: quantity of code, 0-no limit
          format: int64
          properties: {}
          type: integer
        startTime:
          description: start of discount available utc time
          format: int64
          properties: {}
          type: integer
        status:
          description: status, 1-editable, 2-active, 3-deactivate, 4-expire, 10-archive
          format: int
          properties: {}
          type: integer
        upgradeLongerOnly:
          description: >-
            AdvanceConfig, 0-false,1-true, will forbid for all except upgrade to
            longer plan if set true
          format: bool
          properties: {}
          type: boolean
        upgradeOnly:
          description: >-
            AdvanceConfig, 0-false,1-true, will forbid for all except same
            interval upgrade action if set true
          format: bool
          properties: {}
          type: boolean
        userLimit:
          description: >-
            AdvanceConfig, The limit of every customer can apply, the recurring
            apply not involved, 0-unlimited
          format: int
          properties: {}
          type: integer
        userScope:
          description: >-
            AdvanceConfig, Apply user scope,0-for all, 1-for only new user,
            2-for only renewals, renewals is upgrade&downgrade&renew
          format: int
          properties: {}
          type: integer
      type: object
    unibee.api.bean.detail.Gateway:
      properties:
        IsSetupFinished:
          description: Whether the gateway finished setup process
          format: bool
          properties: {}
          type: boolean
        archive:
          format: bool
          properties: {}
          type: boolean
        autoChargeEnabled:
          format: bool
          properties: {}
          type: boolean
        bank:
          $ref: '#/components/schemas/unibee.api.bean.detail.GatewayBank'
        companyIssuer:
          $ref: '#/components/schemas/unibee.api.bean.detail.GatewayCompanyIssuer'
        countryConfig:
          additionalProperties:
            format: bool
            properties: {}
            type: boolean
          format: map[string]bool
          properties: {}
          type: object
        createTime:
          description: create utc time
          format: int64
          properties: {}
          type: integer
        currency:
          description: 'The currency of wire transfer '
          format: string
          properties: {}
          type: string
        currencyExchange:
          description: >-
            The currency exchange for gateway payment, effect at start of
            payment creation when currency matched
          format: '[]*detail.GatewayCurrencyExchange'
          items:
            $ref: >-
              #/components/schemas/unibee.api.bean.detail.GatewayCurrencyExchange
          properties: {}
          type: array
        currencyExchangeEnabled:
          description: whether to enable currency exchange
          format: bool
          properties: {}
          type: boolean
        defaultGatewayPaymentType:
          $ref: '#/components/schemas/unibee.internal.interface.GatewayPaymentType'
        description:
          description: The description of gateway
          format: string
          properties: {}
          type: string
        displayName:
          description: The gateway display name, used at user portal
          format: string
          properties: {}
          type: string
        gatewayIcons:
          description: The gateway display name, used at user portal
          format: '[]string'
          items:
            format: string
            properties: {}
            type: string
          properties: {}
          type: array
        gatewayId:
          format: int64
          properties: {}
          type: integer
        gatewayKey:
          format: string
          properties: {}
          type: string
        gatewayLogo:
          format: string
          properties: {}
          type: string
        gatewayName:
          description: >-
            The gateway name,
            stripe|paypal|changelly|unitpay|payssion|cryptadium
          format: string
          properties: {}
          type: string
        gatewayPaymentTypes:
          description: gatewayPaymentTypes
          format: '[]*_interface.GatewayPaymentType'
          items:
            $ref: '#/components/schemas/unibee.internal.interface.GatewayPaymentType'
          properties: {}
          type: array
        gatewaySecret:
          format: string
          properties: {}
          type: string
        gatewayType:
          description: >-
            gateway type: 1-Card | 2-Crypto | 3-Wire Transfer | 4-PayPal |
            5-Credit | 6-Alipay+ | 7-Hyperswitch | 8-External
          format: int64
          properties: {}
          type: integer
        gatewayWebhookIntegrationLink:
          description: >-
            The gateway webhook integration guide link, gateway webhook need
            setup if not blank
          format: string
          properties: {}
          type: string
        gatewayWebsiteLink:
          description: The gateway website link
          format: string
          properties: {}
          type: string
        isDefault:
          format: bool
          properties: {}
          type: boolean
        metadata:
          additionalProperties:
            $ref: '#/components/schemas/interface'
          format: map[string]interface {}
          properties: {}
          type: object
        minimumAmount:
          description: The minimum amount of wire transfer
          format: int64
          properties: {}
          type: integer
        name:
          description: The name of gateway
          format: string
          properties: {}
          type: string
        privateSecretName:
          format: string
          properties: {}
          type: string
        publicKeyName:
          format: string
          properties: {}
          type: string
        setupGatewayPaymentTypes:
          description: The total list of gateway payment types, used for setup
          format: '[]*_interface.GatewayPaymentType'
          items:
            $ref: '#/components/schemas/unibee.internal.interface.GatewayPaymentType'
          properties: {}
          type: array
        sort:
          description: >-
            The sort value of payment gateway, The higher the value, the lower
            the ranking
          format: int64
          properties: {}
          type: integer
        subGateway:
          format: string
          properties: {}
          type: string
        subGatewayName:
          format: string
          properties: {}
          type: string
        webhookEndpointUrl:
          description: 'The endpoint url of gateway webhook '
          format: string
          properties: {}
          type: string
        webhookSecret:
          description: The secret of gateway webhook
          format: string
          properties: {}
          type: string
      type: object
    unibee.api.bean.Invoice:
      properties:
        PaymentMethodId:
          format: string
          properties: {}
          type: string
        autoCharge:
          format: bool
          properties: {}
          type: boolean
        billingCycleAnchor:
          description: billing_cycle_anchor
          format: int64
          properties: {}
          type: integer
        bizType:
          description: biz type from payment 1-onetime payment, 3-subscription
          format: int
          properties: {}
          type: integer
        countryCode:
          format: string
          properties: {}
          type: string
        createFrom:
          description: create from
          format: string
          properties: {}
          type: string
        creditAccount:
          $ref: '#/components/schemas/unibee.api.bean.CreditAccount'
        creditPayout:
          $ref: '#/components/schemas/unibee.api.bean.CreditPayout'
        cryptoAmount:
          description: crypto_amount, cent
          format: int64
          properties: {}
          type: integer
        cryptoCurrency:
          description: crypto_currency
          format: string
          properties: {}
          type: string
        currency:
          format: string
          properties: {}
          type: string
        data:
          format: string
          properties: {}
          type: string
        dayUtilDue:
          description: day util due after finish
          format: int64
          properties: {}
          type: integer
        discount:
          $ref: '#/components/schemas/unibee.api.bean.MerchantDiscountCode'
        discountAmount:
          format: int64
          properties: {}
          type: integer
        discountCode:
          format: string
          properties: {}
          type: string
        finishTime:
          format: int64
          properties: {}
          type: integer
        gatewayId:
          format: int64
          properties: {}
          type: integer
        id:
          format: int64
          properties: {}
          type: integer
        invoiceId:
          format: string
          properties: {}
          type: string
        invoiceName:
          format: string
          properties: {}
          type: string
        lines:
          format: '[]*bean.InvoiceItemSimplify'
          items:
            $ref: '#/components/schemas/unibee.api.bean.InvoiceItemSimplify'
          properties: {}
          type: array
        link:
          description: invoice link
          format: string
          properties: {}
          type: string
        metadata:
          additionalProperties:
            $ref: '#/components/schemas/interface'
          description: Metadata，Map
          format: map[string]interface {}
          properties: {}
          type: object
        originAmount:
          format: int64
          properties: {}
          type: integer
        partialCreditPaidAmount:
          description: partial credit paid amount
          format: int64
          properties: {}
          type: integer
        paymentId:
          description: paymentId
          format: string
          properties: {}
          type: string
        paymentLink:
          description: invoice payment link
          format: string
          properties: {}
          type: string
        paymentType:
          format: string
          properties: {}
          type: string
        periodEnd:
          format: int64
          properties: {}
          type: integer
        periodStart:
          format: int64
          properties: {}
          type: integer
        planSnapshot:
          $ref: '#/components/schemas/unibee.api.bean.InvoicePlanSnapshot'
        productName:
          format: string
          properties: {}
          type: string
        promoCreditAccount:
          $ref: '#/components/schemas/unibee.api.bean.CreditAccount'
        promoCreditDiscountAmount:
          description: promo credit discount amount
          format: int64
          properties: {}
          type: integer
        promoCreditPayout:
          $ref: '#/components/schemas/unibee.api.bean.CreditPayout'
        promoCreditTransaction:
          $ref: '#/components/schemas/unibee.api.bean.CreditTransaction'
        prorationDate:
          format: int64
          properties: {}
          type: integer
        prorationScale:
          format: int64
          properties: {}
          type: integer
        refundId:
          description: refundId
          format: string
          properties: {}
          type: string
        sendNote:
          description: send_note
          format: string
          properties: {}
          type: string
        sendStatus:
          description: email send status，0-No | 1- YES| 2-Unnecessary
          format: int
          properties: {}
          type: integer
        status:
          description: status，1-pending｜2-processing｜3-paid | 4-failed | 5-cancelled
          format: int
          properties: {}
          type: integer
        subscriptionAmount:
          format: int64
          properties: {}
          type: integer
        subscriptionAmountExcludingTax:
          format: int64
          properties: {}
          type: integer
        subscriptionId:
          description: subscription_id
          format: string
          properties: {}
          type: string
        taxAmount:
          format: int64
          properties: {}
          type: integer
        taxPercentage:
          description: TaxPercentage，1000 = 10%
          format: int64
          properties: {}
          type: integer
        totalAmount:
          format: int64
          properties: {}
          type: integer
        totalAmountExcludingTax:
          format: int64
          properties: {}
          type: integer
        trialEnd:
          description: trial_end, utc time
          format: int64
          properties: {}
          type: integer
        userId:
          description: UserId
          format: int64
          properties: {}
          type: integer
        userMetricChargeForInvoice:
          $ref: >-
            #/components/schemas/unibee.api.bean.UserMetricChargeInvoiceItemEntity
        vatNumber:
          format: string
          properties: {}
          type: string
      type: object
    unibee.api.bean.detail.SubscriptionDetail:
      properties:
        addonParams:
          description: AddonParams
          format: '[]*bean.PlanAddonParam'
          items:
            $ref: '#/components/schemas/unibee.api.bean.PlanAddonParam'
          properties: {}
          type: array
        addons:
          description: Addon
          format: '[]*bean.PlanAddonDetail'
          items:
            $ref: '#/components/schemas/unibee.api.bean.PlanAddonDetail'
          properties: {}
          type: array
        dayLeft:
          description: DayLeft util the period end, only available for webhook
          format: int
          properties: {}
          type: integer
        discount:
          $ref: '#/components/schemas/unibee.api.bean.MerchantDiscountCode'
        gateway:
          $ref: '#/components/schemas/unibee.api.bean.detail.Gateway'
        latestInvoice:
          $ref: '#/components/schemas/unibee.api.bean.Invoice'
        note:
          description: note
          format: string
          properties: {}
          type: string
        plan:
          $ref: '#/components/schemas/unibee.api.bean.Plan'
        source:
          description: Source
          format: string
          properties: {}
          type: string
        subscription:
          $ref: '#/components/schemas/unibee.api.bean.Subscription'
        unfinishedSubscriptionPendingUpdate:
          $ref: >-
            #/components/schemas/unibee.api.bean.detail.SubscriptionPendingUpdateDetail
        user:
          $ref: '#/components/schemas/unibee.api.bean.UserAccount'
      type: object
    unibee.api.bean.Plan:
      properties:
        amount:
          description: amount, cent, without tax
          format: int64
          properties: {}
          type: integer
        bindingAddonIds:
          description: binded recurring addon planIds，split with ,
          format: string
          properties: {}
          type: string
        bindingOnetimeAddonIds:
          description: binded onetime addon planIds，split with ,
          format: string
          properties: {}
          type: string
        cancelAtTrialEnd:
          description: >-
            whether cancel at subscription first trial end，0-false | 1-true,
            will pass to cancelAtPeriodEnd of subscription
          format: int
          properties: {}
          type: integer
        checkoutUrl:
          description: CheckoutUrl
          format: string
          properties: {}
          type: string
        createTime:
          description: create utc time
          format: int64
          properties: {}
          type: integer
        currency:
          description: currency
          format: string
          properties: {}
          type: string
        description:
          description: description
          format: string
          properties: {}
          type: string
        disableAutoCharge:
          description: disable auto-charge, 0-false,1-true
          format: int
          properties: {}
          type: integer
        externalPlanId:
          description: external_user_id
          format: string
          properties: {}
          type: string
        extraMetricData:
          format: string
          properties: {}
          type: string
        gasPayer:
          description: who pay the gas, merchant|user
          format: string
          properties: {}
          type: string
        homeUrl:
          description: home_url
          format: string
          properties: {}
          type: string
        id:
          format: int64
          properties: {}
          type: integer
        imageUrl:
          description: image_url
          format: string
          properties: {}
          type: string
        internalName:
          description: PlanInternalName
          format: string
          properties: {}
          type: string
        intervalCount:
          description: period unit count
          format: int
          properties: {}
          type: integer
        intervalUnit:
          description: period unit,day|month|year|week
          format: string
          properties: {}
          type: string
        merchantId:
          description: merchant id
          format: int64
          properties: {}
          type: integer
        metadata:
          additionalProperties:
            $ref: '#/components/schemas/interface'
          format: map[string]interface {}
          properties: {}
          type: object
        metricLimits:
          description: Plan's MetricLimit List
          format: '[]*bean.PlanMetricLimitParam'
          items:
            $ref: '#/components/schemas/unibee.api.bean.PlanMetricLimitParam'
          properties: {}
          type: array
        metricMeteredCharge:
          description: Plan's MetricMeteredCharge
          format: '[]*bean.PlanMetricMeteredChargeParam'
          items:
            $ref: '#/components/schemas/unibee.api.bean.PlanMetricMeteredChargeParam'
          properties: {}
          type: array
        metricRecurringCharge:
          description: Plan's MetricRecurringCharge
          format: '[]*bean.PlanMetricMeteredChargeParam'
          items:
            $ref: '#/components/schemas/unibee.api.bean.PlanMetricMeteredChargeParam'
          properties: {}
          type: array
        multiCurrencies:
          description: Plan's MultiCurrencies
          format: '[]*bean.PlanMultiCurrency'
          items:
            $ref: '#/components/schemas/unibee.api.bean.PlanMultiCurrency'
          properties: {}
          type: array
        planName:
          description: PlanName
          format: string
          properties: {}
          type: string
        productId:
          description: product id
          format: int64
          properties: {}
          type: integer
        publishStatus:
          description: 1-UnPublish,2-Publish, Use For Display Plan At UserPortal
          format: int
          properties: {}
          type: integer
        status:
          description: status，1-editing，2-active，3-inactive，4-soft archive, 5-hard archive
          format: int
          properties: {}
          type: integer
        taxPercentage:
          description: TaxPercentage 1000 = 10%
          format: int
          properties: {}
          type: integer
        trialAmount:
          description: price of trial period
          format: int64
          properties: {}
          type: integer
        trialDemand:
          format: string
          properties: {}
          type: string
        trialDurationTime:
          description: duration of trial
          format: int64
          properties: {}
          type: integer
        type:
          description: type，1-main plan，2-addon plan
          format: int
          properties: {}
          type: integer
        usVATConfig:
          $ref: '#/components/schemas/unibee.api.bean.USVATConfig'
      type: object
    unibee.api.bean.ValidResult:
      properties:
        companyAddress:
          format: string
          properties: {}
          type: string
        companyName:
          format: string
          properties: {}
          type: string
        countryCode:
          format: string
          properties: {}
          type: string
        valid:
          format: bool
          properties: {}
          type: boolean
        validateMessage:
          format: string
          properties: {}
          type: string
        vatNumber:
          format: string
          properties: {}
          type: string
      type: object
    unibee.api.bean.NewUser:
      properties:
        address:
          description: Address
          format: string
          properties: {}
          type: string
        city:
          description: city
          format: string
          properties: {}
          type: string
        companyName:
          description: company name
          format: string
          properties: {}
          type: string
        countryCode:
          description: CountryCode
          format: string
          properties: {}
          type: string
        email:
          description: Email
          format: string
          properties: {}
          type: string
        externalUserId:
          description: ExternalUserId
          format: string
          properties: {}
          type: string
        firstName:
          description: First Name
          format: string
          properties: {}
          type: string
        language:
          description: User Language, en|ru|cn|vi|bp
          format: string
          properties: {}
          type: string
        lastName:
          description: Last Name
          format: string
          properties: {}
          type: string
        phone:
          description: Phone
          format: string
          properties: {}
          type: string
        registrationNumber:
          description: RegistrationNumber
          format: string
          properties: {}
          type: string
        state:
          description: State
          format: string
          properties: {}
          type: string
        type:
          description: User type, 1-Individual|2-Business
          format: int64
          properties: {}
          type: integer
        userName:
          description: UserName
          format: string
          properties: {}
          type: string
        vatNumber:
          description: vat number
          format: string
          properties: {}
          type: string
        zipCode:
          description: zip_code
          format: string
          properties: {}
          type: string
      required:
        - email
      type: object
    interface:
      properties: {}
      type: object
    unibee.api.bean.GroupPlanSelector:
      properties:
        currency:
          format: '[]string'
          items:
            format: string
            properties: {}
            type: string
          properties: {}
          type: array
        groupPlanIntervalSelector:
          format: '[]*bean.GroupPlanIntervalSelector'
          items:
            $ref: '#/components/schemas/unibee.api.bean.GroupPlanIntervalSelector'
          properties: {}
          type: array
        type:
          description: 1-main plan，2-addon plan,3-onetime
          format: '[]int'
          items:
            format: int
            properties: {}
            type: integer
          properties: {}
          type: array
      type: object
    unibee.api.bean.detail.GatewayBank:
      properties:
        ABARoutingNumber:
          description: 'The ABARoutingNumber of wire transfer '
          format: string
          properties: {}
          type: string
        CNAPS:
          description: 'The CNAPS of wire transfer '
          format: string
          properties: {}
          type: string
        Remarks:
          description: 'The Remarks additional content '
          format: string
          properties: {}
          type: string
        accountHolder:
          description: 'The AccountHolder of wire transfer '
          format: string
          properties: {}
          type: string
        accountNumber:
          description: The Account Number
          format: string
          properties: {}
          type: string
        address:
          description: 'The address of wire transfer '
          format: string
          properties: {}
          type: string
        bankName:
          description: The Bank Name
          format: string
          properties: {}
          type: string
        bic:
          description: 'The BIC of wire transfer '
          format: string
          properties: {}
          type: string
        bsbCode:
          description: The BSB Code
          format: string
          properties: {}
          type: string
        iban:
          description: 'The IBAN of wire transfer '
          format: string
          properties: {}
          type: string
        swiftCode:
          description: The Swift Code
          format: string
          properties: {}
          type: string
      required:
        - accountHolder
        - address
      type: object
    unibee.api.bean.detail.GatewayCompanyIssuer:
      properties:
        issueAddress:
          format: string
          properties: {}
          type: string
        issueCompanyName:
          format: string
          properties: {}
          type: string
        issueLogo:
          format: string
          properties: {}
          type: string
        issueRegNumber:
          format: string
          properties: {}
          type: string
        issueVatNumber:
          format: string
          properties: {}
          type: string
      type: object
    unibee.api.bean.detail.GatewayCurrencyExchange:
      properties:
        exchange_rate:
          description: >-
            the exchange rate of gateway, set to 0 if using
            https://app.exchangerate-api.com/ instead of fixed exchange rate
          format: float64
          properties: {}
          type: number
        from_currency:
          description: the currency of gateway exchange from
          format: string
          properties: {}
          type: string
        to_currency:
          description: the currency of gateway exchange to
          format: string
          properties: {}
          type: string
      type: object
    unibee.internal.interface.GatewayPaymentType:
      properties:
        autoCharge:
          format: bool
          properties: {}
          type: boolean
        category:
          format: string
          properties: {}
          type: string
        countryName:
          format: string
          properties: {}
          type: string
        name:
          format: string
          properties: {}
          type: string
        paymentType:
          format: string
          properties: {}
          type: string
        supportCurrencies:
          format: '[]string'
          items:
            format: string
            properties: {}
            type: string
          properties: {}
          type: array
      type: object
    unibee.api.bean.CreditAccount:
      properties:
        amount:
          description: credit amount, in cent if type is main
          format: int64
          properties: {}
          type: integer
        createTime:
          description: create utc time
          format: int64
          properties: {}
          type: integer
        currency:
          description: currency
          format: string
          properties: {}
          type: string
        currencyAmount:
          description: currency amount, in cent
          format: int64
          properties: {}
          type: integer
        exchangeRate:
          description: >-
            keep two decimal places，multiply by 100 saved, 1 currency = 1 credit
            * (exchange_rate/100), main account fixed rate to 100
          format: int64
          properties: {}
          type: integer
        id:
          description: Id
          format: int64
          properties: {}
          type: integer
        payoutEnable:
          description: 0-no, 1-yes
          format: int
          properties: {}
          type: integer
        rechargeEnable:
          description: 0-no, 1-yes
          format: int
          properties: {}
          type: integer
        totalDecrementAmount:
          description: the total decrement amount
          format: int64
          properties: {}
          type: integer
        totalIncrementAmount:
          description: the total increment amount
          format: int64
          properties: {}
          type: integer
        type:
          description: type of credit account, 1-main account, 2-gift account
          format: int
          properties: {}
          type: integer
        userId:
          description: user_id
          format: int64
          properties: {}
          type: integer
      type: object
    unibee.api.bean.CreditPayout:
      properties:
        creditAmount:
          description: credit amount, scale = 100
          format: int64
          properties: {}
          type: integer
        currencyAmount:
          description: currency amount,cent
          format: int64
          properties: {}
          type: integer
        exchangeRate:
          description: >-
            exchange rate, keep two decimal places，scale = 100, 1 currency = 1
            credit * (exchange_rate/100), main account fixed rate to 100
          format: int64
          properties: {}
          type: integer
      type: object
    unibee.api.bean.InvoiceItemSimplify:
      properties:
        amount:
          format: int64
          properties: {}
          type: integer
        amountExcludingTax:
          format: int64
          properties: {}
          type: integer
        currency:
          format: string
          properties: {}
          type: string
        description:
          format: string
          properties: {}
          type: string
        discountAmount:
          format: int64
          properties: {}
          type: integer
        discountCode:
          format: string
          properties: {}
          type: string
        fromAddress:
          $ref: '#/components/schemas/unibee.api.bean.USAddress'
        lineId:
          format: string
          properties: {}
          type: string
        metricCharge:
          $ref: '#/components/schemas/unibee.api.bean.UserMetricChargeInvoiceItem'
        name:
          format: string
          properties: {}
          type: string
        nexusAddresses:
          format: '[]*bean.USAddress'
          items:
            $ref: '#/components/schemas/unibee.api.bean.USAddress'
          properties: {}
          type: array
        originAmount:
          format: int64
          properties: {}
          type: integer
        originUnitAmountExcludeTax:
          format: int64
          properties: {}
          type: integer
        pdfDescription:
          format: string
          properties: {}
          type: string
        periodEnd:
          format: int64
          properties: {}
          type: integer
        periodStart:
          format: int64
          properties: {}
          type: integer
        plan:
          $ref: '#/components/schemas/unibee.api.bean.Plan'
        planMetricChargeConfigs:
          description: Metric charge configurations bound to this plan/addon
          format: '[]*bean.InvoiceMetricCharge'
          items:
            $ref: '#/components/schemas/unibee.api.bean.InvoiceMetricCharge'
          properties: {}
          type: array
        planMetricLimitConfigs:
          description: Metric limit configurations bound to this plan/addon
          format: '[]*bean.InvoiceMetricLimit'
          items:
            $ref: '#/components/schemas/unibee.api.bean.InvoiceMetricLimit'
          properties: {}
          type: array
        proration:
          format: bool
          properties: {}
          type: boolean
        prorationDate:
          format: int64
          properties: {}
          type: integer
        prorationScale:
          format: int64
          properties: {}
          type: integer
        quantity:
          format: int64
          properties: {}
          type: integer
        tax:
          format: int64
          properties: {}
          type: integer
        taxCode:
          format: string
          properties: {}
          type: string
        taxPercentage:
          description: Tax Percentage，1000 = 10%
          format: int64
          properties: {}
          type: integer
        toAddress:
          $ref: '#/components/schemas/unibee.api.bean.USAddress'
        unitAmountExcludingTax:
          format: int64
          properties: {}
          type: integer
        ustaxAlert:
          format: string
          properties: {}
          type: string
      type: object
    unibee.api.bean.InvoicePlanSnapshot:
      properties:
        addons:
          description: Addons associated with the current plan.
          format: '[]*bean.PlanAddonDetail'
          items:
            $ref: '#/components/schemas/unibee.api.bean.PlanAddonDetail'
          properties: {}
          type: array
        autoCharge:
          description: Billing charge
          format: bool
          properties: {}
          type: boolean
        chargeType:
          description: >-
            Billing charge type. 0: One-time, 1: New Subscription, 2: Upgrade,
            3: Downgrade, 4: Renewal, 5: Billing Cycle Charge.
          format: bean.InvoiceSnapshotChargeType
          properties: {}
          type: integer
        plan:
          $ref: '#/components/schemas/unibee.api.bean.Plan'
        previousAddons:
          description: >-
            Addons from the previous plan, relevant for upgrade or downgrade
            (paidType = 2 or 3).
          format: '[]*bean.PlanAddonDetail'
          items:
            $ref: '#/components/schemas/unibee.api.bean.PlanAddonDetail'
          properties: {}
          type: array
        previousPlan:
          $ref: '#/components/schemas/unibee.api.bean.Plan'
      type: object
    unibee.api.bean.CreditTransaction:
      properties:
        accountType:
          description: >-
            type of credit account, 1-main recharge account, 2-promo credit
            account
          format: int
          properties: {}
          type: integer
        bizId:
          description: business id
          format: string
          properties: {}
          type: string
        by:
          format: string
          properties: {}
          type: string
        createTime:
          description: create utc time
          format: int64
          properties: {}
          type: integer
        creditAmountAfter:
          description: the credit amount after transaction,cent
          format: int64
          properties: {}
          type: integer
        creditAmountBefore:
          description: the credit amount before transaction,cent
          format: int64
          properties: {}
          type: integer
        creditId:
          description: id of credit account
          format: int64
          properties: {}
          type: integer
        currency:
          description: currency
          format: string
          properties: {}
          type: string
        deltaAmount:
          description: delta amount,cent
          format: int64
          properties: {}
          type: integer
        deltaCurrencyAmount:
          description: delta currency amount, in cent
          format: int64
          properties: {}
          type: integer
        description:
          description: recharge transaction description
          format: string
          properties: {}
          type: string
        exchangeRate:
          description: >-
            ExchangeRate for transaction, keep two decimal places，multiply by
            100 saved, 1 currency = 1 credit * (exchange_rate/100), main account
            fixed rate to 100
          format: int64
          properties: {}
          type: integer
        id:
          description: Id
          format: int64
          properties: {}
          type: integer
        invoiceId:
          description: invoice_id
          format: string
          properties: {}
          type: string
        merchantId:
          description: merchant id
          format: int64
          properties: {}
          type: integer
        name:
          description: recharge transaction title
          format: string
          properties: {}
          type: string
        transactionId:
          description: unique id for timeline
          format: string
          properties: {}
          type: string
        transactionType:
          description: >-
            transaction type。1-recharge income，2-payment out，3-refund
            income，4-withdraw out，5-withdraw failed income, 6-admin
            change，7-recharge refund out
          format: int
          properties: {}
          type: integer
        userId:
          description: user_id
          format: int64
          properties: {}
          type: integer
      type: object
    unibee.api.bean.UserMetricChargeInvoiceItemEntity:
      properties:
        meteredChargeStats:
          description: MeteredChargeStats
          format: '[]*bean.UserMetricChargeInvoiceItem'
          items:
            $ref: '#/components/schemas/unibee.api.bean.UserMetricChargeInvoiceItem'
          properties: {}
          type: array
        recurringChargeStats:
          description: RecurringChargeStats
          format: '[]*bean.UserMetricChargeInvoiceItem'
          items:
            $ref: '#/components/schemas/unibee.api.bean.UserMetricChargeInvoiceItem'
          properties: {}
          type: array
      type: object
    unibee.api.bean.Subscription:
      properties:
        addonData:
          description: plan addon json data
          format: string
          properties: {}
          type: string
        amount:
          description: amount, cent
          format: int64
          properties: {}
          type: integer
        billingCycleAnchor:
          description: billing_cycle_anchor
          format: int64
          properties: {}
          type: integer
        cancelAtPeriodEnd:
          description: whether cancel at period end，0-false | 1-true
          format: int
          properties: {}
          type: integer
        cancelOrExpireTime:
          description: >-
            the cancel or expire time, utc time, 0 if subscription not in
            cancelled or expired status
          format: int64
          properties: {}
          type: integer
        cancelReason:
          format: string
          properties: {}
          type: string
        countryCode:
          format: string
          properties: {}
          type: string
        createTime:
          description: create utc time
          format: int64
          properties: {}
          type: integer
        currency:
          description: currency
          format: string
          properties: {}
          type: string
        currentPeriodEnd:
          description: current_period_end, utc time
          format: int64
          properties: {}
          type: integer
        currentPeriodPaid:
          description: current period paid or not, 1-paid, other-the utc time to expire
          format: int64
          properties: {}
          type: integer
        currentPeriodStart:
          description: current_period_start, utc time
          format: int64
          properties: {}
          type: integer
        defaultPaymentMethodId:
          format: string
          properties: {}
          type: string
        dunningTime:
          description: dunning_time, utc time
          format: int64
          properties: {}
          type: integer
        externalSubscriptionId:
          description: external_subscription_id
          format: string
          properties: {}
          type: string
        features:
          description: features
          format: string
          properties: {}
          type: string
        firstPaidTime:
          description: first success payment time
          format: int64
          properties: {}
          type: integer
        gasPayer:
          description: who pay the gas, merchant|user
          format: string
          properties: {}
          type: string
        gatewayId:
          description: gateway_id
          format: int64
          properties: {}
          type: integer
        gatewayStatus:
          description: >-
            gateway
            status，Stripe：https://stripe.com/docs/billing/subscriptions/webhooks 
            Paypal：https://developer.paypal.com/docs/api/subscriptions/v1/#subscriptions_get
          format: string
          properties: {}
          type: string
        id:
          format: int64
          properties: {}
          type: integer
        lastUpdateTime:
          format: int64
          properties: {}
          type: integer
        latestInvoiceId:
          description: latest_invoice_id
          format: string
          properties: {}
          type: string
        link:
          format: string
          properties: {}
          type: string
        merchantId:
          description: merchant id
          format: int64
          properties: {}
          type: integer
        metadata:
          additionalProperties:
            $ref: '#/components/schemas/interface'
          format: map[string]interface {}
          properties: {}
          type: object
        originalPeriodEnd:
          description: original_period_end, utc time
          format: int64
          properties: {}
          type: integer
        pendingUpdateId:
          format: string
          properties: {}
          type: string
        planId:
          description: plan id
          format: int64
          properties: {}
          type: integer
        productId:
          description: product id
          format: int64
          properties: {}
          type: integer
        quantity:
          description: quantity
          format: int64
          properties: {}
          type: integer
        returnUrl:
          format: string
          properties: {}
          type: string
        status:
          description: >-
            status，1-Pending｜2-Active｜3-PendingInActive | 4-Cancel | 5-Expire |
            6- Suspend| 7-Incomplete | 8-Processing | 9- Failed
          format: int
          properties: {}
          type: integer
        subscriptionId:
          description: subscription id
          format: string
          properties: {}
          type: string
        taskTime:
          description: task_time
          format: '*gtime.Time'
          properties: {}
          type: string
        taxPercentage:
          description: TaxPercentage，1000 = 10%
          format: int64
          properties: {}
          type: integer
        testClock:
          description: >-
            test_clock, simulator clock for subscription, if set , sub will out
            of cronjob controll
          format: int64
          properties: {}
          type: integer
        trialEnd:
          description: trial_end, utc time
          format: int64
          properties: {}
          type: integer
        type:
          description: sub type, 0-gateway sub, 1-unibee sub
          format: int
          properties: {}
          type: integer
        userId:
          description: userId
          format: int64
          properties: {}
          type: integer
        vatNumber:
          format: string
          properties: {}
          type: string
      type: object
    unibee.api.bean.detail.SubscriptionPendingUpdateDetail:
      properties:
        addonData:
          description: plan addon json data
          format: string
          properties: {}
          type: string
        addons:
          description: Addons
          format: '[]*bean.PlanAddonDetail'
          items:
            $ref: '#/components/schemas/unibee.api.bean.PlanAddonDetail'
          properties: {}
          type: array
        amount:
          description: CaptureAmount, Cent
          format: int64
          properties: {}
          type: integer
        currency:
          description: Currency
          format: string
          properties: {}
          type: string
        effectImmediate:
          description: EffectImmediate
          format: int
          properties: {}
          type: integer
        effectTime:
          description: effect_immediate=0, EffectTime unit_time
          format: int64
          properties: {}
          type: integer
        gatewayId:
          description: Id
          format: int64
          properties: {}
          type: integer
        gmtCreate:
          description: GmtCreate
          format: '*gtime.Time'
          properties: {}
          type: string
        gmtModify:
          description: GmtModify
          format: '*gtime.Time'
          properties: {}
          type: string
        invoiceId:
          description: invoice id
          format: string
          properties: {}
          type: string
        link:
          description: Link
          format: string
          properties: {}
          type: string
        merchantId:
          description: MerchantId
          format: int64
          properties: {}
          type: integer
        merchantMember:
          $ref: '#/components/schemas/unibee.api.bean.detail.MerchantMemberDetail'
        metadata:
          additionalProperties:
            $ref: '#/components/schemas/interface'
          format: map[string]interface {}
          properties: {}
          type: object
        note:
          description: Update Note
          format: string
          properties: {}
          type: string
        paid:
          description: Paid
          format: int
          properties: {}
          type: integer
        pendingUpdateId:
          description: PendingUpdateId
          format: string
          properties: {}
          type: string
        plan:
          $ref: '#/components/schemas/unibee.api.bean.Plan'
        planId:
          description: PlanId
          format: int64
          properties: {}
          type: integer
        prorationAmount:
          description: ProrationAmount,Cents
          format: int64
          properties: {}
          type: integer
        quantity:
          description: quantity
          format: int64
          properties: {}
          type: integer
        status:
          description: Status，1-Pending｜2-Finished｜3-Cancelled
          format: int
          properties: {}
          type: integer
        subscriptionId:
          description: SubscriptionId
          format: string
          properties: {}
          type: string
        updateAddonData:
          description: UpdateAddonData
          format: string
          properties: {}
          type: string
        updateAddons:
          description: UpdateAddons
          format: '[]*bean.PlanAddonDetail'
          items:
            $ref: '#/components/schemas/unibee.api.bean.PlanAddonDetail'
          properties: {}
          type: array
        updateAmount:
          description: UpdateAmount, Cents
          format: int64
          properties: {}
          type: integer
        updateCurrency:
          description: UpdateCurrency
          format: string
          properties: {}
          type: string
        updatePlan:
          $ref: '#/components/schemas/unibee.api.bean.Plan'
        updatePlanId:
          description: UpdatePlanId
          format: int64
          properties: {}
          type: integer
        updateQuantity:
          description: UpdateQuantity
          format: int64
          properties: {}
          type: integer
        userId:
          description: UserId
          format: int64
          properties: {}
          type: integer
      type: object
    unibee.api.bean.UserAccount:
      properties:
        address:
          description: address
          format: string
          properties: {}
          type: string
        avatarUrl:
          description: avator url
          format: string
          properties: {}
          type: string
        billingType:
          description: 1-recurring,2-one-time
          format: int
          properties: {}
          type: integer
        birthday:
          description: brithday
          format: string
          properties: {}
          type: string
        city:
          description: city
          format: string
          properties: {}
          type: string
        companyName:
          description: company name
          format: string
          properties: {}
          type: string
        countryCode:
          description: country_code
          format: string
          properties: {}
          type: string
        countryName:
          description: country_name
          format: string
          properties: {}
          type: string
        createTime:
          description: create utc time
          format: int64
          properties: {}
          type: integer
        custom:
          description: Custom
          format: string
          properties: {}
          type: string
        email:
          description: email
          format: string
          properties: {}
          type: string
        externalUserId:
          description: external_user_id
          format: string
          properties: {}
          type: string
        facebook:
          description: facebook
          format: string
          properties: {}
          type: string
        firstName:
          description: first name
          format: string
          properties: {}
          type: string
        gatewayId:
          description: gateway_id
          format: int64
          properties: {}
          type: integer
        gatewayPaymentType:
          format: string
          properties: {}
          type: string
        gender:
          description: gender
          format: string
          properties: {}
          type: string
        id:
          description: userId
          format: int64
          properties: {}
          type: integer
        isRisk:
          description: is risk account (deperated)
          format: int
          properties: {}
          type: integer
        isSpecial:
          description: is special account（0.no，1.yes）- deperated
          format: int
          properties: {}
          type: integer
        language:
          description: User Language, en|ru|cn|vi|bp
          format: string
          properties: {}
          type: string
        lastLoginAt:
          description: last login time, utc time
          format: int64
          properties: {}
          type: integer
        lastName:
          description: last name
          format: string
          properties: {}
          type: string
        linkedIn:
          description: linkedin
          format: string
          properties: {}
          type: string
        merchantId:
          description: merchant_id
          format: int64
          properties: {}
          type: integer
        metadata:
          additionalProperties:
            $ref: '#/components/schemas/interface'
          format: map[string]interface {}
          properties: {}
          type: object
        mobile:
          description: mobile
          format: string
          properties: {}
          type: string
        otherSocialInfo:
          format: string
          properties: {}
          type: string
        paymentMethod:
          format: string
          properties: {}
          type: string
        phone:
          description: phone
          format: string
          properties: {}
          type: string
        recurringAmount:
          description: total recurring amount, cent
          format: int64
          properties: {}
          type: integer
        registrationNumber:
          description: RegistrationNumber
          format: string
          properties: {}
          type: string
        school:
          description: school
          format: string
          properties: {}
          type: string
        state:
          description: State
          format: string
          properties: {}
          type: string
        status:
          description: 0-Active, 2-Suspend
          format: int
          properties: {}
          type: integer
        subscriptionId:
          description: subscription id
          format: string
          properties: {}
          type: string
        subscriptionName:
          description: subscription name
          format: string
          properties: {}
          type: string
        subscriptionStatus:
          description: >-
            sub status， 1-Pending｜2-Active｜3-PendingInActive | 4-Cancel |
            5-Expire | 6- Suspend| 7-Incomplete | 8-Processing | 9-Failed
          format: int
          properties: {}
          type: integer
        taxPercentage:
          description: taxPercentage，1000 = 10%
          format: int64
          properties: {}
          type: integer
        telegram:
          description: telegram
          format: string
          properties: {}
          type: string
        tikTok:
          description: tictok
          format: string
          properties: {}
          type: string
        timeZone:
          format: string
          properties: {}
          type: string
        type:
          description: User type, 1-Individual|2-Business
          format: int64
          properties: {}
          type: integer
        userName:
          description: user name
          format: string
          properties: {}
          type: string
        vATNumber:
          description: vat number
          format: string
          properties: {}
          type: string
        version:
          description: version
          format: int
          properties: {}
          type: integer
        weChat:
          description: wechat
          format: string
          properties: {}
          type: string
        whatsAPP:
          description: whats app
          format: string
          properties: {}
          type: string
        zipCode:
          description: zip_code
          format: string
          properties: {}
          type: string
      type: object
    unibee.api.bean.PlanMetricLimitParam:
      properties:
        metricId:
          description: MetricId
          format: int64
          properties: {}
          type: integer
        metricLimit:
          description: MetricLimit
          format: int64
          properties: {}
          type: integer
      type: object
    unibee.api.bean.PlanMetricMeteredChargeParam:
      properties:
        chargeType:
          description: ChargeType,0-standard pricing 1-graduated pricing
          format: int
          properties: {}
          type: integer
        graduatedAmounts:
          description: GraduatedAmounts, used for graduated pricing
          format: '[]*bean.MetricPlanChargeGraduatedStep'
          items:
            $ref: '#/components/schemas/unibee.api.bean.MetricPlanChargeGraduatedStep'
          properties: {}
          type: array
        metricId:
          description: MetricId
          format: int64
          properties: {}
          type: integer
        standardAmount:
          description: StandardAmount, cent, used for standard pricing,cent
          format: int64
          properties: {}
          type: integer
        standardStartValue:
          description: StandardStartValue, used for standard pricing
          format: int64
          properties: {}
          type: integer
      type: object
    unibee.api.bean.PlanMultiCurrency:
      properties:
        amount:
          description: the amount of exchange rate
          format: int64
          properties: {}
          type: integer
        autoExchange:
          description: >-
            using https://app.exchangerate-api.com/ to update exchange rate if
            true, the exchange APIKey need setup first
          format: bool
          properties: {}
          type: boolean
        currency:
          description: target currency
          format: string
          properties: {}
          type: string
        disable:
          description: disable currency exchange
          format: bool
          properties: {}
          type: boolean
        exchangeRate:
          description: exchange rate, no setup required if AutoExchange is true
          format: float64
          properties: {}
          type: number
      type: object
    unibee.api.bean.USVATConfig:
      properties:
        active:
          format: bool
          properties: {}
          type: boolean
        fromAddress:
          $ref: '#/components/schemas/unibee.api.bean.USAddress'
        nexusAddresses:
          format: '[]*bean.USAddress'
          items:
            $ref: '#/components/schemas/unibee.api.bean.USAddress'
          properties: {}
          type: array
        sellOnUSOnly:
          format: bool
          properties: {}
          type: boolean
        taxCode:
          format: string
          properties: {}
          type: string
        toAddress:
          $ref: '#/components/schemas/unibee.api.bean.USAddress'
      type: object
    unibee.api.bean.GroupPlanIntervalSelector:
      properties:
        intervalCount:
          description: 'Number Of IntervalUnit，em: day|month|year|week'
          format: int
          properties: {}
          type: integer
        intervalUnit:
          description: 'Plan Interval Unit，em: day|month|year|week'
          format: string
          properties: {}
          type: string
      type: object
    unibee.api.bean.USAddress:
      properties:
        address:
          format: string
          properties: {}
          type: string
        city:
          format: string
          properties: {}
          type: string
        countryCode:
          format: string
          properties: {}
          type: string
        state:
          format: string
          properties: {}
          type: string
        verified:
          format: bool
          properties: {}
          type: boolean
        zipCode:
          format: string
          properties: {}
          type: string
      type: object
    unibee.api.bean.UserMetricChargeInvoiceItem:
      properties:
        CurrentUsedValue:
          description: CurrentUsedValue
          format: int64
          properties: {}
          type: integer
        chargePricing:
          $ref: '#/components/schemas/unibee.api.bean.PlanMetricMeteredChargeParam'
        description:
          description: Description
          format: string
          properties: {}
          type: string
        lines:
          description: Lines
          format: '[]*bean.MetricPlanChargeLine'
          items:
            $ref: '#/components/schemas/unibee.api.bean.MetricPlanChargeLine'
          properties: {}
          type: array
        maxEventId:
          format: int64
          properties: {}
          type: integer
        metricId:
          description: MetricId
          format: int64
          properties: {}
          type: integer
        minEventId:
          format: int64
          properties: {}
          type: integer
        name:
          description: Name
          format: string
          properties: {}
          type: string
        totalChargeAmount:
          description: TotalChargeAmount
          format: int64
          properties: {}
          type: integer
      required:
        - metricId
      type: object
    unibee.api.bean.InvoiceMetricCharge:
      properties:
        chargeType:
          description: 'Charge type: 0-standard pricing, 1-graduated pricing'
          format: int
          properties: {}
          type: integer
        metricCode:
          description: Metric code
          format: string
          properties: {}
          type: string
        metricId:
          description: Metric ID
          format: int64
          properties: {}
          type: integer
        metricName:
          description: Metric name
          format: string
          properties: {}
          type: string
        metricType:
          description: 'Metric type: 2-charge_metered, 3-charge_recurring'
          format: int
          properties: {}
          type: integer
        standardAmount:
          description: Standard amount per unit (cent), used when chargeType=0
          format: int64
          properties: {}
          type: integer
        standardStartValue:
          description: Start value for standard pricing
          format: int64
          properties: {}
          type: integer
      type: object
    unibee.api.bean.InvoiceMetricLimit:
      properties:
        metricCode:
          description: Metric code
          format: string
          properties: {}
          type: string
        metricId:
          description: Metric ID
          format: int64
          properties: {}
          type: integer
        metricLimit:
          description: Limit value for this metric
          format: int64
          properties: {}
          type: integer
        metricName:
          description: Metric name
          format: string
          properties: {}
          type: string
        metricType:
          description: 'Metric type: 1-limit_metered, 4-limit_recurring'
          format: int
          properties: {}
          type: integer
      type: object
    unibee.api.bean.detail.MerchantMemberDetail:
      properties:
        MemberGroupPermission:
          additionalProperties:
            $ref: '#/components/schemas/unibee.api.bean.MerchantRolePermission'
          description: The member group permission map'
          format: map[string]*bean.MerchantRolePermission
          properties: {}
          type: object
        MemberRoles:
          description: The member role list'
          format: '[]*bean.MerchantRole'
          items:
            $ref: '#/components/schemas/unibee.api.bean.MerchantRole'
          properties: {}
          type: array
        createTime:
          description: create utc time
          format: int64
          properties: {}
          type: integer
        currentDeviceIdentity:
          description: The Current DeviceIdentity'
          format: string
          properties: {}
          type: string
        deviceList:
          description: The devices list'
          format: '[]*bean.MerchantMemberDevice'
          items:
            $ref: '#/components/schemas/unibee.api.bean.MerchantMemberDevice'
          properties: {}
          type: array
        email:
          description: email
          format: string
          properties: {}
          type: string
        firstName:
          description: first name
          format: string
          properties: {}
          type: string
        id:
          description: userId
          format: int64
          properties: {}
          type: integer
        isBlankPasswd:
          description: is blank password
          format: bool
          properties: {}
          type: boolean
        isOwner:
          description: Check Member is Owner
          format: bool
          properties: {}
          type: boolean
        lastName:
          description: last name
          format: string
          properties: {}
          type: string
        merchantId:
          description: merchant id
          format: int64
          properties: {}
          type: integer
        mobile:
          description: mobile
          format: string
          properties: {}
          type: string
        oauthAccounts:
          description: List of connected OAuth accounts
          format: '[]*bean.Oauth'
          items:
            $ref: '#/components/schemas/unibee.api.bean.Oauth'
          properties: {}
          type: array
        status:
          description: 0-Active, 2-Suspend
          format: int
          properties: {}
          type: integer
        totpType:
          description: >-
            0-Inactive, 1-General, Google Authenticator | 2-Microsoft
            Authenticator | 3-Authy | 4-1Password | 5-LastPass | 6-FreeOTP |
            7-Other TOTP
          format: int
          properties: {}
          type: integer
      type: object
    unibee.api.bean.MetricPlanChargeGraduatedStep:
      properties:
        endValue:
          description: EndValue, -1 = infinity value(∞)
          format: int64
          properties: {}
          type: integer
        flatAmount:
          description: FlatAmount,cent
          format: int64
          properties: {}
          type: integer
        perAmount:
          description: PerAmount,cent
          format: int64
          properties: {}
          type: integer
        startValue:
          description: StartValue
          format: int64
          properties: {}
          type: integer
      type: object
    unibee.api.bean.MetricPlanChargeLine:
      properties:
        amount:
          description: Amount,cent
          format: int64
          properties: {}
          type: integer
        flatAmount:
          description: FlatAmount,cent
          format: int64
          properties: {}
          type: integer
        quantity:
          description: Quantity
          format: int64
          properties: {}
          type: integer
        step:
          description: Step
          format: string
          properties: {}
          type: string
        unitAmount:
          description: UnitAmount,cent
          format: int64
          properties: {}
          type: integer
      type: object
    unibee.api.bean.MerchantRolePermission:
      properties:
        group:
          description: Group
          format: string
          properties: {}
          type: string
        permissions:
          description: Permissions
          format: '[]string'
          items:
            format: string
            properties: {}
            type: string
          properties: {}
          type: array
      type: object
    unibee.api.bean.MerchantRole:
      properties:
        createTime:
          description: create utc time
          format: int64
          properties: {}
          type: integer
        id:
          description: id
          format: int64
          properties: {}
          type: integer
        merchantId:
          description: merchant id
          format: int64
          properties: {}
          type: integer
        permissions:
          description: permissions
          format: '[]*bean.MerchantRolePermission'
          items:
            $ref: '#/components/schemas/unibee.api.bean.MerchantRolePermission'
          properties: {}
          type: array
        role:
          description: role
          format: string
          properties: {}
          type: string
      type: object
    unibee.api.bean.MerchantMemberDevice:
      properties:
        currentDevice:
          description: Is CurrentDevice
          format: bool
          properties: {}
          type: boolean
        identity:
          description: Identity
          format: string
          properties: {}
          type: string
        ipAddress:
          description: IP Address
          format: string
          properties: {}
          type: string
        lastActiveTime:
          description: Last Active Time
          format: int64
          properties: {}
          type: integer
        lastLoginTime:
          description: Last Login Time
          format: int64
          properties: {}
          type: integer
        lastTotpVerificationTime:
          description: Last Totp Verification Time
          format: int64
          properties: {}
          type: integer
        name:
          description: Name
          format: string
          properties: {}
          type: string
        status:
          description: true-Active, false-Offline
          format: bool
          properties: {}
          type: boolean
      type: object
    unibee.api.bean.Oauth:
      properties:
        email:
          format: string
          properties: {}
          type: string
        emailVerified:
          format: bool
          properties: {}
          type: boolean
        image:
          format: string
          properties: {}
          type: string
        name:
          format: string
          properties: {}
          type: string
        provider:
          format: string
          properties: {}
          type: string
        providerId:
          format: string
          properties: {}
          type: string
      type: object
  securitySchemes:
    Authorization:
      bearerFormat: JWT
      scheme: bearer
      type: http

````