# Update a subscription

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /v1/subscriptions/{id}:
    post:
      summary: Update a subscription
      deprecated: false
      description: ''
      tags:
        - API Reference/Subscriptions
      parameters:
        - name: id
          in: path
          description: ''
          required: true
          schema:
            type: string
        - name: Accept
          in: header
          description: ''
          required: true
          example: application/json
          schema:
            type: string
        - name: Content-Type
          in: header
          description: ''
          required: true
          example: application/json
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                cancel_at_period_end:
                  type: boolean
                  description: >-
                    Boolean indicating whether this subscription should cancel
                    at the end of the current period.
                items:
                  type: array
                  items:
                    type: object
                    properties:
                      id:
                        type: string
                        description: Subscription item to update.
                      price:
                        type: string
                        description: >-
                          When changing a subscription item’s price, quantity is
                          set to 1 unless a quantity parameter is provided.
                      price_data:
                        type: object
                        properties:
                          currency:
                            type: string
                            description: Three-letter ISO currency code
                          product:
                            type: string
                            description: >-
                              The ID of the Product that this Price will belong
                              to.
                          recurring:
                            type: object
                            properties:
                              interval:
                                type: string
                                enum:
                                  - day
                                  - month
                                  - week
                                  - year
                                description: >-
                                  Specifies billing frequency. Either day, week,
                                  month or year.
                                x-apifox-enum:
                                  - value: day
                                    name: ''
                                    description: ''
                                  - value: month
                                    name: ''
                                    description: ''
                                  - value: week
                                    name: ''
                                    description: ''
                                  - value: year
                                    name: ''
                                    description: ''
                              interval_count:
                                type: integer
                                description: >-
                                  The number of intervals between subscription
                                  billings. For example, interval=month and
                                  interval_count=3 bills every 3 months. Maximum
                                  of three years interval allowed (3 years, 36
                                  months, or 156 weeks).
                            x-apifox-orders:
                              - interval
                              - interval_count
                            required:
                              - interval
                              - interval_count
                            description: >-
                              The recurring components of a price such as
                              interval and interval_count.
                            x-apifox-ignore-properties: []
                          unit_amount:
                            type: integer
                            description: >-
                              A positive integer in cents (or 0 for a free
                              price) representing how much to charge.
                        x-apifox-orders:
                          - currency
                          - product
                          - recurring
                          - unit_amount
                        description: >-
                          The ID of the price object. One of price or price_data
                          is required.
                        required:
                          - currency
                          - product
                          - recurring
                          - unit_amount
                        x-apifox-ignore-properties: []
                      quantity:
                        type: integer
                        description: Quantity for this item.
                    x-apifox-orders:
                      - id
                      - price
                      - price_data
                      - quantity
                    required:
                      - id
                      - quantity
                    x-apifox-ignore-properties: []
                  description: >-
                    A list of up to 20 subscription items, each with an attached
                    price.
                proration_behavior:
                  type: string
                  enum:
                    - always_invoice
                    - create_prorations
                  description: >-
                    Determines how to handle prorations when the billing cycle
                    changes (e.g., when switching plans, resetting
                    billing_cycle_anchor=now, or starting a trial), or if an
                    item’s quantity changes. The default value is
                    create_prorations.
                  x-apifox-enum:
                    - value: always_invoice
                      name: ''
                      description: Always invoice immediately for prorations.
                    - value: create_prorations
                      name: ''
                      description: >-
                        Will cause proration invoice items to be created when
                        applicable. 
              x-apifox-orders:
                - cancel_at_period_end
                - items
                - proration_behavior
              x-apifox-ignore-properties: []
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                x-apifox-refs:
                  01HW4GF232CN0JJ6RDDKGPXJ78:
                    $ref: '#/components/schemas/Subscription'
                    x-apifox-overrides:
                      pending_invoice_item_interval: null
                      pause_collection: null
                      cancellation_details: null
                      default_tax_rates: null
                      trial_from_plan: null
                      trial_period_days: null
                      trial_settings: null
                      billing_thresholds: null
                      test_clock: null
                x-apifox-orders:
                  - 01HW4GF232CN0JJ6RDDKGPXJ78
                properties:
                  id:
                    type: string
                    description: Unique identifier for the object.
                  object:
                    type: string
                    description: value is "subscription"
                  cancel_at_period_end:
                    type: boolean
                    description: >-
                      If the subscription has been canceled with the
                      at_period_end flag set to true, cancel_at_period_end on
                      the subscription will be true. You can use this attribute
                      to determine whether a subscription that has a status of
                      active is scheduled to be canceled at the end of the
                      current period.
                  currency:
                    type: string
                    description: >-
                      Three-letter ISO currency code, in lowercase. Must be a
                      supported currency.
                  current_period_end:
                    type: integer
                    description: >-
                      End of the current period that the subscription has been
                      invoiced for. At the end of this period, a new invoice
                      will be created.
                  current_period_start:
                    type: integer
                    description: >-
                      Start of the current period that the subscription has been
                      invoiced for.
                  customer:
                    type: string
                    description: EXPANDABLE. ID of the customer who owns the subscription.
                  default_payment_method:
                    type: string
                    description: >-
                      EXPANDABLE. ID of the default payment method for the
                      subscription. It must belong to the customer associated
                      with the subscription. This takes precedence over
                      default_source. If neither are set, invoices will use the
                      customer’s invoice_settings.default_payment_method or
                      default_source.
                    nullable: true
                  description:
                    type: string
                    description: >-
                      The subscription’s description, meant to be displayable to
                      the customer. 
                    nullable: true
                  items:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          description: Unique identifier for the object.
                        object:
                          type: string
                          description: >-
                            String representing the object’s type. Objects of
                            the same type share the same value.
                        metadata:
                          type: string
                          description: >-
                            Set of key-value pairs that you can attach to an
                            object. This can be useful for storing additional
                            information about the object in a structured format.
                        price:
                          description: The price the customer is subscribed to.
                          type: object
                          x-apifox-refs:
                            01HMZYXK76H2T05N689SJEYWDW: &ref_0
                              $ref: '#/components/schemas/Price'
                              x-apifox-overrides:
                                unit_amount_decimal: null
                                transform_quantity: null
                                tax_behavior: null
                                custom_unit_amount: null
                          x-apifox-orders:
                            - 01HMZYXK76H2T05N689SJEYWDW
                          properties:
                            id:
                              type: string
                              description: >-
                                Unique identifier for the object, like
                                "price_xxxx".
                            object:
                              type: string
                              description: '''price'''
                            active:
                              type: boolean
                              description: Whether the price can be used for new purchases.
                            billing_scheme:
                              type: string
                              description: >-
                                Describes how to compute the price per period.
                                Either per_unit or tiered
                              enum:
                                - per_unit
                                - tiered
                              x-apifox-enum:
                                - value: per_unit
                                  name: ''
                                  description: only per_unit is supported now.
                                - value: tiered
                                  name: ''
                                  description: ''
                            created:
                              type: integer
                              description: >-
                                Time at which the object was created. Measured
                                in seconds since the Unix epoch.
                            currency:
                              type: string
                              description: 'Three-letter ISO currency code, in uppercase. '
                            livemode:
                              type: boolean
                              description: >-
                                Has the value true if the object exists in live
                                mode or the value false if the object exists in
                                test mode.
                            lookup_key:
                              type: string
                              description: >-
                                A lookup key used to retrieve prices dynamically
                                from a static string. This may be up to 200
                                characters.
                            metadata:
                              type: object
                              properties: {}
                              x-apifox-orders: []
                              description: >-
                                Set of key-value pairs that you can attach to an
                                object. This can be useful for storing
                                additional information about the object in a
                                structured format.
                              x-apifox-ignore-properties: []
                            nickname:
                              type: string
                              description: >-
                                A brief description of the price, hidden from
                                customers.
                            product:
                              type: string
                              description: >-
                                The ID of the product this price is associated
                                with.
                            type:
                              type: string
                              description: >-
                                One of one_time or recurring depending on
                                whether the price is for a one-time purchase or
                                a recurring (subscription) purchase.
                              enum:
                                - one_time
                                - recurring
                              x-apifox-enum:
                                - value: one_time
                                  name: ''
                                  description: only one-time is supported now.
                                - value: recurring
                                  name: ''
                                  description: ''
                            unit_amount:
                              type: integer
                              description: >-
                                The unit amount in cents to be charged,
                                represented as a whole integer if possible. Only
                                set if billing_scheme=per_unit.
                            recurring:
                              type: object
                              properties:
                                interval:
                                  type: string
                                  description: >-
                                    The frequency at which a subscription is
                                    billed. One of day, week, month or year.
                                  enum:
                                    - day
                                    - week
                                    - month
                                    - year
                                  x-apifox-enum:
                                    - value: day
                                      name: ''
                                      description: ''
                                    - value: week
                                      name: ''
                                      description: ''
                                    - value: month
                                      name: ''
                                      description: ''
                                    - value: year
                                      name: ''
                                      description: ''
                                interval_count:
                                  type: integer
                                  description: >-
                                    The number of intervals (specified in the
                                    interval attribute) between subscription
                                    billings. For example, interval=month and
                                    interval_count=3 bills every 3 months.
                                usage_type:
                                  type: string
                                  description: >-
                                    Configures how the quantity per period
                                    should be determined.
                                  enum:
                                    - licensed
                                  x-apifox-enum:
                                    - value: licensed
                                      name: ''
                                      description: ''
                              x-apifox-orders:
                                - interval
                                - interval_count
                                - usage_type
                              description: The recurring components of a price
                              required:
                                - interval
                              x-apifox-ignore-properties: []
                            tiers_mode:
                              type: 'null'
                              description: （未实现）
                            tiers:
                              type: array
                              items:
                                type: object
                                properties:
                                  up_to:
                                    type: string
                                    description: >-
                                      Specifies the upper bound of this tier.
                                      The lower bound of a tier is the upper
                                      bound of the previous tier adding one. Use
                                      inf to define a fallback tier.
                                  flat_amount:
                                    type: string
                                    description: >-
                                      The flat billing amount for an entire
                                      tier, regardless of the number of units in
                                      the tier.
                                  unit_amount:
                                    type: string
                                    description: >-
                                      The per unit billing amount for each
                                      individual unit for which this tier
                                      applies.
                                x-apifox-orders:
                                  - up_to
                                  - flat_amount
                                  - unit_amount
                                x-apifox-ignore-properties: []
                              description: （未实现）
                          x-apifox-ignore-properties:
                            - id
                            - object
                            - active
                            - billing_scheme
                            - created
                            - currency
                            - livemode
                            - lookup_key
                            - metadata
                            - nickname
                            - product
                            - type
                            - unit_amount
                            - recurring
                            - tiers_mode
                            - tiers
                        quantity:
                          type: integer
                          description: >-
                            The quantity of the plan to which the customer
                            should be subscribed.
                        subscription:
                          type: string
                          description: The subscription this subscription_item belongs to.
                        created:
                          type: string
                          description: >-
                            Time at which the object was created. Measured in
                            seconds since the Unix epoch.
                      x-apifox-orders:
                        - 01JCFXF6EDSWAFKH5RRG0PXVDF
                      x-apifox-refs:
                        01JCFXF6EDSWAFKH5RRG0PXVDF: &ref_31
                          $ref: '#/components/schemas/Subscription%20item'
                          x-apifox-overrides:
                            billing_thresholds: null
                            tax_rates: null
                      x-apifox-ignore-properties:
                        - id
                        - object
                        - metadata
                        - price
                        - quantity
                        - subscription
                        - created
                  latest_invoice:
                    type: string
                    description: The most recent invoice this subscription has generated.
                    nullable: true
                  metadata:
                    type: string
                    description: >-
                      Set of key-value pairs that you can attach to an object.
                      This can be useful for storing additional information
                      about the object in a structured format.
                  pending_setup_intent:
                    type: string
                    description: >-
                      Set of key-value pairs that you can attach to an object.
                      This can be useful for storing additional information
                      about the object in a structured format.
                    nullable: true
                  pending_update:
                    type: object
                    properties:
                      billing_cycle_anchor:
                        type: string
                      expires_at:
                        type: string
                      subscription_items:
                        type: string
                      trial_end:
                        type: string
                      trial_from_plan:
                        type: string
                    description: >-
                      You can use this SetupIntent to collect user
                      authentication when creating a subscription without
                      immediate payment or updating a subscription’s payment
                      method, allowing you to optimize for off-session payments.
                      Learn more in the SCA Migration Guide.
                    x-apifox-orders:
                      - billing_cycle_anchor
                      - expires_at
                      - subscription_items
                      - trial_end
                      - trial_from_plan
                    x-apifox-ignore-properties: []
                    nullable: true
                  status:
                    type: string
                    description: >-
                      Possible values are incomplete, incomplete_expired,
                      trialing, active, past_due, canceled, or unpaid.
                  cancel_at:
                    type: integer
                    description: >-
                      A date in the future at which the subscription will
                      automatically get canceled
                    nullable: true
                  canceled_at:
                    type: integer
                    description: >-
                      If the subscription has been canceled, the date of that
                      cancellation. If the subscription was canceled with
                      cancel_at_period_end, canceled_at will reflect the time of
                      the most recent update request, not the end of the
                      subscription period when the subscription is automatically
                      moved to a canceled state.
                    nullable: true
                  collection_method:
                    type: string
                    description: Either charge_automatically, or send_invoice.
                  created:
                    type: string
                    description: >-
                      Time at which the object was created. Measured in seconds
                      since the Unix epoch.
                  days_until_due:
                    type: integer
                    description: >-
                      Number of days a customer has to pay invoices generated by
                      this subscription. This value will be null for
                      subscriptions where
                      collection_method=charge_automatically.
                    nullable: true
                  default_source:
                    type: string
                    nullable: true
                  start_date:
                    type: integer
                    description: >-
                      Date when the subscription was first created. The date
                      might differ from the created date due to backdating.
                  ended_at:
                    type: integer
                    description: >-
                      If the subscription has ended, the date the subscription
                      ended.
                  livemode:
                    type: boolean
                    description: >-
                      Has the value true if the object exists in live mode or
                      the value false if the object exists in test mode.
                  next_pending_invoice_item_invoice:
                    type: integer
                    description: >-
                      Timestamp. Specifies the approximate timestamp on which
                      any pending invoice items will be billed according to the
                      schedule provided at pending_invoice_item_interval.
                    nullable: true
                  payment_settings:
                    type: object
                    properties:
                      payment_method_options: &ref_32
                        $ref: '#/components/schemas/Payment%20Method%20Options'
                      payment_method_types:
                        type: string
                      save_default_payment_method:
                        type: string
                        description: 'Either off, or on_subscription. '
                      pending_invoice_item_interval:
                        type: object
                        properties:
                          interval:
                            type: string
                            description: >-
                              Specifies invoicing frequency. Either day, week,
                              month or year.
                          interval_count:
                            type: string
                            description: >-
                              The number of intervals between invoices. For
                              example, interval=month and interval_count=3 bills
                              every 3 months. Maximum of one year interval
                              allowed (1 year, 12 months, or 52 weeks).
                        description: >-
                          Specifies an interval for how often to bill for any
                          pending invoice items. It is analogous to calling
                          Create an invoice for the given subscription at the
                          specified interval.
                        x-apifox-orders:
                          - interval
                          - interval_count
                        x-apifox-ignore-properties: []
                      schedule:
                        type: string
                        description: The schedule attached to the subscription
                    description: >-
                      Payment settings passed on to invoices created by the
                      subscription.
                    x-apifox-orders:
                      - payment_method_options
                      - payment_method_types
                      - save_default_payment_method
                      - pending_invoice_item_interval
                      - schedule
                    x-apifox-ignore-properties: []
                    nullable: true
                  trial_start:
                    type: integer
                    description: >-
                      If the subscription has a trial, the beginning of that
                      trial.
                    nullable: true
                  trial_end:
                    type: integer
                    description: If the subscription has a trial, the end of that trial.
                    nullable: true
                  billing_cycle_anchor:
                    type: string
                    description: >-
                      Determines the date of the first full invoice, and, for
                      plans with month or year intervals, the day of the month
                      for subsequent invoices. The timestamp is in UTC format.
                x-apifox-ignore-properties:
                  - id
                  - object
                  - cancel_at_period_end
                  - currency
                  - current_period_end
                  - current_period_start
                  - customer
                  - default_payment_method
                  - description
                  - items
                  - latest_invoice
                  - metadata
                  - pending_setup_intent
                  - pending_update
                  - status
                  - cancel_at
                  - canceled_at
                  - collection_method
                  - created
                  - days_until_due
                  - default_source
                  - start_date
                  - ended_at
                  - livemode
                  - next_pending_invoice_item_invoice
                  - payment_settings
                  - trial_start
                  - trial_end
                  - billing_cycle_anchor
          headers: {}
          x-apifox-name: OK
      security:
        - basic: []
      x-apifox-folder: API Reference/Subscriptions
      x-apifox-status: released
      x-run-in-apifox: https://app.apifox.com/web/project/1296482/apis/api-167714593-run
components:
  schemas:
    Payment Method Options:
      type: object
      properties:
        card:
          type: object
          properties:
            request_three_d_secure:
              type: string
              description: >-
                Values can be auto, any, void When a user selects the void
                option, Wooshpay will still perform 3DS if it encounters a
                policy.
              enum:
                - any
                - auto
                - void
              x-apifox-enum:
                - value: any
                  name: ''
                  description: Use any to request 3DS with a preference for 3ds flow
                - value: auto
                  name: ''
                  description: >-
                    (Default) Our SCA Engine automatically prompts your
                    customers for authentication based on risk level and other
                    requirements.
                - value: void
                  name: ''
                  description: Do not prefer the 3ds flow
            setup_future_usage:
              type: string
              description: >-
                Indicates that you intend to make future payments with this
                PaymentIntent’s payment method. Providing this parameter will
                attach the payment method to the PaymentIntent’s Customer, if
                present, after the PaymentIntent is confirmed and any required
                actions from the user are complete.
              enum:
                - on_session
                - off_session
                - none
              x-apifox-enum:
                - value: on_session
                  name: ''
                  description: >-
                    if you intend to only reuse the payment method when your
                    customer is present in your checkout flow.
                - value: off_session
                  name: ''
                  description: ' if your customer may or may not be present in your checkout flow.'
                - value: none
                  name: ''
                  description: >-
                    if you do not intend to reuse this payment method and want
                    to override the top-level setup_future_usage value for this
                    payment method.
            capture_method:
              type: string
              description: >-
                Controls when the funds will be captured from the customer’s
                account. If capture_method is already set on the PaymentIntent,
                providing an empty value for this parameter will unset the
                stored value for this payment method type.
            tax_id:
              type: string
          x-apifox-orders:
            - request_three_d_secure
            - setup_future_usage
            - capture_method
            - tax_id
          x-apifox-ignore-properties: []
        alipayplus:
          type: object
          properties:
            terminal_type:
              type: string
              description: >-
                enum:"WEB","WAP","APP","MINI_APP". WEB: indicates that a PC
                browser is used.WAP: indicates that a mobile browser is
                used.APP: indicates that a mobile app is used.MINI_APP:
                indicates that a mini program is used.
              enum:
                - APP
                - WAP
                - WEB
              x-apifox-enum:
                - value: APP
                  name: ''
                  description: ''
                - value: WAP
                  name: ''
                  description: ''
                - value: WEB
                  name: ''
                  description: ''
            os_type:
              type: string
              description: >-
                enum:"IOS", "ANDROID". os_type is required if terminal_type is
                "APP" or "WAP"
              enum:
                - IOS
                - ANDROID
              x-apifox-enum:
                - value: IOS
                  name: ''
                  description: ''
                - value: ANDROID
                  name: ''
                  description: ''
          x-apifox-orders:
            - terminal_type
            - os_type
          x-apifox-ignore-properties: []
        alipay_hk:
          type: object
          properties:
            terminal_type:
              type: string
              description: >-
                enum:"IOS", "ANDROID". os_type is required if terminal_type is
                "APP" or "WAP"
              enum:
                - APP
                - WAP
                - WEB
              x-apifox-enum:
                - value: APP
                  name: ''
                  description: ''
                - value: WAP
                  name: ''
                  description: ''
                - value: WEB
                  name: ''
                  description: ''
            os_type:
              type: string
              description: >-
                enum:"WEB","WAP","APP","MINI_APP". WEB: indicates that a PC
                browser is used.WAP: indicates that a mobile browser is
                used.APP: indicates that a mobile app is used.MINI_APP:
                indicates that a mini program is used.
              enum:
                - IOS
                - ANDROID
              x-apifox-enum:
                - value: IOS
                  name: ''
                  description: ''
                - value: ANDROID
                  name: ''
                  description: ''
          x-apifox-orders:
            - terminal_type
            - os_type
          x-apifox-ignore-properties: []
        alipay:
          type: object
          properties:
            terminal_type:
              type: string
              description: >-
                enum:"IOS", "ANDROID". os_type is required if terminal_type is
                "APP" or "WAP"
              enum:
                - APP
                - WAP
                - WEB
              x-apifox-enum:
                - value: APP
                  name: ''
                  description: ''
                - value: WAP
                  name: ''
                  description: ''
                - value: WEB
                  name: ''
                  description: ''
            os_type:
              type: string
              description: >-
                enum:"WEB","WAP","APP","MINI_APP". WEB: indicates that a PC
                browser is used.WAP: indicates that a mobile browser is
                used.APP: indicates that a mobile app is used.MINI_APP:
                indicates that a mini program is used.
              enum:
                - IOS
                - ANDROID
              x-apifox-enum:
                - value: IOS
                  name: ''
                  description: ''
                - value: ANDROID
                  name: ''
                  description: ''
          x-apifox-orders:
            - terminal_type
            - os_type
          x-apifox-ignore-properties: []
        wechat_pay:
          type: object
          properties:
            terminal_type:
              type: string
              enum:
                - WEB
                - SCAN_CODE
                - WAP
                - OFFICIAL_ACCOUNT
              description: |-
                enum:"WEB","WAP","SCAN_CODE","OFFICIAL_ACCOUNT".
                "WEB": QR Code Payment
                "WAP": H5 Payment
                "SCAN_CODE": Quick Pay
                "OFFICIAL_ACCOUNT":Official Account Payment
              x-apifox-enum:
                - value: WEB
                  name: ''
                  description: >-
                    Users use WeChat's "Scan" feature to scan a payment code
                    generated by a merchant on a web page to make a payment.
                - value: SCAN_CODE
                  name: ''
                  description: Users present their WeChat Pay payment code to the merchant
                - value: WAP
                  name: ''
                  description: Users make purchases in merchant apps using WeChat Pay.
                - value: OFFICIAL_ACCOUNT
                  name: ''
                  description: ''
            client_ip:
              type: string
            os_type:
              type: string
              enum:
                - IOS
                - ANDROID
              x-apifox-enum:
                - value: IOS
                  name: ''
                  description: ''
                - value: ANDROID
                  name: ''
                  description: ''
            openid:
              type: string
              description: user's identification in the WeChat official account
          x-apifox-orders:
            - terminal_type
            - client_ip
            - os_type
            - openid
          x-apifox-ignore-properties: []
        sepa_debit:
          type: object
          properties: {}
          x-apifox-orders: []
          x-apifox-ignore-properties: []
        akulaku:
          type: object
          properties:
            terminal_type:
              type: string
              description: >-
                enum:"WEB","WAP","APP","MINI_APP". WEB: indicates that a PC
                browser is used.WAP: indicates that a mobile browser is
                used.APP: indicates that a mobile app is used.MINI_APP:
                indicates that a mini program is used.
              enum:
                - WEB
                - WAP
                - APP
                - MINI_APP
              x-apifox-enum:
                - value: WEB
                  name: ''
                  description: ''
                - value: WAP
                  name: ''
                  description: ''
                - value: APP
                  name: ''
                  description: ''
                - value: MINI_APP
                  name: ''
                  description: ''
            os_type:
              type: string
              description: >-
                enum:"IOS", "ANDROID". os_type is required if terminal_type is
                "APP" or "WAP"
              enum:
                - IOS
                - ANDROID
              x-apifox-enum:
                - value: IOS
                  name: ''
                  description: ''
                - value: ANDROID
                  name: ''
                  description: ''
          x-apifox-orders:
            - terminal_type
            - os_type
          x-apifox-ignore-properties: []
        truemoney:
          type: object
          properties:
            terminal_type:
              type: string
              description: >-
                enum:"WEB","WAP","APP","MINI_APP". WEB: indicates that a PC
                browser is used.WAP: indicates that a mobile browser is
                used.APP: indicates that a mobile app is used.MINI_APP:
                indicates that a mini program is used.
              enum:
                - WEB
                - WAP
                - APP
                - MINI_APP
              x-apifox-enum:
                - value: WEB
                  name: ''
                  description: ''
                - value: WAP
                  name: ''
                  description: ''
                - value: APP
                  name: ''
                  description: ''
                - value: MINI_APP
                  name: ''
                  description: ''
            os_type:
              type: string
              description: >-
                enum:"IOS", "ANDROID". os_type is required if terminal_type is
                "APP" or "WAP"
              enum:
                - IOS
                - ANDROID
              x-apifox-enum:
                - value: IOS
                  name: ''
                  description: ''
                - value: ANDROID
                  name: ''
                  description: ''
          x-apifox-orders:
            - terminal_type
            - os_type
          x-apifox-ignore-properties: []
        kakaopay:
          type: object
          properties:
            terminal_type:
              type: string
              description: >-
                enum:"WEB","WAP","APP","MINI_APP". WEB: indicates that a PC
                browser is used.WAP: indicates that a mobile browser is
                used.APP: indicates that a mobile app is used.MINI_APP:
                indicates that a mini program is used.
              enum:
                - WEB
                - WAP
                - APP
                - MINI_APP
              x-apifox-enum:
                - value: WEB
                  name: ''
                  description: ''
                - value: WAP
                  name: ''
                  description: ''
                - value: APP
                  name: ''
                  description: ''
                - value: MINI_APP
                  name: ''
                  description: ''
            os_type:
              type: string
              description: >-
                enum:"IOS", "ANDROID". os_type is required if terminal_type is
                "APP" or "WAP"
              enum:
                - IOS
                - ANDROID
              x-apifox-enum:
                - value: IOS
                  name: ''
                  description: ''
                - value: ANDROID
                  name: ''
                  description: ''
          x-apifox-orders:
            - terminal_type
            - os_type
          x-apifox-ignore-properties: []
        shopeepay:
          type: object
          properties:
            terminal_type:
              type: string
              description: >-
                enum:"WEB","WAP","APP","MINI_APP". WEB: indicates that a PC
                browser is used.WAP: indicates that a mobile browser is
                used.APP: indicates that a mobile app is used.MINI_APP:
                indicates that a mini program is used.
            os_type:
              type: string
              description: >-
                enum:"IOS", "ANDROID". os_type is required if terminal_type is
                "APP" or "WAP"
          x-apifox-orders:
            - terminal_type
            - os_type
          x-apifox-ignore-properties: []
        dana:
          type: object
          properties:
            terminal_type:
              type: string
              description: >-
                enum:"WEB","WAP","APP","MINI_APP". WEB: indicates that a PC
                browser is used.WAP: indicates that a mobile browser is
                used.APP: indicates that a mobile app is used.MINI_APP:
                indicates that a mini program is used.
            os_type:
              type: string
              description: >-
                enum:"IOS", "ANDROID". os_type is required if terminal_type is
                "APP" or "WAP"
          x-apifox-orders:
            - terminal_type
            - os_type
          x-apifox-ignore-properties: []
        pix:
          type: object
          properties:
            tax_id:
              type: string
          x-apifox-orders:
            - tax_id
          required:
            - tax_id
          x-apifox-ignore-properties: []
      x-apifox-orders:
        - card
        - alipayplus
        - alipay_hk
        - alipay
        - wechat_pay
        - sepa_debit
        - akulaku
        - truemoney
        - kakaopay
        - shopeepay
        - dana
        - pix
      description: Payment-method-specific configuration for this PaymentIntent.
      x-apifox-ignore-properties: []
      x-apifox-folder: ''
    Price:
      type: object
      properties:
        id: &ref_1
          type: string
          description: Unique identifier for the object, like "price_xxxx".
        object: &ref_2
          type: string
          description: '''price'''
        active: &ref_3
          type: boolean
          description: Whether the price can be used for new purchases.
        billing_scheme:
          type: string
          description: >-
            Describes how to compute the price per period. Either per_unit or
            tiered
          enum: &ref_4
            - per_unit
            - tiered
          x-apifox-enum:
            - value: per_unit
              name: ''
              description: only per_unit is supported now.
            - value: tiered
              name: ''
              description: ''
        created: &ref_5
          type: integer
          description: >-
            Time at which the object was created. Measured in seconds since the
            Unix epoch.
        currency: &ref_6
          type: string
          description: 'Three-letter ISO currency code, in uppercase. '
        livemode: &ref_7
          type: boolean
          description: >-
            Has the value true if the object exists in live mode or the value
            false if the object exists in test mode.
        lookup_key: &ref_8
          type: string
          description: >-
            A lookup key used to retrieve prices dynamically from a static
            string. This may be up to 200 characters.
        metadata:
          type: object
          properties: {}
          x-apifox-orders: &ref_9 []
          description: >-
            Set of key-value pairs that you can attach to an object. This can be
            useful for storing additional information about the object in a
            structured format.
          x-apifox-ignore-properties: []
        nickname: &ref_10
          type: string
          description: A brief description of the price, hidden from customers.
        product: &ref_11
          type: string
          description: The ID of the product this price is associated with.
        type:
          type: string
          description: >-
            One of one_time or recurring depending on whether the price is for a
            one-time purchase or a recurring (subscription) purchase.
          enum: &ref_12
            - one_time
            - recurring
          x-apifox-enum:
            - value: one_time
              name: ''
              description: only one-time is supported now.
            - value: recurring
              name: ''
              description: ''
        unit_amount: &ref_13
          type: integer
          description: >-
            The unit amount in cents to be charged, represented as a whole
            integer if possible. Only set if billing_scheme=per_unit.
        custom_unit_amount:
          type: 'null'
          description: （未实现）
        recurring:
          type: object
          properties:
            interval:
              type: string
              description: >-
                The frequency at which a subscription is billed. One of day,
                week, month or year.
              enum: &ref_14
                - day
                - week
                - month
                - year
              x-apifox-enum:
                - value: day
                  name: ''
                  description: ''
                - value: week
                  name: ''
                  description: ''
                - value: month
                  name: ''
                  description: ''
                - value: year
                  name: ''
                  description: ''
            interval_count: &ref_15
              type: integer
              description: >-
                The number of intervals (specified in the interval attribute)
                between subscription billings. For example, interval=month and
                interval_count=3 bills every 3 months.
            usage_type:
              type: string
              description: Configures how the quantity per period should be determined.
              enum: &ref_16
                - licensed
              x-apifox-enum:
                - value: licensed
                  name: ''
                  description: ''
          x-apifox-orders: &ref_17
            - interval
            - interval_count
            - usage_type
          description: The recurring components of a price
          required:
            - interval
          x-apifox-ignore-properties: []
        tax_behavior:
          type: string
          description: （未实现）
        tiers_mode: &ref_18
          type: 'null'
          description: （未实现）
        tiers:
          type: array
          items:
            type: object
            properties:
              up_to: &ref_19
                type: string
                description: >-
                  Specifies the upper bound of this tier. The lower bound of a
                  tier is the upper bound of the previous tier adding one. Use
                  inf to define a fallback tier.
              flat_amount: &ref_20
                type: string
                description: >-
                  The flat billing amount for an entire tier, regardless of the
                  number of units in the tier.
              unit_amount: &ref_21
                type: string
                description: >-
                  The per unit billing amount for each individual unit for which
                  this tier applies.
            x-apifox-orders: &ref_22
              - up_to
              - flat_amount
              - unit_amount
            x-apifox-ignore-properties: []
          description: （未实现）
        transform_quantity:
          type: 'null'
          description: （未实现）
        unit_amount_decimal:
          type: string
          description: （未实现）
      x-apifox-orders:
        - id
        - object
        - active
        - billing_scheme
        - created
        - currency
        - livemode
        - lookup_key
        - metadata
        - nickname
        - product
        - type
        - unit_amount
        - custom_unit_amount
        - recurring
        - tax_behavior
        - tiers_mode
        - tiers
        - transform_quantity
        - unit_amount_decimal
      x-apifox-ignore-properties: []
      x-apifox-folder: ''
    Subscription item:
      type: object
      properties:
        id: &ref_23
          type: string
          description: Unique identifier for the object.
        object: &ref_24
          type: string
          description: >-
            String representing the object’s type. Objects of the same type
            share the same value.
        metadata: &ref_25
          type: string
          description: >-
            Set of key-value pairs that you can attach to an object. This can be
            useful for storing additional information about the object in a
            structured format.
        price:
          description: The price the customer is subscribed to.
          type: object
          x-apifox-refs: &ref_26
            01HMZYXK76H2T05N689SJEYWDW: *ref_0
          x-apifox-orders: &ref_27
            - 01HMZYXK76H2T05N689SJEYWDW
          properties:
            id: *ref_1
            object: *ref_2
            active: *ref_3
            billing_scheme:
              type: string
              description: >-
                Describes how to compute the price per period. Either per_unit
                or tiered
              enum: *ref_4
              x-apifox-enum:
                - value: per_unit
                  name: ''
                  description: only per_unit is supported now.
                - value: tiered
                  name: ''
                  description: ''
            created: *ref_5
            currency: *ref_6
            livemode: *ref_7
            lookup_key: *ref_8
            metadata:
              type: object
              properties: {}
              x-apifox-orders: *ref_9
              description: >-
                Set of key-value pairs that you can attach to an object. This
                can be useful for storing additional information about the
                object in a structured format.
              x-apifox-ignore-properties: []
            nickname: *ref_10
            product: *ref_11
            type:
              type: string
              description: >-
                One of one_time or recurring depending on whether the price is
                for a one-time purchase or a recurring (subscription) purchase.
              enum: *ref_12
              x-apifox-enum:
                - value: one_time
                  name: ''
                  description: only one-time is supported now.
                - value: recurring
                  name: ''
                  description: ''
            unit_amount: *ref_13
            recurring:
              type: object
              properties:
                interval:
                  type: string
                  description: >-
                    The frequency at which a subscription is billed. One of day,
                    week, month or year.
                  enum: *ref_14
                  x-apifox-enum:
                    - value: day
                      name: ''
                      description: ''
                    - value: week
                      name: ''
                      description: ''
                    - value: month
                      name: ''
                      description: ''
                    - value: year
                      name: ''
                      description: ''
                interval_count: *ref_15
                usage_type:
                  type: string
                  description: Configures how the quantity per period should be determined.
                  enum: *ref_16
                  x-apifox-enum:
                    - value: licensed
                      name: ''
                      description: ''
              x-apifox-orders: *ref_17
              description: The recurring components of a price
              required:
                - interval
              x-apifox-ignore-properties: []
            tiers_mode: *ref_18
            tiers:
              type: array
              items:
                type: object
                properties:
                  up_to: *ref_19
                  flat_amount: *ref_20
                  unit_amount: *ref_21
                x-apifox-orders: *ref_22
                x-apifox-ignore-properties: []
              description: （未实现）
          x-apifox-ignore-properties:
            - id
            - object
            - active
            - billing_scheme
            - created
            - currency
            - livemode
            - lookup_key
            - metadata
            - nickname
            - product
            - type
            - unit_amount
            - recurring
            - tiers_mode
            - tiers
        quantity: &ref_28
          type: integer
          description: The quantity of the plan to which the customer should be subscribed.
        subscription: &ref_29
          type: string
          description: The subscription this subscription_item belongs to.
        billing_thresholds:
          type: object
          properties:
            usage_gte:
              type: integer
              description: >-
                Usage threshold that triggers the subscription to create an
                invoice
          description: >-
            Define thresholds at which an invoice will be sent, and the related
            subscription advanced to a new billing period
          x-apifox-orders:
            - usage_gte
          deprecated: true
          x-apifox-ignore-properties: []
        created: &ref_30
          type: string
          description: >-
            Time at which the object was created. Measured in seconds since the
            Unix epoch.
        tax_rates:
          type: object
          properties: {}
          description: 未完成
          x-apifox-orders: []
          deprecated: true
          x-apifox-ignore-properties: []
      x-apifox-orders:
        - id
        - object
        - metadata
        - price
        - quantity
        - subscription
        - billing_thresholds
        - created
        - tax_rates
      x-apifox-ignore-properties: []
      x-apifox-folder: ''
    Subscription:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the object.
        object:
          type: string
          description: value is "subscription"
        cancel_at_period_end:
          type: boolean
          description: >-
            If the subscription has been canceled with the at_period_end flag
            set to true, cancel_at_period_end on the subscription will be true.
            You can use this attribute to determine whether a subscription that
            has a status of active is scheduled to be canceled at the end of the
            current period.
        currency:
          type: string
          description: >-
            Three-letter ISO currency code, in lowercase. Must be a supported
            currency.
        current_period_end:
          type: integer
          description: >-
            End of the current period that the subscription has been invoiced
            for. At the end of this period, a new invoice will be created.
        current_period_start:
          type: integer
          description: >-
            Start of the current period that the subscription has been invoiced
            for.
        customer:
          type: string
          description: EXPANDABLE. ID of the customer who owns the subscription.
        default_payment_method:
          type: string
          description: >-
            EXPANDABLE. ID of the default payment method for the subscription.
            It must belong to the customer associated with the subscription.
            This takes precedence over default_source. If neither are set,
            invoices will use the customer’s
            invoice_settings.default_payment_method or default_source.
          nullable: true
        description:
          type: string
          description: >-
            The subscription’s description, meant to be displayable to the
            customer. 
          nullable: true
        items:
          type: array
          items:
            type: object
            properties:
              id: *ref_23
              object: *ref_24
              metadata: *ref_25
              price:
                description: The price the customer is subscribed to.
                type: object
                x-apifox-refs: *ref_26
                x-apifox-orders: *ref_27
                properties:
                  id: *ref_1
                  object: *ref_2
                  active: *ref_3
                  billing_scheme:
                    type: string
                    description: >-
                      Describes how to compute the price per period. Either
                      per_unit or tiered
                    enum: *ref_4
                    x-apifox-enum:
                      - value: per_unit
                        name: ''
                        description: only per_unit is supported now.
                      - value: tiered
                        name: ''
                        description: ''
                  created: *ref_5
                  currency: *ref_6
                  livemode: *ref_7
                  lookup_key: *ref_8
                  metadata:
                    type: object
                    properties: {}
                    x-apifox-orders: *ref_9
                    description: >-
                      Set of key-value pairs that you can attach to an object.
                      This can be useful for storing additional information
                      about the object in a structured format.
                    x-apifox-ignore-properties: []
                  nickname: *ref_10
                  product: *ref_11
                  type:
                    type: string
                    description: >-
                      One of one_time or recurring depending on whether the
                      price is for a one-time purchase or a recurring
                      (subscription) purchase.
                    enum: *ref_12
                    x-apifox-enum:
                      - value: one_time
                        name: ''
                        description: only one-time is supported now.
                      - value: recurring
                        name: ''
                        description: ''
                  unit_amount: *ref_13
                  recurring:
                    type: object
                    properties:
                      interval:
                        type: string
                        description: >-
                          The frequency at which a subscription is billed. One
                          of day, week, month or year.
                        enum: *ref_14
                        x-apifox-enum:
                          - value: day
                            name: ''
                            description: ''
                          - value: week
                            name: ''
                            description: ''
                          - value: month
                            name: ''
                            description: ''
                          - value: year
                            name: ''
                            description: ''
                      interval_count: *ref_15
                      usage_type:
                        type: string
                        description: >-
                          Configures how the quantity per period should be
                          determined.
                        enum: *ref_16
                        x-apifox-enum:
                          - value: licensed
                            name: ''
                            description: ''
                    x-apifox-orders: *ref_17
                    description: The recurring components of a price
                    required:
                      - interval
                    x-apifox-ignore-properties: []
                  tiers_mode: *ref_18
                  tiers:
                    type: array
                    items:
                      type: object
                      properties:
                        up_to: *ref_19
                        flat_amount: *ref_20
                        unit_amount: *ref_21
                      x-apifox-orders: *ref_22
                      x-apifox-ignore-properties: []
                    description: （未实现）
                x-apifox-ignore-properties:
                  - id
                  - object
                  - active
                  - billing_scheme
                  - created
                  - currency
                  - livemode
                  - lookup_key
                  - metadata
                  - nickname
                  - product
                  - type
                  - unit_amount
                  - recurring
                  - tiers_mode
                  - tiers
              quantity: *ref_28
              subscription: *ref_29
              created: *ref_30
            x-apifox-orders:
              - 01JCFXF6EDSWAFKH5RRG0PXVDF
            x-apifox-refs:
              01JCFXF6EDSWAFKH5RRG0PXVDF: *ref_31
            x-apifox-ignore-properties:
              - id
              - object
              - metadata
              - price
              - quantity
              - subscription
              - created
        latest_invoice:
          type: string
          description: The most recent invoice this subscription has generated.
          nullable: true
        metadata:
          type: string
          description: >-
            Set of key-value pairs that you can attach to an object. This can be
            useful for storing additional information about the object in a
            structured format.
        pending_setup_intent:
          type: string
          description: >-
            Set of key-value pairs that you can attach to an object. This can be
            useful for storing additional information about the object in a
            structured format.
          nullable: true
        pending_update:
          type: object
          properties:
            billing_cycle_anchor:
              type: string
            expires_at:
              type: string
            subscription_items:
              type: string
            trial_end:
              type: string
            trial_from_plan:
              type: string
          description: >-
            You can use this SetupIntent to collect user authentication when
            creating a subscription without immediate payment or updating a
            subscription’s payment method, allowing you to optimize for
            off-session payments. Learn more in the SCA Migration Guide.
          x-apifox-orders:
            - billing_cycle_anchor
            - expires_at
            - subscription_items
            - trial_end
            - trial_from_plan
          x-apifox-ignore-properties: []
          nullable: true
        status:
          type: string
          description: >-
            Possible values are incomplete, incomplete_expired, trialing,
            active, past_due, canceled, or unpaid.
        cancel_at:
          type: integer
          description: >-
            A date in the future at which the subscription will automatically
            get canceled
          nullable: true
        canceled_at:
          type: integer
          description: >-
            If the subscription has been canceled, the date of that
            cancellation. If the subscription was canceled with
            cancel_at_period_end, canceled_at will reflect the time of the most
            recent update request, not the end of the subscription period when
            the subscription is automatically moved to a canceled state.
          nullable: true
        collection_method:
          type: string
          description: Either charge_automatically, or send_invoice.
        created:
          type: string
          description: >-
            Time at which the object was created. Measured in seconds since the
            Unix epoch.
        days_until_due:
          type: integer
          description: >-
            Number of days a customer has to pay invoices generated by this
            subscription. This value will be null for subscriptions where
            collection_method=charge_automatically.
          nullable: true
        default_source:
          type: string
          nullable: true
        start_date:
          type: integer
          description: >-
            Date when the subscription was first created. The date might differ
            from the created date due to backdating.
        ended_at:
          type: integer
          description: If the subscription has ended, the date the subscription ended.
        livemode:
          type: boolean
          description: >-
            Has the value true if the object exists in live mode or the value
            false if the object exists in test mode.
        next_pending_invoice_item_invoice:
          type: integer
          description: >-
            Timestamp. Specifies the approximate timestamp on which any pending
            invoice items will be billed according to the schedule provided at
            pending_invoice_item_interval.
          nullable: true
        payment_settings:
          type: object
          properties:
            payment_method_options: *ref_32
            payment_method_types:
              type: string
            save_default_payment_method:
              type: string
              description: 'Either off, or on_subscription. '
            pending_invoice_item_interval:
              type: object
              properties:
                interval:
                  type: string
                  description: >-
                    Specifies invoicing frequency. Either day, week, month or
                    year.
                interval_count:
                  type: string
                  description: >-
                    The number of intervals between invoices. For example,
                    interval=month and interval_count=3 bills every 3 months.
                    Maximum of one year interval allowed (1 year, 12 months, or
                    52 weeks).
              description: >-
                Specifies an interval for how often to bill for any pending
                invoice items. It is analogous to calling Create an invoice for
                the given subscription at the specified interval.
              x-apifox-orders:
                - interval
                - interval_count
              x-apifox-ignore-properties: []
            schedule:
              type: string
              description: The schedule attached to the subscription
          description: Payment settings passed on to invoices created by the subscription.
          x-apifox-orders:
            - payment_method_options
            - payment_method_types
            - save_default_payment_method
            - pending_invoice_item_interval
            - schedule
          x-apifox-ignore-properties: []
          nullable: true
        trial_start:
          type: integer
          description: If the subscription has a trial, the beginning of that trial.
          nullable: true
        trial_end:
          type: integer
          description: If the subscription has a trial, the end of that trial.
          nullable: true
        test_clock:
          type: string
          description: ID of the test clock this subscription belongs to.
          nullable: true
        billing_cycle_anchor:
          type: string
          description: >-
            Determines the date of the first full invoice, and, for plans with
            month or year intervals, the day of the month for subsequent
            invoices. The timestamp is in UTC format.
        billing_thresholds:
          type: object
          properties:
            amount_gte:
              type: string
            reset_billing_cycle_anchor:
              type: boolean
          description: >-
            Define thresholds at which an invoice will be sent, and the
            subscription advanced to a new billing period
          x-apifox-orders:
            - amount_gte
            - reset_billing_cycle_anchor
          deprecated: true
          x-apifox-ignore-properties: []
          nullable: true
        pending_invoice_item_interval:
          type: object
          properties:
            interval:
              type: string
              description: Specifies invoicing frequency. Either day, week, month or year.
            interval_count:
              type: integer
              description: >-
                The number of intervals between invoices. For example,
                interval=month and interval_count=3 bills every 3 months.
                Maximum of one year interval allowed (1 year, 12 months, or 52
                weeks).
          description: >-
            Specifies an interval for how often to bill for any pending invoice
            items. It is analogous to calling Create an invoice for the given
            subscription at the specified interval.
          x-apifox-orders:
            - interval
            - interval_count
          deprecated: true
          x-apifox-ignore-properties: []
          nullable: true
        pause_collection:
          type: object
          properties: {}
          x-apifox-orders: []
          deprecated: true
          x-apifox-ignore-properties: []
        cancellation_details:
          type: object
          properties: {}
          x-apifox-orders: []
          deprecated: true
          x-apifox-ignore-properties: []
        default_tax_rates:
          type: string
          deprecated: true
        trial_from_plan:
          type: string
          deprecated: true
        trial_settings:
          type: object
          properties: {}
          x-apifox-orders: []
          deprecated: true
          x-apifox-ignore-properties: []
      x-apifox-orders:
        - id
        - object
        - cancel_at_period_end
        - currency
        - current_period_end
        - current_period_start
        - customer
        - default_payment_method
        - description
        - items
        - latest_invoice
        - metadata
        - pending_setup_intent
        - pending_update
        - status
        - cancel_at
        - canceled_at
        - collection_method
        - created
        - days_until_due
        - default_source
        - start_date
        - ended_at
        - livemode
        - next_pending_invoice_item_invoice
        - payment_settings
        - trial_start
        - trial_end
        - test_clock
        - billing_cycle_anchor
        - billing_thresholds
        - pending_invoice_item_interval
        - pause_collection
        - cancellation_details
        - default_tax_rates
        - trial_from_plan
        - trial_settings
      x-apifox-ignore-properties: []
      x-apifox-folder: ''
  securitySchemes:
    basic:
      type: http
      scheme: basic
servers:
  - url: https://apitest.wooshpay.com
    description: 官网测试
security:
  - basic: []

```
