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

# Update Pricing Model



## OpenAPI

````yaml https://app.flowglad.com/api/openapi put /api/v1/pricing-models/{id}
openapi: 3.1.0
info:
  title: Flowglad API
  version: 0.0.1
servers:
  - url: https://app.flowglad.com
security: []
externalDocs:
  url: https://docs.flowglad.com
paths:
  /api/v1/pricing-models/{id}:
    put:
      tags:
        - Pricing Models
      summary: Update Pricing Model
      operationId: pricingModels-update
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                pricingModel:
                  type: object
                  properties:
                    id:
                      type: string
                    isDefault:
                      type: boolean
                    name:
                      description: The name of the pricing model
                      type: string
                      minLength: 1
                      maxLength: 255
                    features:
                      type: array
                      items:
                        description: >-
                          A feature that can be granted to a customer. Will be
                          associated with products.
                        oneOf:
                          - description: >-
                              A feature that can be granted in a true / false
                              boolean state. When granted to a customer, it will
                              return true.
                            type: object
                            properties:
                              type:
                                type: string
                                const: toggle
                              slug:
                                type: string
                                minLength: 1
                                maxLength: 255
                              name:
                                type: string
                              description:
                                type: string
                              active:
                                type: boolean
                            required:
                              - type
                              - slug
                              - name
                              - description
                          - description: A credit grant to give for a usage meter.
                            type: object
                            properties:
                              type:
                                type: string
                                const: usage_credit_grant
                              slug:
                                type: string
                                minLength: 1
                                maxLength: 255
                              name:
                                type: string
                              description:
                                type: string
                              amount:
                                description: A positive integer
                                type: integer
                                exclusiveMinimum: 0
                                maximum: 9007199254740991
                              renewalFrequency:
                                type: string
                                enum:
                                  - once
                                  - every_billing_period
                              active:
                                type: boolean
                              usageMeterSlug:
                                description: >-
                                  The slug of the usage meter to grant credit
                                  for. Must be a valid slug for a usage meter.
                                type: string
                            required:
                              - type
                              - slug
                              - name
                              - description
                              - amount
                              - renewalFrequency
                              - usageMeterSlug
                          - description: >-
                              A resource grant feature that allocates a specific
                              amount of a resource.
                            type: object
                            properties:
                              type:
                                type: string
                                const: resource
                              slug:
                                type: string
                                minLength: 1
                                maxLength: 255
                              name:
                                type: string
                              description:
                                type: string
                              amount:
                                description: A positive integer
                                type: integer
                                exclusiveMinimum: 0
                                maximum: 9007199254740991
                              active:
                                type: boolean
                              resourceSlug:
                                description: >-
                                  The slug of the resource to grant. Must be a
                                  valid slug for a resource in this pricing
                                  model.
                                type: string
                            required:
                              - type
                              - slug
                              - name
                              - description
                              - amount
                              - resourceSlug
                        type: object
                    products:
                      type: array
                      items:
                        type: object
                        properties:
                          product:
                            description: >-
                              The product to add to the pricingModel. Must be a
                              subset of the products in the pricingModel.
                            type: object
                            properties:
                              name:
                                description: The name of the product
                                type: string
                                minLength: 1
                                maxLength: 255
                              description:
                                anyOf:
                                  - type: string
                                  - type: 'null'
                              imageURL:
                                anyOf:
                                  - type: string
                                  - type: 'null'
                              active:
                                type: boolean
                              singularQuantityLabel:
                                anyOf:
                                  - type: string
                                  - type: 'null'
                              pluralQuantityLabel:
                                anyOf:
                                  - type: string
                                  - type: 'null'
                              default:
                                type: boolean
                              slug:
                                description: The slug of the product
                                type: string
                                minLength: 1
                                maxLength: 255
                            required:
                              - name
                              - active
                              - slug
                          price:
                            description: >-
                              The price for the product. Must have active=true
                              and isDefault=true.
                            oneOf:
                              - type: object
                                properties:
                                  intervalUnit:
                                    type: string
                                    enum:
                                      - day
                                      - week
                                      - month
                                      - year
                                  name:
                                    type: string
                                    minLength: 1
                                    maxLength: 255
                                  intervalCount:
                                    description: A positive integer
                                    type: integer
                                    exclusiveMinimum: 0
                                    maximum: 9007199254740991
                                  type:
                                    type: string
                                    const: subscription
                                  trialPeriodDays:
                                    description: >-
                                      The trial period in days. If the trial
                                      period is 0 or null, there will be no
                                      trial period.
                                    anyOf:
                                      - anyOf:
                                          - description: A positive integer
                                            type: integer
                                            exclusiveMinimum: 0
                                            maximum: 9007199254740991
                                          - type: number
                                            const: 0
                                      - type: 'null'
                                  isDefault:
                                    description: >-
                                      Whether or not this price is the default
                                      price. For product prices, this indicates
                                      the default price for that product. For
                                      usage prices, this indicates the default
                                      price for that usage meter.
                                    type: boolean
                                  unitPrice:
                                    description: >-
                                      The price per unit. This should be in the
                                      smallest unit of the currency. For
                                      example, if the currency is USD, GBP, CAD,
                                      EUR or SGD, the price should be in cents.
                                    anyOf:
                                      - description: A positive integer
                                        type: integer
                                        exclusiveMinimum: 0
                                        maximum: 9007199254740991
                                      - type: number
                                        const: 0
                                  usageEventsPerUnit:
                                    description: Omitted.
                                    type: 'null'
                                  active:
                                    type: boolean
                                  slug:
                                    type: string
                                    minLength: 1
                                    maxLength: 255
                                  usageMeterId:
                                    description: Omitted.
                                    type: 'null'
                                  currency:
                                    $ref: '#/components/schemas/CurrencyCode'
                                required:
                                  - intervalUnit
                                  - intervalCount
                                  - type
                                  - isDefault
                                  - unitPrice
                              - type: object
                                properties:
                                  intervalUnit:
                                    description: Omitted.
                                    type: 'null'
                                  name:
                                    type: string
                                    minLength: 1
                                    maxLength: 255
                                  intervalCount:
                                    description: Omitted.
                                    type: 'null'
                                  type:
                                    type: string
                                    const: single_payment
                                  trialPeriodDays:
                                    description: Omitted.
                                    type: 'null'
                                  isDefault:
                                    description: >-
                                      Whether or not this price is the default
                                      price. For product prices, this indicates
                                      the default price for that product. For
                                      usage prices, this indicates the default
                                      price for that usage meter.
                                    type: boolean
                                  unitPrice:
                                    description: >-
                                      The price per unit. This should be in the
                                      smallest unit of the currency. For
                                      example, if the currency is USD, GBP, CAD,
                                      EUR or SGD, the price should be in cents.
                                    anyOf:
                                      - description: A positive integer
                                        type: integer
                                        exclusiveMinimum: 0
                                        maximum: 9007199254740991
                                      - type: number
                                        const: 0
                                  usageEventsPerUnit:
                                    description: Omitted.
                                    type: 'null'
                                  active:
                                    type: boolean
                                  slug:
                                    type: string
                                    minLength: 1
                                    maxLength: 255
                                  usageMeterId:
                                    description: Omitted.
                                    type: 'null'
                                  currency:
                                    $ref: '#/components/schemas/CurrencyCode'
                                required:
                                  - type
                                  - isDefault
                                  - unitPrice
                            type: object
                          features:
                            description: >-
                              The slugs of the features that will granted when
                              they purchase the product. Must be a subset of the
                              slugs of the features in the pricingModel.
                            type: array
                            items:
                              type: string
                        required:
                          - product
                          - price
                          - features
                    usageMeters:
                      type: array
                      items:
                        type: object
                        properties:
                          usageMeter:
                            $ref: '#/components/schemas/UsageMeterClientInsertSchema'
                            description: >-
                              The usage meter configuration. Each dimension
                              along which usage will be tracked needs its own
                              meter.
                          prices:
                            description: >-
                              The prices for this usage meter. Each price
                              defines how usage on this meter is billed.
                            type: array
                            items:
                              type: object
                              properties:
                                intervalUnit:
                                  type: string
                                  enum:
                                    - day
                                    - week
                                    - month
                                    - year
                                name:
                                  type: string
                                  minLength: 1
                                  maxLength: 255
                                intervalCount:
                                  description: A positive integer
                                  type: integer
                                  exclusiveMinimum: 0
                                  maximum: 9007199254740991
                                type:
                                  type: string
                                  const: usage
                                trialPeriodDays:
                                  description: Omitted.
                                  type: 'null'
                                isDefault:
                                  description: >-
                                    Whether or not this price is the default
                                    price. For product prices, this indicates
                                    the default price for that product. For
                                    usage prices, this indicates the default
                                    price for that usage meter.
                                  type: boolean
                                unitPrice:
                                  description: >-
                                    The price per unit. This should be in the
                                    smallest unit of the currency. For example,
                                    if the currency is USD, GBP, CAD, EUR or
                                    SGD, the price should be in cents.
                                  anyOf:
                                    - description: A positive integer
                                      type: integer
                                      exclusiveMinimum: 0
                                      maximum: 9007199254740991
                                    - type: number
                                      const: 0
                                usageEventsPerUnit:
                                  description: >-
                                    The number of usage events per unit. Used to
                                    determine how to map usage events to
                                    quantities when raising invoices for usage.
                                  type: integer
                                  exclusiveMinimum: 0
                                  maximum: 9007199254740991
                                active:
                                  type: boolean
                                slug:
                                  type: string
                                  minLength: 1
                                  maxLength: 255
                                currency:
                                  $ref: '#/components/schemas/CurrencyCode'
                              required:
                                - intervalUnit
                                - intervalCount
                                - type
                                - isDefault
                                - unitPrice
                                - usageEventsPerUnit
                        required:
                          - usageMeter
                    resources:
                      type: array
                      items:
                        description: >-
                          A resource that can be claimed by subscriptions via
                          resource features.
                        type: object
                        properties:
                          slug:
                            description: The slug of the resource
                            type: string
                            minLength: 1
                            maxLength: 255
                          name:
                            description: The name of the resource
                            type: string
                            minLength: 1
                            maxLength: 255
                          active:
                            type: boolean
                        required:
                          - slug
                          - name
                  required:
                    - id
                    - name
              required:
                - pricingModel
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  pricingModel:
                    $ref: '#/components/schemas/PricingModelClientSelectSchema'
                required:
                  - pricingModel
                additionalProperties: false
        '400':
          description: Invalid input data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.BAD_REQUEST'
        '401':
          description: Authorization not provided
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.UNAUTHORIZED'
        '403':
          description: Insufficient access
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.FORBIDDEN'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.NOT_FOUND'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.INTERNAL_SERVER_ERROR'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    CurrencyCode:
      description: Currency code
      type: string
      enum:
        - USD
        - AED
        - AFN
        - ALL
        - AMD
        - ANG
        - AOA
        - ARS
        - AUD
        - AWG
        - AZN
        - BAM
        - BBD
        - BDT
        - BGN
        - BIF
        - BMD
        - BND
        - BOB
        - BRL
        - BSD
        - BWP
        - BYN
        - BZD
        - CAD
        - CDF
        - CHF
        - CLP
        - CNY
        - COP
        - CRC
        - CVE
        - CZK
        - DJF
        - DKK
        - DOP
        - DZD
        - EGP
        - ETB
        - EUR
        - FJD
        - FKP
        - GBP
        - GEL
        - GIP
        - GMD
        - GNF
        - GTQ
        - GYD
        - HKD
        - HNL
        - HTG
        - HUF
        - IDR
        - ILS
        - INR
        - ISK
        - JMD
        - JPY
        - KES
        - KGS
        - KHR
        - KMF
        - KRW
        - KYD
        - KZT
        - LAK
        - LBP
        - LKR
        - LRD
        - LSL
        - MAD
        - MDL
        - MGA
        - MKD
        - MMK
        - MNT
        - MOP
        - MUR
        - MVR
        - MWK
        - MXN
        - MYR
        - MZN
        - NAD
        - NGN
        - NIO
        - NOK
        - NPR
        - NZD
        - PAB
        - PEN
        - PGK
        - PHP
        - PKR
        - PLN
        - PYG
        - QAR
        - RON
        - RSD
        - RUB
        - RWF
        - SAR
        - SBD
        - SCR
        - SEK
        - SGD
        - SHP
        - SLE
        - SOS
        - SRD
        - STD
        - SZL
        - THB
        - TJS
        - TOP
        - TRY
        - TTD
        - TWD
        - TZS
        - UAH
        - UGX
        - UYU
        - UZS
        - VND
        - VUV
        - WST
        - XAF
        - XCD
        - XOF
        - XPF
        - YER
        - ZAR
        - ZMW
    UsageMeterClientInsertSchema:
      type: object
      properties:
        name:
          type: string
        slug:
          type: string
        aggregationType:
          description: >-
            The type of aggregation to perform on the usage meter. Defaults to
            "sum", which aggregates all the usage event amounts for the billing
            period. "count_distinct_properties" counts the number of distinct
            properties in the billing period for a given meter.
          type: string
          enum:
            - sum
            - count_distinct_properties
      required:
        - name
        - slug
    PricingModelClientSelectSchema:
      type: object
      properties:
        id:
          type: string
        createdAt:
          description: Epoch milliseconds.
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        updatedAt:
          description: Epoch milliseconds.
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        livemode:
          type: boolean
        organizationId:
          type: string
        isDefault:
          type: boolean
        name:
          type: string
      required:
        - id
        - createdAt
        - updatedAt
        - livemode
        - organizationId
        - isDefault
        - name
      additionalProperties: false
    error.BAD_REQUEST:
      title: Invalid input data error (400)
      description: The error information
      example:
        code: BAD_REQUEST
        message: Invalid input data
        issues: []
      type: object
      properties:
        message:
          description: The error message
          example: Invalid input data
          type: string
        code:
          description: The error code
          example: BAD_REQUEST
          type: string
        issues:
          description: An array of issues that were responsible for the error
          example: []
          type: array
          items:
            type: object
            properties:
              message:
                type: string
            required:
              - message
            additionalProperties: false
      required:
        - message
        - code
      additionalProperties: false
    error.UNAUTHORIZED:
      title: Authorization not provided error (401)
      description: The error information
      example:
        code: UNAUTHORIZED
        message: Authorization not provided
        issues: []
      type: object
      properties:
        message:
          description: The error message
          example: Authorization not provided
          type: string
        code:
          description: The error code
          example: UNAUTHORIZED
          type: string
        issues:
          description: An array of issues that were responsible for the error
          example: []
          type: array
          items:
            type: object
            properties:
              message:
                type: string
            required:
              - message
            additionalProperties: false
      required:
        - message
        - code
      additionalProperties: false
    error.FORBIDDEN:
      title: Insufficient access error (403)
      description: The error information
      example:
        code: FORBIDDEN
        message: Insufficient access
        issues: []
      type: object
      properties:
        message:
          description: The error message
          example: Insufficient access
          type: string
        code:
          description: The error code
          example: FORBIDDEN
          type: string
        issues:
          description: An array of issues that were responsible for the error
          example: []
          type: array
          items:
            type: object
            properties:
              message:
                type: string
            required:
              - message
            additionalProperties: false
      required:
        - message
        - code
      additionalProperties: false
    error.NOT_FOUND:
      title: Not found error (404)
      description: The error information
      example:
        code: NOT_FOUND
        message: Not found
        issues: []
      type: object
      properties:
        message:
          description: The error message
          example: Not found
          type: string
        code:
          description: The error code
          example: NOT_FOUND
          type: string
        issues:
          description: An array of issues that were responsible for the error
          example: []
          type: array
          items:
            type: object
            properties:
              message:
                type: string
            required:
              - message
            additionalProperties: false
      required:
        - message
        - code
      additionalProperties: false
    error.INTERNAL_SERVER_ERROR:
      title: Internal server error error (500)
      description: The error information
      example:
        code: INTERNAL_SERVER_ERROR
        message: Internal server error
        issues: []
      type: object
      properties:
        message:
          description: The error message
          example: Internal server error
          type: string
        code:
          description: The error code
          example: INTERNAL_SERVER_ERROR
          type: string
        issues:
          description: An array of issues that were responsible for the error
          example: []
          type: array
          items:
            type: object
            properties:
              message:
                type: string
            required:
              - message
            additionalProperties: false
      required:
        - message
        - code
      additionalProperties: false
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization

````