openapi: 3.0.3
info:
  title: 'Profiles, Billing and Access Control API Reference'
  version: 2024.03.15
paths:
  /api:
    get:
      operationId: root_retrieve
      description: |2+

        Retrieves version of the API

      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Version'
          description: ''
      summary: API version
      tags:
      - visitor
  /api/accounts:
    get:
      operationId: accounts_list
      description: |2+

        Returns a list of 5 candidate profiles
        or user accounts based of a search criteria (``q``).

        The API is designed to be used in typeahead input fields. As such
        it only returns results when the number of candidates is less
        than 5.

        If you need to list all profiles, please see
        `Lists billing profiles </docs/api/#listOrganization>`_

        The queryset can be further refined by a range of dates
        ([``start_at``, ``ends_at``]), and sorted on specific fields (``o``).

        The API is typically used in pages for the support team to quickly
        locate an account. For example, it is used within the HTML
        `provider dashboard page </docs/guides/themes/#dashboard_metrics_dashboard>`_
        as present in the default theme.

      parameters:
      - name: ends_at
        required: false
        in: query
        description: date/time in ISO 8601 format
        schema:
          type: string
      - name: o
        required: false
        in: query
        description: sort by full_name, created_at. If a field is preceded by a minus
          sign ('-'), the order will be reversed. Multiple 'o' parameters can be specified
          to produce a stable result.
        schema:
          type: string
      - name: q
        required: false
        in: query
        description: value to search for in the fields specified by q_f
        schema:
          type: string
      - name: q_f
        required: false
        in: query
        description: 'restrict searches to one or more fields in: slug, full_name,
          email, phone, street_address, locality, region, postal_code, country, username,
          first_name, last_name. searches all fields when unspecified.'
        schema:
          type: string
      - name: start_at
        required: false
        in: query
        description: date/time in ISO 8601 format
        schema:
          type: string
      tags:
      - profile
      - user
      - list
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TypeaheadOrganizationList'
          description: ''
      summary: Searches profile and user accounts
  /api/accounts/profiles:
    get:
      operationId: accounts_profiles_list
      description: |2+

        Returns a list of 5 candidate profiles
        based of a search criteria (``q``).

        The API is designed to be used in typeahead input fields. As such
        it only returns results when the number of candidates is less
        than 5.

        If you need to list all profiles, please see
        `Lists billing profiles </docs/api/#listOrganization>`_

        The queryset can be further refined by a range of dates
        ([``start_at``, ``ends_at``]), and sorted on specific fields (``o``).

        The API is typically used within an HTML
        `connected profiles page </docs/guides/themes/#dashboard_users_roles>`_
        as present in the default theme.

      parameters:
      - name: ends_at
        required: false
        in: query
        description: date/time in ISO 8601 format
        schema:
          type: string
      - name: o
        required: false
        in: query
        description: sort by full_name, created_at. If a field is preceded by a minus
          sign ('-'), the order will be reversed. Multiple 'o' parameters can be specified
          to produce a stable result.
        schema:
          type: string
      - name: q
        required: false
        in: query
        description: value to search for in the fields specified by q_f
        schema:
          type: string
      - name: q_f
        required: false
        in: query
        description: 'restrict searches to one or more fields in: slug, full_name,
          email, phone, street_address, locality, region, postal_code, country, username,
          first_name, last_name. searches all fields when unspecified.'
        schema:
          type: string
      - name: start_at
        required: false
        in: query
        description: date/time in ISO 8601 format
        schema:
          type: string
      tags:
      - profile
      - user
      - list
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TypeaheadOrganizationList'
          description: ''
      summary: Searches profiles
    post:
      operationId: accounts_profiles_create
      description: |2+

        Creates a profile that is not associated to any user.

      tags:
      - profile
      - user
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrganizationCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/OrganizationCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/OrganizationCreate'
        required: true
      security:
      - {}
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrganizationDetail'
          description: ''
      summary: Creates a shadow profile
  /api/accounts/profiles/{profile}:
    get:
      operationId: accounts_profiles_retrieve
      description: |2+

        While the `profiles typeahead <#listProfilesTypeahead>`_ API returns
        a list of profiles summary based on search criteria, if you already
        know the unique slug of a profile, you can get the same summary
        by using this API.

      parameters:
      - in: path
        name: profile
        schema:
          type: string
        required: true
      tags:
      - profile
      - subscriber
      - profilemodel
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Organization'
          description: ''
      summary: Retrieves a profile summary
  /api/accounts/users:
    get:
      operationId: accounts_users_list
      description: |2+

        Returns a list of 5 candidate users
        based of a search criteria (``q``).

        The API is designed to be used in typeahead input fields. As such
        it only returns results when the number of candidates is less
        than 5.

        If you need to list all users, please see
        `Lists user accounts </docs/api/#listUserListCreate>`_

        The queryset can be further refined by a range of dates
        ([``start_at``, ``ends_at``]), and sorted on specific fields (``o``).

        The API is typically used within an HTML
        `profile role page </docs/guides/themes/#dashboard_profile_roles>`_
        as present in the default theme.

      parameters:
      - name: ends_at
        required: false
        in: query
        description: date/time in ISO 8601 format
        schema:
          type: string
      - name: o
        required: false
        in: query
        description: sort by first_name, last_name, email, created_at. If a field
          is preceded by a minus sign ('-'), the order will be reversed. Multiple
          'o' parameters can be specified to produce a stable result.
        schema:
          type: string
      - name: q
        required: false
        in: query
        description: value to search for in the fields specified by q_f
        schema:
          type: string
      - name: q_f
        required: false
        in: query
        description: 'restrict searches to one or more fields in: username, first_name,
          last_name, email, slug, full_name. searches all fields when unspecified.'
        schema:
          type: string
      - name: start_at
        required: false
        in: query
        description: date/time in ISO 8601 format
        schema:
          type: string
      tags:
      - profile
      - user
      - list
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TypeaheadUserList'
          description: ''
      summary: Searches users
  /api/agreements:
    get:
      operationId: agreements_list
      description: |2+

        List all legal agreements a user might be requested to sign.
        This is a convenience API for authenticated broker profile managers.
        For listing legal agreements publicly, see
        `GET /api/legal <#listAgreement>`_.

      parameters:
      - name: o
        required: false
        in: query
        description: sort by title, updated_at. If a field is preceded by a minus
          sign ('-'), the order will be reversed. Multiple 'o' parameters can be specified
          to produce a stable result.
        schema:
          type: string
      - name: page
        required: false
        in: query
        description: A page number within the paginated result set.
        schema:
          type: integer
      - name: page_size
        required: false
        in: query
        description: Number of results to return per page between 1 and 100 (defaults
          to 25).
        schema:
          type: integer
      - name: q
        required: false
        in: query
        description: value to search for in the fields specified by q_f
        schema:
          type: string
      - name: q_f
        required: false
        in: query
        description: 'restrict searches to one or more fields in: slug, title. searches
          all fields when unspecified.'
        schema:
          type: string
      tags:
      - broker
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedAgreementList'
          description: ''
      summary: List legal agreements (broker)
    post:
      operationId: agreements_create
      description: |2+

        Creates a new legal agreement a user might be requested to sign.

        All users visiting an URL decorated with an "Agreed to {agreement}"
        access control rule will be prompted to sign the agreement.

      tags:
      - broker
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AgreementCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/AgreementCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/AgreementCreate'
        required: true
      security:
      - {}
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Agreement'
          description: ''
      summary: Creates a legal agreement
  /api/agreements/{document}:
    get:
      operationId: agreements_retrieve
      description: |2+

        Retrieves the text of legal agreement a user might be requested to sign.
        This is a convenience API for authenticated broker profile managers.
        For retrieving the text of a legal agreement publicly, see
        `GET /api/legal/{agreement} <#retrieveAgreementDetail>`_.

      parameters:
      - in: path
        name: document
        schema:
          type: string
        required: true
      tags:
      - broker
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgreementDetail'
          description: ''
      summary: Retrieves a legal agreement (broker)
    put:
      operationId: agreements_update
      description: |2+

        Updates the latest modification date of a legal agreement a user might
        be requested to sign.

        All users visiting an URL decorated with an "Agreed to {agreement}"
        access control rule will be prompted to sign the agreement again
        if the last time they signed is older that the `updated_at` date set
        here.

      parameters:
      - in: path
        name: document
        schema:
          type: string
        required: true
      tags:
      - broker
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AgreementUpdate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/AgreementUpdate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/AgreementUpdate'
        required: true
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgreementDetail'
          description: ''
      summary: Updates a legal agreement
    patch:
      operationId: agreements_partial_update
      description: |2+

        Retrieves the text of legal agreement a user might be requested to sign.
        This is a convenience API for authenticated broker profile managers.
        For retrieving the text of a legal agreement publicly, see
        `GET /api/legal/{agreement} <#retrieveAgreementDetail>`_.

      parameters:
      - in: path
        name: document
        schema:
          type: string
        required: true
      tags:
      - broker
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedAgreementUpdate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedAgreementUpdate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedAgreementUpdate'
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgreementDetail'
          description: ''
      summary: Retrieves a legal agreement (broker)
    delete:
      operationId: agreements_destroy
      description: |2+

        Deletes a legal agreement a user might be requested to sign.

        This will remove the agreement as well as all user signatures of it.

      parameters:
      - in: path
        name: document
        schema:
          type: string
        required: true
      tags:
      - broker
      security:
      - {}
      responses:
        '204':
          description: No response body
      summary: Deletes a legal agreement
  /api/auth:
    post:
      operationId: auth_create
      description: |2+

        Returns a JSON Web Token that can be used in HTTP requests that require
        authentication.

        The API is typically used within an HTML
        `login page </docs/guides/themes/#workflow_login>`_
        as present in the default theme.

      parameters:
      - in: query
        name: cookie
        schema:
          type: boolean
          nullable: true
        description: True when a cookie session should additionally be created
      tags:
      - visitor
      - auth
      - usermodel
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Credentials'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Credentials'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Credentials'
        required: true
      security:
      - {}
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Token'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
          description: ''
      summary: Authenticates a user
  /api/auth/activate/{verification_key}:
    get:
      operationId: auth_activate_retrieve
      description: |2+

        Retrieves information about a contact or user associated
        to the activation key.

        This API is typically used to pre-populate a registration form
        when a user was invited to the site by another user.

        The response is usually presented in an HTML
        `activate page </docs/guides/themes/#workflow_activate>`_
        as present in the default theme.

      parameters:
      - in: path
        name: verification_key
        schema:
          type: string
          pattern: ^[a-f0-9]{40}$
        required: true
      tags:
      - visitor
      - auth
      - usermodel
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserDetail'
          description: ''
      summary: Retrieves contact from an activation key
    post:
      operationId: auth_activate_create
      description: |2+

        Activates a new user and returns a JSON Web Token that can subsequently
        be used to authenticate the new user in HTTP requests.

      parameters:
      - in: query
        name: cookie
        schema:
          type: boolean
          nullable: true
        description: True when a cookie session should additionally be created
      - in: path
        name: verification_key
        schema:
          type: string
          pattern: ^[a-f0-9]{40}$
        required: true
      tags:
      - visitor
      - auth
      - usermodel
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserActivate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/UserActivate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/UserActivate'
        required: true
      security:
      - {}
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Token'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
          description: ''
      summary: Activates a user
  /api/auth/logout:
    post:
      operationId: auth_logout_create
      description: |2+

        Removes all cookies associated with the session.

        This API endpoint is only useful when the user is using Cookie-based
        authentication. Tokens expire; they cannot be revoked.

      tags:
      - user
      - auth
      - usermodel
      security:
      - {}
      responses:
        '200':
          description: No response body
      summary: Logs a user out
  /api/auth/recover:
    post:
      operationId: auth_recover_create
      description: |2+

        Sends a one time code to verify an e-mail or phone number.

        The user is uniquely identified by her email address or phone number.

        The API is typically used within an HTML
        `recover credentials page </docs/guides/themes/#workflow_recover>`_
        as present in the default theme.

      tags:
      - visitor
      - auth
      - usermodel
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Recover'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Recover'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Recover'
        required: true
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Recover'
          description: ''
      summary: Sends a verification link
  /api/auth/register:
    post:
      operationId: auth_register_create
      description: |2+

        Creates a new user and returns a JSON Web Token that can subsequently
        be used to authenticate the new user in HTTP requests.

        The API is typically used within an HTML
        `register page </docs/guides/themes/#workflow_register>`_
        as present in the default theme.

      parameters:
      - in: query
        name: cookie
        schema:
          type: boolean
          nullable: true
        description: True when a cookie session should additionally be created
      tags:
      - visitor
      - auth
      - usermodel
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Register'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Register'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Register'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Token'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
          description: ''
      summary: Registers a user
  /api/auth/reset/{verification_key}:
    post:
      operationId: auth_reset_create
      description: |2+

        Resets a user password, hence triggering an activation
        workflow the next time a user attempts to login.

      parameters:
      - in: path
        name: verification_key
        schema:
          type: string
          pattern: ^[a-f0-9]{40}$
        required: true
      tags:
      - visitor
      - auth
      - usermodel
      security:
      - {}
      responses:
        '201':
          description: No response body
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
          description: ''
      summary: Resets a user password
  /api/auth/tokens:
    post:
      operationId: auth_tokens_create
      description: |2+

        Refreshes a JSON Web Token by verifying the token and creating
        a new one that expires further in the future.

        The authenticated user and the user associated to the token should be
        identical.

      tags:
      - user
      - auth
      - usermodel
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Token'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Token'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Token'
        required: true
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Token'
          description: ''
      summary: Refreshes a JSON Web Token
  /api/auth/tokens/realms/{profile}:
    get:
      operationId: auth_tokens_realms_retrieve
      description: |2

        Gets temporary credentials to access S3 directly from the browser.
      parameters:
      - in: path
        name: profile
        schema:
          type: string
          pattern: ^[-a-zA-Z0-9_]+$
        required: true
      tags: []
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthRealms'
          description: ''
      summary: Retrieves temporary credentials
  /api/auth/tokens/verify:
    post:
      operationId: auth_tokens_verify_create
      description: |2+

        The authenticated user and the user associated to the token should be
        identical.

      tags:
      - user
      - auth
      - usermodel
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Token'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Token'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Token'
        required: true
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Token'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
          description: ''
      summary: Verifies a JSON Web Token
  /api/billing/{profile}/balance:
    get:
      operationId: billing_balance_list
      description: |2+

        Get the statement balance due for a billing profile.

      parameters:
      - name: ends_at
        required: false
        in: query
        description: date/time in ISO 8601 format
        schema:
          type: string
      - name: o
        required: false
        in: query
        description: sort by description, amount, dest_profile, dest_profile__full_name,
          dest_account, orig_profile, orig_profile__full_name, orig_account, created_at.
          If a field is preceded by a minus sign ('-'), the order will be reversed.
          Multiple 'o' parameters can be specified to produce a stable result.
        schema:
          type: string
      - name: page
        required: false
        in: query
        description: A page number within the paginated result set.
        schema:
          type: integer
      - name: page_size
        required: false
        in: query
        description: Number of results to return per page between 1 and 100 (defaults
          to 25).
        schema:
          type: integer
      - in: path
        name: profile
        schema:
          type: string
        required: true
      - name: q
        required: false
        in: query
        description: value to search for in the fields specified by q_f
        schema:
          type: string
      - name: q_f
        required: false
        in: query
        description: 'restrict searches to one or more fields in: description, dest_profile,
          dest_profile__full_name, orig_profile, orig_profile__full_name. searches
          all fields when unspecified.'
        schema:
          type: string
      - name: start_at
        required: false
        in: query
        description: date/time in ISO 8601 format
        schema:
          type: string
      tags:
      - subscriber
      - billing
      - transactionmodel
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedTransactionList'
          description: ''
      summary: Retrieves a customer balance
    post:
      operationId: billing_balance_create
      description: |2+

        This API endpoint can be used to add use charges to a subscriber
        invoice while charging the subscriber at a later date.

      parameters:
      - in: path
        name: profile
        schema:
          type: string
        required: true
      tags:
      - subscriber
      - billing
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CartItemCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CartItemCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CartItemCreate'
        required: true
      security:
      - {}
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Transaction'
          description: ''
      summary: Adds to the order balance
    delete:
      operationId: billing_balance_destroy
      description: |2+

        Cancel the balance due by profile. This will create
        a transaction for this balance cancellation. A provider manager can
        use this endpoint to cancel balance dues that is known impossible
        to be recovered (e.g. an external bank or credit card company
        act).

      parameters:
      - in: path
        name: profile
        schema:
          type: string
        required: true
      tags:
      - provider
      - billing
      - transactionmodel
      security:
      - {}
      responses:
        '204':
          description: No response body
      summary: Cancels a balance due
  /api/billing/{profile}/bank:
    get:
      operationId: billing_bank_retrieve
      description: |2+

        Pass through that calls the payment processor API to retrieve some details
        about the deposit account associated to a provider (if that information is
        available through the `payment processor backend <http://djaodjin-saas.readthedocs.io/en/latest/backends.html>`_ API).

        This API does not trigger payment of a subscriber to a provider. Checkout
        of a subscription cart is done either through the
        `HTML page </docs/guides/themes/#workflow_billing_cart>`_ or
        `API end point <#createCheckout>`_.

      parameters:
      - in: path
        name: profile
        schema:
          type: string
        required: true
      tags:
      - profilemodel
      - provider
      - billing
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Bank'
          description: ''
      summary: Retrieves a payout account
  /api/billing/{profile}/card:
    get:
      operationId: billing_card_retrieve
      description: |2+

        Pass through to the payment processor to retrieve some details about
        the payment method (ex: credit card) associated to a subscriber.

        When you wish to update the payment method on file through
        a Strong Customer Authentication (SCA) workflow, the payment processor
        will require a token generated by the server. That token can be retrieved
        in the processor.STRIPE_INTENT_SECRET field when the API is called
        with `?update=1` query parameters.

        The API is typically used within an HTML
        `update payment method page </docs/guides/themes/#dashboard_billing_card>`_
        as present in the default theme.

      parameters:
      - in: path
        name: profile
        schema:
          type: string
        required: true
      - in: query
        name: update
        schema:
          type: boolean
        description: Adds context to update a payment method on file.
      tags:
      - profilemodel
      - subscriber
      - billing
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Card'
          description: ''
      summary: Retrieves a payment method
    put:
      operationId: billing_card_update
      description: |2+

        Pass through to the payment processor to update some details about
        the payment method (ex: credit card) associated to a subscriber.

        The API is typically used within an HTML
        `update payment method page </docs/guides/themes/#dashboard_billing_card>`_
        as present in the default theme.

      parameters:
      - in: path
        name: profile
        schema:
          type: string
        required: true
      tags:
      - profilemodel
      - subscriber
      - billing
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CardToken'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CardToken'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CardToken'
        required: true
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Card'
          description: ''
      summary: Updates a payment method
    patch:
      operationId: billing_card_partial_update
      description: |2+

        Pass through to the payment processor to retrieve some details about
        the payment method (ex: credit card) associated to a subscriber.

        When you wish to update the payment method on file through
        a Strong Customer Authentication (SCA) workflow, the payment processor
        will require a token generated by the server. That token can be retrieved
        in the processor.STRIPE_INTENT_SECRET field when the API is called
        with `?update=1` query parameters.

        The API is typically used within an HTML
        `update payment method page </docs/guides/themes/#dashboard_billing_card>`_
        as present in the default theme.

      parameters:
      - in: path
        name: profile
        schema:
          type: string
        required: true
      tags:
      - profilemodel
      - subscriber
      - billing
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedCard'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedCard'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedCard'
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Card'
          description: ''
      summary: Retrieves a payment method
    delete:
      operationId: billing_card_destroy
      description: |2+

        Pass through to the payment processor to remove the payment method
        (ex: credit card) associated to a subscriber.

        The API is typically used within an HTML
        `update payment method page </docs/guides/themes/#dashboard_billing_card>`_
        as present in the default theme.

      parameters:
      - in: path
        name: profile
        schema:
          type: string
        required: true
      tags:
      - profilemodel
      - subscriber
      - billing
      security:
      - {}
      responses:
        '204':
          description: No response body
      summary: Deletes a payment method
  /api/billing/{profile}/charges/{charge}:
    get:
      operationId: billing_charges_retrieve
      description: |2+

        Pass through to the processor and returns details about a ``Charge``.

      parameters:
      - in: path
        name: charge
        schema:
          type: string
        required: true
      - in: path
        name: profile
        schema:
          type: string
        required: true
      tags:
      - subscriber
      - chargemodel
      - billing
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Charge'
          description: ''
      summary: Retrieves a processor charge
  /api/billing/{profile}/charges/{charge}/email:
    post:
      operationId: billing_charges_email_create
      description: |2+

        Email the charge receipt to the customer email address on file.

        The service sends a duplicate e-mail receipt for charge `ch_XAb124EF`
        to the e-mail address of the customer, i.e. `joe@localhost.localdomain`.

      parameters:
      - in: path
        name: charge
        schema:
          type: string
        required: true
      - in: path
        name: profile
        schema:
          type: string
        required: true
      tags:
      - subscriber
      - chargemodel
      - billing
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmailChargeReceipt'
          description: ''
      summary: Re-sends a charge receipt
  /api/billing/{profile}/charges/{charge}/refund:
    post:
      operationId: billing_charges_refund_create
      description: |2+

        Partially or totally refund all or a subset of line items on a ``Charge``.

      parameters:
      - in: path
        name: charge
        schema:
          type: string
        required: true
      - in: path
        name: profile
        schema:
          type: string
        required: true
      tags:
      - provider
      - chargemodel
      - billing
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RefundCharge'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/RefundCharge'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/RefundCharge'
        required: true
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Charge'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
          description: ''
      summary: Refunds a processor charge
  /api/billing/{profile}/checkout:
    get:
      operationId: billing_checkout_retrieve
      description: |2+

        Get a list indexed by plans of items that will be charged
        (`lines`) and options that could be charged instead.

        In many subscription businesses, it is possible to buy multiple
        period in advance at a discount. The options reflects that.

        The API is typically used within an HTML
        `checkout page </docs/guides/themes/#workflow_billing_cart>`_
        as present in the default theme.

      parameters:
      - in: path
        name: profile
        schema:
          type: string
        required: true
      tags:
      - cartmodel
      - subscriber
      - billing
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrganizationCart'
          description: ''
      summary: Retrieves a cart for checkout
    post:
      operationId: billing_checkout_create
      description: |2+

        Places an order for the subscription items in the cart and creates
        a ``Charge`` on the billing profile payment method.

        If the charge fails a balance is due, to be collected later.

        The cart is manipulated through various API endpoints:

        - `Redeems a discount code </docs/api/#createCouponRedeem>`_ applies a coupon code for a potential discount, and
        - `Adds an item to the request user cart </docs/api/#createCartItem>`_, `Removes an item from the request user cart </docs/api/#destroyCartItem>`_ to update a cart.

        The API is typically used within an HTML
        `checkout page </docs/guides/themes/#workflow_billing_cart>`_
        as present in the default theme.

      parameters:
      - in: path
        name: profile
        schema:
          type: string
        required: true
      tags:
      - cartmodel
      - subscriber
      - billing
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Checkout'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Checkout'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Checkout'
      security:
      - {}
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Charge'
          description: ''
      summary: Checkouts a cart
  /api/billing/{profile}/coupons:
    get:
      operationId: billing_coupons_list
      description: |2+

        Returns a list of `page_size` coupons created by a provider profile.

        The queryset can be further refined to match a search filter (``q``)
        and/or a range of dates ([``start_at``, ``ends_at``]),
        and sorted on specific fields (``o``).

        The API is typically used within an HTML
        `coupons page </docs/guides/themes/#dashboard_billing_coupons>`_
        as present in the default theme.

      parameters:
      - name: ends_at
        required: false
        in: query
        description: date/time in ISO 8601 format
        schema:
          type: string
      - name: o
        required: false
        in: query
        description: sort by amount, code, created_at, description, ends_at, discount_type,
          profile, profile__full_name. If a field is preceded by a minus sign ('-'),
          the order will be reversed. Multiple 'o' parameters can be specified to
          produce a stable result.
        schema:
          type: string
      - name: page
        required: false
        in: query
        description: A page number within the paginated result set.
        schema:
          type: integer
      - name: page_size
        required: false
        in: query
        description: Number of results to return per page between 1 and 100 (defaults
          to 25).
        schema:
          type: integer
      - in: path
        name: profile
        schema:
          type: string
        required: true
      - name: q
        required: false
        in: query
        description: value to search for in the fields specified by q_f
        schema:
          type: string
      - name: q_f
        required: false
        in: query
        description: 'restrict searches to one or more fields in: amount, code, description,
          discount_type, profile, profile__full_name. searches all fields when unspecified.'
        schema:
          type: string
      - name: start_at
        required: false
        in: query
        description: date/time in ISO 8601 format
        schema:
          type: string
      tags:
      - list
      - provider
      - billing
      - couponmodel
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedCouponList'
          description: ''
      summary: Lists discount codes
    post:
      operationId: billing_coupons_create
      description: |2+

        Customers will be able to use the `code` until `ends_at`
        to subscribe to plans from the Coupon's provider at a discount.

        The API is typically used within an HTML
        `coupons page </docs/guides/themes/#dashboard_billing_coupons>`_
        as present in the default theme.

      parameters:
      - in: path
        name: profile
        schema:
          type: string
        required: true
      tags:
      - provider
      - billing
      - couponmodel
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CouponCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CouponCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CouponCreate'
        required: true
      security:
      - {}
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Coupon'
          description: ''
      summary: Creates a discount code
  /api/billing/{profile}/coupons/{coupon}:
    get:
      operationId: billing_coupons_retrieve
      description: |2+

        The API is typically used within an HTML
        `coupons page </docs/guides/themes/#dashboard_billing_coupons>`_
        as present in the default theme.

      parameters:
      - in: path
        name: coupon
        schema:
          type: string
        required: true
      - in: path
        name: profile
        schema:
          type: string
        required: true
      tags:
      - provider
      - billing
      - couponmodel
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Coupon'
          description: ''
      summary: Retrieves a discount code
    put:
      operationId: billing_coupons_update
      description: |2+

        The API is typically used within an HTML
        `coupons page </docs/guides/themes/#dashboard_billing_coupons>`_
        as present in the default theme.

      parameters:
      - in: path
        name: coupon
        schema:
          type: string
        required: true
      - in: path
        name: profile
        schema:
          type: string
        required: true
      tags:
      - provider
      - billing
      - couponmodel
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CouponUpdate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CouponUpdate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CouponUpdate'
        required: true
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Coupon'
          description: ''
      summary: Updates a discount code
    patch:
      operationId: billing_coupons_partial_update
      description: |2+

        The API is typically used within an HTML
        `coupons page </docs/guides/themes/#dashboard_billing_coupons>`_
        as present in the default theme.

      parameters:
      - in: path
        name: coupon
        schema:
          type: string
        required: true
      - in: path
        name: profile
        schema:
          type: string
        required: true
      tags:
      - provider
      - billing
      - couponmodel
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedCouponUpdate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedCouponUpdate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedCouponUpdate'
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CouponUpdate'
          description: ''
      summary: Retrieves a discount code
    delete:
      operationId: billing_coupons_destroy
      description: |2+

        Only coupons which have never been applied to an order will
        be permanently deleted. Coupons which have already be used
        at least once will be de-activated and still available for
        performance measurements.

        The API is typically used within an HTML
        `coupons page </docs/guides/themes/#dashboard_billing_coupons>`_
        as present in the default theme.

      parameters:
      - in: path
        name: coupon
        schema:
          type: string
        required: true
      - in: path
        name: profile
        schema:
          type: string
        required: true
      tags:
      - provider
      - billing
      - couponmodel
      security:
      - {}
      responses:
        '204':
          description: No response body
      summary: Deletes a discount code
  /api/billing/{profile}/history:
    get:
      operationId: billing_history_list
      description: |2+

        Returns a list of `page_size` transactions associated
        to a billing profile while the profile acts as a subscriber.

        The queryset can be further refined to match a search filter (``q``)
        and/or a range of dates ([``start_at``, ``ends_at``]),
        and sorted on specific fields (``o``).

        The API is typically used within an HTML
        `billing history page </docs/guides/themes/#dashboard_billing_history>`_
        as present in the default theme.

      parameters:
      - name: ends_at
        required: false
        in: query
        description: date/time in ISO 8601 format
        schema:
          type: string
      - name: o
        required: false
        in: query
        description: sort by description, amount, dest_profile, dest_profile__full_name,
          dest_account, orig_profile, orig_profile__full_name, orig_account, created_at.
          If a field is preceded by a minus sign ('-'), the order will be reversed.
          Multiple 'o' parameters can be specified to produce a stable result.
        schema:
          type: string
      - name: page
        required: false
        in: query
        description: A page number within the paginated result set.
        schema:
          type: integer
      - name: page_size
        required: false
        in: query
        description: Number of results to return per page between 1 and 100 (defaults
          to 25).
        schema:
          type: integer
      - in: path
        name: profile
        schema:
          type: string
        required: true
      - name: q
        required: false
        in: query
        description: value to search for in the fields specified by q_f
        schema:
          type: string
      - name: q_f
        required: false
        in: query
        description: 'restrict searches to one or more fields in: description, dest_profile,
          dest_profile__full_name, orig_profile, orig_profile__full_name. searches
          all fields when unspecified.'
        schema:
          type: string
      - name: start_at
        required: false
        in: query
        description: date/time in ISO 8601 format
        schema:
          type: string
      tags:
      - list
      - subscriber
      - billing
      - transactionmodel
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedTransactionList'
          description: ''
      summary: Lists subscriber transactions
  /api/billing/{profile}/receivables:
    get:
      operationId: billing_receivables_list
      description: |2+

        Returns a list of `page_size` transactions marked as receivables
        associated to a billing profile while the profile acts as a provider.

        The queryset can be further refined to match a search filter (``q``)
        and/or a range of dates ([``start_at``, ``ends_at``]),
        and sorted on specific fields (``o``).

        This API endpoint is typically used to find all sales for a provider,
        whether it was paid or not.

      parameters:
      - name: ends_at
        required: false
        in: query
        description: date/time in ISO 8601 format
        schema:
          type: string
      - name: o
        required: false
        in: query
        description: sort by description, amount, dest_profile, dest_profile__full_name,
          dest_account, orig_profile, orig_profile__full_name, orig_account, created_at.
          If a field is preceded by a minus sign ('-'), the order will be reversed.
          Multiple 'o' parameters can be specified to produce a stable result.
        schema:
          type: string
      - name: page
        required: false
        in: query
        description: A page number within the paginated result set.
        schema:
          type: integer
      - name: page_size
        required: false
        in: query
        description: Number of results to return per page between 1 and 100 (defaults
          to 25).
        schema:
          type: integer
      - in: path
        name: profile
        schema:
          type: string
        required: true
      - name: q
        required: false
        in: query
        description: value to search for in the fields specified by q_f
        schema:
          type: string
      - name: q_f
        required: false
        in: query
        description: 'restrict searches to one or more fields in: description, dest_profile,
          dest_profile__full_name, orig_profile, orig_profile__full_name. searches
          all fields when unspecified.'
        schema:
          type: string
      - name: start_at
        required: false
        in: query
        description: date/time in ISO 8601 format
        schema:
          type: string
      tags:
      - list
      - provider
      - billing
      - transactionmodel
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedTransactionList'
          description: ''
      summary: Lists provider receivables
  /api/billing/{profile}/transfers:
    get:
      operationId: billing_transfers_list
      description: |2+

        Returns a list of `page_size` transactions associated
        to a billing profile while the profile acts as a provider.

        The queryset can be further refined to match a search filter (``q``)
        and/or a range of dates ([``start_at``, ``ends_at``]),
        and sorted on specific fields (``o``).

        The API is typically used within an HTML
        `funds page </docs/guides/themes/#dashboard_billing_transfers>`_
        as present in the default theme.

      parameters:
      - name: ends_at
        required: false
        in: query
        description: date/time in ISO 8601 format
        schema:
          type: string
      - name: o
        required: false
        in: query
        description: sort by description, amount, dest_profile, dest_profile__full_name,
          dest_account, orig_profile, orig_profile__full_name, orig_account, created_at.
          If a field is preceded by a minus sign ('-'), the order will be reversed.
          Multiple 'o' parameters can be specified to produce a stable result.
        schema:
          type: string
      - name: page
        required: false
        in: query
        description: A page number within the paginated result set.
        schema:
          type: integer
      - in: path
        name: profile
        schema:
          type: string
        required: true
      - name: q
        required: false
        in: query
        description: value to search for in the fields specified by q_f
        schema:
          type: string
      - name: q_f
        required: false
        in: query
        description: 'restrict searches to one or more fields in: description, dest_profile,
          dest_profile__full_name, orig_profile, orig_profile__full_name. searches
          all fields when unspecified.'
        schema:
          type: string
      - name: start_at
        required: false
        in: query
        description: date/time in ISO 8601 format
        schema:
          type: string
      tags:
      - list
      - provider
      - billing
      - transactionmodel
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedTransactionList'
          description: ''
      summary: Lists provider payouts
  /api/billing/{profile}/transfers/import:
    post:
      operationId: billing_transfers_import_create
      description: |2+

        The primary purpose of this API call is for a provider to keep
        accurate metrics for the performance of the product sold, regardless
        of payment options (online or offline).

      parameters:
      - in: path
        name: profile
        schema:
          type: string
        required: true
      tags:
      - provider
      - billing
      - transactionmodel
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateOfflineTransaction'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CreateOfflineTransaction'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CreateOfflineTransaction'
        required: true
      security:
      - {}
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OfflineTransaction'
          description: ''
      summary: Creates an offline transaction
  /api/billing/cartitems:
    get:
      operationId: billing_cartitems_list
      description: |2+

        Returns a list of `page_size` cart items that haven't been checked out
        yet.

        The queryset can be further refined to match a search filter (``q``)
        and/or a range of dates ([``start_at``, ``ends_at``]),
        and sorted on specific fields (``o``).

      parameters:
      - name: ends_at
        required: false
        in: query
        description: date/time in ISO 8601 format
        schema:
          type: string
      - name: o
        required: false
        in: query
        description: sort by username, created_at. If a field is preceded by a minus
          sign ('-'), the order will be reversed. Multiple 'o' parameters can be specified
          to produce a stable result.
        schema:
          type: string
      - name: page
        required: false
        in: query
        description: A page number within the paginated result set.
        schema:
          type: integer
      - name: page_size
        required: false
        in: query
        description: Number of results to return per page between 1 and 100 (defaults
          to 25).
        schema:
          type: integer
      - name: q
        required: false
        in: query
        description: value to search for in the fields specified by q_f
        schema:
          type: string
      - name: q_f
        required: false
        in: query
        description: 'restrict searches to one or more fields in: user__username,
          user__first_name, user__last_name, user__email. searches all fields when
          unspecified.'
        schema:
          type: string
      - name: start_at
        required: false
        in: query
        description: date/time in ISO 8601 format
        schema:
          type: string
      tags:
      - billing
      - broker
      - cart
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedCartItemList'
          description: ''
      summary: Lists active cart items
    post:
      operationId: billing_cartitems_create
      description: |2+

        This endpoint lets broker to add items into a user cart.

      tags:
      - billing
      - broker
      - cart
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserCartItemCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/UserCartItemCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/UserCartItemCreate'
        required: true
      security:
      - {}
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CartItem'
          description: ''
      summary: Creates a cart item
  /api/billing/cartitems/{cartitem_id}:
    get:
      operationId: billing_cartitems_retrieve
      description: |2+

        Returns a single cart item based on its primary key.

        This API endpoint is intended for broker to analyze and modify
        active cart items as necessary when responding to support requests.

      parameters:
      - in: path
        name: cartitem_id
        schema:
          type: integer
        required: true
      tags:
      - billing
      - broker
      - cart
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CartItem'
          description: ''
      summary: Retrieves a cart item
    put:
      operationId: billing_cartitems_update
      description: |2+

        Updates a single cart item based on its primary key.

        This API endpoint is intended for broker to analyze and modify
        active cart items as necessary when responding to support requests.

      parameters:
      - in: path
        name: cartitem_id
        schema:
          type: integer
        required: true
      tags:
      - billing
      - broker
      - cart
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CartItemUpdate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CartItemUpdate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CartItemUpdate'
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CartItemUpdate'
          description: ''
      summary: Updates a cart item
    patch:
      operationId: billing_cartitems_partial_update
      description: |2+

        Returns a single cart item based on its primary key.

        This API endpoint is intended for broker to analyze and modify
        active cart items as necessary when responding to support requests.

      parameters:
      - in: path
        name: cartitem_id
        schema:
          type: integer
        required: true
      tags:
      - billing
      - broker
      - cart
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedCartItemUpdate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedCartItemUpdate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedCartItemUpdate'
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CartItemUpdate'
          description: ''
      summary: Retrieves a cart item
    delete:
      operationId: billing_cartitems_destroy
      description: |2+

        Deletes a single cart item based on its primary key.

        This API endpoint is intended for broker to analyze and modify
        active cart items as necessary when responding to support requests.

      parameters:
      - in: path
        name: cartitem_id
        schema:
          type: integer
        required: true
      tags:
      - billing
      - broker
      - cart
      security:
      - {}
      responses:
        '204':
          description: No response body
      summary: Deletes a cart item
  /api/billing/cartitems/user/{user}:
    get:
      operationId: billing_cartitems_user_list
      description: |2+

        Returns a list of `page_size` cart items that a specified user hasn't
        checked out yet.

        The queryset can be further refined to match a search filter (``q``)
        and/or a range of dates ([``start_at``, ``ends_at``]),
        and sorted on specific fields (``o``).

      parameters:
      - name: ends_at
        required: false
        in: query
        description: date/time in ISO 8601 format
        schema:
          type: string
      - name: o
        required: false
        in: query
        description: sort by username, created_at. If a field is preceded by a minus
          sign ('-'), the order will be reversed. Multiple 'o' parameters can be specified
          to produce a stable result.
        schema:
          type: string
      - name: page
        required: false
        in: query
        description: A page number within the paginated result set.
        schema:
          type: integer
      - name: page_size
        required: false
        in: query
        description: Number of results to return per page between 1 and 100 (defaults
          to 25).
        schema:
          type: integer
      - name: q
        required: false
        in: query
        description: value to search for in the fields specified by q_f
        schema:
          type: string
      - name: q_f
        required: false
        in: query
        description: 'restrict searches to one or more fields in: user__username,
          user__first_name, user__last_name, user__email. searches all fields when
          unspecified.'
        schema:
          type: string
      - name: start_at
        required: false
        in: query
        description: date/time in ISO 8601 format
        schema:
          type: string
      - in: path
        name: user
        schema:
          type: string
        required: true
      tags:
      - billing
      - broker
      - cart
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedCartItemList'
          description: ''
      summary: Lists a user active cart items
  /api/billing/charges:
    get:
      operationId: billing_charges_list
      description: |2+

        Returns a list of `page_size` charges that were created on the payment
        processor (ex: Stripe).

        The queryset can be further refined to match a search filter (``q``)
        and/or a range of dates ([``start_at``, ``ends_at``]),
        and sorted on specific fields (``o``).

      parameters:
      - name: ends_at
        required: false
        in: query
        description: date/time in ISO 8601 format
        schema:
          type: string
      - name: o
        required: false
        in: query
        description: sort by description, amount, Full name, created_at. If a field
          is preceded by a minus sign ('-'), the order will be reversed. Multiple
          'o' parameters can be specified to produce a stable result.
        schema:
          type: string
      - name: page
        required: false
        in: query
        description: A page number within the paginated result set.
        schema:
          type: integer
      - name: page_size
        required: false
        in: query
        description: Number of results to return per page between 1 and 100 (defaults
          to 25).
        schema:
          type: integer
      - name: q
        required: false
        in: query
        description: value to search for in the fields specified by q_f
        schema:
          type: string
      - name: q_f
        required: false
        in: query
        description: 'restrict searches to one or more fields in: description, processor_key,
          customer__full_name. searches all fields when unspecified.'
        schema:
          type: string
      - name: start_at
        required: false
        in: query
        description: date/time in ISO 8601 format
        schema:
          type: string
      tags:
      - list
      - chargemodel
      - billing
      - broker
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedChargeList'
          description: ''
      summary: Lists processor charges
  /api/billing/transactions:
    get:
      operationId: billing_transactions_list
      description: |2+

        Returns a list of `page_size` transactions.

        The queryset can be further refined to match a search filter (``q``)
        and/or a range of dates ([``start_at``, ``ends_at``]),
        and sorted on specific fields (``o``).

      parameters:
      - name: ends_at
        required: false
        in: query
        description: date/time in ISO 8601 format
        schema:
          type: string
      - name: o
        required: false
        in: query
        description: sort by description, amount, dest_profile, dest_profile__full_name,
          dest_account, orig_profile, orig_profile__full_name, orig_account, created_at.
          If a field is preceded by a minus sign ('-'), the order will be reversed.
          Multiple 'o' parameters can be specified to produce a stable result.
        schema:
          type: string
      - name: page
        required: false
        in: query
        description: A page number within the paginated result set.
        schema:
          type: integer
      - name: page_size
        required: false
        in: query
        description: Number of results to return per page between 1 and 100 (defaults
          to 25).
        schema:
          type: integer
      - name: q
        required: false
        in: query
        description: value to search for in the fields specified by q_f
        schema:
          type: string
      - name: q_f
        required: false
        in: query
        description: 'restrict searches to one or more fields in: description, dest_profile,
          dest_profile__full_name, orig_profile, orig_profile__full_name. searches
          all fields when unspecified.'
        schema:
          type: string
      - name: start_at
        required: false
        in: query
        description: date/time in ISO 8601 format
        schema:
          type: string
      tags:
      - list
      - transactionmodel
      - billing
      - broker
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedTransactionList'
          description: ''
      summary: Lists ledger transactions
  /api/cart:
    post:
      operationId: cart_create
      description: |2+

        Adds a plan into the cart of the user identified through the HTTP request.

        The cart can later be checked out and paid by a billing profile, either
        through the `HTML checkout page </docs/guides/themes/#workflow_billing_cart>`_
        or `API end point </docs/api/#createCheckout>`_.

        This end point is typically used when a user is presented with a list
        of add-ons that she can subscribes to in one checkout screen. The end-point
        works in both cases, authenticated or anonymous users. For authenticated
        users, the cart is stored in the database as ``CartItem`` objects.
        For anonymous users, the cart is stored in an HTTP Cookie.

        The end-point accepts a single item or a list of items.

        ``option`` is optional. When it is not specified, subsquent checkout
        screens will provide choices to pay multiple periods in advance.

        When additional ``full_name`` and ``sync_on`` are specified,
        payment can be made by one billing profile for another profile
        to be subscribed (see `GroupBuy orders  <group_buy>`_).

      tags:
      - visitor
      - cartmodel
      - billing
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CartItemCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CartItemCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CartItemCreate'
        required: true
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CartItem'
          description: ''
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CartItem'
          description: ''
      summary: Adds an item to the user cart
    delete:
      operationId: cart_destroy
      description: |2+

        Removes an item from the ``request.user`` cart.

      parameters:
      - in: query
        name: email
        schema:
          type: string
          format: email
          nullable: true
          minLength: 1
        description: E-mail address
      - in: query
        name: plan
        schema:
          type: string
          nullable: true
        description: Plan
      tags:
      - visitor
      - cartmodel
      - billing
      security:
      - {}
      responses:
        '204':
          description: No response body
      summary: Removes an item from the user cart
  /api/cart/{plan}/upload:
    post:
      operationId: cart_upload_create
      description: |2+

        Add a ``Plan`` into the subscription cart of multiple users as per the
        content of an uploaded file.

        This works bulk fashion of `/cart/ endpoint <api_cart>`_. The
        uploaded file must be a CSV containing the fields ``first_name``,
        ``last_name`` and email. The CSV file must not contain a header
        line, only data.

      parameters:
      - in: path
        name: plan
        schema:
          type: string
        required: true
      tags:
      - cartmodel
      - billing
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CartItemUpload'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CartItemUpload'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CartItemUpload'
        required: true
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CartItemUpload'
          description: ''
      summary: Uploads multiple items into a user cart
  /api/cart/redeem:
    post:
      operationId: cart_redeem_create
      description: |2+

        Redeems a ``Coupon`` and applies the discount to the eligible items
        in the cart.

      tags:
      - visitor
      - cartmodel
      - billing
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RedeemCoupon'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/RedeemCoupon'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/RedeemCoupon'
        required: true
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
          description: ''
      summary: Redeems a discount code
  /api/contact:
    post:
      operationId: contact_create
      description: |2+

        Emails a free form contact-us message from a customer to the provider

        The API is typically used within an HTML
        `contact page </docs/guides/themes/#workflow_contact>`_
        as present in the default theme.

      tags:
      - visitor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ContactUs'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ContactUs'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ContactUs'
        required: true
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
          description: ''
      summary: Sends a contact-us message
  /api/contacts/{user}/activities:
    get:
      operationId: contacts_activities_list
      description: |2+

        Returns a list of `page_size` activity records for user account {user}.

      parameters:
      - name: o
        required: false
        in: query
        description: sort by created_at. If a field is preceded by a minus sign ('-'),
          the order will be reversed. Multiple 'o' parameters can be specified to
          produce a stable result.
        schema:
          type: string
      - name: page
        required: false
        in: query
        description: A page number within the paginated result set.
        schema:
          type: integer
      - name: page_size
        required: false
        in: query
        description: Number of results to return per page between 1 and 100 (defaults
          to 25).
        schema:
          type: integer
      - name: q
        required: false
        in: query
        description: value to search for in the fields specified by q_f
        schema:
          type: string
      - name: q_f
        required: false
        in: query
        description: 'restrict searches to one or more fields in: text. searches all
          fields when unspecified.'
        schema:
          type: string
      - in: path
        name: user
        schema:
          type: string
        required: true
      tags:
      - profile
      - usermodel
      - broker
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedActivityList'
          description: ''
      summary: Lists activities for a user
    post:
      operationId: contacts_activities_create
      description: |2+

      parameters:
      - in: path
        name: user
        schema:
          type: string
        required: true
      tags:
      - profile
      - usermodel
      - broker
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ActivityCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ActivityCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ActivityCreate'
        required: true
      security:
      - {}
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ActivityCreate'
          description: ''
      summary: Records new activity with a user
  /api/contacts/{user}/picture:
    post:
      operationId: contacts_picture_create
      description: ''
      parameters:
      - in: path
        name: user
        schema:
          type: string
        required: true
      tags: []
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/UploadBlob'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/UploadBlob'
        required: true
      security:
      - {}
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadBlob'
          description: ''
      summary: Uploads a picture for the user profile
  /api/legal:
    get:
      operationId: legal_list
      description: |2+

        Returns a list of `page_size` legal agreements a user might be requested
        to sign such as "terms of use" or "security policy". This end point can be
        used by unauthenticated users. As such it is perfect for
        `legal disclosure pages </docs/guides/themes/#workflow_legal_index>`_.

      parameters:
      - name: o
        required: false
        in: query
        description: sort by title, updated_at. If a field is preceded by a minus
          sign ('-'), the order will be reversed. Multiple 'o' parameters can be specified
          to produce a stable result.
        schema:
          type: string
      - name: page
        required: false
        in: query
        description: A page number within the paginated result set.
        schema:
          type: integer
      - name: page_size
        required: false
        in: query
        description: Number of results to return per page between 1 and 100 (defaults
          to 25).
        schema:
          type: integer
      - name: q
        required: false
        in: query
        description: value to search for in the fields specified by q_f
        schema:
          type: string
      - name: q_f
        required: false
        in: query
        description: 'restrict searches to one or more fields in: slug, title. searches
          all fields when unspecified.'
        schema:
          type: string
      tags:
      - visitor
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedAgreementList'
          description: ''
      summary: List legal agreements
  /api/legal/{agreement}:
    get:
      operationId: legal_retrieve
      description: |2+

        Retrieves the text of legal agreement a user might be requested to sign.
        This end point can be used by unauthenticated users. As such it is perfect
        for `legal disclosure pages
        </docs/guides/themes/#workflow_legal_agreement>`_.

      parameters:
      - in: path
        name: agreement
        schema:
          type: string
        required: true
      tags:
      - visitor
      - broker
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgreementDetail'
          description: ''
      summary: Retrieves a legal agreement
  /api/legal/{agreement}/sign:
    post:
      operationId: legal_sign_create
      description: |2+

        Indicates the request user has signed the required consent agreement.

        The API is typically used within an HTML
        `legal agreement page </docs/guides/themes/#workflow_legal_sign>`_
        as present in the default theme.

      parameters:
      - in: path
        name: agreement
        schema:
          type: string
        required: true
      tags:
      - profile
      - user
      - usermodel
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AgreementSign'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/AgreementSign'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/AgreementSign'
        required: true
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgreementSign'
          description: ''
      summary: Signs a consent agreement
  /api/metrics/{profile}/balances:
    get:
      operationId: metrics_balances_retrieve
      description: |2+

        Generates a table of currency amounts (rows) per period (columns)
        for a default balance sheet (Income, Backlog, Receivable).

        The date/time returned in `results[].values[]` specifies the end
        of the period (not included) for which the associated amount
        in the tuple is computed.

        The date from which trailing balances are computed can be specified
        by the `ends_at` query parameter. The type of periods (hourly, daily,
        weekly, monthly, yearly) to aggregate balances over, and the number of
        periods to return can be specificed by `period_type` and `nb_periods`
        respectively.

        The API is typically used within an HTML
        `revenue page </docs/guides/themes/#dashboard_metrics_revenue>`_
        as present in the default theme.

      parameters:
      - in: query
        name: ends_at
        schema:
          type: string
          minLength: 1
        description: Data/time for the end of the period (in ISO format)
      - in: query
        name: nb_periods
        schema:
          type: integer
          maximum: 100
          minimum: 1
        description: Specify the number of periods to include. Min value is 1.
      - in: query
        name: period_type
        schema:
          enum:
          - hourly
          - daily
          - weekly
          - monthly
          - yearly
          type: string
          minLength: 1
        description: Natural period length (hourly, daily, weekly, monthly, yearly).
          Defaults to monthly.
      - in: path
        name: profile
        schema:
          type: string
        required: true
      tags:
      - provider
      - chart
      - metrics
      - transactionmodel
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Metrics'
          description: ''
      summary: Retrieves trailing deferred balances
  /api/metrics/{profile}/balances-due:
    get:
      operationId: metrics_balances_due_list
      description: |2+

        This endpoint returns a list of organizations with their respective
        total contract value, payments made, and total balance due.

      parameters:
      - name: ends_at
        required: false
        in: query
        description: date/time in ISO 8601 format
        schema:
          type: string
      - name: o
        required: false
        in: query
        description: sort by Slug, Full Name, Created At. If a field is preceded by
          a minus sign ('-'), the order will be reversed. Multiple 'o' parameters
          can be specified to produce a stable result.
        schema:
          type: string
      - name: page
        required: false
        in: query
        description: A page number within the paginated result set.
        schema:
          type: integer
      - name: page_size
        required: false
        in: query
        description: Number of results to return per page between 1 and 100 (defaults
          to 25).
        schema:
          type: integer
      - in: path
        name: profile
        schema:
          type: string
        required: true
      - name: q
        required: false
        in: query
        description: value to search for in the fields specified by q_f
        schema:
          type: string
      - name: q_f
        required: false
        in: query
        description: 'restrict searches to one or more fields in: slug, full_name.
          searches all fields when unspecified.'
        schema:
          type: string
      - name: start_at
        required: false
        in: query
        description: date/time in ISO 8601 format
        schema:
          type: string
      tags:
      - organization
      - provider
      - subscribers
      - balance
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedBalancesDueList'
          description: ''
      summary: Lists subscribers to a provider with a balance due
  /api/metrics/{profile}/coupons/{coupon}:
    get:
      operationId: metrics_coupons_list
      description: |2+

        Returns a list of `page_size` cart items on which coupon with
        code {coupon} was used. Coupon {coupon} must have been created by
        the specified provider.

        The queryset can be further refined to match a search filter (``q``)
        and/or a range of dates ([``start_at``, ``ends_at``]),
        and sorted on specific fields (``o``).

      parameters:
      - in: path
        name: coupon
        schema:
          type: string
        required: true
      - name: ends_at
        required: false
        in: query
        description: date/time in ISO 8601 format
        schema:
          type: string
      - name: o
        required: false
        in: query
        description: sort by user__username, plan, created_at. If a field is preceded
          by a minus sign ('-'), the order will be reversed. Multiple 'o' parameters
          can be specified to produce a stable result.
        schema:
          type: string
      - name: page
        required: false
        in: query
        description: A page number within the paginated result set.
        schema:
          type: integer
      - name: page_size
        required: false
        in: query
        description: Number of results to return per page between 1 and 100 (defaults
          to 25).
        schema:
          type: integer
      - in: path
        name: profile
        schema:
          type: string
        required: true
      - name: q
        required: false
        in: query
        description: value to search for in the fields specified by q_f
        schema:
          type: string
      - name: q_f
        required: false
        in: query
        description: 'restrict searches to one or more fields in: user__username,
          user__first_name, user__last_name, user__email. searches all fields when
          unspecified.'
        schema:
          type: string
      - name: start_at
        required: false
        in: query
        description: date/time in ISO 8601 format
        schema:
          type: string
      tags:
      - provider
      - couponmodel
      - list
      - metrics
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedCartItemList'
          description: ''
      summary: Retrieves performance of a discount code
  /api/metrics/{profile}/customers:
    get:
      operationId: metrics_customers_retrieve
      description: |2+

        Generates a table of total number of customers, number of new customers,
        number of churned customers, and number of net new customers (rows)
        per period (columns).

        New customers are defined as customers that made an order in the period,
        but not in the previous period. Churned customers are defined as customers
        that made an order in the previous period, but not in the period.
        The net new customers is defined as the number of new customers minus
        the number of churned customers.

        The date/time returned in `results[].values[]` specifies the end
        of the period (not included) for which the associated count
        in the tuple is computed.

        The date from which trailing balances are computed can be specified
        by the `ends_at` query parameter. The type of periods (hourly, daily,
        weekly, monthly, yearly) to aggregate balances over, and the number of
        periods to return can be specificed by `period_type` and `nb_periods`
        respectively.

        The API is typically used within an HTML
        `revenue page </docs/guides/themes/#dashboard_metrics_revenue>`_
        as present in the default theme.

      parameters:
      - in: query
        name: ends_at
        schema:
          type: string
          minLength: 1
        description: Data/time for the end of the period (in ISO format)
      - in: query
        name: nb_periods
        schema:
          type: integer
          maximum: 100
          minimum: 1
        description: Specify the number of periods to include. Min value is 1.
      - in: query
        name: period_type
        schema:
          enum:
          - hourly
          - daily
          - weekly
          - monthly
          - yearly
          type: string
          minLength: 1
        description: Natural period length (hourly, daily, weekly, monthly, yearly).
          Defaults to monthly.
      - in: path
        name: profile
        schema:
          type: string
        required: true
      tags:
      - provider
      - profilemodel
      - chart
      - metrics
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Metrics'
          description: ''
      summary: Retrieves trailing customer counts
  /api/metrics/{profile}/federated:
    get:
      operationId: metrics_federated_retrieve
      description: |2+

        Returns the number of churned vs. new subscribers per plans for a period
        for all members of a federation of provider.

      parameters:
      - in: path
        name: profile
        schema:
          type: string
        required: true
      tags:
      - provider
      - metrics
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Metrics'
          description: ''
      summary: Retrieves churned vs. new subscribers for a federation
  /api/metrics/{profile}/federated/shared:
    get:
      operationId: metrics_federated_shared_retrieve
      description: |2+

        Returns the number of shared profiles

      parameters:
      - in: path
        name: profile
        schema:
          type: string
        required: true
      tags:
      - provider
      - metrics
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Metrics'
          description: ''
      summary: Retrieves shared profiles within a federation
  /api/metrics/{profile}/funds:
    get:
      operationId: metrics_funds_retrieve
      description: |2+

        Produces sales, payments and refunds over a period of time.

        The API is typically used within an HTML
        `revenue page </docs/guides/themes/#dashboard_metrics_revenue>`_
        as present in the default theme.

      parameters:
      - in: query
        name: ends_at
        schema:
          type: string
          minLength: 1
        description: Data/time for the end of the period (in ISO format)
      - in: query
        name: nb_periods
        schema:
          type: integer
          maximum: 100
          minimum: 1
        description: Specify the number of periods to include. Min value is 1.
      - in: query
        name: period_type
        schema:
          enum:
          - hourly
          - daily
          - weekly
          - monthly
          - yearly
          type: string
          minLength: 1
        description: Natural period length (hourly, daily, weekly, monthly, yearly).
          Defaults to monthly.
      - in: path
        name: profile
        schema:
          type: string
        required: true
      tags:
      - provider
      - chart
      - metrics
      - transactionmodel
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Metrics'
          description: ''
      summary: Retrieves trailing revenue
  /api/metrics/{profile}/lifetimevalue:
    get:
      operationId: metrics_lifetimevalue_list
      description: |2+

        Generates the total amount of the contract for a customer,
        the amount of cash payments towards the contract value made so far
        by the customer, and the deferred revenue remaining to be recognized
        on the contract value.

      parameters:
      - name: ends_at
        required: false
        in: query
        description: date/time in ISO 8601 format
        schema:
          type: string
      - name: page
        required: false
        in: query
        description: A page number within the paginated result set.
        schema:
          type: integer
      - name: page_size
        required: false
        in: query
        description: Number of results to return per page between 1 and 100 (defaults
          to 25).
        schema:
          type: integer
      - in: path
        name: profile
        schema:
          type: string
        required: true
      - name: start_at
        required: false
        in: query
        description: date/time in ISO 8601 format
        schema:
          type: string
      tags:
      - profilemodel
      - provider
      - list
      - metrics
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedLifetimeList'
          description: ''
      summary: Retrieves customers lifetime value
  /api/metrics/{profile}/plans:
    get:
      operationId: metrics_plans_retrieve
      description: |2+

        Generates a table of active susbribers for each plan (rows)
        per period (columns).

        The date/time returned in `results[].values[]` specifies the end
        of the period (not included) for which the associated count
        in the tuple is computed.

        The date from which trailing balances are computed can be specified
        by the `ends_at` query parameter. The type of periods (hourly, daily,
        weekly, monthly, yearly) to aggregate balances over, and the number of
        periods to return can be specificed by `period_type` and `nb_periods`
        respectively.

        The API is typically used within an HTML
        `revenue page </docs/guides/themes/#dashboard_metrics_revenue>`_
        as present in the default theme.

      parameters:
      - in: query
        name: ends_at
        schema:
          type: string
          minLength: 1
        description: Data/time for the end of the period (in ISO format)
      - in: query
        name: nb_periods
        schema:
          type: integer
          maximum: 100
          minimum: 1
        description: Specify the number of periods to include. Min value is 1.
      - in: query
        name: period_type
        schema:
          enum:
          - hourly
          - daily
          - weekly
          - monthly
          - yearly
          type: string
          minLength: 1
        description: Natural period length (hourly, daily, weekly, monthly, yearly).
          Defaults to monthly.
      - in: path
        name: profile
        schema:
          type: string
        required: true
      tags:
      - provider
      - chart
      - metrics
      - planmodel
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Metrics'
          description: ''
      summary: Retrieves trailing plans performance
  /api/metrics/balances/{report}:
    get:
      operationId: metrics_balances_report
      description: |2+

        Queries a balance sheet named ``{report}`` for the broker.

        To add lines in the report see `/api/metrics/balances/{report}/lines/`.

      parameters:
      - in: query
        name: ends_at
        schema:
          type: string
          minLength: 1
        description: Data/time for the end of the period (in ISO format)
      - in: query
        name: nb_periods
        schema:
          type: integer
          maximum: 100
          minimum: 1
        description: Specify the number of periods to include. Min value is 1.
      - in: query
        name: period_type
        schema:
          enum:
          - hourly
          - daily
          - weekly
          - monthly
          - yearly
          type: string
          minLength: 1
        description: Natural period length (hourly, daily, weekly, monthly, yearly).
          Defaults to monthly.
      - in: path
        name: report
        schema:
          type: string
        required: true
      tags:
      - transactionmodel
      - metrics
      - broker
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Metrics'
          description: ''
      summary: Retrieves a balance sheet
  /api/metrics/balances/{report}/lines:
    get:
      operationId: metrics_balances_lines_list
      description: |2+

        Queries the list of rows reported on a balance sheet named `{report}`.

      parameters:
      - name: page
        required: false
        in: query
        description: A page number within the paginated result set.
        schema:
          type: integer
      - name: page_size
        required: false
        in: query
        description: Number of results to return per page between 1 and 100 (defaults
          to 25).
        schema:
          type: integer
      - in: path
        name: report
        schema:
          type: string
        required: true
      tags:
      - transactionmodel
      - metrics
      - broker
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedBalanceLineList'
          description: ''
      summary: Retrieves row headers for a balance sheet
    post:
      operationId: metrics_balances_lines_create
      description: |2+

        Adds a new row on the ``{report}`` balance sheet.

      parameters:
      - in: path
        name: report
        schema:
          type: string
        required: true
      tags:
      - transactionmodel
      - metrics
      - broker
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BalanceLine'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/BalanceLine'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/BalanceLine'
        required: true
      security:
      - {}
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BalanceLine'
          description: ''
      summary: Creates a row in a balance sheet
    patch:
      operationId: metrics_balances_lines_partial_update
      description: |2+

        When receiving a request like [{"newpos": 1, "oldpos": 3}],
        it will move the line at position 3 to position 1, updating the
        rank of all lines in-between.

      parameters:
      - in: path
        name: report
        schema:
          type: string
        required: true
      tags:
      - transactionmodel
      - metrics
      - broker
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedUpdateRank'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedUpdateRank'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedUpdateRank'
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedBalanceLineList'
          description: ''
      summary: Updates the order in which lines are displayed
  /api/metrics/balances/{report}/lines/{rank}:
    get:
      operationId: metrics_balances_lines_retrieve
      description: |2+

        Describes a row reported on a balance sheet named `{report}`.

      parameters:
      - in: path
        name: rank
        schema:
          type: integer
        required: true
      - in: path
        name: report
        schema:
          type: string
        required: true
      tags:
      - transactionmodel
      - metrics
      - broker
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BalanceLine'
          description: ''
      summary: Retrieves a row in a balance sheet
    put:
      operationId: metrics_balances_lines_single_update
      description: |2+

        Updates a row reported on a balance sheet named `{report}`.

      parameters:
      - in: path
        name: rank
        schema:
          type: integer
        required: true
      - in: path
        name: report
        schema:
          type: string
        required: true
      tags:
      - transactionmodel
      - metrics
      - broker
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BalanceLine'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/BalanceLine'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/BalanceLine'
        required: true
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BalanceLine'
          description: ''
      summary: Updates a row in a balance sheet
    patch:
      operationId: metrics_balances_lines_single_partial_update
      description: |2+

        Describes a row reported on a balance sheet named `{report}`.

      parameters:
      - in: path
        name: rank
        schema:
          type: integer
        required: true
      - in: path
        name: report
        schema:
          type: string
        required: true
      tags:
      - transactionmodel
      - metrics
      - broker
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedBalanceLine'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedBalanceLine'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedBalanceLine'
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BalanceLine'
          description: ''
      summary: Retrieves a row in a balance sheet
    delete:
      operationId: metrics_balances_lines_destroy
      description: |2+

        Deletes a row reported on a balance sheet named `{report}`.

      parameters:
      - in: path
        name: rank
        schema:
          type: integer
        required: true
      - in: path
        name: report
        schema:
          type: string
        required: true
      tags:
      - transactionmodel
      - metrics
      - broker
      security:
      - {}
      responses:
        '204':
          description: No response body
      summary: Deletes a row in a balance sheet
  /api/metrics/registered:
    get:
      operationId: metrics_registered_list
      description: |2+

        Returns a list of `page_size` users which have no associated role
        or a role to a profile which has no subscription, active or inactive.

        The queryset can be further refined to match a search filter (``q``)
        and/or a range of dates ([``start_at``, ``ends_at``]),
        and sorted on specific fields (``o``).

        The API is typically used within an HTML
        `subscribers page </docs/guides/themes/#dashboard_profile_subscribers>`_
        as present in the default theme.

      parameters:
      - name: ends_at
        required: false
        in: query
        description: date/time in ISO 8601 format
        schema:
          type: string
      - name: o
        required: false
        in: query
        description: sort by first_name, last_name, email, created_at. If a field
          is preceded by a minus sign ('-'), the order will be reversed. Multiple
          'o' parameters can be specified to produce a stable result.
        schema:
          type: string
      - name: page
        required: false
        in: query
        description: A page number within the paginated result set.
        schema:
          type: integer
      - name: page_size
        required: false
        in: query
        description: Number of results to return per page between 1 and 100 (defaults
          to 25).
        schema:
          type: integer
      - name: q
        required: false
        in: query
        description: value to search for in the fields specified by q_f
        schema:
          type: string
      - name: q_f
        required: false
        in: query
        description: 'restrict searches to one or more fields in: username, first_name,
          last_name, email, slug, full_name. searches all fields when unspecified.'
        schema:
          type: string
      - name: start_at
        required: false
        in: query
        description: date/time in ISO 8601 format
        schema:
          type: string
      tags:
      - usermodel
      - metrics
      - broker
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedUserList'
          description: ''
      summary: Lists top of funnel registered users
  /api/notifications/{template}:
    post:
      operationId: notifications_create
      description: |2+

      parameters:
      - in: path
        name: template
        schema:
          type: string
          pattern: ^[-a-zA-Z0-9_]+$
        required: true
      tags:
      - themes
      - notificationmodel
      - broker
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: ''
      summary: Sends a test notification e-mail
  /api/pricing:
    get:
      operationId: pricing_list
      description: |2+

        Returns a list of `page_size` plans which are active and can
        be subscribed to.

        The queryset can be further refined to match a search filter (``q``)
        and/or a range of dates ([``start_at``, ``ends_at``]),
        and sorted on specific fields (``o``).

        The API is typically used within an HTML
        `pricing page </docs/guides/themes/#workflow_pricing>`_
        as present in the default theme.

      parameters:
      - name: ends_at
        required: false
        in: query
        description: date/time in ISO 8601 format
        schema:
          type: string
      - name: o
        required: false
        in: query
        description: sort by title, period_amount, is_active, created_at. If a field
          is preceded by a minus sign ('-'), the order will be reversed. Multiple
          'o' parameters can be specified to produce a stable result.
        schema:
          type: string
      - name: page
        required: false
        in: query
        description: A page number within the paginated result set.
        schema:
          type: integer
      - name: page_size
        required: false
        in: query
        description: Number of results to return per page between 1 and 100 (defaults
          to 25).
        schema:
          type: integer
      - name: q
        required: false
        in: query
        description: value to search for in the fields specified by q_f
        schema:
          type: string
      - name: q_f
        required: false
        in: query
        description: 'restrict searches to one or more fields in: slug, title. searches
          all fields when unspecified.'
        schema:
          type: string
      - name: start_at
        required: false
        in: query
        description: date/time in ISO 8601 format
        schema:
          type: string
      tags:
      - visitor
      - subscriptions
      - planmodel
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedPlanDetailList'
          description: ''
      summary: Lists pricing plans
  /api/profile:
    get:
      operationId: profile_list
      description: |2+

        Returns a list of `page_size` profile and user accounts.

        The queryset can be further refined to match a search filter (``q``)
        and/or a range of dates ([``start_at``, ``ends_at``]),
        and sorted on specific fields (``o``).

      parameters:
      - name: ends_at
        required: false
        in: query
        description: date/time in ISO 8601 format
        schema:
          type: string
      - name: o
        required: false
        in: query
        description: sort by full_name, created_at. If a field is preceded by a minus
          sign ('-'), the order will be reversed. Multiple 'o' parameters can be specified
          to produce a stable result.
        schema:
          type: string
      - name: page
        required: false
        in: query
        description: A page number within the paginated result set.
        schema:
          type: integer
      - name: page_size
        required: false
        in: query
        description: Number of results to return per page between 1 and 100 (defaults
          to 25).
        schema:
          type: integer
      - name: q
        required: false
        in: query
        description: value to search for in the fields specified by q_f
        schema:
          type: string
      - name: q_f
        required: false
        in: query
        description: 'restrict searches to one or more fields in: slug, full_name,
          email, phone, street_address, locality, region, postal_code, country, username,
          first_name, last_name. searches all fields when unspecified.'
        schema:
          type: string
      - name: start_at
        required: false
        in: query
        description: date/time in ISO 8601 format
        schema:
          type: string
      tags:
      - profile
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedProfileList'
          description: ''
      summary: Lists billing profiles
  /api/profile/{profile}:
    get:
      operationId: profile_retrieve
      description: |2+

        The API is typically used within an HTML
        `contact information page </docs/guides/themes/#dashboard_profile>`_
        as present in the default theme.

      parameters:
      - in: path
        name: profile
        schema:
          type: string
          pattern: ^[-a-zA-Z0-9_]+$
        required: true
      tags:
      - profile
      - subscriber
      - profilemodel
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProfileDetail'
          description: ''
      summary: Retrieves a billing profile
    put:
      operationId: profile_update
      description: |2+

      parameters:
      - in: path
        name: profile
        schema:
          type: string
          pattern: ^[-a-zA-Z0-9_]+$
        required: true
      tags:
      - profile
      - subscriber
      - profilemodel
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProfileDetail'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ProfileDetail'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ProfileDetail'
        required: true
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProfileDetail'
          description: ''
      summary: Updates a billing profile
    patch:
      operationId: profile_partial_update
      description: |2+

        The API is typically used within an HTML
        `contact information page </docs/guides/themes/#dashboard_profile>`_
        as present in the default theme.

      parameters:
      - in: path
        name: profile
        schema:
          type: string
          pattern: ^[-a-zA-Z0-9_]+$
        required: true
      tags:
      - profile
      - subscriber
      - profilemodel
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedProfileDetail'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedProfileDetail'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedProfileDetail'
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProfileDetail'
          description: ''
      summary: Retrieves a billing profile
    delete:
      operationId: profile_destroy
      description: |2+

        We anonymize the profile instead of purely deleting
        it from the database because we don't want to loose history
        on subscriptions and transactions.

      parameters:
      - in: path
        name: profile
        schema:
          type: string
          pattern: ^[-a-zA-Z0-9_]+$
        required: true
      tags:
      - profile
      - subscriber
      - profilemodel
      security:
      - {}
      responses:
        '204':
          description: No response body
      summary: Deletes a billing profile
  /api/profile/{profile}/picture:
    post:
      operationId: profile_picture_create
      description: ''
      parameters:
      - in: path
        name: profile
        schema:
          type: string
          pattern: ^[-a-zA-Z0-9_]+$
        required: true
      tags: []
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/UploadBlob'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/UploadBlob'
        required: true
      security:
      - {}
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadBlob'
          description: ''
      summary: Uploads a static asset file
  /api/profile/{profile}/plans:
    get:
      operationId: profile_plans_list
      description: |2+

        Returns a list of `page_size` plans managed by a specified provider.

        The queryset can be further refined to match a search filter (``q``)
        and/or a range of dates ([``start_at``, ``ends_at``]),
        and sorted on specific fields (``o``).

      parameters:
      - name: active
        required: false
        in: query
        description: True when customers can subscribe to the plan
        schema:
          type: string
      - name: ends_at
        required: false
        in: query
        description: date/time in ISO 8601 format
        schema:
          type: string
      - name: o
        required: false
        in: query
        description: sort by title, period_amount, is_active, created_at. If a field
          is preceded by a minus sign ('-'), the order will be reversed. Multiple
          'o' parameters can be specified to produce a stable result.
        schema:
          type: string
      - name: page
        required: false
        in: query
        description: A page number within the paginated result set.
        schema:
          type: integer
      - name: page_size
        required: false
        in: query
        description: Number of results to return per page between 1 and 100 (defaults
          to 25).
        schema:
          type: integer
      - in: path
        name: profile
        schema:
          type: string
        required: true
      - name: q
        required: false
        in: query
        description: value to search for in the fields specified by q_f
        schema:
          type: string
      - name: q_f
        required: false
        in: query
        description: 'restrict searches to one or more fields in: slug, title. searches
          all fields when unspecified.'
        schema:
          type: string
      - name: start_at
        required: false
        in: query
        description: date/time in ISO 8601 format
        schema:
          type: string
      tags:
      - provider
      - subscriptions
      - list
      - planmodel
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedPlanDetailList'
          description: ''
      summary: Lists a provider plans
    post:
      operationId: profile_plans_create
      description: |2+

        Creates a new subscription plan that belongs
        to the specified provider.

      parameters:
      - in: path
        name: profile
        schema:
          type: string
        required: true
      tags:
      - provider
      - subscriptions
      - planmodel
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PlanCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PlanCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PlanCreate'
        required: true
      security:
      - {}
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlanDetail'
          description: ''
      summary: Creates a plan
  /api/profile/{profile}/plans/{plan}:
    get:
      operationId: profile_plans_retrieve
      description: |2+

        Returns the {plan} that belongs to the specified provider.

        The ``is_active`` boolean is used to activate a plan, enabling users
        to subscribe to it, or deactivate a plan, disabling users from subscribing
        to it.

        The API is typically used within an HTML
        `update plan page </docs/guides/themes/#profile_plans_plan>`_
        as present in the default theme.

      parameters:
      - in: path
        name: plan
        schema:
          type: string
        required: true
      - in: path
        name: profile
        schema:
          type: string
        required: true
      tags:
      - provider
      - subscriptions
      - planmodel
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlanDetail'
          description: ''
      summary: Retrieves a plan
    put:
      operationId: profile_plans_update
      description: |2+

        Updates fields for {plan}. If the ``period_amount`` is modified,
        all subscriptions to this plan will be charged the ``period_amount``
        on renewal.

        The ``is_active`` boolean is used to activate a plan, enabling users
        to subscribe to it, or deactivate a plan, disabling users
        from subscribing to it.

        The API is typically used within an HTML
        `update plan page </docs/guides/themes/#profile_plans_plan>`_
        as present in the default theme.

      parameters:
      - in: path
        name: plan
        schema:
          type: string
        required: true
      - in: path
        name: profile
        schema:
          type: string
        required: true
      tags:
      - provider
      - subscriptions
      - planmodel
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PlanDetail'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PlanDetail'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PlanDetail'
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlanDetail'
          description: ''
      summary: Updates a plan
    patch:
      operationId: profile_plans_partial_update
      description: |2+

        Returns the {plan} that belongs to the specified provider.

        The ``is_active`` boolean is used to activate a plan, enabling users
        to subscribe to it, or deactivate a plan, disabling users from subscribing
        to it.

        The API is typically used within an HTML
        `update plan page </docs/guides/themes/#profile_plans_plan>`_
        as present in the default theme.

      parameters:
      - in: path
        name: plan
        schema:
          type: string
        required: true
      - in: path
        name: profile
        schema:
          type: string
        required: true
      tags:
      - provider
      - subscriptions
      - planmodel
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedPlanDetail'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedPlanDetail'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedPlanDetail'
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlanDetail'
          description: ''
      summary: Retrieves a plan
    delete:
      operationId: profile_plans_destroy
      description: |2+

        A plan can only be deleted when there are no subscriptions to it.
        Even if all subscriptions to a plan have expired, the plan cannot
        be deleted. It should be de-activated instead such that no customers
        can subscribes to it.

        The API is typically used within an HTML
        `update plan page </docs/guides/themes/#profile_plans_plan>`_
        as present in the default theme.

      parameters:
      - in: path
        name: plan
        schema:
          type: string
        required: true
      - in: path
        name: profile
        schema:
          type: string
        required: true
      tags:
      - provider
      - subscriptions
      - planmodel
      security:
      - {}
      responses:
        '204':
          description: No response body
      summary: Deletes a plan
  /api/profile/{profile}/plans/{plan}/subscriptions:
    get:
      operationId: profile_plans_subscriptions_list
      description: |2+

        Returns a list of `page_size` subscriptions to a {plan}
        of the provider {profile} whose renewal date is later than the time
        at which the API call was made.

        Optionnaly when an ``start_at`` query parameter is specified,
        the returned queryset is filtered such that each subscription
        start date (i.e. ``created_at`` field) is greater than ``start_at``.
        Using the ``start_at`` query parameter, it is effectively possible
        to construct cohorts of active subscribers by period of initial
        subscription.

        The queryset can be filtered for at least one field to match a search
        term (``q``).

        Returned results can be ordered by natural fields (``o``) in either
        ascending or descending order by using the minus sign ('-') in front
        of the ordering field name.

        The API is typically used within an HTML
        `subscribers page </docs/guides/themes/#dashboard_profile_subscribers>`_
        as present in the default theme.

      parameters:
      - name: o
        required: false
        in: query
        description: sort by created_at, ends_at, profile, profile__full_name, profile__email,
          profile__phone, profile__street_address, profile__locality, profile__region,
          profile__postal_code, profile__country, plan, plan__title. If a field is
          preceded by a minus sign ('-'), the order will be reversed. Multiple 'o'
          parameters can be specified to produce a stable result.
        schema:
          type: string
      - name: page
        required: false
        in: query
        description: A page number within the paginated result set.
        schema:
          type: integer
      - name: page_size
        required: false
        in: query
        description: Number of results to return per page between 1 and 100 (defaults
          to 25).
        schema:
          type: integer
      - in: path
        name: plan
        schema:
          type: string
        required: true
      - in: path
        name: profile
        schema:
          type: string
        required: true
      - name: q
        required: false
        in: query
        description: value to search for in the fields specified by q_f
        schema:
          type: string
      - name: q_f
        required: false
        in: query
        description: 'restrict searches to one or more fields in: profile, profile__full_name,
          profile__email, profile__phone, profile__street_address, profile__locality,
          profile__region, profile__postal_code, profile__country, plan, plan__title.
          searches all fields when unspecified.'
        schema:
          type: string
      - name: start_at
        required: false
        in: query
        description: date/time in ISO 8601 format
        schema:
          type: string
      tags:
      - provider
      - subscriptions
      - list
      - subscriptionmodel
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedProvidedSubscriptionDetailList'
          description: ''
      summary: Lists plan active subscriptions
    post:
      operationId: profile_plans_subscriptions_create
      description: |2+

        Subscribes a customer to the plan {plan} of the specified provider.

      parameters:
      - in: query
        name: force
        schema:
          type: boolean
        description: Forces invite of user/organization that could not be found
      - in: path
        name: plan
        schema:
          type: string
        required: true
      - in: path
        name: profile
        schema:
          type: string
        required: true
      tags:
      - provider
      - subscriptions
      - subscriptionmodel
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProvidedSubscriptionCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ProvidedSubscriptionCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ProvidedSubscriptionCreate'
        required: true
      security:
      - {}
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProvidedSubscription'
          description: ''
      summary: Grants a subscription
  /api/profile/{profile}/plans/{plan}/subscriptions/{subscriber}:
    get:
      operationId: profile_plans_subscriptions_retrieve
      description: |2+

        Returns the subscription of {subscriber} to a plan {plan}
        of the specified provider.

      parameters:
      - in: path
        name: plan
        schema:
          type: string
        required: true
      - in: path
        name: profile
        schema:
          type: string
        required: true
      - in: path
        name: subscriber
        schema:
          type: string
        required: true
      tags:
      - provider
      - subscriptions
      - subscriptionmodel
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProvidedSubscription'
          description: ''
      summary: Retrieves a plan subscription
    put:
      operationId: profile_plans_subscriptions_update
      description: |2+

        Updates the subscription of {subscriber} to a plan {plan}
        of the specified provider.

      parameters:
      - in: path
        name: plan
        schema:
          type: string
        required: true
      - in: path
        name: profile
        schema:
          type: string
        required: true
      - in: path
        name: subscriber
        schema:
          type: string
        required: true
      tags:
      - provider
      - subscriptions
      - subscriptionmodel
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProvidedSubscription'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ProvidedSubscription'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ProvidedSubscription'
        required: true
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProvidedSubscription'
          description: ''
      summary: Updates a plan subscription
    patch:
      operationId: profile_plans_subscriptions_partial_update
      description: |2+

        Returns the subscription of {subscriber} to a plan {plan}
        of the specified provider.

      parameters:
      - in: path
        name: plan
        schema:
          type: string
        required: true
      - in: path
        name: profile
        schema:
          type: string
        required: true
      - in: path
        name: subscriber
        schema:
          type: string
        required: true
      tags:
      - provider
      - subscriptions
      - subscriptionmodel
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedProvidedSubscription'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedProvidedSubscription'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedProvidedSubscription'
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProvidedSubscription'
          description: ''
      summary: Retrieves a plan subscription
    delete:
      operationId: profile_plans_subscriptions_destroy
      description: |2+

        Provider cancels a {subscriber}'s subscription to a plan {plan},
        effective at the time the API is called.


      parameters:
      - in: path
        name: plan
        schema:
          type: string
        required: true
      - in: path
        name: profile
        schema:
          type: string
        required: true
      - in: path
        name: subscriber
        schema:
          type: string
        required: true
      tags:
      - provider
      - subscriptions
      - subscriptionmodel
      security:
      - {}
      responses:
        '204':
          description: No response body
      summary: Cancels subscription
  /api/profile/{profile}/plans/{plan}/subscriptions/all:
    get:
      operationId: profile_plans_subscriptions_all_list
      description: |2+

        Returns a list of `page_size` subscriptions to a plan {plan}
        of the provider {profile}.

        The queryset can be filtered for at least one field to match a search
        term (``q``) and/or intersects a period (``start_at``, ``ends_at``).

        Returned results can be ordered by natural fields (``o``) in either
        ascending or descending order by using the minus sign ('-') in front
        of the ordering field name.

      parameters:
      - name: ends_at
        required: false
        in: query
        description: date/time in ISO 8601 format
        schema:
          type: string
      - name: o
        required: false
        in: query
        description: sort by created_at, ends_at, profile, profile__full_name, profile__email,
          profile__phone, profile__street_address, profile__locality, profile__region,
          profile__postal_code, profile__country, plan, plan__title. If a field is
          preceded by a minus sign ('-'), the order will be reversed. Multiple 'o'
          parameters can be specified to produce a stable result.
        schema:
          type: string
      - name: page
        required: false
        in: query
        description: A page number within the paginated result set.
        schema:
          type: integer
      - name: page_size
        required: false
        in: query
        description: Number of results to return per page between 1 and 100 (defaults
          to 25).
        schema:
          type: integer
      - in: path
        name: plan
        schema:
          type: string
        required: true
      - in: path
        name: profile
        schema:
          type: string
        required: true
      - name: q
        required: false
        in: query
        description: value to search for in the fields specified by q_f
        schema:
          type: string
      - name: q_f
        required: false
        in: query
        description: 'restrict searches to one or more fields in: profile, profile__full_name,
          profile__email, profile__phone, profile__street_address, profile__locality,
          profile__region, profile__postal_code, profile__country, plan, plan__title.
          searches all fields when unspecified.'
        schema:
          type: string
      - name: start_at
        required: false
        in: query
        description: date/time in ISO 8601 format
        schema:
          type: string
      tags:
      - provider
      - subscriptions
      - list
      - subscriptionmodel
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedProvidedSubscriptionList'
          description: ''
      summary: Lists plan subscriptions
  /api/profile/{profile}/plans/{plan}/subscriptions/churned:
    get:
      operationId: profile_plans_subscriptions_churned_list
      description: |2+

        Returns a list of `page_size` subscriptions to a {plan}
        of the provider {profile} which have ended already at the time
        the API call was made.

        Optionally by defining either ``start_at``, ``ends_at`` , or both,
        it is possible to construct cohorts of subscribers that have churned
        within a period.

        The queryset can be filtered for at least one field to match a search
        term (``q``).

        Returned results can be ordered by natural fields (``o``) in either
        ascending or descending order by using the minus sign ('-') in front
        of the ordering field name.

        The API is typically used within an HTML
        `subscribers page </docs/guides/themes/#dashboard_profile_subscribers>`_
        as present in the default theme.

      parameters:
      - name: ends_at
        required: false
        in: query
        description: date/time in ISO 8601 format
        schema:
          type: string
      - name: o
        required: false
        in: query
        description: sort by created_at, ends_at, profile, profile__full_name, profile__email,
          profile__phone, profile__street_address, profile__locality, profile__region,
          profile__postal_code, profile__country, plan, plan__title. If a field is
          preceded by a minus sign ('-'), the order will be reversed. Multiple 'o'
          parameters can be specified to produce a stable result.
        schema:
          type: string
      - name: page
        required: false
        in: query
        description: A page number within the paginated result set.
        schema:
          type: integer
      - name: page_size
        required: false
        in: query
        description: Number of results to return per page between 1 and 100 (defaults
          to 25).
        schema:
          type: integer
      - in: path
        name: plan
        schema:
          type: string
        required: true
      - in: path
        name: profile
        schema:
          type: string
        required: true
      - name: q
        required: false
        in: query
        description: value to search for in the fields specified by q_f
        schema:
          type: string
      - name: q_f
        required: false
        in: query
        description: 'restrict searches to one or more fields in: profile, profile__full_name,
          profile__email, profile__phone, profile__street_address, profile__locality,
          profile__region, profile__postal_code, profile__country, plan, plan__title.
          searches all fields when unspecified.'
        schema:
          type: string
      - name: start_at
        required: false
        in: query
        description: date/time in ISO 8601 format
        schema:
          type: string
      tags:
      - provider
      - subscriptions
      - list
      - subscriptionmodel
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedProvidedSubscriptionList'
          description: ''
      summary: Lists plan churned subscriptions
  /api/profile/{profile}/roles:
    get:
      operationId: profile_roles_list
      description: |2+

      parameters:
      - name: o
        required: false
        in: query
        description: sort by profile__full_name, user, user__full_name, role__title,
          grant_key, request_key, created_at. If a field is preceded by a minus sign
          ('-'), the order will be reversed. Multiple 'o' parameters can be specified
          to produce a stable result.
        schema:
          type: string
      - name: page
        required: false
        in: query
        description: A page number within the paginated result set.
        schema:
          type: integer
      - name: page_size
        required: false
        in: query
        description: Number of results to return per page between 1 and 100 (defaults
          to 25).
        schema:
          type: integer
      - in: path
        name: profile
        schema:
          type: string
        required: true
      - name: q
        required: false
        in: query
        description: value to search for in the fields specified by q_f
        schema:
          type: string
      - name: q_f
        required: false
        in: query
        description: 'restrict searches to one or more fields in: user, user__full_name,
          user__email, role, role__title. searches all fields when unspecified.'
        schema:
          type: string
      tags:
      - subscriber
      - list
      - rolemodel
      - rbac
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedRoleList'
          description: ''
      summary: Lists users and their role on an profile
  /api/profile/{profile}/roles/{role}:
    get:
      operationId: profile_roles_list_by_role
      description: |2+

        Lists the specified role assignments for a profile.

      parameters:
      - name: o
        required: false
        in: query
        description: sort by profile__full_name, user, user__full_name, role__title,
          grant_key, request_key, created_at. If a field is preceded by a minus sign
          ('-'), the order will be reversed. Multiple 'o' parameters can be specified
          to produce a stable result.
        schema:
          type: string
      - name: page
        required: false
        in: query
        description: A page number within the paginated result set.
        schema:
          type: integer
      - name: page_size
        required: false
        in: query
        description: Number of results to return per page between 1 and 100 (defaults
          to 25).
        schema:
          type: integer
      - in: path
        name: profile
        schema:
          type: string
          pattern: ^[-a-zA-Z0-9_]+$
        required: true
      - name: q
        required: false
        in: query
        description: value to search for in the fields specified by q_f
        schema:
          type: string
      - name: q_f
        required: false
        in: query
        description: 'restrict searches to one or more fields in: user, user__full_name,
          user__email. searches all fields when unspecified.'
        schema:
          type: string
      - in: path
        name: role
        schema:
          type: string
          pattern: ^[-a-zA-Z0-9_]+$
        required: true
      tags:
      - rbac
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedRoleList'
          description: ''
      summary: Lists roles of a specific type
    post:
      operationId: profile_roles_create
      description: |2+

        Attaches a user to a specified billing profile with a {role},
        typically granting permissions to the user with regards
        to managing the profile
        (see `Flexible Security Framework  <http://djaodjin-saas.readthedocs.io/en/latest/security.html>`_).

      parameters:
      - in: query
        name: force
        schema:
          type: boolean
        description: Forces invite of user/organization that could not be found
      - in: path
        name: profile
        schema:
          type: string
          pattern: ^[-a-zA-Z0-9_]+$
        required: true
      - in: path
        name: role
        schema:
          type: string
          pattern: ^[-a-zA-Z0-9_]+$
        required: true
      tags:
      - subscriber
      - rolemodel
      - rbac
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RoleCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/RoleCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/RoleCreate'
      security:
      - {}
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Role'
          description: ''
      summary: Creates a role
  /api/profile/{profile}/roles/{role}/{user}:
    post:
      operationId: profile_roles_invite
      description: |2+

        Re-sends the notification that the {user} was granted a {role}
        on the specified billing profile.

      parameters:
      - in: path
        name: profile
        schema:
          type: string
          pattern: ^[-a-zA-Z0-9_]+$
        required: true
      - in: path
        name: role
        schema:
          type: string
          pattern: ^[-a-zA-Z0-9_]+$
        required: true
      - in: path
        name: user
        schema:
          type: string
          pattern: ^[a-zA-Z0-9_\-\+\.\@]+$
        required: true
      tags:
      - subscriber
      - rolemodel
      - rbac
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Role'
          description: ''
      summary: Sends invite notification for a role
    delete:
      operationId: profile_roles_destroy
      description: |2+

        Dettaches a {user} from one or all roles with regards to the
        specified billing profile, typically resulting in revoking
        permissions from the user to manage part of the profile.

      parameters:
      - in: path
        name: profile
        schema:
          type: string
          pattern: ^[-a-zA-Z0-9_]+$
        required: true
      - in: path
        name: role
        schema:
          type: string
          pattern: ^[-a-zA-Z0-9_]+$
        required: true
      - in: path
        name: user
        schema:
          type: string
          pattern: ^[a-zA-Z0-9_\-\+\.\@]+$
        required: true
      tags:
      - subscriber
      - rolemodel
      - rbac
      security:
      - {}
      responses:
        '204':
          description: No response body
      summary: Deletes a role
  /api/profile/{profile}/roles/describe:
    get:
      operationId: profile_roles_describe_list
      description: |2+

        Lists roles by description``RoleDescription``.

        see `Flexible Security Framework  <http://djaodjin-saas.readthedocs.io/en/latest/security.html>`_.

      parameters:
      - name: o
        required: false
        in: query
        description: sort by slug, title. If a field is preceded by a minus sign ('-'),
          the order will be reversed. Multiple 'o' parameters can be specified to
          produce a stable result.
        schema:
          type: string
      - name: page
        required: false
        in: query
        description: A page number within the paginated result set.
        schema:
          type: integer
      - name: page_size
        required: false
        in: query
        description: Number of results to return per page between 1 and 100 (defaults
          to 25).
        schema:
          type: integer
      - in: path
        name: profile
        schema:
          type: string
        required: true
      - name: q
        required: false
        in: query
        description: value to search for in the fields specified by q_f
        schema:
          type: string
      - name: q_f
        required: false
        in: query
        description: 'restrict searches to one or more fields in: slug, title. searches
          all fields when unspecified.'
        schema:
          type: string
      tags:
      - subscriber
      - list
      - rolemodel
      - rbac
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedRoleDescriptionList'
          description: ''
      summary: Lists role types
    post:
      operationId: profile_roles_describe_create
      description: |2+

        Creates a role that users can take on a profile.

        see `Flexible Security Framework  <http://djaodjin-saas.readthedocs.io/en/latest/security.html>`_.

      parameters:
      - in: path
        name: profile
        schema:
          type: string
        required: true
      tags:
      - subscriber
      - rolemodel
      - rbac
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RoleDescription'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/RoleDescription'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/RoleDescription'
        required: true
      security:
      - {}
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RoleDescription'
          description: ''
      summary: Creates a role type
  /api/profile/{profile}/roles/describe/{role}:
    get:
      operationId: profile_roles_describe_retrieve
      description: |2+

        see `Flexible Security Framework  <http://djaodjin-saas.readthedocs.io/en/latest/security.html>`_.

      parameters:
      - in: path
        name: profile
        schema:
          type: string
        required: true
      - in: path
        name: role
        schema:
          type: string
        required: true
      tags:
      - subscriber
      - rolemodel
      - rbac
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RoleDescription'
          description: ''
      summary: Retrieves a role type
    put:
      operationId: profile_roles_describe_update
      description: |2+

        see `Flexible Security Framework  <http://djaodjin-saas.readthedocs.io/en/latest/security.html>`_.

      parameters:
      - in: path
        name: profile
        schema:
          type: string
        required: true
      - in: path
        name: role
        schema:
          type: string
        required: true
      tags:
      - subscriber
      - rolemodel
      - rbac
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RoleDescription'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/RoleDescription'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/RoleDescription'
        required: true
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RoleDescription'
          description: ''
      summary: Updates a role type
    patch:
      operationId: profile_roles_describe_partial_update
      description: |2+

        see `Flexible Security Framework  <http://djaodjin-saas.readthedocs.io/en/latest/security.html>`_.

      parameters:
      - in: path
        name: profile
        schema:
          type: string
        required: true
      - in: path
        name: role
        schema:
          type: string
        required: true
      tags:
      - subscriber
      - rolemodel
      - rbac
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedRoleDescription'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedRoleDescription'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedRoleDescription'
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RoleDescription'
          description: ''
      summary: Retrieves a role type
    delete:
      operationId: profile_roles_describe_destroy
      description: |2+

        see `Flexible Security Framework  <http://djaodjin-saas.readthedocs.io/en/latest/security.html>`_.

      parameters:
      - in: path
        name: profile
        schema:
          type: string
        required: true
      - in: path
        name: role
        schema:
          type: string
        required: true
      tags:
      - subscriber
      - rolemodel
      - rbac
      security:
      - {}
      responses:
        '204':
          description: No response body
      summary: Deletes a role type
  /api/profile/{profile}/subscribers:
    get:
      operationId: profile_subscribers_list
      description: |2+

        Returns a list of `page_size` subscribers which have an active
        subscription to a plan of the specified provider {profile}.

        The queryset can be filtered for at least one field to match a search
        term (``q``) and/or intersects a period (``start_at``, ``ends_at``).

        Returned results can be ordered by natural fields (``o``) in either
        ascending or descending order by using the minus sign ('-') in front
        of the ordering field name.

        The API is typically used in search forms linked to providers.

      parameters:
      - name: ends_at
        required: false
        in: query
        description: date/time in ISO 8601 format
        schema:
          type: string
      - name: o
        required: false
        in: query
        description: sort by full_name, created_at. If a field is preceded by a minus
          sign ('-'), the order will be reversed. Multiple 'o' parameters can be specified
          to produce a stable result.
        schema:
          type: string
      - name: page
        required: false
        in: query
        description: A page number within the paginated result set.
        schema:
          type: integer
      - name: page_size
        required: false
        in: query
        description: Number of results to return per page between 1 and 100 (defaults
          to 25).
        schema:
          type: integer
      - in: path
        name: profile
        schema:
          type: string
        required: true
      - name: q
        required: false
        in: query
        description: value to search for in the fields specified by q_f
        schema:
          type: string
      - name: q_f
        required: false
        in: query
        description: 'restrict searches to one or more fields in: slug, full_name,
          email, phone, street_address, locality, region, postal_code, country, username,
          first_name, last_name. searches all fields when unspecified.'
        schema:
          type: string
      - name: start_at
        required: false
        in: query
        description: date/time in ISO 8601 format
        schema:
          type: string
      tags:
      - profilemodel
      - provider
      - subscriptions
      - list
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedOrganizationList'
          description: ''
      summary: Lists active subscribers
  /api/profile/{profile}/subscribers/accept/{request_key}:
    post:
      operationId: profile_subscribers_accept_create
      description: |2+

        Accepts a subscription request identified by {request_key}.
        The subscription must be to a plan that belongs to the specified
        provider.

      parameters:
      - in: path
        name: profile
        schema:
          type: string
          pattern: ^[-a-zA-Z0-9_]+$
        required: true
      - in: path
        name: request_key
        schema:
          type: string
          pattern: ^[a-f0-9]{40}$
        required: true
      tags:
      - provider
      - subscriptionmodel
      - rbac
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProvidedSubscription'
          description: ''
      summary: Grants a subscription request
  /api/profile/{profile}/subscribers/all:
    get:
      operationId: profile_subscribers_all_list
      description: |2+

        Returns a list of `page_size` subscribers which have or
        had a subscription to a plan of the specified provider {profile}.

        The queryset can be filtered for at least one field to match a search
        term (``q``) and/or intersects a period (``start_at``, ``ends_at``).

        Returned results can be ordered by natural fields (``o``) in either
        ascending or descending order by using the minus sign ('-') in front
        of the ordering field name.

        The API is typically used in search forms linked to providers.

      parameters:
      - name: ends_at
        required: false
        in: query
        description: date/time in ISO 8601 format
        schema:
          type: string
      - name: o
        required: false
        in: query
        description: sort by full_name, created_at. If a field is preceded by a minus
          sign ('-'), the order will be reversed. Multiple 'o' parameters can be specified
          to produce a stable result.
        schema:
          type: string
      - name: page
        required: false
        in: query
        description: A page number within the paginated result set.
        schema:
          type: integer
      - name: page_size
        required: false
        in: query
        description: Number of results to return per page between 1 and 100 (defaults
          to 25).
        schema:
          type: integer
      - in: path
        name: profile
        schema:
          type: string
        required: true
      - name: q
        required: false
        in: query
        description: value to search for in the fields specified by q_f
        schema:
          type: string
      - name: q_f
        required: false
        in: query
        description: 'restrict searches to one or more fields in: slug, full_name,
          email, phone, street_address, locality, region, postal_code, country, username,
          first_name, last_name. searches all fields when unspecified.'
        schema:
          type: string
      - name: start_at
        required: false
        in: query
        description: date/time in ISO 8601 format
        schema:
          type: string
      tags:
      - profilemodel
      - provider
      - subscriptions
      - list
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedOrganizationList'
          description: ''
      summary: Lists subscribers
  /api/profile/{profile}/subscribers/engaged:
    get:
      operationId: profile_subscribers_engaged_list
      description: |2+

        Returns a list of `page_size` subscribers which have or
        had a subscription to a plan of the specified provider {profile}.

        The queryset can be further refined to match a search filter (``q``)
        and/or a range of dates ([``start_at``, ``ends_at``]),
        and sorted on specific fields (``o``).

      parameters:
      - name: o
        required: false
        in: query
        description: sort by created_at, first_name, last_name, profile, profile__full_name.
          If a field is preceded by a minus sign ('-'), the order will be reversed.
          Multiple 'o' parameters can be specified to produce a stable result.
        schema:
          type: string
      - name: page
        required: false
        in: query
        description: A page number within the paginated result set.
        schema:
          type: integer
      - name: page_size
        required: false
        in: query
        description: Number of results to return per page between 1 and 100 (defaults
          to 25).
        schema:
          type: integer
      - in: path
        name: profile
        schema:
          type: string
        required: true
      - name: q
        required: false
        in: query
        description: value to search for in the fields specified by q_f
        schema:
          type: string
      - name: q_f
        required: false
        in: query
        description: 'restrict searches to one or more fields in: first_name, last_name,
          profile, profile__full_name. searches all fields when unspecified.'
        schema:
          type: string
      tags:
      - provider
      - subscriptions
      - list
      - rolemodel
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedEngagedSubscriberList'
          description: ''
      summary: Lists engaged subscribers
  /api/profile/{profile}/subscribers/subscriptions:
    get:
      operationId: profile_subscribers_subscriptions_list
      description: |2+

        Returns a list of `page_size` subscriptions whose renewal
        date is later than the time at which the API call was made,
        and the owner of the subscription plan is the specified provider
        {profile}.

        Optionnaly when an ``start_at`` query parameter is specified,
        the returned queryset is filtered such that each subscription
        start date (i.e. ``created_at`` field) is greater than ``start_at``.
        Using the ``start_at`` query parameter, it is effectively possible
        to construct cohorts of active subscribers by period of initial
        subscription.

        The queryset can be filtered for at least one field to match a search
        term (``q``).

        Returned results can be ordered by natural fields (``o``) in either
        ascending or descending order by using the minus sign ('-') in front
        of the ordering field name.

        The API is typically used within an HTML
        `subscribers page </docs/guides/themes/#dashboard_profile_subscribers>`_
        as present in the default theme.

      parameters:
      - name: o
        required: false
        in: query
        description: sort by created_at, ends_at, profile, profile__full_name, profile__email,
          profile__phone, profile__street_address, profile__locality, profile__region,
          profile__postal_code, profile__country, plan, plan__title. If a field is
          preceded by a minus sign ('-'), the order will be reversed. Multiple 'o'
          parameters can be specified to produce a stable result.
        schema:
          type: string
      - name: page
        required: false
        in: query
        description: A page number within the paginated result set.
        schema:
          type: integer
      - name: page_size
        required: false
        in: query
        description: Number of results to return per page between 1 and 100 (defaults
          to 25).
        schema:
          type: integer
      - in: path
        name: profile
        schema:
          type: string
        required: true
      - name: q
        required: false
        in: query
        description: value to search for in the fields specified by q_f
        schema:
          type: string
      - name: q_f
        required: false
        in: query
        description: 'restrict searches to one or more fields in: profile, profile__full_name,
          profile__email, profile__phone, profile__street_address, profile__locality,
          profile__region, profile__postal_code, profile__country, plan, plan__title.
          searches all fields when unspecified.'
        schema:
          type: string
      - name: start_at
        required: false
        in: query
        description: date/time in ISO 8601 format
        schema:
          type: string
      tags:
      - provider
      - subscriptions
      - list
      - subscriptionmodel
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedProvidedSubscriptionDetailList'
          description: ''
      summary: Lists provider active subscriptions
  /api/profile/{profile}/subscribers/subscriptions/all:
    get:
      operationId: profile_subscribers_subscriptions_all_list
      description: |2+

        Returns a list of `page_size` subscriber profiles which have or
        had a subscription to a plan of the specified provider.

        The queryset can be filtered for at least one field to match a search
        term (``q``)  and/or intersects a period (``start_at``, ``ends_at``).

        Returned results can be ordered by natural fields (``o``) in either
        ascending or descending order by using the minus sign ('-') in front
        of the ordering field name.

      parameters:
      - name: ends_at
        required: false
        in: query
        description: date/time in ISO 8601 format
        schema:
          type: string
      - name: o
        required: false
        in: query
        description: sort by created_at, ends_at, profile, profile__full_name, profile__email,
          profile__phone, profile__street_address, profile__locality, profile__region,
          profile__postal_code, profile__country, plan, plan__title. If a field is
          preceded by a minus sign ('-'), the order will be reversed. Multiple 'o'
          parameters can be specified to produce a stable result.
        schema:
          type: string
      - name: page
        required: false
        in: query
        description: A page number within the paginated result set.
        schema:
          type: integer
      - name: page_size
        required: false
        in: query
        description: Number of results to return per page between 1 and 100 (defaults
          to 25).
        schema:
          type: integer
      - in: path
        name: profile
        schema:
          type: string
        required: true
      - name: q
        required: false
        in: query
        description: value to search for in the fields specified by q_f
        schema:
          type: string
      - name: q_f
        required: false
        in: query
        description: 'restrict searches to one or more fields in: profile, profile__full_name,
          profile__email, profile__phone, profile__street_address, profile__locality,
          profile__region, profile__postal_code, profile__country, plan, plan__title.
          searches all fields when unspecified.'
        schema:
          type: string
      - name: start_at
        required: false
        in: query
        description: date/time in ISO 8601 format
        schema:
          type: string
      tags:
      - provider
      - subscriptions
      - list
      - subscriptionmodel
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedProvidedSubscriptionList'
          description: ''
      summary: Lists provider subscriptions
  /api/profile/{profile}/subscribers/subscriptions/churned:
    get:
      operationId: profile_subscribers_subscriptions_churned_list
      description: |2+

        Returns a list of `page_size` subscriptions which have ended already
        the time at which the API call was made, and the owner of the subscription
        plan is the specified provider {profile}.

        Optionally by defining either ``start_at``, ``ends_at`` , or both,
        it is possible to construct cohorts of subscribers that have churned
        within a period.

        The queryset can be filtered for at least one field to match a search
        term (``q``).

        Returned results can be ordered by natural fields (``o``) in either
        ascending or descending order by using the minus sign ('-') in front
        of the ordering field name.

        The API is typically used within an HTML
        `subscribers page </docs/guides/themes/#dashboard_profile_subscribers>`_
        as present in the default theme.

      parameters:
      - name: ends_at
        required: false
        in: query
        description: date/time in ISO 8601 format
        schema:
          type: string
      - name: o
        required: false
        in: query
        description: sort by created_at, ends_at, profile, profile__full_name, profile__email,
          profile__phone, profile__street_address, profile__locality, profile__region,
          profile__postal_code, profile__country, plan, plan__title. If a field is
          preceded by a minus sign ('-'), the order will be reversed. Multiple 'o'
          parameters can be specified to produce a stable result.
        schema:
          type: string
      - name: page
        required: false
        in: query
        description: A page number within the paginated result set.
        schema:
          type: integer
      - name: page_size
        required: false
        in: query
        description: Number of results to return per page between 1 and 100 (defaults
          to 25).
        schema:
          type: integer
      - in: path
        name: profile
        schema:
          type: string
        required: true
      - name: q
        required: false
        in: query
        description: value to search for in the fields specified by q_f
        schema:
          type: string
      - name: q_f
        required: false
        in: query
        description: 'restrict searches to one or more fields in: profile, profile__full_name,
          profile__email, profile__phone, profile__street_address, profile__locality,
          profile__region, profile__postal_code, profile__country, plan, plan__title.
          searches all fields when unspecified.'
        schema:
          type: string
      - name: start_at
        required: false
        in: query
        description: date/time in ISO 8601 format
        schema:
          type: string
      tags:
      - provider
      - subscriptions
      - list
      - subscriptionmodel
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedProvidedSubscriptionList'
          description: ''
      summary: Lists provider churned subscriptions
  /api/profile/{profile}/subscribers/unengaged:
    get:
      operationId: profile_subscribers_unengaged_list
      description: |2+

        Returns a list of `page_size` subscribers which have or
        had a subscription to a plan of the specified provider {profile}.

        The queryset can be further refined to match a search filter (``q``)
        and/or a range of dates ([``start_at``, ``ends_at``]),
        and sorted on specific fields (``o``).

      parameters:
      - name: o
        required: false
        in: query
        description: sort by full_name, created_at. If a field is preceded by a minus
          sign ('-'), the order will be reversed. Multiple 'o' parameters can be specified
          to produce a stable result.
        schema:
          type: string
      - name: page
        required: false
        in: query
        description: A page number within the paginated result set.
        schema:
          type: integer
      - name: page_size
        required: false
        in: query
        description: Number of results to return per page between 1 and 100 (defaults
          to 25).
        schema:
          type: integer
      - in: path
        name: profile
        schema:
          type: string
        required: true
      - name: q
        required: false
        in: query
        description: value to search for in the fields specified by q_f
        schema:
          type: string
      - name: q_f
        required: false
        in: query
        description: 'restrict searches to one or more fields in: slug, full_name,
          email, phone, street_address, locality, region, postal_code, country, username,
          first_name, last_name. searches all fields when unspecified.'
        schema:
          type: string
      tags:
      - profilemodel
      - provider
      - subscriptions
      - list
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedOrganizationList'
          description: ''
      summary: Lists inactive subscribers
  /api/profile/{profile}/subscriptions:
    get:
      operationId: profile_subscriptions_list
      description: |2+

        Returns a list of `page_size` subscriptions for subscriber {profile}
        whose renewal date is later than the time at which the API call was made.

        The queryset can be filtered such that each subscription initial start
        date is greater than the ``start_at`` query parameter.

        The queryset can be filtered for at least one field to match a search
        term (``q``).

        Returned results can be ordered by natural fields (``o``) in either
        ascending or descending order by using the minus sign ('-') in front
        of the ordering field name.

        The API is typically used within an HTML
        `subscriptions page </docs/guides/themes/#dashboard_profile_subscriptions>`_
        as present in the default theme.

      parameters:
      - name: o
        required: false
        in: query
        description: sort by created_at, ends_at, profile, profile__full_name, profile__email,
          profile__phone, profile__street_address, profile__locality, profile__region,
          profile__postal_code, profile__country, plan, plan__title. If a field is
          preceded by a minus sign ('-'), the order will be reversed. Multiple 'o'
          parameters can be specified to produce a stable result.
        schema:
          type: string
      - name: page
        required: false
        in: query
        description: A page number within the paginated result set.
        schema:
          type: integer
      - name: page_size
        required: false
        in: query
        description: Number of results to return per page between 1 and 100 (defaults
          to 25).
        schema:
          type: integer
      - in: path
        name: profile
        schema:
          type: string
        required: true
      - name: q
        required: false
        in: query
        description: value to search for in the fields specified by q_f
        schema:
          type: string
      - name: q_f
        required: false
        in: query
        description: 'restrict searches to one or more fields in: profile, profile__full_name,
          profile__email, profile__phone, profile__street_address, profile__locality,
          profile__region, profile__postal_code, profile__country, plan, plan__title.
          searches all fields when unspecified.'
        schema:
          type: string
      - name: start_at
        required: false
        in: query
        description: date/time in ISO 8601 format
        schema:
          type: string
      tags:
      - subscriber
      - subscriptions
      - subscriptionmodel
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedSubscribedSubscriptionList'
          description: ''
      summary: Lists present subscriptions
  /api/profile/{profile}/subscriptions/{subscribed_plan}:
    get:
      operationId: profile_subscriptions_retrieve
      description: |2+

        Returns a subscription to plan {subscribed_plan} for the specified
        subscriber.

      parameters:
      - in: path
        name: profile
        schema:
          type: string
        required: true
      - in: path
        name: subscribed_plan
        schema:
          type: string
        required: true
      tags:
      - subscriber
      - subscriptions
      - subscriptionmodel
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubscribedSubscription'
          description: ''
      summary: Retrieves a subscriber subscription
    put:
      operationId: profile_subscriptions_update
      description: |2+

        Unsubscribes a specified subscriber from a plan {subscribed_plan}
        at a future date.

        The API is typically used within an HTML
        `subscribers page </docs/guides/themes/#dashboard_profile_subscribers>`_
        as present in the default theme.

      parameters:
      - in: path
        name: profile
        schema:
          type: string
        required: true
      - in: path
        name: subscribed_plan
        schema:
          type: string
        required: true
      tags:
      - subscriber
      - subscriptions
      - subscriptionmodel
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubscribedSubscription'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/SubscribedSubscription'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/SubscribedSubscription'
        required: true
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubscribedSubscription'
          description: ''
      summary: Unsubscribes  at a future date
    patch:
      operationId: profile_subscriptions_partial_update
      description: |2+

        Returns a subscription to plan {subscribed_plan} for the specified
        subscriber.

      parameters:
      - in: path
        name: profile
        schema:
          type: string
        required: true
      - in: path
        name: subscribed_plan
        schema:
          type: string
        required: true
      tags:
      - subscriber
      - subscriptions
      - subscriptionmodel
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedSubscribedSubscription'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedSubscribedSubscription'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedSubscribedSubscription'
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubscribedSubscription'
          description: ''
      summary: Retrieves a subscriber subscription
    delete:
      operationId: profile_subscriptions_destroy
      description: |2+

        Unsubscribes a specified subscriber from a plan {subscribed_plan}.

        The API is typically used within an HTML
        `subscribers page </docs/guides/themes/#dashboard_profile_subscribers>`_
        as present in the default theme.

      parameters:
      - in: path
        name: profile
        schema:
          type: string
        required: true
      - in: path
        name: subscribed_plan
        schema:
          type: string
        required: true
      tags:
      - subscriber
      - subscriptions
      - subscriptionmodel
      security:
      - {}
      responses:
        '204':
          description: No response body
      summary: Unsubscribes now
  /api/profile/{profile}/subscriptions/expired:
    get:
      operationId: profile_subscriptions_expired_list
      description: |2+

        Returns a list of `page_size` subscriptions for subscriber {profile}
        which have ended already the time at which the API call was made.

        Optionally by defining either ``start_at``, ``ends_at`` , or both,
        it is possible to find subscriptions which have expired within
        a specified period.

        The queryset can be filtered for at least one field to match a search
        term (``q``).

        Returned results can be ordered by natural fields (``o``) in either
        ascending or descending order by using the minus sign ('-') in front
        of the ordering field name.

        The API is typically used within an HTML
        `subscriptions page </docs/guides/themes/#dashboard_profile_subscriptions>`_
        as present in the default theme.

      parameters:
      - name: ends_at
        required: false
        in: query
        description: date/time in ISO 8601 format
        schema:
          type: string
      - name: o
        required: false
        in: query
        description: sort by created_at, ends_at, profile, profile__full_name, profile__email,
          profile__phone, profile__street_address, profile__locality, profile__region,
          profile__postal_code, profile__country, plan, plan__title. If a field is
          preceded by a minus sign ('-'), the order will be reversed. Multiple 'o'
          parameters can be specified to produce a stable result.
        schema:
          type: string
      - name: page
        required: false
        in: query
        description: A page number within the paginated result set.
        schema:
          type: integer
      - name: page_size
        required: false
        in: query
        description: Number of results to return per page between 1 and 100 (defaults
          to 25).
        schema:
          type: integer
      - in: path
        name: profile
        schema:
          type: string
        required: true
      - name: q
        required: false
        in: query
        description: value to search for in the fields specified by q_f
        schema:
          type: string
      - name: q_f
        required: false
        in: query
        description: 'restrict searches to one or more fields in: profile, profile__full_name,
          profile__email, profile__phone, profile__street_address, profile__locality,
          profile__region, profile__postal_code, profile__country, plan, plan__title.
          searches all fields when unspecified.'
        schema:
          type: string
      - name: start_at
        required: false
        in: query
        description: date/time in ISO 8601 format
        schema:
          type: string
      tags:
      - subscriber
      - subscriptions
      - subscriptionmodel
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedSubscribedSubscriptionList'
          description: ''
      summary: Lists expired subscriptions
  /api/proxy:
    get:
      operationId: proxy_retrieve
      description: |2+

        Returns the URL endpoint to which requests passing the access rules
        are forwarded to, and the format in which the session information
        is encoded.

        When running tests, you can retrieve the actual session information
        for a specific user through the
        `session API endpoint  <#retrieveGetSessionDetail>`_.

      tags:
      - appmodel
      - broker
      - rbac
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/App'
          description: ''
      summary: Retrieves forward end-point
    put:
      operationId: proxy_update
      description: |2+

        Updates the URL endpoint to which requests passing the access rules
        are forwarded to and/or the format in which the session information
        is encoded.

      tags:
      - appmodel
      - broker
      - rbac
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/App'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/App'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/App'
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/App'
          description: ''
      summary: Updates forward end-point
    patch:
      operationId: proxy_partial_update
      description: |2+

        Returns the URL endpoint to which requests passing the access rules
        are forwarded to, and the format in which the session information
        is encoded.

        When running tests, you can retrieve the actual session information
        for a specific user through the
        `session API endpoint  <#retrieveGetSessionDetail>`_.

      tags:
      - appmodel
      - broker
      - rbac
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedApp'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedApp'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedApp'
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/App'
          description: ''
      summary: Retrieves forward end-point
  /api/proxy/engagement:
    get:
      operationId: proxy_engagement_retrieve
      description: |2+

      tags:
      - appmodel
      - broker
      - rbac
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Engagements'
          description: ''
      summary: Retrieves users engagement
  /api/proxy/engagement/users:
    get:
      operationId: proxy_engagement_users_list
      description: |2+

      parameters:
      - name: page
        required: false
        in: query
        description: A page number within the paginated result set.
        schema:
          type: integer
      - name: page_size
        required: false
        in: query
        description: Number of results to return per page between 1 and 100 (defaults
          to 25).
        schema:
          type: integer
      tags:
      - appmodel
      - broker
      - rbac
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedUserEngagementList'
          description: ''
      summary: Retrieves engagement metrics
  /api/proxy/key:
    post:
      operationId: proxy_key_create
      description: |2+

        Rotates the key used to encode the session information forwarded
        to the application entry point.

      tags:
      - appmodel
      - broker
      - rbac
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AppKey'
          description: ''
      summary: Rotates session encoding key
  /api/proxy/recent:
    get:
      operationId: proxy_recent_list
      description: |2+

        The API is typically used within an HTML
        `dashboard page </docs/guides/themes/#dashboard_metrics_dashboard>`_
        as present in the default theme.

      parameters:
      - name: page
        required: false
        in: query
        description: A page number within the paginated result set.
        schema:
          type: integer
      - name: page_size
        required: false
        in: query
        description: Number of results to return per page between 1 and 100 (defaults
          to 25).
        schema:
          type: integer
      tags:
      - appmodel
      - metrics
      - broker
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedRecentActivityList'
          description: ''
      summary: Retrieves recently active users
  /api/proxy/rules:
    get:
      operationId: proxy_rules_list
      description: |2+

        Returns a list of `page_size` rules incoming HTTP requests
        are checked against.

      parameters:
      - name: page
        required: false
        in: query
        description: A page number within the paginated result set.
        schema:
          type: integer
      - name: page_size
        required: false
        in: query
        description: Number of results to return per page between 1 and 100 (defaults
          to 25).
        schema:
          type: integer
      tags:
      - appmodel
      - broker
      - rbac
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedRuleList'
          description: ''
      summary: Lists access rules
    post:
      operationId: proxy_rules_create
      description: |2+

      tags:
      - appmodel
      - broker
      - rbac
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Rule'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Rule'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Rule'
        required: true
      security:
      - {}
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Rule'
          description: ''
      summary: Creates an access rule
    patch:
      operationId: proxy_rules_partial_update
      description: |2+

        When receiving a request like [{"newpos": 1, "oldpos": 3}],
        it will move the rule at position 3 to position 1, updating all
        rules ranks in-between.

      tags:
      - appmodel
      - broker
      - rbac
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedRuleRankUpdate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedRuleRankUpdate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedRuleRankUpdate'
      security:
      - {}
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedRuleList'
          description: ''
      summary: Updates order of rules
  /api/proxy/rules/{path}:
    get:
      operationId: proxy_rules_retrieve
      description: |2+

      parameters:
      - in: path
        name: path
        schema:
          type: string
          pattern: ^([a-zA-Z0-9:\-\{\}]+/)*[a-zA-Z0-9:\-\{\}]*$
        required: true
      tags:
      - appmodel
      - broker
      - rbac
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateRule'
          description: ''
      summary: Retrieves an access rule
    put:
      operationId: proxy_rules_update
      description: |2+

      parameters:
      - in: path
        name: path
        schema:
          type: string
          pattern: ^([a-zA-Z0-9:\-\{\}]+/)*[a-zA-Z0-9:\-\{\}]*$
        required: true
      tags:
      - appmodel
      - broker
      - rbac
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateRule'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/UpdateRule'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/UpdateRule'
        required: true
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateRule'
          description: ''
      summary: Updates an access rule
    patch:
      operationId: proxy_rules_partial_update_2
      description: |2+

      parameters:
      - in: path
        name: path
        schema:
          type: string
          pattern: ^([a-zA-Z0-9:\-\{\}]+/)*[a-zA-Z0-9:\-\{\}]*$
        required: true
      tags:
      - appmodel
      - broker
      - rbac
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedUpdateRule'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedUpdateRule'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedUpdateRule'
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateRule'
          description: ''
      summary: Retrieves an access rule
    delete:
      operationId: proxy_rules_destroy
      description: |2+

      parameters:
      - in: path
        name: path
        schema:
          type: string
          pattern: ^([a-zA-Z0-9:\-\{\}]+/)*[a-zA-Z0-9:\-\{\}]*$
        required: true
      tags:
      - appmodel
      - broker
      - rbac
      security:
      - {}
      responses:
        '204':
          description: No response body
      summary: Deletes an access rule
  /api/proxy/sessions/{user}:
    get:
      operationId: proxy_sessions_retrieve
      description: |2+

        Returns a session data for a user as it will be passed to the backend
        service.

      parameters:
      - in: path
        name: user
        schema:
          type: string
        required: true
      tags:
      - appmodel
      - broker
      - rbac
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SessionData'
          description: ''
      summary: Retrieves example session
  /api/themes:
    post:
      operationId: themes_create
      description: |2+

        Uploads a theme package with templates that will override the default
        ones. See `references and tutorials on creating themes
        <https://www.djaodjin.com/docs/guides/themes/>`_ for details
        on the theme package structure and customizing the default templates.

      tags:
      - themes
      - appmodel
      - broker
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ThemePackageUploadBody'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ThemePackageUploadBody'
          application/json:
            schema:
              $ref: '#/components/schemas/ThemePackageUploadBody'
        required: true
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ThemePackageUpload'
          description: ''
      summary: Uploads a theme package
    delete:
      operationId: themes_destroy
      description: |2+

        Removes the custom theme templates and assets.

        Pages will be using the default theme after a reset.

      tags:
      - themes
      - appmodel
      - broker
      security:
      - {}
      responses:
        '204':
          description: No response body
      summary: Removes custom theme
  /api/themes/assets/{path}:
    get:
      operationId: themes_assets_list
      description: ''
      parameters:
      - name: page
        required: false
        in: query
        description: A page number within the paginated result set.
        schema:
          type: integer
      - in: path
        name: path
        schema:
          type: string
          pattern: ^([a-zA-Z0-9\-]+/)*[a-zA-Z0-9\-]*$
        required: true
      tags: []
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedAssetList'
          description: ''
      summary: Lists static asset files
    post:
      operationId: themes_assets_create
      description: ''
      parameters:
      - in: path
        name: path
        schema:
          type: string
          pattern: ^([a-zA-Z0-9\-]+/)*[a-zA-Z0-9\-]*$
        required: true
      tags: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Asset'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Asset'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Asset'
          '*/*':
            schema:
              $ref: '#/components/schemas/Asset'
        required: true
      security:
      - {}
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Asset'
          description: ''
      summary: Uploads a static asset file
    put:
      operationId: themes_assets_update
      description: ''
      parameters:
      - in: path
        name: path
        schema:
          type: string
          pattern: ^([a-zA-Z0-9\-]+/)*[a-zA-Z0-9\-]*$
        required: true
      tags: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MediaItemList'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/MediaItemList'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/MediaItemList'
          '*/*':
            schema:
              $ref: '#/components/schemas/MediaItemList'
        required: true
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedAssetList'
          description: ''
      summary: Updates meta tags on assets
    delete:
      operationId: themes_assets_destroy
      description: ''
      parameters:
      - in: path
        name: path
        schema:
          type: string
          pattern: ^([a-zA-Z0-9\-]+/)*[a-zA-Z0-9\-]*$
        required: true
      tags: []
      security:
      - {}
      responses:
        '204':
          description: No response body
      summary: Deletes static assets file
  /api/themes/sitecss/variables/:
    get:
      operationId: themes_sitecss_variables_list
      description: ''
      parameters:
      - name: page
        required: false
        in: query
        description: A page number within the paginated result set.
        schema:
          type: integer
      - name: page_size
        required: false
        in: query
        description: Number of results to return per page between 1 and 100 (defaults
          to 25).
        schema:
          type: integer
      tags: []
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedLessVariableList'
          description: ''
      summary: Lists a website css variables
  /api/themes/sitecss/variables/{name}/:
    get:
      operationId: themes_sitecss_variables_retrieve
      description: ''
      parameters:
      - in: path
        name: name
        schema:
          type: string
          pattern: ^[\w-]+$
        required: true
      tags: []
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LessVariable'
          description: ''
      summary: Retrieves a css variable
    put:
      operationId: themes_sitecss_variables_update
      description: ''
      parameters:
      - in: path
        name: name
        schema:
          type: string
          pattern: ^[\w-]+$
        required: true
      tags: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LessVariable'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/LessVariable'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/LessVariable'
        required: true
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LessVariable'
          description: ''
      summary: Updates a css variable
    patch:
      operationId: themes_sitecss_variables_partial_update
      description: ''
      parameters:
      - in: path
        name: name
        schema:
          type: string
          pattern: ^[\w-]+$
        required: true
      tags: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedLessVariable'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedLessVariable'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedLessVariable'
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LessVariable'
          description: ''
      summary: Retrieves a css variable
    delete:
      operationId: themes_sitecss_variables_destroy
      description: ''
      parameters:
      - in: path
        name: name
        schema:
          type: string
          pattern: ^[\w-]+$
        required: true
      tags: []
      security:
      - {}
      responses:
        '204':
          description: No response body
      summary: Deletes a css variable
  /api/themes/sources/{page}:
    get:
      operationId: themes_sources_retrieve
      description: ''
      parameters:
      - in: path
        name: page
        schema:
          type: string
          pattern: ^\S+$
        required: true
      tags: []
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SourceCode'
          description: ''
      summary: Retrieves a template source file
    post:
      operationId: themes_sources_create
      description: ''
      parameters:
      - in: path
        name: page
        schema:
          type: string
          pattern: ^\S+$
        required: true
      tags: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SourceCode'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/SourceCode'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/SourceCode'
      security:
      - {}
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SourceCode'
          description: ''
      summary: Creates a template source file
    put:
      operationId: themes_sources_update
      description: ''
      parameters:
      - in: path
        name: page
        schema:
          type: string
          pattern: ^\S+$
        required: true
      tags: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SourceCode'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/SourceCode'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/SourceCode'
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SourceCode'
          description: ''
      summary: Updates a template source file
    patch:
      operationId: themes_sources_partial_update
      description: ''
      parameters:
      - in: path
        name: page
        schema:
          type: string
          pattern: ^\S+$
        required: true
      tags: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedSourceCode'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedSourceCode'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedSourceCode'
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SourceCode'
          description: ''
      summary: Retrieves a template source file
  /api/themes/sources/editables/{path}:
    put:
      operationId: themes_sources_editables_update
      description: ''
      parameters:
      - in: path
        name: path
        schema:
          type: string
          pattern: ^([a-zA-Z0-9\-]+/)*[a-zA-Z0-9\-]+$
        required: true
      tags: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SourceElement'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/SourceElement'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/SourceElement'
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SourceElement'
          description: ''
      summary: Updates an element inside a template source file
  /api/themes/tools:
    get:
      operationId: themes_tools_retrieve
      description: |2+

      tags:
      - themes
      - appmodel
      - broker
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EditTools'
          description: ''
      summary: Retrives edit tools toggle
    put:
      operationId: themes_tools_update
      description: |2+

      tags:
      - themes
      - appmodel
      - broker
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EditTools'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/EditTools'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/EditTools'
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EditTools'
          description: ''
      summary: Toggles edit tools on/off
    patch:
      operationId: themes_tools_partial_update
      description: |2+

      tags:
      - themes
      - appmodel
      - broker
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedEditTools'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedEditTools'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedEditTools'
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EditTools'
          description: ''
      summary: Retrives edit tools toggle
  /api/users:
    get:
      operationId: users_list
      description: |2+

        Returns a list of `page_size` profile and user accounts.

        The queryset can be filtered for at least one field to match a search
        term (``q``).

        The queryset can be ordered by a field by adding an HTTP query parameter
        ``o=`` followed by the field name. A sequence of fields can be used
        to create a complete ordering by adding a sequence of ``o`` HTTP query
        parameters. To reverse the natural order of a field, prefix the field
        name by a minus (-) sign.

      parameters:
      - name: o
        required: false
        in: query
        description: sort by full_name, created_at, date_joined. If a field is preceded
          by a minus sign ('-'), the order will be reversed. Multiple 'o' parameters
          can be specified to produce a stable result.
        schema:
          type: string
      - name: page
        required: false
        in: query
        description: A page number within the paginated result set.
        schema:
          type: integer
      - name: page_size
        required: false
        in: query
        description: Number of results to return per page between 1 and 100 (defaults
          to 25).
        schema:
          type: integer
      - name: q
        required: false
        in: query
        description: value to search for in the fields specified by q_f
        schema:
          type: string
      - name: q_f
        required: false
        in: query
        description: 'restrict searches to one or more fields in: email, username.
          searches all fields when unspecified.'
        schema:
          type: string
      tags:
      - profile
      - usermodel
      - broker
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedUserList'
          description: ''
      summary: Lists user accounts
    post:
      operationId: users_create
      description: |2+

      tags:
      - profile
      - usermodel
      - broker
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/UserCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/UserCreate'
        required: true
      security:
      - {}
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserDetail'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
          description: ''
      summary: Creates a user account
  /api/users/{user}:
    get:
      operationId: users_retrieve
      description: |2+

        Retrieves details on one single user account with slug ``{user}``.

        The API is typically used within an HTML
        `contact information page </docs/guides/themes/#dashboard_profile>`_
        as present in the default theme.

      parameters:
      - in: path
        name: user
        schema:
          type: string
          pattern: ^[\w.@+-]+$
        required: true
      tags:
      - profile
      - user
      - usermodel
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserDetail'
          description: ''
      summary: Retrieves a user account
    put:
      operationId: users_update
      description: |2+

        The API is typically used within an HTML
        `contact information page </docs/guides/themes/#dashboard_profile>`_
        as present in the default theme.

      parameters:
      - in: path
        name: user
        schema:
          type: string
          pattern: ^[\w.@+-]+$
        required: true
      tags:
      - profile
      - user
      - usermodel
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserDetail'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/UserDetail'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/UserDetail'
        required: true
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserDetail'
          description: ''
      summary: Updates a user account
    patch:
      operationId: users_partial_update
      description: |2+

        The API is typically used within an HTML
        `contact information page </docs/guides/themes/#dashboard_profile>`_
        as present in the default theme.

      parameters:
      - in: path
        name: user
        schema:
          type: string
          pattern: ^[\w.@+-]+$
        required: true
      tags:
      - profile
      - user
      - usermodel
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedUserDetail'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedUserDetail'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedUserDetail'
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserDetail'
          description: ''
      summary: Updates a user account
    delete:
      operationId: users_destroy
      description: |2+

        The API is typically used within an HTML
        `contact information page </docs/guides/themes/#dashboard_profile>`_
        as present in the default theme.

      parameters:
      - in: path
        name: user
        schema:
          type: string
          pattern: ^[\w.@+-]+$
        required: true
      tags:
      - profile
      - user
      - usermodel
      security:
      - {}
      responses:
        '204':
          description: No response body
      summary: Deletes a user account
  /api/users/{user}/accessibles:
    get:
      operationId: users_accessibles_list
      description: |2+

        Returns a list of `page_size` roles where a profile is accessible by
        {user}. Typically the user was granted a role with specific permissions
        on the profile.

        The queryset can be further refined to match a search filter (``q``)
        and sorted on specific fields (``o``).

        The API is typically used within an HTML
        `connected profiles page </docs/guides/themes/#dashboard_users_roles>`_
        as present in the default theme.

        see `Flexible Security Framework  <http://djaodjin-saas.readthedocs.io/en/latest/security.html>`_.

      parameters:
      - name: o
        required: false
        in: query
        description: sort by profile__full_name, user, user__full_name, role__title,
          grant_key, request_key, created_at. If a field is preceded by a minus sign
          ('-'), the order will be reversed. Multiple 'o' parameters can be specified
          to produce a stable result.
        schema:
          type: string
      - name: page
        required: false
        in: query
        description: A page number within the paginated result set.
        schema:
          type: integer
      - name: page_size
        required: false
        in: query
        description: Number of results to return per page between 1 and 100 (defaults
          to 25).
        schema:
          type: integer
      - name: q
        required: false
        in: query
        description: value to search for in the fields specified by q_f
        schema:
          type: string
      - name: q_f
        required: false
        in: query
        description: 'restrict searches to one or more fields in: profile, profile__full_name,
          profile__email, role, role__title. searches all fields when unspecified.'
        schema:
          type: string
      - in: path
        name: user
        schema:
          type: string
        required: true
      tags:
      - user
      - rolemodel
      - rbac
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedAccessibleList'
          description: ''
      summary: Lists roles by user
    post:
      operationId: users_accessibles_create
      description: |2+

        Creates a request to connect {user} to a profile

        The API is typically used within an HTML
        `connected profiles page </docs/guides/themes/#dashboard_users_roles>`_
        as present in the default theme.

        see `Flexible Security Framework  <http://djaodjin-saas.readthedocs.io/en/latest/security.html>`_.

      parameters:
      - in: query
        name: force
        schema:
          type: boolean
        description: Forces invite of user/organization that could not be found
      - in: path
        name: user
        schema:
          type: string
        required: true
      tags:
      - user
      - rolemodel
      - rbac
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AccessibleCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/AccessibleCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/AccessibleCreate'
      security:
      - {}
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Accessible'
          description: ''
      summary: Requests a role
  /api/users/{user}/accessibles/{role}:
    get:
      operationId: users_accessibles_list_by_role
      description: |2+

        Returns a list of `page_size` roles where a profile is accessible by
        {user} through a {role}. Typically the user was granted the {role}
        with specific permissions on the profile.

        The queryset can be further refined to match a search filter (``q``)
        and sorted on specific fields (``o``).

        The API is typically used within an HTML
        `connected profiles page </docs/guides/themes/#dashboard_users_roles>`_
        as present in the default theme.

        see `Flexible Security Framework  <http://djaodjin-saas.readthedocs.io/en/latest/security.html>`_.

      parameters:
      - name: o
        required: false
        in: query
        description: sort by profile__full_name, user, user__full_name, role__title,
          grant_key, request_key, created_at. If a field is preceded by a minus sign
          ('-'), the order will be reversed. Multiple 'o' parameters can be specified
          to produce a stable result.
        schema:
          type: string
      - name: page
        required: false
        in: query
        description: A page number within the paginated result set.
        schema:
          type: integer
      - name: page_size
        required: false
        in: query
        description: Number of results to return per page between 1 and 100 (defaults
          to 25).
        schema:
          type: integer
      - name: q
        required: false
        in: query
        description: value to search for in the fields specified by q_f
        schema:
          type: string
      - name: q_f
        required: false
        in: query
        description: 'restrict searches to one or more fields in: profile, profile__full_name,
          profile__email. searches all fields when unspecified.'
        schema:
          type: string
      - in: path
        name: role
        schema:
          type: string
        required: true
      - in: path
        name: user
        schema:
          type: string
        required: true
      tags:
      - user
      - rolemodel
      - rbac
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedAccessibleList'
          description: ''
      summary: Lists roles of specific type by user
    post:
      operationId: users_accessibles_create_by_role
      description: |2+

        Creates a request to connect {user} to a profile
        with a specified {role}.

        The API is typically used within an HTML
        `connected profiles page </docs/guides/themes/#dashboard_users_roles>`_
        as present in the default theme.

        see `Flexible Security Framework  <http://djaodjin-saas.readthedocs.io/en/latest/security.html>`_.

      parameters:
      - in: query
        name: force
        schema:
          type: boolean
        description: Forces invite of user/organization that could not be found
      - in: path
        name: role
        schema:
          type: string
        required: true
      - in: path
        name: user
        schema:
          type: string
        required: true
      tags:
      - user
      - rolemodel
      - rbac
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AccessibleCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/AccessibleCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/AccessibleCreate'
      security:
      - {}
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Accessible'
          description: ''
      summary: Requests a role of a specified type
  /api/users/{user}/accessibles/{role}/{profile}:
    post:
      operationId: users_accessibles_invite
      description: |2+

        Re-sends the notification that the {user} is requesting a {role}
        on the specified billing profile.

      parameters:
      - in: path
        name: profile
        schema:
          type: string
        required: true
      - in: path
        name: role
        schema:
          type: string
        required: true
      - in: path
        name: user
        schema:
          type: string
        required: true
      tags:
      - user
      - rolemodel
      - rbac
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Accessible'
          description: ''
      summary: Sends request notification for role
    delete:
      operationId: users_accessibles_destroy
      description: |2+

        Dettaches {user} from one or all roles with regards to the
        specified billing profile, typically resulting in revoking
        permissions from this user to manage part of the profile.

        The API is typically used within an HTML
        `connected profiles page </docs/guides/themes/#dashboard_users_roles>`_
        as present in the default theme.

      parameters:
      - in: path
        name: profile
        schema:
          type: string
        required: true
      - in: path
        name: role
        schema:
          type: string
        required: true
      - in: path
        name: user
        schema:
          type: string
        required: true
      tags:
      - rbac
      security:
      - {}
      responses:
        '204':
          description: No response body
      summary: Deletes a role by type
  /api/users/{user}/accessibles/accept/{verification_key}:
    put:
      operationId: users_accessibles_accept_update
      description: |2+

        Accepts a role identified by {verification_key}.

        The API is typically used within an HTML
        `connected profiles page </docs/guides/themes/#dashboard_users_roles>`_
        as present in the default theme.

      parameters:
      - in: path
        name: user
        schema:
          type: string
          pattern: ^[-a-zA-Z0-9_]+$
        required: true
      - in: path
        name: verification_key
        schema:
          type: string
          pattern: ^[a-f0-9]{40}$
        required: true
      tags:
      - user
      - rolemodel
      - rbac
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Accessible'
          description: ''
      summary: Accepts role invite
  /api/users/{user}/activate:
    post:
      operationId: users_activate_create
      description: |2+

        Re-sends an activation e-mail if the user is not already activated.

        The template for the e-mail sent to the user can be found in
        notification/verification.eml.

      parameters:
      - in: path
        name: user
        schema:
          type: string
        required: true
      tags:
      - user
      - auth
      - usermodel
      security:
      - {}
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserDetail'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
          description: ''
      summary: Sends an activation link
  /api/users/{user}/api-keys:
    get:
      operationId: users_api_keys_list
      description: |2+

        Lists the API keys with which a user can authenticate
        with the service.

      parameters:
      - name: o
        required: false
        in: query
        description: sort by title, ends_at. If a field is preceded by a minus sign
          ('-'), the order will be reversed. Multiple 'o' parameters can be specified
          to produce a stable result.
        schema:
          type: string
      - name: page
        required: false
        in: query
        description: A page number within the paginated result set.
        schema:
          type: integer
      - name: page_size
        required: false
        in: query
        description: Number of results to return per page between 1 and 100 (defaults
          to 25).
        schema:
          type: integer
      - name: q
        required: false
        in: query
        description: value to search for in the fields specified by q_f
        schema:
          type: string
      - name: q_f
        required: false
        in: query
        description: 'restrict searches to one or more fields in: title. searches
          all fields when unspecified.'
        schema:
          type: string
      - in: path
        name: user
        schema:
          type: string
        required: true
      tags:
      - user
      - auth
      - usermodel
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedAPIKeySeralizerList'
          description: ''
      summary: Lists user API keys
    post:
      operationId: users_api_keys_create
      description: |2+

        Creates an API key with which a user can authenticate
        with the service.

      parameters:
      - in: path
        name: user
        schema:
          type: string
        required: true
      tags:
      - user
      - auth
      - usermodel
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NewKeypair'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/NewKeypair'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/NewKeypair'
      security:
      - {}
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIKeypair'
          description: ''
      summary: Creates an API key
  /api/users/{user}/api-keys/{key}:
    post:
      operationId: users_api_keys_delete
      description: |2+

        Deletes the API key which user used to authenticate
        with the service.

      parameters:
      - in: path
        name: key
        schema:
          type: string
        required: true
      - in: path
        name: user
        schema:
          type: string
        required: true
      tags:
      - user
      - auth
      - usermodel
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AuthenticatedUserPassword'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/AuthenticatedUserPassword'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/AuthenticatedUserPassword'
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
          description: ''
      summary: Deletes a user API key
  /api/users/{user}/notifications:
    get:
      operationId: users_notifications_retrieve
      description: |2+

      parameters:
      - in: path
        name: user
        schema:
          type: string
          pattern: ^[\w.@+-]+$
        required: true
      tags:
      - profile
      - user
      - usermodel
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Notifications'
          description: ''
      summary: Lists a user notifications preferences
    put:
      operationId: users_notifications_update
      description: |2+

      parameters:
      - in: path
        name: user
        schema:
          type: string
          pattern: ^[\w.@+-]+$
        required: true
      tags:
      - profile
      - user
      - usermodel
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Notifications'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Notifications'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Notifications'
        required: true
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Notifications'
          description: ''
      summary: Changes a user notifications preferences
    patch:
      operationId: users_notifications_partial_update
      description: |2+

      parameters:
      - in: path
        name: user
        schema:
          type: string
          pattern: ^[\w.@+-]+$
        required: true
      tags:
      - profile
      - user
      - usermodel
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedNotifications'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedNotifications'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedNotifications'
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Notifications'
          description: ''
      summary: Lists a user notifications preferences
  /api/users/{user}/otp:
    put:
      operationId: users_otp_update
      description: |2+

        Enables multi-factor authentication, through either an OTP one-time
        code, email verification, phone verification or any combination
        of the above.

        To disable any of the MFA requirements, pass a `false` value for
        its respective field.

        The API is typically used within an HTML
        `update password page </docs/guides/themes/#dashboard_users_password>`_
        as present in the default theme.

      parameters:
      - in: path
        name: user
        schema:
          type: string
          pattern: ^[\w.@+-]+$
        required: true
      tags:
      - user
      - auth
      - usermodel
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OTPUpdate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/OTPUpdate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/OTPUpdate'
        required: true
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OTP'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
          description: ''
      summary: Enables multi-factor authentication
  /api/users/{user}/password:
    put:
      operationId: users_password_update
      description: |2+

        Sets a new password for a user. Any or a combination of
        the HTTP request user secrets must be passed along for authorization.

        The API is typically used within an HTML
        `update password page </docs/guides/themes/#dashboard_users_password>`_
        as present in the default theme.

      parameters:
      - in: path
        name: user
        schema:
          type: string
        required: true
      tags:
      - user
      - auth
      - usermodel
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PasswordChange'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PasswordChange'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PasswordChange'
        required: true
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
          description: ''
      summary: Updates a user password
  /api/users/{user}/picture:
    post:
      operationId: users_picture_create
      description: |2

        The API is typically used within an HTML
        `contact information page </docs/guides/themes/#dashboard_profile>`_
        as present in the default theme.
      parameters:
      - in: path
        name: user
        schema:
          type: string
        required: true
      tags: []
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/UploadBlob'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/UploadBlob'
        required: true
      security:
      - {}
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadBlob'
          description: ''
      summary: Uploads a picture for a user account
  /api/users/{user}/profiles:
    get:
      operationId: users_profiles_list
      description: |2+

        Returns a list of `page_size` of profiles

        The queryset can be further refined to match a search filter (``q``)
        and/or a range of dates ([``start_at``, ``ends_at``]),
        and sorted on specific fields (``o``).

      parameters:
      - name: ends_at
        required: false
        in: query
        description: date/time in ISO 8601 format
        schema:
          type: string
      - name: o
        required: false
        in: query
        description: sort by full_name, created_at. If a field is preceded by a minus
          sign ('-'), the order will be reversed. Multiple 'o' parameters can be specified
          to produce a stable result.
        schema:
          type: string
      - name: page
        required: false
        in: query
        description: A page number within the paginated result set.
        schema:
          type: integer
      - name: page_size
        required: false
        in: query
        description: Number of results to return per page between 1 and 100 (defaults
          to 25).
        schema:
          type: integer
      - name: q
        required: false
        in: query
        description: value to search for in the fields specified by q_f
        schema:
          type: string
      - name: q_f
        required: false
        in: query
        description: 'restrict searches to one or more fields in: slug, full_name,
          email, phone, street_address, locality, region, postal_code, country, username,
          first_name, last_name. searches all fields when unspecified.'
        schema:
          type: string
      - name: start_at
        required: false
        in: query
        description: date/time in ISO 8601 format
        schema:
          type: string
      - in: path
        name: user
        schema:
          type: string
        required: true
      tags:
      - profile
      - user
      - usermodel
      - rbac
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedOrganizationDetailList'
          description: ''
      summary: Lists billing profiles with a user as a profile manager
    post:
      operationId: users_profiles_create
      description: |2+

        This end-point creates a new profile whose manager is {user}.
        It returns an error if the profile already exists.

        If you want to request access to an already existing profile,
        see the `accessibles <#createAccessibleByList>`_
        end-point.

      parameters:
      - in: path
        name: user
        schema:
          type: string
        required: true
      tags:
      - profile
      - user
      - usermodel
      - rbac
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrganizationCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/OrganizationCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/OrganizationCreate'
        required: true
      security:
      - {}
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrganizationDetail'
          description: ''
      summary: Creates a connected profile
  /api/users/{user}/ssh-keys:
    put:
      operationId: users_ssh_keys_update
      description: |2+

        Sets a new public RSA key for a user. Any or a combination of
        the HTTP request user secrets must be passed along for authorization.

      parameters:
      - in: path
        name: user
        schema:
          type: string
        required: true
      tags:
      - user
      - auth
      - usermodel
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicKey'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PublicKey'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PublicKey'
        required: true
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
          description: ''
      summary: Updates a user public RSA key
components:
  schemas:
    APIKeySeralizer:
      type: object
      description: Returns a list of API pub keys and their expiration dates
      properties:
        title:
          type: string
          description: Short description of the notification
          maxLength: 100
        api_pub_key:
          type: string
          description: Unique public identifier for the API key
          maxLength: 32
          pattern: ^[-a-zA-Z0-9_]+$
        ends_at:
          type: string
          format: date-time
          nullable: true
          description: Date/time at which the API key expires (in ISO format)
      required:
      - api_pub_key
    APIKeypair:
      type: object
      description: username and password for authentication through API.
      properties:
        secret:
          type: string
          readOnly: true
          description: Secret API Key used to authenticate user on every HTTP request
          maxLength: 128
      required:
      - secret
    Accessible:
      type: object
      description: Formats an entry in a list of ``Organization`` accessible by a
        ``User``.
      properties:
        created_at:
          type: string
          format: date-time
          readOnly: true
          description: Date/time of creation (in ISO format)
        request_key:
          type: string
          readOnly: true
          nullable: true
          description: Key to identify the request for the role
          pattern: ^[-a-zA-Z0-9_]+$
        profile:
          allOf:
          - $ref: '#/components/schemas/Organization'
          description: Profile the user has a role on
        role_description:
          allOf:
          - $ref: '#/components/schemas/RoleDescription'
          readOnly: true
          description: Description of the role
        home_url:
          type: string
          readOnly: true
          description: URL to the homepage for the profile associated to the role
        settings_url:
          type: string
          readOnly: true
          description: URL to the settings page for the profile associated to the
            role
        accept_grant_api_url:
          type: string
          readOnly: true
          description: URL API endpoint to grant the role
        remove_api_url:
          type: string
          readOnly: true
          description: URL API endpoint to remove the role grant or request
      required:
      - accept_grant_api_url
      - created_at
      - home_url
      - profile
      - remove_api_url
      - request_key
      - role_description
      - settings_url
    AccessibleCreate:
      type: object
      description: Invite a previously existing or new Organization
      properties:
        slug:
          type: string
          description: Profile to grant {user} a role onto
          pattern: '[-a-zA-Z0-9_]+'
        email:
          type: string
          format: email
          description: E-mail of profile to grant {user} a role onto (potentially
            generating an invite to the site)
        message:
          type: string
          description: Message to send along the invitation
          maxLength: 255
    Activity:
      type: object
      properties:
        created_at:
          type: string
          format: date-time
          readOnly: true
          description: Date/time of creation (in ISO format)
        created_by:
          allOf:
          - $ref: '#/components/schemas/User'
          readOnly: true
          description: User that created the activity
        text:
          type: string
          description: Free form text description of the activity
        account:
          allOf:
          - $ref: '#/components/schemas/Organization'
          nullable: true
          description: Account the activity is associated to
      required:
      - account
      - created_at
      - created_by
    ActivityCreate:
      type: object
      properties:
        text:
          type: string
          description: Free form text description of the activity
        account:
          type: string
          description: Account the activity is associated to
          nullable: true
      required:
      - account
    AdvanceDiscount:
      type: object
      properties:
        discount_type:
          allOf:
          - $ref: '#/components/schemas/DiscountTypeEnum'
          description: Type of discount (periods, percentage or currency unit)
        discount_value:
          type: integer
          description: Amount of the discount
        length:
          type: integer
          description: Contract length associated with the period (defaults to 1)
      required:
      - discount_type
    Agreement:
      type: object
      properties:
        slug:
          type: string
          readOnly: true
          description: Unique identifier shown in the URL bar
          pattern: ^[-a-zA-Z0-9_]+$
        title:
          type: string
          description: Short description of the agreement
          maxLength: 150
        updated_at:
          type: string
          format: date-time
          readOnly: true
          description: Date/time the agreement was last updated (in ISO format)
      required:
      - slug
      - title
      - updated_at
    AgreementCreate:
      type: object
      description: Serializer to create an agreement
      properties:
        slug:
          type: string
          readOnly: true
          description: Unique identifier shown in the URL bar
          pattern: ^[-a-zA-Z0-9_]+$
        title:
          type: string
          description: Short description of the agreement
          maxLength: 150
        updated_at:
          type: string
          format: date-time
          description: Date/time of update (in ISO 8601 format)
      required:
      - slug
      - title
    AgreementDetail:
      type: object
      description: Serializer to retrieve the text of an agreement
      properties:
        slug:
          type: string
          readOnly: true
          description: Unique identifier shown in the URL bar
          pattern: ^[-a-zA-Z0-9_]+$
        title:
          type: string
          description: Short description of the agreement
          maxLength: 150
        updated_at:
          type: string
          format: date-time
          readOnly: true
          description: Date/time the agreement was last updated (in ISO format)
        text:
          type: string
          readOnly: true
          description: Text of the agreement
      required:
      - slug
      - text
      - title
      - updated_at
    AgreementSign:
      type: object
      properties:
        read_terms:
          type: boolean
          description: I have read and understand these terms and conditions
        last_signed:
          type: string
          format: date-time
          readOnly: true
          description: Date/time of signature (in ISO 8601 format)
      required:
      - last_signed
      - read_terms
    AgreementUpdate:
      type: object
      description: Serializer to update an agreement
      properties:
        slug:
          type: string
          readOnly: true
          description: Unique identifier shown in the URL bar
          pattern: ^[-a-zA-Z0-9_]+$
        title:
          type: string
          description: Short description of the agreement
          maxLength: 150
        updated_at:
          type: string
          format: date-time
          description: Date/time of update (in ISO 8601 format)
      required:
      - slug
      - title
      - updated_at
    App:
      type: object
      properties:
        slug:
          type: string
          readOnly: true
          description: unique identifier for the site (also serves as subdomain)
          pattern: ^[-a-zA-Z0-9_]+$
        entry_point:
          type: string
          format: uri
          nullable: true
          description: Entry point to which requests will be redirected to
          maxLength: 100
        session_backend:
          allOf:
          - $ref: '#/components/schemas/SessionBackendEnum'
          description: Format to encode session in the forwarded HTTP request
        authentication:
          allOf:
          - $ref: '#/components/schemas/AuthenticationEnum'
          description: Restricted authentication and registration
        welcome_email:
          type: boolean
          description: Send a welcome e-mail to newly registered users
        cors_restricted:
          type: boolean
          description: Set CORS headers on HTTP responses
        detail:
          type: string
          description: Describes the result of the action in human-readable form
      required:
      - slug
    AppKey:
      type: object
      description: Used when a secret key is generated.
      properties:
        enc_key:
          type: string
          readOnly: true
          description: Key used to decrypt the encoded session information.
      required:
      - enc_key
    Asset:
      type: object
      properties:
        location:
          type: string
          description: URL where the asset content is stored.
        updated_at:
          type: string
          format: date-time
          description: Last date/time the asset content was updated.
        tags:
          type: string
          description: Tags associated to the asset.
      required:
      - location
    AuthRealms:
      type: object
      properties:
        location:
          type: string
          description: URL to upload files
        access_key:
          type: string
          description: Access key
        acl:
          type: string
          description: ACL (i.e. private or public-read)
        policy:
          type: string
          description: Policy
        signature:
          type: string
          description: Signature
        security_token:
          type: string
          description: Security token
        x_amz_credential:
          type: string
          description: AMZ Credential
        x_amz_date:
          type: string
          description: AMZ Date
      required:
      - access_key
      - acl
      - location
      - policy
      - security_token
      - signature
      - x_amz_credential
      - x_amz_date
    AuthenticatedUserPassword:
      type: object
      description: We need at least on secret of the HTTP `request.user` to commit
        changes.
      properties:
        password:
          type: string
          writeOnly: true
          description: Password of the user making the HTTP request
        otp_code:
          type: integer
          writeOnly: true
          description: One-time code. This field will be checked against an expected
            code when multi-factor authentication (MFA) is enabled.
        email_code:
          type: integer
          writeOnly: true
          description: Email verification code.
        phone_code:
          type: integer
          writeOnly: true
          description: Phone verification code.
    AuthenticationEnum:
      enum:
      - enabled
      - login-only
      - disabled
      type: string
    BalanceLine:
      type: object
      properties:
        title:
          type: string
          description: Title for the row
          maxLength: 255
        selector:
          type: string
          description: Filter on transaction accounts
          maxLength: 255
        rank:
          type: integer
          description: Absolute position of the row in the list of rows for the table
      required:
      - rank
      - title
    BalancesDue:
      type: object
      properties:
        slug:
          type: string
          readOnly: true
          description: Unique identifier shown in the URL bar
          pattern: ^[-a-zA-Z0-9_]+$
        printable_name:
          type: string
          readOnly: true
          description: Name that can be safely used for display in HTML pages
        picture:
          type: string
          format: uri
          nullable: true
          title: Profile picture
          description: URL location of the profile picture
          maxLength: 2083
        type:
          type: string
          readOnly: true
          description: One of 'organization', 'personal' or 'user'
        credentials:
          type: string
          readOnly: true
          description: True if the account has valid login credentials
        created_at:
          type: string
          format: date-time
          readOnly: true
          description: Date/time of creation (in ISO format)
        balances:
          type: object
          additionalProperties: {}
          readOnly: true
          description: Dictionary of balances due, keyed by unit
      required:
      - balances
      - created_at
      - credentials
      - printable_name
      - slug
      - type
    Bank:
      type: object
      description: Information to verify a deposit account
      properties:
        bank_name:
          type: string
          description: Name of the deposit account
        last4:
          type: string
          description: Last 4 characters of the deposit account identifier
        balance_amount:
          type: integer
          description: Amount available to transfer to the provider deposit account
        balance_unit:
          type: string
          description: 'Three-letter ISO 4217 code for currency unit (ex: usd)'
      required:
      - balance_amount
      - balance_unit
      - bank_name
      - last4
    BlankEnum:
      enum:
      - ''
    Card:
      type: object
      description: Information to verify a credit card
      properties:
        processor:
          allOf:
          - $ref: '#/components/schemas/ProcessorAuth'
          description: Keys to authenticate the client with the payment processor
        last4:
          type: string
          description: Last 4 digits of the credit card on file
        exp_date:
          type: string
          description: Expiration date of the credit card on file
      required:
      - exp_date
      - last4
    CardToken:
      type: object
      description: Updates a payment method on file.
      properties:
        token:
          type: string
          description: Processor token to retrieve the payment method
        full_name:
          type: string
          description: Full name
        email:
          type: string
          format: email
          description: E-mail address for the account
        phone:
          type: string
          description: Phone number
        street_address:
          type: string
          description: Street address
        locality:
          type: string
          description: City/Town
        region:
          type: string
          description: State/Province/County
        postal_code:
          type: string
          description: Zip/Postal code
        country:
          description: Country as 2-letter code (ISO 3166-1)
          oneOf:
          - $ref: '#/components/schemas/CountryEnum'
          - $ref: '#/components/schemas/BlankEnum'
      required:
      - token
    CartItem:
      type: object
      description: |-
        serializer for a ``CartItem`` object.

        This serializer is typically used in coupon performance metrics.
      properties:
        created_at:
          type: string
          format: date-time
          readOnly: true
          description: Date/time of creation (in ISO format)
        user:
          allOf:
          - $ref: '#/components/schemas/User'
          description: User the cart belongs to
        claim_code:
          type: string
          readOnly: true
          nullable: true
          description: Code used to assign the cart item to a user in group buy
          pattern: ^[-a-zA-Z0-9_]+$
        plan:
          allOf:
          - $ref: '#/components/schemas/Plan'
          description: Item in the cart (if plan)
        option:
          type: integer
          description: Index in the list of discounts for advance payments
        use:
          type: integer
          nullable: true
          description: Item added to the cart (if use charge)
        quantity:
          type: integer
          description: Number of periods to be paid in advance
        sync_on:
          type: string
          nullable: true
          description: identifier of the person that will benefit from the subscription
            (GroupBuy)
          maxLength: 255
        full_name:
          type: string
          description: Full name of the person that will benefit from the subscription
            (GroupBuy)
          maxLength: 150
        email:
          type: string
          nullable: true
          description: e-mail of the person that will benefit from the subscription
            (GroupBuy)
          maxLength: 255
        detail:
          type: string
          readOnly: true
          description: Describes the result of the action in human-readable form
      required:
      - claim_code
      - created_at
      - detail
      - plan
      - user
    CartItemCreate:
      type: object
      description: Serializer to build a request.user set of plans to subscribe to
        (i.e. cart).
      properties:
        created_at:
          type: string
          format: date-time
          readOnly: true
          description: Date/time of creation (in ISO format)
        plan:
          type: string
          description: The plan to add into the request.user cart.
        option:
          type: integer
          description: Index in the list of discounts for advance payments
        use:
          type: string
          description: The use charge to add into the request.user cart.
        quantity:
          type: integer
          description: Number of periods to be paid in advance
        sync_on:
          type: string
          nullable: true
          description: identifier of the person that will benefit from the subscription
            (GroupBuy)
          maxLength: 255
        full_name:
          type: string
          description: Full name of the person that will benefit from the subscription
            (GroupBuy)
          maxLength: 150
        email:
          type: string
          nullable: true
          description: e-mail of the person that will benefit from the subscription
            (GroupBuy)
          maxLength: 255
      required:
      - created_at
      - plan
    CartItemUpdate:
      type: object
      description: |-
        Designed for handling update operations on cart items.
        Restricts user and plan fields to be read-only.
      properties:
        created_at:
          type: string
          format: date-time
          readOnly: true
          description: Date/time of creation (in ISO format)
        user:
          allOf:
          - $ref: '#/components/schemas/User'
          readOnly: true
          description: User the cart belongs to
        claim_code:
          type: string
          readOnly: true
          nullable: true
          description: Code used to assign the cart item to a user in group buy
          pattern: ^[-a-zA-Z0-9_]+$
        plan:
          allOf:
          - $ref: '#/components/schemas/Plan'
          readOnly: true
          description: Plan in the cart (if any)
        option:
          type: integer
          description: Index in the list of discounts for advance payments
        use:
          type: integer
          nullable: true
          description: Item added to the cart (if use charge)
        quantity:
          type: integer
          description: Number of periods to be paid in advance
        sync_on:
          type: string
          nullable: true
          description: identifier of the person that will benefit from the subscription
            (GroupBuy)
          maxLength: 255
        full_name:
          type: string
          description: Full name of the person that will benefit from the subscription
            (GroupBuy)
          maxLength: 150
        email:
          type: string
          nullable: true
          description: e-mail of the person that will benefit from the subscription
            (GroupBuy)
          maxLength: 255
        detail:
          type: string
          readOnly: true
          description: Describes the result of the action in human-readable form
      required:
      - claim_code
      - created_at
      - detail
      - plan
      - user
    CartItemUpload:
      type: object
      properties:
        created:
          type: array
          items:
            $ref: '#/components/schemas/CartItem'
          description: Items that have been created in the cart
        updated:
          type: array
          items:
            $ref: '#/components/schemas/CartItem'
          description: Rows that have been uploaded
        failed:
          type: array
          items:
            $ref: '#/components/schemas/CartItem'
          description: Rows that have failed to be created in the cart
      required:
      - created
      - failed
      - updated
    Charge:
      type: object
      properties:
        created_at:
          type: string
          format: date-time
          readOnly: true
          description: Date/time of creation (in ISO format)
        amount:
          type: integer
          readOnly: true
          description: Total amount in currency unit
        unit:
          type: string
          readOnly: true
          description: 'Three-letter ISO 4217 code for currency unit (ex: usd)'
        readable_amount:
          type: string
          readOnly: true
          description: Amount and unit in a commonly accepted readable format
        description:
          type: string
          readOnly: true
          nullable: true
          description: Description for the charge as appears on billing statements
        last4:
          type: string
          readOnly: true
          description: Last 4 digits of the credit card used
        exp_date:
          type: string
          format: date
          readOnly: true
          nullable: true
          description: Expiration date of the credit card used
        processor_key:
          type: string
          readOnly: true
          description: Unique identifier returned by the payment processor
          pattern: ^[-a-zA-Z0-9_]+$
        state:
          type: string
          description: Current state (i.e. created, done, failed, disputed)
        detail:
          type: string
          readOnly: true
          description: Feedback for the user in plain text
      required:
      - amount
      - created_at
      - description
      - detail
      - exp_date
      - last4
      - processor_key
      - readable_amount
      - state
      - unit
    Checkout:
      type: object
      description: Processor token to charge the cart items.
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/CheckoutItem'
          description: List of indices, one per subscription that has multiple advance
            discount options
        remember_card:
          type: boolean
          description: attaches the payment method to the profile when true
        processor_token:
          type: string
          description: one-time token generated by the processorfrom the payment card.
          maxLength: 255
        street_address:
          type: string
          description: Street address
        locality:
          type: string
          description: City/Town
        region:
          type: string
          description: State/Province/County
        postal_code:
          type: string
          description: Zip/Postal code
        country:
          description: Country as 2-letter code (ISO 3166-1)
          oneOf:
          - $ref: '#/components/schemas/CountryEnum'
          - $ref: '#/components/schemas/BlankEnum'
    CheckoutItem:
      type: object
      properties:
        option:
          type: integer
          description: selected plan option during checkout
      required:
      - option
    ContactUs:
      type: object
      properties:
        full_name:
          type: string
          description: Full name the sender of the message wishes to be addressed
            as
        email:
          type: string
          format: email
          description: Email address to reply to the sender
        message:
          type: string
          description: Description of the reason for contacting the provider
      required:
      - email
      - full_name
    CountryEnum:
      enum:
      - AF
      - AX
      - AL
      - DZ
      - AS
      - AD
      - AO
      - AI
      - AQ
      - AG
      - AR
      - AM
      - AW
      - AU
      - AT
      - AZ
      - BS
      - BH
      - BD
      - BB
      - BY
      - BE
      - BZ
      - BJ
      - BM
      - BT
      - BO
      - BQ
      - BA
      - BW
      - BV
      - BR
      - IO
      - BN
      - BG
      - BF
      - BI
      - CV
      - KH
      - CM
      - CA
      - KY
      - CF
      - TD
      - CL
      - CN
      - CX
      - CC
      - CO
      - KM
      - CG
      - CD
      - CK
      - CR
      - CI
      - HR
      - CU
      - CW
      - CY
      - CZ
      - DK
      - DJ
      - DM
      - DO
      - EC
      - EG
      - SV
      - GQ
      - ER
      - EE
      - SZ
      - ET
      - FK
      - FO
      - FJ
      - FI
      - FR
      - GF
      - PF
      - TF
      - GA
      - GM
      - GE
      - DE
      - GH
      - GI
      - GR
      - GL
      - GD
      - GP
      - GU
      - GT
      - GG
      - GN
      - GW
      - GY
      - HT
      - HM
      - VA
      - HN
      - HK
      - HU
      - IS
      - IN
      - ID
      - IR
      - IQ
      - IE
      - IM
      - IL
      - IT
      - JM
      - JP
      - JE
      - JO
      - KZ
      - KE
      - KI
      - KW
      - KG
      - LA
      - LV
      - LB
      - LS
      - LR
      - LY
      - LI
      - LT
      - LU
      - MO
      - MG
      - MW
      - MY
      - MV
      - ML
      - MT
      - MH
      - MQ
      - MR
      - MU
      - YT
      - MX
      - FM
      - MD
      - MC
      - MN
      - ME
      - MS
      - MA
      - MZ
      - MM
      - NA
      - NR
      - NP
      - NL
      - NC
      - NZ
      - NI
      - NE
      - NG
      - NU
      - NF
      - KP
      - MK
      - MP
      - 'NO'
      - OM
      - PK
      - PW
      - PS
      - PA
      - PG
      - PY
      - PE
      - PH
      - PN
      - PL
      - PT
      - PR
      - QA
      - RE
      - RO
      - RU
      - RW
      - BL
      - SH
      - KN
      - LC
      - MF
      - PM
      - VC
      - WS
      - SM
      - ST
      - SA
      - SN
      - RS
      - SC
      - SL
      - SG
      - SX
      - SK
      - SI
      - SB
      - SO
      - ZA
      - GS
      - KR
      - SS
      - ES
      - LK
      - SD
      - SR
      - SJ
      - SE
      - CH
      - SY
      - TW
      - TJ
      - TZ
      - TH
      - TL
      - TG
      - TK
      - TO
      - TT
      - TN
      - TR
      - TM
      - TC
      - TV
      - UG
      - UA
      - AE
      - GB
      - UM
      - US
      - UY
      - UZ
      - VU
      - VE
      - VN
      - VG
      - VI
      - WF
      - EH
      - YE
      - ZM
      - ZW
      type: string
    Coupon:
      type: object
      description: Serializer to retrieve or update a `Coupon`.
      properties:
        code:
          type: string
          description: Unique identifier per provider, typically used in URLs
        discount_type:
          allOf:
          - $ref: '#/components/schemas/DiscountTypeEnum'
          description: Type of discount ('percentage', 'currency', or 'period')
        discount_value:
          type: integer
          description: Amount of the discount
        created_at:
          type: string
          format: date-time
          readOnly: true
          description: Date/time of creation (in ISO format)
        ends_at:
          type: string
          format: date-time
          nullable: true
          description: Date/time at which the coupon code expires (in ISO format)
        description:
          type: string
          nullable: true
          description: Free-form text description for the coupon
        nb_attempts:
          type: integer
          nullable: true
          description: Number of times the coupon can be used
        plan:
          allOf:
          - $ref: '#/components/schemas/Plan'
          nullable: true
          description: Coupon will only apply to this plan
      required:
      - created_at
      - discount_type
    CouponCreate:
      type: object
      description: Serializer to create a coupon, including the `code`.
      properties:
        code:
          type: string
          description: Unique identifier per provider, typically used in URLs
        discount_type:
          allOf:
          - $ref: '#/components/schemas/DiscountTypeEnum'
          description: Type of discount ('percentage', 'currency', or 'period')
        discount_value:
          type: integer
          description: Amount of the discount
        created_at:
          type: string
          format: date-time
          readOnly: true
          description: Date/time of creation (in ISO format)
        ends_at:
          type: string
          format: date-time
          nullable: true
          description: Date/time at which the coupon code expires (in ISO format)
        description:
          type: string
          nullable: true
          description: Free-form text description for the coupon
        nb_attempts:
          type: integer
          nullable: true
          description: Number of times the coupon can be used
        plan:
          type: string
          nullable: true
          description: Coupon will only apply to this plan
      required:
      - code
      - created_at
      - discount_type
      - discount_value
    CouponUpdate:
      type: object
      description: Serializer to update a coupon
      properties:
        code:
          type: string
          description: Unique identifier per provider, typically used in URLs
        discount_type:
          allOf:
          - $ref: '#/components/schemas/DiscountTypeEnum'
          description: Type of discount ('percentage', 'currency', or 'period')
        discount_value:
          type: integer
          description: Amount of the discount
        created_at:
          type: string
          format: date-time
          readOnly: true
          description: Date/time of creation (in ISO format)
        ends_at:
          type: string
          format: date-time
          nullable: true
          description: Date/time at which the coupon code expires (in ISO format)
        description:
          type: string
          nullable: true
          description: Free-form text description for the coupon
        nb_attempts:
          type: integer
          nullable: true
          description: Number of times the coupon can be used
        plan:
          type: string
          nullable: true
          description: Coupon will only apply to this plan
      required:
      - created_at
      - discount_type
    CreateOfflineTransaction:
      type: object
      description: Serializer to validate the input that creates an off-line transaction.
      properties:
        subscription:
          type: string
          description: The subscription the offline transaction refers to.
        created_at:
          type: string
          format: date-time
          description: Date/time of creation (in ISO 8601 format)
        amount:
          type: string
          format: decimal
          description: Total amount in currency unit
        descr:
          type: string
          description: Free-form text description for the transaction
      required:
      - amount
      - created_at
      - subscription
    Credentials:
      type: object
      description: username and password for authentication through API.
      properties:
        password:
          type: string
          writeOnly: true
          description: Password of the user making the HTTP request
        otp_code:
          type: integer
          writeOnly: true
          description: One-time code. This field will be checked against an expected
            code when multi-factor authentication (MFA) is enabled.
        email_code:
          type: integer
          writeOnly: true
          description: Email verification code.
        phone_code:
          type: integer
          writeOnly: true
          description: Phone verification code.
        username:
          type: string
          description: Username, e-mail address or phone number to identify the account
      required:
      - username
    Detail:
      type: object
      description: Details on the result of an API call
      properties:
        detail:
          type: string
          description: Describes the result of the API call in plain text
      required:
      - detail
    DiscountTypeEnum:
      enum:
      - percentage
      - currency
      - period
      type: string
    EditTools:
      type: object
      properties:
        show_edit_tools:
          type: boolean
          description: Show the online editor tools
    EmailChargeReceipt:
      type: object
      description: Response for the API call to send an e-mail duplicate to the customer.
      properties:
        charge_id:
          type: string
          readOnly: true
          description: Charge identifier (i.e. matches the URL {charge} parameter)
        email:
          type: string
          format: email
          readOnly: true
          description: E-mail address to which the receipt was sent.
        detail:
          type: string
          readOnly: true
          description: Feedback for the user in plain text
      required:
      - charge_id
      - detail
      - email
    EngagedSubscriber:
      type: object
      description: |-
        The engaged subscribers API gives users with a role to a subscriber
        that have logged in within a time period.
      properties:
        created_at:
          type: string
          format: date-time
          readOnly: true
          description: Date/time of creation (in ISO format)
        user:
          allOf:
          - $ref: '#/components/schemas/UserDetail'
          readOnly: true
          description: User with the role
        grant_key:
          type: string
          readOnly: true
          nullable: true
          description: Key to identify the grant of the role
          pattern: ^[-a-zA-Z0-9_]+$
        role_description:
          allOf:
          - $ref: '#/components/schemas/RoleDescription'
          readOnly: true
          description: Description of the role
        accept_request_api_url:
          type: string
          readOnly: true
          description: URL API endpoint to grant the role
        remove_api_url:
          type: string
          readOnly: true
          description: URL API endpoint to remove the role grant or request
        detail:
          type: string
          readOnly: true
          description: Describes the result of the action in human-readable form
        profile:
          allOf:
          - $ref: '#/components/schemas/Organization'
          description: Profile the user has a role on
      required:
      - accept_request_api_url
      - created_at
      - detail
      - grant_key
      - profile
      - remove_api_url
      - role_description
      - user
    Engagement:
      type: object
      properties:
        slug:
          type: string
          description: Engagement tag
        count:
          type: integer
          description: Number of users that have engaged with this tag
      required:
      - count
      - slug
    Engagements:
      type: object
      properties:
        engagements:
          type: array
          items:
            $ref: '#/components/schemas/Engagement'
          description: Engagement tags by user
        active_users:
          type: integer
          description: Number of users that have engaged with the app
        authentication:
          allOf:
          - $ref: '#/components/schemas/AuthenticationEnum'
          description: Restricted authentication and registration
      required:
      - active_users
      - engagements
    Hint:
      type: object
      properties:
        index:
          type: integer
        name:
          type: string
      required:
      - index
      - name
    Invoicable:
      type: object
      description: serializer for an invoicable item with available options.
      properties:
        subscription:
          allOf:
          - $ref: '#/components/schemas/Subscription'
          readOnly: true
          description: Subscription lines and options refer to.
        lines:
          type: array
          items:
            $ref: '#/components/schemas/Transaction'
          description: Line items to charge on checkout.
        options:
          type: array
          items:
            $ref: '#/components/schemas/Transaction'
          readOnly: true
          description: Options to replace line items.
      required:
      - lines
      - options
      - subscription
    LangEnum:
      enum:
      - af
      - ar
      - ar-dz
      - ast
      - az
      - be
      - bg
      - bn
      - br
      - bs
      - ca
      - cs
      - cy
      - da
      - de
      - dsb
      - el
      - en
      - en-au
      - en-gb
      - eo
      - es
      - es-ar
      - es-co
      - es-mx
      - es-ni
      - es-ve
      - et
      - eu
      - fa
      - fi
      - fr
      - fy
      - ga
      - gd
      - gl
      - he
      - hi
      - hr
      - hsb
      - hu
      - hy
      - ia
      - io
      - id
      - ig
      - is
      - it
      - ja
      - ka
      - kab
      - kk
      - km
      - kn
      - ko
      - ky
      - lb
      - lt
      - lv
      - mk
      - ml
      - mn
      - mr
      - my
      - nb
      - ne
      - nl
      - nn
      - 'no'
      - os
      - pa
      - pl
      - pt
      - pt-br
      - ro
      - ru
      - sk
      - sl
      - sq
      - sr
      - sr-latn
      - sv
      - sw
      - ta
      - te
      - tg
      - th
      - tk
      - tr
      - tt
      - udm
      - uk
      - ur
      - uz
      - vi
      - zh-hans
      - zh-hant
      type: string
    LessVariable:
      type: object
      properties:
        name:
          type: string
          maxLength: 250
        value:
          type: string
          maxLength: 250
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
      required:
      - created_at
      - name
      - updated_at
      - value
    Lifetime:
      type: object
      description: A customer lifetime value
      properties:
        slug:
          type: string
          readOnly: true
          description: Unique identifier shown in the URL bar
          pattern: ^[-a-zA-Z0-9_]+$
        printable_name:
          type: string
          readOnly: true
          description: Name that can be safely used for display in HTML pages
        picture:
          type: string
          format: uri
          nullable: true
          title: Profile picture
          description: URL location of the profile picture
          maxLength: 2083
        type:
          type: string
          readOnly: true
          description: One of 'organization', 'personal' or 'user'
        credentials:
          type: string
          readOnly: true
          description: True if the account has valid login credentials
        created_at:
          type: string
          description: Since when is the profile a subscriber
        ends_at:
          type: string
          description: Current end date for the contract
        contract_value:
          type: integer
          description: Total value to be collected from the profile
        cash_payments:
          type: integer
          description: Cash payments collected from the profile
        deferred_revenue:
          type: integer
          description: The deferred revenue for the profile
        unit:
          type: string
          description: 'Three-letter ISO 4217 code for currency unit (ex: usd)'
      required:
      - cash_payments
      - contract_value
      - created_at
      - credentials
      - deferred_revenue
      - ends_at
      - printable_name
      - slug
      - type
      - unit
    MediaItemList:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/Asset'
        tags:
          type: array
          items:
            type: string
      required:
      - items
    Metrics:
      type: object
      properties:
        scale:
          type: number
          format: double
          description: 'The scale of the number reported in the tables (ex: 1000 when
            numbers are reported in thousands of dollars)'
        unit:
          type: string
          description: 'Three-letter ISO 4217 code for currency unit (ex: usd)'
        title:
          type: string
          description: Title for the table
        results:
          type: array
          items:
            $ref: '#/components/schemas/Table'
          description: Data series
      required:
      - results
      - title
    NewKeypair:
      type: object
      description: Creates a new API key with a title
      properties:
        password:
          type: string
          writeOnly: true
          description: Password of the user making the HTTP request
        otp_code:
          type: integer
          writeOnly: true
          description: One-time code. This field will be checked against an expected
            code when multi-factor authentication (MFA) is enabled.
        email_code:
          type: integer
          writeOnly: true
          description: Email verification code.
        phone_code:
          type: integer
          writeOnly: true
          description: Phone verification code.
        title:
          type: string
          description: Title of the new keypair
          maxLength: 100
    Notifications:
      type: object
      properties:
        notifications:
          type: array
          items:
            type: string
          description: List of notifications from card_updated, charge_updated, claim_code_generated,
            expires_soon, order_executed, period_sales_report_created, profile_updated,
            role_request_created, user_activated, user_contact, user_registered, user_reset_password,
            user_verification, user_welcome
      required:
      - notifications
    OTP:
      type: object
      description: Returns sensitive information to setup OTP generator
      properties:
        priv_key:
          type: string
          description: Private key
        provisioning_uri:
          type: string
          format: uri
          description: Provisioning URI
      required:
      - priv_key
      - provisioning_uri
    OTPUpdate:
      type: object
      description: Returns sensitive information to setup OTP generator
      properties:
        password:
          type: string
          writeOnly: true
          description: Password of the user making the HTTP request
        otp_code:
          type: integer
          writeOnly: true
          description: One-time code. This field will be checked against an expected
            code when multi-factor authentication (MFA) is enabled.
        email_code:
          type: integer
          writeOnly: true
          description: Email verification code.
        phone_code:
          type: integer
          writeOnly: true
          description: Phone verification code.
        otp_enabled:
          type: boolean
          writeOnly: true
          description: Enables/disables OTP
        email_verification_enabled:
          type: boolean
          writeOnly: true
          description: Enables/disables E-mail verification
        phone_verification_enabled:
          type: boolean
          writeOnly: true
          description: Enables/disables Phone verification
      required:
      - email_verification_enabled
      - otp_enabled
      - phone_verification_enabled
    OfflineTransaction:
      type: object
      description: Serializer to format the output of importing an off-line transaction.
      properties:
        detail:
          type: string
          description: Describes the result of the action in human-readable form
        results:
          type: array
          items:
            $ref: '#/components/schemas/Transaction'
          description: transactions being created by the import
      required:
      - results
    Organization:
      type: object
      properties:
        slug:
          type: string
          readOnly: true
          description: Unique identifier shown in the URL bar
          pattern: ^[-a-zA-Z0-9_]+$
        printable_name:
          type: string
          readOnly: true
          description: Name that can be safely used for display in HTML pages
        picture:
          type: string
          format: uri
          nullable: true
          title: Profile picture
          description: URL location of the profile picture
          maxLength: 2083
        type:
          type: string
          readOnly: true
          description: One of 'organization', 'personal' or 'user'
        credentials:
          type: string
          readOnly: true
          description: True if the account has valid login credentials
        created_at:
          type: string
          format: date-time
          readOnly: true
          description: Date/time of creation (in ISO format)
      required:
      - created_at
      - credentials
      - printable_name
      - slug
      - type
    OrganizationCart:
      type: object
      description: Items which will be charged on an order checkout action.
      properties:
        processor:
          allOf:
          - $ref: '#/components/schemas/ProcessorAuth'
          description: Keys to authenticate the client with the payment processor
        results:
          type: array
          items:
            $ref: '#/components/schemas/Invoicable'
          description: Items that will be charged
      required:
      - results
    OrganizationCreate:
      type: object
      properties:
        slug:
          type: string
          description: Unique identifier shown in the URL bar
          pattern: ^[-a-zA-Z0-9_]+$
        printable_name:
          type: string
          readOnly: true
          description: Name that can be safely used for display in HTML pages
        picture:
          type: string
          format: uri
          nullable: true
          title: Profile picture
          description: URL location of the profile picture
          maxLength: 2083
        type:
          type: string
          description: One of 'organization', 'personal' or 'user'
        credentials:
          type: string
          readOnly: true
          description: True if the account has valid login credentials
        created_at:
          type: string
          format: date-time
          readOnly: true
          description: Date/time of creation (in ISO format)
        full_name:
          type: string
          description: Full name
        email:
          type: string
          format: email
          description: E-mail address
        phone:
          type: string
          description: Phone number
        street_address:
          type: string
          description: Street address
        locality:
          type: string
          description: City/Town
        region:
          type: string
          description: State/Province/County
        postal_code:
          type: string
          description: Zip/Postal code
        country:
          description: Country as 2-letter code (ISO 3166-1)
          oneOf:
          - $ref: '#/components/schemas/CountryEnum'
          - $ref: '#/components/schemas/BlankEnum'
        default_timezone:
          type: string
          description: Timezone to use when reporting metrics
        is_provider:
          type: boolean
          description: The profile can fulfill the provider side of a subscription.
        is_bulk_buyer:
          type: boolean
          default: false
          description: Enable GroupBuy
        extra:
          type: string
          nullable: true
          description: Extra meta data (can be stringify JSON)
        detail:
          type: string
          readOnly: true
          description: Describes the result of the action in human-readable form
      required:
      - created_at
      - credentials
      - detail
      - full_name
      - printable_name
    OrganizationDetail:
      type: object
      properties:
        slug:
          type: string
          description: Unique identifier shown in the URL bar
          pattern: ^[-a-zA-Z0-9_]+$
        printable_name:
          type: string
          readOnly: true
          description: Name that can be safely used for display in HTML pages
        picture:
          type: string
          format: uri
          nullable: true
          title: Profile picture
          description: URL location of the profile picture
          maxLength: 2083
        type:
          type: string
          readOnly: true
          description: One of 'organization', 'personal' or 'user'
        credentials:
          type: string
          readOnly: true
          description: True if the account has valid login credentials
        created_at:
          type: string
          format: date-time
          readOnly: true
          description: Date/time of creation (in ISO format)
        full_name:
          type: string
          description: Full name
        email:
          type: string
          format: email
          description: E-mail address
        phone:
          type: string
          description: Phone number
        street_address:
          type: string
          description: Street address
        locality:
          type: string
          description: City/Town
        region:
          type: string
          description: State/Province/County
        postal_code:
          type: string
          description: Zip/Postal code
        country:
          description: Country as 2-letter code (ISO 3166-1)
          oneOf:
          - $ref: '#/components/schemas/CountryEnum'
          - $ref: '#/components/schemas/BlankEnum'
        default_timezone:
          type: string
          description: Timezone to use when reporting metrics
        is_provider:
          type: boolean
          description: The profile can fulfill the provider side of a subscription.
        is_bulk_buyer:
          type: boolean
          default: false
          description: Enable GroupBuy
        extra:
          type: string
          nullable: true
          description: Extra meta data (can be stringify JSON)
        detail:
          type: string
          readOnly: true
          description: Describes the result of the action in human-readable form
      required:
      - created_at
      - credentials
      - detail
      - full_name
      - printable_name
      - type
    OrganizationInvite:
      type: object
      properties:
        slug:
          type: string
          description: Unique identifier shown in the URL bar
          pattern: ^[-a-zA-Z0-9_]+$
        printable_name:
          type: string
          readOnly: true
          description: Name that can be safely used for display in HTML pages
        picture:
          type: string
          format: uri
          nullable: true
          title: Profile picture
          description: URL location of the profile picture
          maxLength: 2083
        type:
          type: string
          description: One of 'organization', 'personal' or 'user'
        credentials:
          type: string
          readOnly: true
          description: True if the account has valid login credentials
        created_at:
          type: string
          format: date-time
          readOnly: true
          description: Date/time of creation (in ISO format)
        full_name:
          type: string
          description: Full name
        email:
          type: string
          format: email
          description: E-mail address
        phone:
          type: string
          description: Phone number
        street_address:
          type: string
          description: Street address
        locality:
          type: string
          description: City/Town
        region:
          type: string
          description: State/Province/County
        postal_code:
          type: string
          description: Zip/Postal code
        country:
          description: Country as 2-letter code (ISO 3166-1)
          oneOf:
          - $ref: '#/components/schemas/CountryEnum'
          - $ref: '#/components/schemas/BlankEnum'
        default_timezone:
          type: string
          description: Timezone to use when reporting metrics
        is_provider:
          type: boolean
          description: The profile can fulfill the provider side of a subscription.
        is_bulk_buyer:
          type: boolean
          default: false
          description: Enable GroupBuy
        extra:
          type: string
          nullable: true
          description: Extra meta data (can be stringify JSON)
        detail:
          type: string
          readOnly: true
          description: Describes the result of the action in human-readable form
      required:
      - created_at
      - credentials
      - detail
      - full_name
      - printable_name
    PaginatedAPIKeySeralizerList:
      type: object
      properties:
        count:
          type: integer
          description: The number of records
        next:
          type: string
          description: API end point to get the next page of records matching the
            query
          nullable: true
          format: uri
        previous:
          type: string
          description: API end point to get the previous page of records matching
            the query
          nullable: true
          format: uri
        results:
          type: array
          items:
            $ref: '#/components/schemas/APIKeySeralizer'
          description: Records in the queryset
    PaginatedAccessibleList:
      type: object
      properties:
        invited_count:
          type: integer
          description: Number of user invited to have a role
        requested_count:
          type: integer
          description: Number of user requesting a role
        count:
          type: integer
          description: Total number of items in the results
        next:
          type: string
          description: API end point to get the next pageof results matching the query
          nullable: true
          format: uri
        previous:
          type: string
          description: API end point to get the previous pageof results matching the
            query
          nullable: true
          format: uri
        results:
          type: array
          items:
            $ref: '#/components/schemas/Accessible'
          description: Items in the queryset
    PaginatedActivityList:
      type: object
      properties:
        count:
          type: integer
          description: The number of records
        next:
          type: string
          description: API end point to get the next page of records matching the
            query
          nullable: true
          format: uri
        previous:
          type: string
          description: API end point to get the previous page of records matching
            the query
          nullable: true
          format: uri
        results:
          type: array
          items:
            $ref: '#/components/schemas/Activity'
          description: Records in the queryset
    PaginatedAgreementList:
      type: object
      properties:
        count:
          type: integer
          description: The number of records
        next:
          type: string
          description: API end point to get the next page of records matching the
            query
          nullable: true
          format: uri
        previous:
          type: string
          description: API end point to get the previous page of records matching
            the query
          nullable: true
          format: uri
        results:
          type: array
          items:
            $ref: '#/components/schemas/Agreement'
          description: Records in the queryset
    PaginatedAssetList:
      type: object
      properties:
        count:
          type: integer
          example: 123
        next:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=4
        previous:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=2
        results:
          type: array
          items:
            $ref: '#/components/schemas/Asset'
    PaginatedBalanceLineList:
      type: object
      properties:
        count:
          type: integer
          description: The number of records
        next:
          type: string
          description: API end point to get the next page of records matching the
            query
          nullable: true
          format: uri
        previous:
          type: string
          description: API end point to get the previous page of records matching
            the query
          nullable: true
          format: uri
        results:
          type: array
          items:
            $ref: '#/components/schemas/BalanceLine'
          description: Records in the queryset
    PaginatedBalancesDueList:
      type: object
      properties:
        count:
          type: integer
          description: The number of records
        next:
          type: string
          description: API end point to get the next page of records matching the
            query
          nullable: true
          format: uri
        previous:
          type: string
          description: API end point to get the previous page of records matching
            the query
          nullable: true
          format: uri
        results:
          type: array
          items:
            $ref: '#/components/schemas/BalancesDue'
          description: Records in the queryset
    PaginatedCartItemList:
      type: object
      properties:
        count:
          type: integer
          description: The number of records
        next:
          type: string
          description: API end point to get the next page of records matching the
            query
          nullable: true
          format: uri
        previous:
          type: string
          description: API end point to get the previous page of records matching
            the query
          nullable: true
          format: uri
        results:
          type: array
          items:
            $ref: '#/components/schemas/CartItem'
          description: Records in the queryset
    PaginatedChargeList:
      type: object
      properties:
        balance_amount:
          type: integer
          description: The sum of all record amounts (in unit)
        balance_unit:
          type: integer
          description: 'three-letter ISO 4217 code for currency unit (ex: usd)'
        count:
          type: integer
          description: Total number of items in the results
        next:
          type: string
          description: API end point to get the next pageof results matching the query
          nullable: true
          format: uri
        previous:
          type: string
          description: API end point to get the previous pageof results matching the
            query
          nullable: true
          format: uri
        results:
          type: array
          items:
            $ref: '#/components/schemas/Charge'
          description: Items in the queryset
    PaginatedCouponList:
      type: object
      properties:
        count:
          type: integer
          description: The number of records
        next:
          type: string
          description: API end point to get the next page of records matching the
            query
          nullable: true
          format: uri
        previous:
          type: string
          description: API end point to get the previous page of records matching
            the query
          nullable: true
          format: uri
        results:
          type: array
          items:
            $ref: '#/components/schemas/Coupon'
          description: Records in the queryset
    PaginatedEngagedSubscriberList:
      type: object
      properties:
        count:
          type: integer
          description: The number of records
        next:
          type: string
          description: API end point to get the next page of records matching the
            query
          nullable: true
          format: uri
        previous:
          type: string
          description: API end point to get the previous page of records matching
            the query
          nullable: true
          format: uri
        results:
          type: array
          items:
            $ref: '#/components/schemas/EngagedSubscriber'
          description: Records in the queryset
    PaginatedLessVariableList:
      type: object
      properties:
        count:
          type: integer
          description: The number of records
        next:
          type: string
          description: API end point to get the next page of records matching the
            query
          nullable: true
          format: uri
        previous:
          type: string
          description: API end point to get the previous page of records matching
            the query
          nullable: true
          format: uri
        results:
          type: array
          items:
            $ref: '#/components/schemas/LessVariable'
          description: Records in the queryset
    PaginatedLifetimeList:
      type: object
      properties:
        count:
          type: integer
          description: The number of records
        next:
          type: string
          description: API end point to get the next page of records matching the
            query
          nullable: true
          format: uri
        previous:
          type: string
          description: API end point to get the previous page of records matching
            the query
          nullable: true
          format: uri
        results:
          type: array
          items:
            $ref: '#/components/schemas/Lifetime'
          description: Records in the queryset
    PaginatedOrganizationDetailList:
      type: object
      properties:
        count:
          type: integer
          description: The number of records
        next:
          type: string
          description: API end point to get the next page of records matching the
            query
          nullable: true
          format: uri
        previous:
          type: string
          description: API end point to get the previous page of records matching
            the query
          nullable: true
          format: uri
        results:
          type: array
          items:
            $ref: '#/components/schemas/OrganizationDetail'
          description: Records in the queryset
    PaginatedOrganizationList:
      type: object
      properties:
        count:
          type: integer
          description: The number of records
        next:
          type: string
          description: API end point to get the next page of records matching the
            query
          nullable: true
          format: uri
        previous:
          type: string
          description: API end point to get the previous page of records matching
            the query
          nullable: true
          format: uri
        results:
          type: array
          items:
            $ref: '#/components/schemas/Organization'
          description: Records in the queryset
    PaginatedPlanDetailList:
      type: object
      properties:
        count:
          type: integer
          description: The number of records
        next:
          type: string
          description: API end point to get the next page of records matching the
            query
          nullable: true
          format: uri
        previous:
          type: string
          description: API end point to get the previous page of records matching
            the query
          nullable: true
          format: uri
        results:
          type: array
          items:
            $ref: '#/components/schemas/PlanDetail'
          description: Records in the queryset
    PaginatedProfileList:
      type: object
      properties:
        count:
          type: integer
          description: The number of records
        next:
          type: string
          description: API end point to get the next page of records matching the
            query
          nullable: true
          format: uri
        previous:
          type: string
          description: API end point to get the previous page of records matching
            the query
          nullable: true
          format: uri
        results:
          type: array
          items:
            $ref: '#/components/schemas/Profile'
          description: Records in the queryset
    PaginatedProvidedSubscriptionDetailList:
      type: object
      properties:
        count:
          type: integer
          description: The number of records
        next:
          type: string
          description: API end point to get the next page of records matching the
            query
          nullable: true
          format: uri
        previous:
          type: string
          description: API end point to get the previous page of records matching
            the query
          nullable: true
          format: uri
        results:
          type: array
          items:
            $ref: '#/components/schemas/ProvidedSubscriptionDetail'
          description: Records in the queryset
    PaginatedProvidedSubscriptionList:
      type: object
      properties:
        count:
          type: integer
          description: The number of records
        next:
          type: string
          description: API end point to get the next page of records matching the
            query
          nullable: true
          format: uri
        previous:
          type: string
          description: API end point to get the previous page of records matching
            the query
          nullable: true
          format: uri
        results:
          type: array
          items:
            $ref: '#/components/schemas/ProvidedSubscription'
          description: Records in the queryset
    PaginatedRecentActivityList:
      type: object
      properties:
        count:
          type: integer
          description: The number of records
        next:
          type: string
          description: API end point to get the next page of records matching the
            query
          nullable: true
          format: uri
        previous:
          type: string
          description: API end point to get the previous page of records matching
            the query
          nullable: true
          format: uri
        results:
          type: array
          items:
            $ref: '#/components/schemas/RecentActivity'
          description: Records in the queryset
    PaginatedRoleDescriptionList:
      type: object
      properties:
        count:
          type: integer
          description: The number of records
        next:
          type: string
          description: API end point to get the next page of records matching the
            query
          nullable: true
          format: uri
        previous:
          type: string
          description: API end point to get the previous page of records matching
            the query
          nullable: true
          format: uri
        results:
          type: array
          items:
            $ref: '#/components/schemas/RoleDescription'
          description: Records in the queryset
    PaginatedRoleList:
      type: object
      properties:
        invited_count:
          type: integer
          description: Number of user invited to have a role
        requested_count:
          type: integer
          description: Number of user requesting a role
        count:
          type: integer
          description: Total number of items in the results
        next:
          type: string
          description: API end point to get the next pageof results matching the query
          nullable: true
          format: uri
        previous:
          type: string
          description: API end point to get the previous pageof results matching the
            query
          nullable: true
          format: uri
        results:
          type: array
          items:
            $ref: '#/components/schemas/Role'
          description: Items in the queryset
    PaginatedRuleList:
      type: object
      properties:
        count:
          type: integer
          description: The number of records
        next:
          type: string
          description: API end point to get the next page of records matching the
            query
          nullable: true
          format: uri
        previous:
          type: string
          description: API end point to get the previous page of records matching
            the query
          nullable: true
          format: uri
        results:
          type: array
          items:
            $ref: '#/components/schemas/Rule'
          description: Records in the queryset
    PaginatedSubscribedSubscriptionList:
      type: object
      properties:
        count:
          type: integer
          description: The number of records
        next:
          type: string
          description: API end point to get the next page of records matching the
            query
          nullable: true
          format: uri
        previous:
          type: string
          description: API end point to get the previous page of records matching
            the query
          nullable: true
          format: uri
        results:
          type: array
          items:
            $ref: '#/components/schemas/SubscribedSubscription'
          description: Records in the queryset
    PaginatedTransactionList:
      type: object
      properties:
        start_at:
          type: string
          format: date
          description: Start of the date range for which the balance was computed
        ends_at:
          type: string
          format: date
          description: End of the date range for which the balance was computed
        balance_amount:
          type: integer
          description: balance of all transactions in cents (i.e. 100ths) of unit
        balance_unit:
          type: integer
          description: 'three-letter ISO 4217 code for currency unit (ex: usd)'
        count:
          type: integer
          description: Total number of items in the results
        next:
          type: string
          description: API end point to get the next pageof results matching the query
          nullable: true
          format: uri
        previous:
          type: string
          description: API end point to get the previous pageof results matching the
            query
          nullable: true
          format: uri
        results:
          type: array
          items:
            $ref: '#/components/schemas/Transaction'
          description: Items in the queryset
    PaginatedUserEngagementList:
      type: object
      properties:
        count:
          type: integer
          description: The number of records
        next:
          type: string
          description: API end point to get the next page of records matching the
            query
          nullable: true
          format: uri
        previous:
          type: string
          description: API end point to get the previous page of records matching
            the query
          nullable: true
          format: uri
        results:
          type: array
          items:
            $ref: '#/components/schemas/UserEngagement'
          description: Records in the queryset
    PaginatedUserList:
      type: object
      properties:
        count:
          type: integer
          description: The number of records
        next:
          type: string
          description: API end point to get the next page of records matching the
            query
          nullable: true
          format: uri
        previous:
          type: string
          description: API end point to get the previous page of records matching
            the query
          nullable: true
          format: uri
        results:
          type: array
          items:
            $ref: '#/components/schemas/User'
          description: Records in the queryset
    PasswordChange:
      type: object
      description: We need at least on secret of the HTTP `request.user` to commit
        changes.
      properties:
        password:
          type: string
          writeOnly: true
          description: Password of the user making the HTTP request
        otp_code:
          type: integer
          writeOnly: true
          description: One-time code. This field will be checked against an expected
            code when multi-factor authentication (MFA) is enabled.
        email_code:
          type: integer
          writeOnly: true
          description: Email verification code.
        phone_code:
          type: integer
          writeOnly: true
          description: Phone verification code.
        new_password:
          type: string
          writeOnly: true
          description: New password for the user referenced in the URL
      required:
      - new_password
    PatchedAgreementUpdate:
      type: object
      description: Serializer to update an agreement
      properties:
        slug:
          type: string
          readOnly: true
          description: Unique identifier shown in the URL bar
          pattern: ^[-a-zA-Z0-9_]+$
        title:
          type: string
          description: Short description of the agreement
          maxLength: 150
        updated_at:
          type: string
          format: date-time
          description: Date/time of update (in ISO 8601 format)
    PatchedApp:
      type: object
      properties:
        slug:
          type: string
          readOnly: true
          description: unique identifier for the site (also serves as subdomain)
          pattern: ^[-a-zA-Z0-9_]+$
        entry_point:
          type: string
          format: uri
          nullable: true
          description: Entry point to which requests will be redirected to
          maxLength: 100
        session_backend:
          allOf:
          - $ref: '#/components/schemas/SessionBackendEnum'
          description: Format to encode session in the forwarded HTTP request
        authentication:
          allOf:
          - $ref: '#/components/schemas/AuthenticationEnum'
          description: Restricted authentication and registration
        welcome_email:
          type: boolean
          description: Send a welcome e-mail to newly registered users
        cors_restricted:
          type: boolean
          description: Set CORS headers on HTTP responses
        detail:
          type: string
          description: Describes the result of the action in human-readable form
    PatchedBalanceLine:
      type: object
      properties:
        title:
          type: string
          description: Title for the row
          maxLength: 255
        selector:
          type: string
          description: Filter on transaction accounts
          maxLength: 255
        rank:
          type: integer
          description: Absolute position of the row in the list of rows for the table
    PatchedCard:
      type: object
      description: Information to verify a credit card
      properties:
        processor:
          allOf:
          - $ref: '#/components/schemas/ProcessorAuth'
          description: Keys to authenticate the client with the payment processor
        last4:
          type: string
          description: Last 4 digits of the credit card on file
        exp_date:
          type: string
          description: Expiration date of the credit card on file
    PatchedCartItemUpdate:
      type: object
      description: |-
        Designed for handling update operations on cart items.
        Restricts user and plan fields to be read-only.
      properties:
        created_at:
          type: string
          format: date-time
          readOnly: true
          description: Date/time of creation (in ISO format)
        user:
          allOf:
          - $ref: '#/components/schemas/User'
          readOnly: true
          description: User the cart belongs to
        claim_code:
          type: string
          readOnly: true
          nullable: true
          description: Code used to assign the cart item to a user in group buy
          pattern: ^[-a-zA-Z0-9_]+$
        plan:
          allOf:
          - $ref: '#/components/schemas/Plan'
          readOnly: true
          description: Plan in the cart (if any)
        option:
          type: integer
          description: Index in the list of discounts for advance payments
        use:
          type: integer
          nullable: true
          description: Item added to the cart (if use charge)
        quantity:
          type: integer
          description: Number of periods to be paid in advance
        sync_on:
          type: string
          nullable: true
          description: identifier of the person that will benefit from the subscription
            (GroupBuy)
          maxLength: 255
        full_name:
          type: string
          description: Full name of the person that will benefit from the subscription
            (GroupBuy)
          maxLength: 150
        email:
          type: string
          nullable: true
          description: e-mail of the person that will benefit from the subscription
            (GroupBuy)
          maxLength: 255
        detail:
          type: string
          readOnly: true
          description: Describes the result of the action in human-readable form
    PatchedCouponUpdate:
      type: object
      description: Serializer to update a coupon
      properties:
        code:
          type: string
          description: Unique identifier per provider, typically used in URLs
        discount_type:
          allOf:
          - $ref: '#/components/schemas/DiscountTypeEnum'
          description: Type of discount ('percentage', 'currency', or 'period')
        discount_value:
          type: integer
          description: Amount of the discount
        created_at:
          type: string
          format: date-time
          readOnly: true
          description: Date/time of creation (in ISO format)
        ends_at:
          type: string
          format: date-time
          nullable: true
          description: Date/time at which the coupon code expires (in ISO format)
        description:
          type: string
          nullable: true
          description: Free-form text description for the coupon
        nb_attempts:
          type: integer
          nullable: true
          description: Number of times the coupon can be used
        plan:
          type: string
          nullable: true
          description: Coupon will only apply to this plan
    PatchedEditTools:
      type: object
      properties:
        show_edit_tools:
          type: boolean
          description: Show the online editor tools
    PatchedLessVariable:
      type: object
      properties:
        name:
          type: string
          maxLength: 250
        value:
          type: string
          maxLength: 250
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
    PatchedNotifications:
      type: object
      properties:
        notifications:
          type: array
          items:
            type: string
          description: List of notifications from card_updated, charge_updated, claim_code_generated,
            expires_soon, order_executed, period_sales_report_created, profile_updated,
            role_request_created, user_activated, user_contact, user_registered, user_reset_password,
            user_verification, user_welcome
    PatchedPlanDetail:
      type: object
      properties:
        slug:
          type: string
          description: Unique identifier shown in the URL bar
          pattern: ^[-a-zA-Z0-9_]+$
        title:
          type: string
          description: Title for the plan
        description:
          type: string
          description: Free-form text description for the plan
        is_active:
          type: boolean
          description: True when customers can subscribe to the plan
        setup_amount:
          type: integer
          description: One-time amount to pay when the subscription starts
        period_amount:
          type: integer
          description: Amount billed every period
        period_type:
          allOf:
          - $ref: '#/components/schemas/PeriodTypeEnum'
          description: Natural period length of a subscription to the plan (hourly,
            daily, weekly, monthly, yearly)
        advance_discounts:
          type: array
          items:
            $ref: '#/components/schemas/AdvanceDiscount'
          description: Discounts when periods are paid in advance.
        use_charges:
          type: array
          items:
            $ref: '#/components/schemas/UseCharge'
          description: Variable pricing based on usage
        unit:
          type: string
          description: 'Three-letter ISO 4217 code for currency unit (ex: usd)'
          maxLength: 3
        profile:
          allOf:
          - $ref: '#/components/schemas/Organization'
          readOnly: true
          description: Provider of the plan
        extra:
          type: string
          nullable: true
          description: Extra meta data (can be stringify JSON)
        period_length:
          type: integer
          description: Number of periods for a subscription to the plan (defaults
            to 1)
        renewal_type:
          allOf:
          - $ref: '#/components/schemas/RenewalTypeEnum'
          description: What happens at the end of a subscription period (one-time,
            auto-renew, repeat)
        is_not_priced:
          type: boolean
          description: True if the plan has no pricing (i.e. contact us)
        unlock_event:
          type: string
          nullable: true
          description: Payment required to access full service
          maxLength: 128
        created_at:
          type: string
          format: date-time
          readOnly: true
          description: Date/time of creation (in ISO format)
        skip_optin_on_grant:
          type: boolean
          description: True when a subscriber can automatically be subscribed to the
            plan by its provider. Otherwise the subscriber must manually accept the
            subscription. (defaults to False)
        optin_on_request:
          type: boolean
          description: True when a provider must manually accept a subscription to
            the plan initiated by a subscriber. (defaults to False)
        discounted_period_amount:
          type: string
          readOnly: true
          description: Discounted amount for the first period
        is_cart_item:
          type: string
          readOnly: true
          description: The plan is part of the cart to checkout
        detail:
          type: string
          readOnly: true
          description: Describes the result of the action in human-readable form
    PatchedProfileDetail:
      type: object
      description: |-
        Operational information on an Organization,
        bundled with its subscriptions.
      properties:
        slug:
          type: string
          description: Unique identifier shown in the URL bar
          pattern: ^[-a-zA-Z0-9_]+$
        printable_name:
          type: string
          readOnly: true
          description: Name that can be safely used for display in HTML pages
        picture:
          type: string
          format: uri
          nullable: true
          title: Profile picture
          description: URL location of the profile picture
          maxLength: 2083
        type:
          type: string
          readOnly: true
          description: One of 'organization', 'personal' or 'user'
        credentials:
          type: string
          readOnly: true
          description: True if the account has valid login credentials
        created_at:
          type: string
          format: date-time
          readOnly: true
          description: Date/time of creation (in ISO format)
        full_name:
          type: string
          description: Full name
        email:
          type: string
          format: email
          description: E-mail address
        phone:
          type: string
          description: Phone number
        street_address:
          type: string
          description: Street address
        locality:
          type: string
          description: City/Town
        region:
          type: string
          description: State/Province/County
        postal_code:
          type: string
          description: Zip/Postal code
        country:
          description: Country as 2-letter code (ISO 3166-1)
          oneOf:
          - $ref: '#/components/schemas/CountryEnum'
          - $ref: '#/components/schemas/BlankEnum'
        default_timezone:
          type: string
          description: Timezone to use when reporting metrics
        is_provider:
          type: boolean
          description: The profile can fulfill the provider side of a subscription.
        is_bulk_buyer:
          type: boolean
          default: false
          description: Enable GroupBuy
        extra:
          type: string
          nullable: true
          description: Extra meta data (can be stringify JSON)
        detail:
          type: string
          readOnly: true
          description: Describes the result of the action in human-readable form
        subscriptions:
          type: array
          items:
            $ref: '#/components/schemas/WithSubscription'
          readOnly: true
          description: Active subscriptions for the profile
        nick_name:
          type: string
          readOnly: true
          description: Short casual name used to address the contact (only available
            for 'personal' and 'user' accounts)
        lang:
          type: string
          readOnly: true
          description: Preferred communication language (only available for 'personal'
            and 'user' accounts)
        activities:
          type: array
          items:
            $ref: '#/components/schemas/Activity'
          readOnly: true
          description: Activities related to the account (only available for 'personal'
            and 'user' accounts)
    PatchedProvidedSubscription:
      type: object
      properties:
        created_at:
          type: string
          format: date-time
          readOnly: true
          description: Date/time of creation (in ISO format)
        ends_at:
          type: string
          format: date-time
          description: Date/time when the subscription period currently ends (in ISO
            format)
        description:
          type: string
          nullable: true
          description: Free-form text description for the subscription
        profile:
          allOf:
          - $ref: '#/components/schemas/Organization'
          readOnly: true
          description: Profile subscribed to the plan
        plan:
          allOf:
          - $ref: '#/components/schemas/Plan'
          readOnly: true
          description: Plan the profile is subscribed to
        auto_renew:
          type: boolean
          description: The subscription is set to auto-renew at the end of the period
        extra:
          type: string
          nullable: true
          description: Extra meta data (can be stringify JSON)
        grant_key:
          type: string
          readOnly: true
          nullable: true
          description: Unique key generated when a grant is initiated
          pattern: ^[-a-zA-Z0-9_]+$
        request_key:
          type: string
          readOnly: true
          nullable: true
          description: Unique key generated when a request is initiated
          pattern: ^[-a-zA-Z0-9_]+$
        app_url:
          type: string
          readOnly: true
          description: URL to access the subscribed service
        accept_request_api_url:
          type: string
          readOnly: true
          description: URL API endpoint to grant the subscription
        remove_api_url:
          type: string
          readOnly: true
          description: URL API endpoint to remove the subscription grant
    PatchedRoleDescription:
      type: object
      properties:
        created_at:
          type: string
          format: date-time
          readOnly: true
          description: Date/time of creation (in ISO format)
        slug:
          type: string
          readOnly: true
          description: Unique identifier shown in the URL bar
          pattern: ^[-a-zA-Z0-9_]+$
        title:
          type: string
          description: Short description of the role. Grammatical rules to pluralize
            the title might be used in User Interfaces.
          maxLength: 20
        skip_optin_on_grant:
          type: boolean
          description: Automatically grants the role without requiring a user to accept
            it.
        implicit_create_on_none:
          type: boolean
          description: Automatically adds the role when a user and profile share the
            same e-mail domain.
        otp_required:
          type: boolean
          description: Requires users with the role to sign-in using an OTP code as
            a multi-factor authentication.
        is_global:
          type: boolean
          readOnly: true
          description: True when the role type is available for all profiles
        profile:
          allOf:
          - $ref: '#/components/schemas/Organization'
          readOnly: true
          description: Profile the role type belongs to
        extra:
          type: string
          nullable: true
          description: Extra meta data (can be stringify JSON)
        editable:
          type: string
          readOnly: true
          description: True if the request user is able to update the role description.
            Typically a profile manager for the organization (local role description)
            or the broker (global role descriptions).
    PatchedRuleRankUpdate:
      type: object
      properties:
        updates:
          type: array
          items:
            $ref: '#/components/schemas/RuleRank'
    PatchedSourceCode:
      type: object
      properties:
        path:
          type: string
          maxLength: 255
        text:
          type: string
          maxLength: 100000
    PatchedSubscribedSubscription:
      type: object
      properties:
        created_at:
          type: string
          format: date-time
          readOnly: true
          description: Date/time of creation (in ISO format)
        ends_at:
          type: string
          format: date-time
          description: Date/time when the subscription period currently ends (in ISO
            format)
        description:
          type: string
          nullable: true
          description: Free-form text description for the subscription
        profile:
          allOf:
          - $ref: '#/components/schemas/Organization'
          readOnly: true
          description: Profile subscribed to the plan
        plan:
          allOf:
          - $ref: '#/components/schemas/Plan'
          readOnly: true
          description: Plan the profile is subscribed to
        auto_renew:
          type: boolean
          description: The subscription is set to auto-renew at the end of the period
        extra:
          type: string
          nullable: true
          description: Extra meta data (can be stringify JSON)
        grant_key:
          type: string
          readOnly: true
          nullable: true
          description: Unique key generated when a grant is initiated
          pattern: ^[-a-zA-Z0-9_]+$
        request_key:
          type: string
          readOnly: true
          nullable: true
          description: Unique key generated when a request is initiated
          pattern: ^[-a-zA-Z0-9_]+$
        app_url:
          type: string
          readOnly: true
          description: URL to access the subscribed service
        remove_api_url:
          type: string
          readOnly: true
          description: URL API endpoint to remove the subscription request
        editable:
          type: string
          readOnly: true
          description: True if the request user is able to update the subscription.
            Typically a profile manager for the plan provider.
    PatchedUpdateRank:
      type: object
      properties:
        oldpos:
          type: integer
          description: old rank for a line in the list of lines
        newpos:
          type: integer
          description: new rank for the line in the list of lines
    PatchedUpdateRule:
      type: object
      properties:
        rank:
          type: integer
          description: Determines the order in which rules are considered
        path:
          type: string
          readOnly: true
          description: OpenAPI path against which requests are matched
        allow:
          type: string
          description: Method applied to grant or deny access
        is_forward:
          type: boolean
          description: When access is granted, should the request be forwarded
        engaged:
          type: string
          description: Tags to check if it is the first time a user engages
    PatchedUserDetail:
      type: object
      properties:
        slug:
          type: string
          description: Unique identifier that can safely be used in place of username
          pattern: ^[\w.@+-]+$
        username:
          type: string
          readOnly: true
          description: Unique identifier for the user, typically used in URLs
          pattern: ^[\w.@+-]+$
        printable_name:
          type: string
          readOnly: true
          description: Name that can be safely used for display in HTML pages
        picture:
          type: string
          readOnly: true
          description: URL location of the profile picture
        email:
          type: string
          format: email
          description: Primary e-mail address to contact user
        phone:
          type: string
          description: Primary phone number to contact user
        full_name:
          type: string
          description: Full name (effectively first name followed by last name)
        nick_name:
          type: string
          description: Short casual name used to address the user
        lang:
          allOf:
          - $ref: '#/components/schemas/LangEnum'
          description: Preferred communication language
        credentials:
          type: string
          readOnly: true
          description: True if the user has valid login credentials
        otp_enabled:
          type: string
          readOnly: true
          description: True if the user has valid login credentials
        created_at:
          type: string
          format: date-time
          readOnly: true
          description: Date at which the user account was created
        last_login:
          type: string
          format: date-time
          readOnly: true
          description: Date at which the user last logged in
        email_code:
          type: integer
          writeOnly: true
          description: Email verification code
        phone_code:
          type: integer
          writeOnly: true
          description: Phone verification code
    PeriodTypeEnum:
      enum:
      - hourly
      - daily
      - weekly
      - monthly
      - yearly
      type: string
    Plan:
      type: object
      properties:
        slug:
          type: string
          description: Unique identifier shown in the URL bar
          pattern: ^[-a-zA-Z0-9_]+$
        title:
          type: string
          description: Title for the plan
    PlanCreate:
      type: object
      description: Serializer to create plans in POST requests
      properties:
        slug:
          type: string
          description: Unique identifier shown in the URL bar
          pattern: ^[-a-zA-Z0-9_]+$
        title:
          type: string
          description: Title for the plan
        description:
          type: string
          description: Free-form text description for the plan
        is_active:
          type: boolean
          description: True when customers can subscribe to the plan
        setup_amount:
          type: integer
          description: One-time amount to pay when the subscription starts
        period_amount:
          type: integer
          description: Amount billed every period
        period_type:
          allOf:
          - $ref: '#/components/schemas/PeriodTypeEnum'
          description: Natural period length of a subscription to the plan (hourly,
            daily, weekly, monthly, yearly)
        advance_discounts:
          type: array
          items:
            $ref: '#/components/schemas/AdvanceDiscount'
          description: Discounts when periods are paid in advance.
        use_charges:
          type: array
          items:
            $ref: '#/components/schemas/UseCharge'
          description: Variable pricing based on usage
        unit:
          type: string
          description: 'Three-letter ISO 4217 code for currency unit (ex: usd)'
          maxLength: 3
        profile:
          allOf:
          - $ref: '#/components/schemas/Organization'
          readOnly: true
          description: Provider of the plan
        extra:
          type: string
          nullable: true
          description: Extra meta data (can be stringify JSON)
        period_length:
          type: integer
          description: Number of periods for a subscription to the plan (defaults
            to 1)
        renewal_type:
          allOf:
          - $ref: '#/components/schemas/RenewalTypeEnum'
          description: What happens at the end of a subscription period (one-time,
            auto-renew, repeat)
        is_not_priced:
          type: boolean
          description: True if the plan has no pricing (i.e. contact us)
        unlock_event:
          type: string
          nullable: true
          description: Payment required to access full service
          maxLength: 128
        created_at:
          type: string
          format: date-time
          readOnly: true
          description: Date/time of creation (in ISO format)
        skip_optin_on_grant:
          type: boolean
          description: True when a subscriber can automatically be subscribed to the
            plan by its provider. Otherwise the subscriber must manually accept the
            subscription. (defaults to False)
        optin_on_request:
          type: boolean
          description: True when a provider must manually accept a subscription to
            the plan initiated by a subscriber. (defaults to False)
        discounted_period_amount:
          type: string
          readOnly: true
          description: Discounted amount for the first period
        is_cart_item:
          type: string
          readOnly: true
          description: The plan is part of the cart to checkout
        detail:
          type: string
          readOnly: true
          description: Describes the result of the action in human-readable form
      required:
      - created_at
      - detail
      - discounted_period_amount
      - is_cart_item
      - profile
      - title
    PlanDetail:
      type: object
      properties:
        slug:
          type: string
          description: Unique identifier shown in the URL bar
          pattern: ^[-a-zA-Z0-9_]+$
        title:
          type: string
          description: Title for the plan
        description:
          type: string
          description: Free-form text description for the plan
        is_active:
          type: boolean
          description: True when customers can subscribe to the plan
        setup_amount:
          type: integer
          description: One-time amount to pay when the subscription starts
        period_amount:
          type: integer
          description: Amount billed every period
        period_type:
          allOf:
          - $ref: '#/components/schemas/PeriodTypeEnum'
          description: Natural period length of a subscription to the plan (hourly,
            daily, weekly, monthly, yearly)
        advance_discounts:
          type: array
          items:
            $ref: '#/components/schemas/AdvanceDiscount'
          description: Discounts when periods are paid in advance.
        use_charges:
          type: array
          items:
            $ref: '#/components/schemas/UseCharge'
          description: Variable pricing based on usage
        unit:
          type: string
          description: 'Three-letter ISO 4217 code for currency unit (ex: usd)'
          maxLength: 3
        profile:
          allOf:
          - $ref: '#/components/schemas/Organization'
          readOnly: true
          description: Provider of the plan
        extra:
          type: string
          nullable: true
          description: Extra meta data (can be stringify JSON)
        period_length:
          type: integer
          description: Number of periods for a subscription to the plan (defaults
            to 1)
        renewal_type:
          allOf:
          - $ref: '#/components/schemas/RenewalTypeEnum'
          description: What happens at the end of a subscription period (one-time,
            auto-renew, repeat)
        is_not_priced:
          type: boolean
          description: True if the plan has no pricing (i.e. contact us)
        unlock_event:
          type: string
          nullable: true
          description: Payment required to access full service
          maxLength: 128
        created_at:
          type: string
          format: date-time
          readOnly: true
          description: Date/time of creation (in ISO format)
        skip_optin_on_grant:
          type: boolean
          description: True when a subscriber can automatically be subscribed to the
            plan by its provider. Otherwise the subscriber must manually accept the
            subscription. (defaults to False)
        optin_on_request:
          type: boolean
          description: True when a provider must manually accept a subscription to
            the plan initiated by a subscriber. (defaults to False)
        discounted_period_amount:
          type: string
          readOnly: true
          description: Discounted amount for the first period
        is_cart_item:
          type: string
          readOnly: true
          description: The plan is part of the cart to checkout
        detail:
          type: string
          readOnly: true
          description: Describes the result of the action in human-readable form
      required:
      - created_at
      - detail
      - discounted_period_amount
      - is_cart_item
      - profile
    ProcessorAuth:
      type: object
      properties:
        STRIPE_PUB_KEY:
          type: string
          description: Processor public key (Stripe)
        STRIPE_INTENT_SECRET:
          type: string
          description: PaymentIntent or SetupIntent secret for SCA (Stripe)
        STRIPE_ACCOUNT:
          type: string
          description: Connected account identifier (Stripe)
    Profile:
      type: object
      properties:
        slug:
          type: string
          description: Unique identifier shown in the URL bar
          pattern: ^[-a-zA-Z0-9_]+$
        printable_name:
          type: string
          readOnly: true
          description: Name that can be safely used for display in HTML pages
        picture:
          type: string
          format: uri
          nullable: true
          title: Profile picture
          description: URL location of the profile picture
          maxLength: 2083
        type:
          type: string
          readOnly: true
          description: One of 'organization', 'personal' or 'user'
        credentials:
          type: string
          readOnly: true
          description: True if the account has valid login credentials
        created_at:
          type: string
          format: date-time
          readOnly: true
          description: Date/time of creation (in ISO format)
        full_name:
          type: string
          description: Full name
        email:
          type: string
          format: email
          description: E-mail address
        phone:
          type: string
          description: Phone number
        street_address:
          type: string
          description: Street address
        locality:
          type: string
          description: City/Town
        region:
          type: string
          description: State/Province/County
        postal_code:
          type: string
          description: Zip/Postal code
        country:
          description: Country as 2-letter code (ISO 3166-1)
          oneOf:
          - $ref: '#/components/schemas/CountryEnum'
          - $ref: '#/components/schemas/BlankEnum'
        default_timezone:
          type: string
          description: Timezone to use when reporting metrics
        is_provider:
          type: boolean
          description: The profile can fulfill the provider side of a subscription.
        is_bulk_buyer:
          type: boolean
          default: false
          description: Enable GroupBuy
        extra:
          type: string
          nullable: true
          description: Extra meta data (can be stringify JSON)
        detail:
          type: string
          readOnly: true
          description: Describes the result of the action in human-readable form
        nick_name:
          type: string
          readOnly: true
          description: Short casual name used to address the contact (only available
            for 'personal' and 'user' accounts)
        lang:
          type: string
          readOnly: true
          description: Preferred communication language (only available for 'personal'
            and 'user' accounts)
      required:
      - created_at
      - credentials
      - detail
      - full_name
      - lang
      - nick_name
      - printable_name
      - type
    ProfileDetail:
      type: object
      description: |-
        Operational information on an Organization,
        bundled with its subscriptions.
      properties:
        slug:
          type: string
          description: Unique identifier shown in the URL bar
          pattern: ^[-a-zA-Z0-9_]+$
        printable_name:
          type: string
          readOnly: true
          description: Name that can be safely used for display in HTML pages
        picture:
          type: string
          format: uri
          nullable: true
          title: Profile picture
          description: URL location of the profile picture
          maxLength: 2083
        type:
          type: string
          readOnly: true
          description: One of 'organization', 'personal' or 'user'
        credentials:
          type: string
          readOnly: true
          description: True if the account has valid login credentials
        created_at:
          type: string
          format: date-time
          readOnly: true
          description: Date/time of creation (in ISO format)
        full_name:
          type: string
          description: Full name
        email:
          type: string
          format: email
          description: E-mail address
        phone:
          type: string
          description: Phone number
        street_address:
          type: string
          description: Street address
        locality:
          type: string
          description: City/Town
        region:
          type: string
          description: State/Province/County
        postal_code:
          type: string
          description: Zip/Postal code
        country:
          description: Country as 2-letter code (ISO 3166-1)
          oneOf:
          - $ref: '#/components/schemas/CountryEnum'
          - $ref: '#/components/schemas/BlankEnum'
        default_timezone:
          type: string
          description: Timezone to use when reporting metrics
        is_provider:
          type: boolean
          description: The profile can fulfill the provider side of a subscription.
        is_bulk_buyer:
          type: boolean
          default: false
          description: Enable GroupBuy
        extra:
          type: string
          nullable: true
          description: Extra meta data (can be stringify JSON)
        detail:
          type: string
          readOnly: true
          description: Describes the result of the action in human-readable form
        subscriptions:
          type: array
          items:
            $ref: '#/components/schemas/WithSubscription'
          readOnly: true
          description: Active subscriptions for the profile
        nick_name:
          type: string
          readOnly: true
          description: Short casual name used to address the contact (only available
            for 'personal' and 'user' accounts)
        lang:
          type: string
          readOnly: true
          description: Preferred communication language (only available for 'personal'
            and 'user' accounts)
        activities:
          type: array
          items:
            $ref: '#/components/schemas/Activity'
          readOnly: true
          description: Activities related to the account (only available for 'personal'
            and 'user' accounts)
      required:
      - activities
      - created_at
      - credentials
      - detail
      - full_name
      - lang
      - nick_name
      - printable_name
      - subscriptions
      - type
    ProvidedSubscription:
      type: object
      properties:
        created_at:
          type: string
          format: date-time
          readOnly: true
          description: Date/time of creation (in ISO format)
        ends_at:
          type: string
          format: date-time
          description: Date/time when the subscription period currently ends (in ISO
            format)
        description:
          type: string
          nullable: true
          description: Free-form text description for the subscription
        profile:
          allOf:
          - $ref: '#/components/schemas/Organization'
          readOnly: true
          description: Profile subscribed to the plan
        plan:
          allOf:
          - $ref: '#/components/schemas/Plan'
          readOnly: true
          description: Plan the profile is subscribed to
        auto_renew:
          type: boolean
          description: The subscription is set to auto-renew at the end of the period
        extra:
          type: string
          nullable: true
          description: Extra meta data (can be stringify JSON)
        grant_key:
          type: string
          readOnly: true
          nullable: true
          description: Unique key generated when a grant is initiated
          pattern: ^[-a-zA-Z0-9_]+$
        request_key:
          type: string
          readOnly: true
          nullable: true
          description: Unique key generated when a request is initiated
          pattern: ^[-a-zA-Z0-9_]+$
        app_url:
          type: string
          readOnly: true
          description: URL to access the subscribed service
        accept_request_api_url:
          type: string
          readOnly: true
          description: URL API endpoint to grant the subscription
        remove_api_url:
          type: string
          readOnly: true
          description: URL API endpoint to remove the subscription grant
      required:
      - accept_request_api_url
      - app_url
      - created_at
      - ends_at
      - grant_key
      - plan
      - profile
      - remove_api_url
      - request_key
    ProvidedSubscriptionCreate:
      type: object
      properties:
        profile:
          allOf:
          - $ref: '#/components/schemas/OrganizationInvite'
          description: Profile subscribed to the plan
        message:
          type: string
          nullable: true
          description: Message to send along the invitation
      required:
      - profile
    ProvidedSubscriptionDetail:
      type: object
      description: For active subscriptions we return the contact information for
        the profile.
      properties:
        created_at:
          type: string
          format: date-time
          readOnly: true
          description: Date/time of creation (in ISO format)
        ends_at:
          type: string
          format: date-time
          description: Date/time when the subscription period currently ends (in ISO
            format)
        description:
          type: string
          nullable: true
          description: Free-form text description for the subscription
        profile:
          allOf:
          - $ref: '#/components/schemas/OrganizationDetail'
          readOnly: true
          description: Profile subscribed to the plan
        plan:
          allOf:
          - $ref: '#/components/schemas/Plan'
          readOnly: true
          description: Plan the profile is subscribed to
        auto_renew:
          type: boolean
          description: The subscription is set to auto-renew at the end of the period
        extra:
          type: string
          nullable: true
          description: Extra meta data (can be stringify JSON)
        grant_key:
          type: string
          readOnly: true
          nullable: true
          description: Unique key generated when a grant is initiated
          pattern: ^[-a-zA-Z0-9_]+$
        request_key:
          type: string
          readOnly: true
          nullable: true
          description: Unique key generated when a request is initiated
          pattern: ^[-a-zA-Z0-9_]+$
        app_url:
          type: string
          readOnly: true
          description: URL to access the subscribed service
      required:
      - app_url
      - created_at
      - ends_at
      - grant_key
      - plan
      - profile
      - request_key
    PublicKey:
      type: object
      description: Updates a user public key
      properties:
        password:
          type: string
          writeOnly: true
          description: Password of the user making the HTTP request
        otp_code:
          type: integer
          writeOnly: true
          description: One-time code. This field will be checked against an expected
            code when multi-factor authentication (MFA) is enabled.
        email_code:
          type: integer
          writeOnly: true
          description: Email verification code.
        phone_code:
          type: integer
          writeOnly: true
          description: Phone verification code.
        pubkey:
          type: string
          description: New public key for the user referenced in the URL
          maxLength: 500
      required:
      - pubkey
    RecentActivity:
      type: object
      description: Serializer for recent activity on the site.
      properties:
        slug:
          type: string
          description: Unique identifier for the user or profile
          pattern: ^[-a-zA-Z0-9_]+$
        printable_name:
          type: string
          description: Name that can be safely used for display in HTML pages
        descr:
          type: string
          description: Description of the activity
        created_at:
          type: string
          format: date-time
          description: Date/time of creation (in ISO format)
        type:
          type: string
          description: One of 'organization', 'personal' or 'user'
      required:
      - created_at
      - descr
      - printable_name
      - slug
    Recover:
      type: object
      description: Serializer to send an e-mail to a user in order to recover her
        account.
      properties:
        email:
          type: string
          description: Email or phone number to recover the account
      required:
      - email
    RedeemCoupon:
      type: object
      description: Serializer to redeem a ``Coupon``.
      properties:
        code:
          type: string
          description: Coupon code to redeem
      required:
      - code
    RefundCharge:
      type: object
      description: Response for the API call to send an e-mail duplicate to the customer.
      properties:
        lines:
          type: array
          items:
            $ref: '#/components/schemas/RefundChargeItem'
          description: Line items in a charge to be refunded
      required:
      - lines
    RefundChargeItem:
      type: object
      description: One item to refund on a `Charge`.
      properties:
        num:
          type: integer
          description: Line item index counting from zero.
        refunded_amount:
          type: integer
          description: The amount to refund cannot be higher than the amount of the
            line item minus the total amount already refunded on that line item.
      required:
      - num
    Register:
      type: object
      properties:
        slug:
          type: string
          description: Unique identifier that can safely be used in place of username
          pattern: ^[\w.@+-]+$
        username:
          type: string
          description: Unique identifier for the user, typically used in URLs
        printable_name:
          type: string
          readOnly: true
          description: Name that can be safely used for display in HTML pages
        picture:
          type: string
          readOnly: true
          description: URL location of the profile picture
        email:
          type: string
          format: email
          description: Primary e-mail address to contact user
        phone:
          type: string
          description: Primary phone number to contact user
        full_name:
          type: string
          description: Full name (effectively first name followed by last name)
        nick_name:
          type: string
          description: Short casual name used to address the user
        lang:
          allOf:
          - $ref: '#/components/schemas/LangEnum'
          description: Preferred communication language
        credentials:
          type: string
          readOnly: true
          description: True if the user has valid login credentials
        otp_enabled:
          type: string
          readOnly: true
          description: True if the user has valid login credentials
        created_at:
          type: string
          format: date-time
          readOnly: true
          description: Date at which the user account was created
        last_login:
          type: string
          format: date-time
          readOnly: true
          description: Date at which the user last logged in
        email_code:
          type: integer
          writeOnly: true
          description: Email verification code
        phone_code:
          type: integer
          writeOnly: true
          description: Phone verification code
        new_password:
          type: string
          writeOnly: true
          description: Password with which a user can authenticate with the service
        organization_name:
          type: string
          description: Organization name that owns the billing, registered with the
            user as profile manager
        street_address:
          type: string
          description: Street address for the billing profile
        locality:
          type: string
          description: City/Town for the billing profile
        region:
          type: string
          description: State/Province/County for the billing profile
        postal_code:
          type: string
          description: Zip/Postal Code for the billing profile
        country:
          type: string
          description: Country for the billing profile
        type:
          allOf:
          - $ref: '#/components/schemas/TypeEnum'
          description: One of 'organization', 'personal' or 'user'
        terms-of-use:
          type: string
          description: Terms Of Use
        security:
          type: string
          description: Security Policy
      required:
      - created_at
      - credentials
      - full_name
      - last_login
      - otp_enabled
      - picture
      - printable_name
    RenewalTypeEnum:
      enum:
      - one-time
      - auto-renew
      - repeat
      type: string
    Role:
      type: object
      properties:
        created_at:
          type: string
          format: date-time
          readOnly: true
          description: Date/time of creation (in ISO format)
        user:
          allOf:
          - $ref: '#/components/schemas/UserDetail'
          readOnly: true
          description: User with the role
        grant_key:
          type: string
          readOnly: true
          nullable: true
          description: Key to identify the grant of the role
          pattern: ^[-a-zA-Z0-9_]+$
        role_description:
          allOf:
          - $ref: '#/components/schemas/RoleDescription'
          readOnly: true
          description: Description of the role
        accept_request_api_url:
          type: string
          readOnly: true
          description: URL API endpoint to grant the role
        remove_api_url:
          type: string
          readOnly: true
          description: URL API endpoint to remove the role grant or request
        detail:
          type: string
          readOnly: true
          description: Describes the result of the action in human-readable form
      required:
      - accept_request_api_url
      - created_at
      - detail
      - grant_key
      - remove_api_url
      - role_description
      - user
    RoleCreate:
      type: object
      description: Invite a previously existing or new User
      properties:
        slug:
          type: string
          description: Username
          pattern: '[-a-zA-Z0-9_]+'
        email:
          type: string
          format: email
          description: E-mail of user to grant role onto profile (potentially generating
            an invite to the site)
          maxLength: 254
        full_name:
          type: string
          description: Full name of user to grant role onto profile (potentially generating
            an invite to the site)
        message:
          type: string
          description: Message to send along the invitation
          maxLength: 255
    RoleDescription:
      type: object
      properties:
        created_at:
          type: string
          format: date-time
          readOnly: true
          description: Date/time of creation (in ISO format)
        slug:
          type: string
          readOnly: true
          description: Unique identifier shown in the URL bar
          pattern: ^[-a-zA-Z0-9_]+$
        title:
          type: string
          description: Short description of the role. Grammatical rules to pluralize
            the title might be used in User Interfaces.
          maxLength: 20
        skip_optin_on_grant:
          type: boolean
          description: Automatically grants the role without requiring a user to accept
            it.
        implicit_create_on_none:
          type: boolean
          description: Automatically adds the role when a user and profile share the
            same e-mail domain.
        otp_required:
          type: boolean
          description: Requires users with the role to sign-in using an OTP code as
            a multi-factor authentication.
        is_global:
          type: boolean
          readOnly: true
          description: True when the role type is available for all profiles
        profile:
          allOf:
          - $ref: '#/components/schemas/Organization'
          readOnly: true
          description: Profile the role type belongs to
        extra:
          type: string
          nullable: true
          description: Extra meta data (can be stringify JSON)
        editable:
          type: string
          readOnly: true
          description: True if the request user is able to update the role description.
            Typically a profile manager for the organization (local role description)
            or the broker (global role descriptions).
      required:
      - created_at
      - editable
      - is_global
      - profile
      - slug
      - title
    Rule:
      type: object
      properties:
        rank:
          type: integer
          description: Determines the order in which rules are considered
        path:
          type: string
          description: OpenAPI path against which requests are matched
          pattern: ^/?([a-zA-Z0-9:\-\{\}]+/)*[a-zA-Z0-9:\-\{\}]*$
          maxLength: 255
        allow:
          type: string
          description: Method applied to grant or deny access
        is_forward:
          type: boolean
          description: When access is granted, should the request be forwarded
        engaged:
          type: string
          description: Tags to check if it is the first time a user engages
      required:
      - path
      - rank
    RuleRank:
      type: object
      properties:
        oldpos:
          type: integer
          description: old rank for a rule in the list of rules
        newpos:
          type: integer
          description: new rank for the rule in the list of rules
      required:
      - newpos
      - oldpos
    RuleRankUpdate:
      type: object
      properties:
        updates:
          type: array
          items:
            $ref: '#/components/schemas/RuleRank'
      required:
      - updates
    SessionBackendEnum:
      enum:
      - 0
      - 1
      - 2
      type: integer
    SessionData:
      type: object
      properties:
        forward_session:
          type: string
          description: The session being forwarded
        forward_session_header:
          type: string
          description: The HTTP header that encodes the session
        forward_url:
          type: string
          description: The URL end point where the request is forwarded
      required:
      - forward_session
      - forward_session_header
      - forward_url
    SourceCode:
      type: object
      properties:
        path:
          type: string
          maxLength: 255
        text:
          type: string
          maxLength: 100000
    SourceElement:
      type: object
      properties:
        path:
          type: string
          maxLength: 255
        text:
          type: string
          maxLength: 100000
        hints:
          type: array
          items:
            $ref: '#/components/schemas/Hint'
    SubscribedSubscription:
      type: object
      properties:
        created_at:
          type: string
          format: date-time
          readOnly: true
          description: Date/time of creation (in ISO format)
        ends_at:
          type: string
          format: date-time
          description: Date/time when the subscription period currently ends (in ISO
            format)
        description:
          type: string
          nullable: true
          description: Free-form text description for the subscription
        profile:
          allOf:
          - $ref: '#/components/schemas/Organization'
          readOnly: true
          description: Profile subscribed to the plan
        plan:
          allOf:
          - $ref: '#/components/schemas/Plan'
          readOnly: true
          description: Plan the profile is subscribed to
        auto_renew:
          type: boolean
          description: The subscription is set to auto-renew at the end of the period
        extra:
          type: string
          nullable: true
          description: Extra meta data (can be stringify JSON)
        grant_key:
          type: string
          readOnly: true
          nullable: true
          description: Unique key generated when a grant is initiated
          pattern: ^[-a-zA-Z0-9_]+$
        request_key:
          type: string
          readOnly: true
          nullable: true
          description: Unique key generated when a request is initiated
          pattern: ^[-a-zA-Z0-9_]+$
        app_url:
          type: string
          readOnly: true
          description: URL to access the subscribed service
        remove_api_url:
          type: string
          readOnly: true
          description: URL API endpoint to remove the subscription request
        editable:
          type: string
          readOnly: true
          description: True if the request user is able to update the subscription.
            Typically a profile manager for the plan provider.
      required:
      - app_url
      - created_at
      - editable
      - ends_at
      - grant_key
      - plan
      - profile
      - remove_api_url
      - request_key
    Subscription:
      type: object
      properties:
        created_at:
          type: string
          format: date-time
          readOnly: true
          description: Date/time of creation (in ISO format)
        ends_at:
          type: string
          format: date-time
          description: Date/time when the subscription period currently ends (in ISO
            format)
        description:
          type: string
          nullable: true
          description: Free-form text description for the subscription
        profile:
          allOf:
          - $ref: '#/components/schemas/Organization'
          readOnly: true
          description: Profile subscribed to the plan
        plan:
          allOf:
          - $ref: '#/components/schemas/Plan'
          readOnly: true
          description: Plan the profile is subscribed to
        auto_renew:
          type: boolean
          description: The subscription is set to auto-renew at the end of the period
        extra:
          type: string
          nullable: true
          description: Extra meta data (can be stringify JSON)
        grant_key:
          type: string
          readOnly: true
          nullable: true
          description: Unique key generated when a grant is initiated
          pattern: ^[-a-zA-Z0-9_]+$
        request_key:
          type: string
          readOnly: true
          nullable: true
          description: Unique key generated when a request is initiated
          pattern: ^[-a-zA-Z0-9_]+$
        app_url:
          type: string
          readOnly: true
          description: URL to access the subscribed service
      required:
      - app_url
      - created_at
      - ends_at
      - grant_key
      - plan
      - profile
      - request_key
    Table:
      type: object
      properties:
        slug:
          type: string
          description: Unique key in the table for the data series
          pattern: ^[-a-zA-Z0-9_]+$
        title:
          type: string
          readOnly: true
          description: Title of data serie that can be safely used for display in
            HTML pages
        extra:
          type: string
          readOnly: true
          description: Extra meta data (can be stringify JSON)
        values:
          type: array
          items:
            type: array
            items:
              type: string
          description: List of (datetime, integer) couples that represents the data
            serie
        selector:
          type: string
          description: Filter on transaction accounts
      required:
      - extra
      - slug
      - title
      - values
    ThemePackageUpload:
      type: object
      properties:
        location:
          type: string
          readOnly: true
          description: URL where the theme package was uploaded.
      required:
      - location
    ThemePackageUploadBody:
      type: object
      properties:
        files:
          type: string
          description: Content of the theme package as a zip file.
      required:
      - files
    Token:
      type: object
      description: token to verify or refresh.
      properties:
        token:
          type: string
          description: Token used to authenticate user on every HTTP request
      required:
      - token
    Transaction:
      type: object
      description: A `Transaction` in the double-entry bookkeeping ledger.
      properties:
        created_at:
          type: string
          format: date-time
          description: Date/time of creation (in ISO format)
        description:
          type: string
          readOnly: true
          description: Free-form text description for the transaction
        amount:
          type: string
          readOnly: true
          description: Amount being transfered
        is_debit:
          type: string
          readOnly: true
          description: True if the transaction is indentified as a debit in the API
            context
        orig_account:
          type: string
          description: Source account from which funds are withdrawn
          maxLength: 255
        orig_profile:
          allOf:
          - $ref: '#/components/schemas/Organization'
          readOnly: true
          description: Billing profile from which funds are withdrawn
        orig_amount:
          type: integer
          description: Amount withdrawn from source in orig_unit
        orig_unit:
          type: string
          description: 'Three-letter ISO 4217 code for source currency unit (ex: usd)'
          maxLength: 3
        dest_account:
          type: string
          description: Target account to which funds are deposited
          maxLength: 255
        dest_profile:
          allOf:
          - $ref: '#/components/schemas/Organization'
          readOnly: true
          description: Billing profile to which funds are deposited
        dest_amount:
          type: integer
          description: Amount deposited into target in dest_unit
        dest_unit:
          type: string
          description: 'Three-letter ISO 4217 code for target currency unit (ex: usd)'
          maxLength: 3
      required:
      - amount
      - created_at
      - description
      - dest_profile
      - is_debit
      - orig_profile
    TypeEnum:
      enum:
      - unknown
      - user
      - personal
      - organization
      - provider
      type: string
    TypeaheadOrganizationList:
      type: object
      properties:
        count:
          type: integer
          description: Total number of items in the results
        results:
          type: array
          items:
            $ref: '#/components/schemas/Organization'
          description: Items in the queryset
    TypeaheadUserList:
      type: object
      properties:
        count:
          type: integer
          description: Total number of items in the results
        results:
          type: array
          items:
            $ref: '#/components/schemas/User'
          description: Items in the queryset
    UpdateRank:
      type: object
      properties:
        oldpos:
          type: integer
          description: old rank for a line in the list of lines
        newpos:
          type: integer
          description: new rank for the line in the list of lines
      required:
      - newpos
      - oldpos
    UpdateRule:
      type: object
      properties:
        rank:
          type: integer
          description: Determines the order in which rules are considered
        path:
          type: string
          readOnly: true
          description: OpenAPI path against which requests are matched
        allow:
          type: string
          description: Method applied to grant or deny access
        is_forward:
          type: boolean
          description: When access is granted, should the request be forwarded
        engaged:
          type: string
          description: Tags to check if it is the first time a user engages
      required:
      - path
      - rank
    UploadBlob:
      type: object
      description: Upload a picture or other POD content
      properties:
        location:
          type: string
          format: uri
          description: URL to uploaded content
      required:
      - location
    UseCharge:
      type: object
      properties:
        slug:
          type: string
          description: Unique identifier shown in the URL bar
          maxLength: 50
          pattern: ^[-a-zA-Z0-9_]+$
        title:
          type: string
          nullable: true
          description: Short description of the use charge
          maxLength: 50
        description:
          type: string
          description: Long description of the use charge
        created_at:
          type: string
          format: date-time
          readOnly: true
          description: Date/time of creation (in ISO format)
        use_amount:
          type: integer
          description: Amount of the use charge in plan currency unit
        quota:
          type: integer
          description: Number of use charge included in the plan
        maximum_limit:
          type: integer
          nullable: true
          description: Maximum number of use charge added per period before notififying
            subscriber
        extra:
          type: string
          nullable: true
          description: Extra meta data (can be stringify JSON)
      required:
      - created_at
      - description
      - slug
    User:
      type: object
      properties:
        slug:
          type: string
          description: Unique identifier that can safely be used in place of username
          pattern: ^[\w.@+-]+$
        username:
          type: string
          description: Unique identifier for the user, typically used in URLs
          pattern: ^[\w.@+-]+$
        printable_name:
          type: string
          readOnly: true
          description: Name that can be safely used for display in HTML pages
        picture:
          type: string
          readOnly: true
          description: URL location of the profile picture
      required:
      - picture
      - printable_name
      - slug
      - username
    UserActivate:
      type: object
      properties:
        slug:
          type: string
          description: Unique identifier that can safely be used in place of username
          pattern: ^[\w.@+-]+$
        username:
          type: string
          description: Unique identifier for the user, typically used in URLs
        printable_name:
          type: string
          readOnly: true
          description: Name that can be safely used for display in HTML pages
        picture:
          type: string
          readOnly: true
          description: URL location of the profile picture
        email:
          type: string
          format: email
          description: Primary e-mail address to contact user
        phone:
          type: string
          description: Primary phone number to contact user
        full_name:
          type: string
          description: Full name (effectively first name followed by last name)
        nick_name:
          type: string
          description: Short casual name used to address the user
        lang:
          allOf:
          - $ref: '#/components/schemas/LangEnum'
          description: Preferred communication language
        credentials:
          type: string
          readOnly: true
          description: True if the user has valid login credentials
        otp_enabled:
          type: string
          readOnly: true
          description: True if the user has valid login credentials
        created_at:
          type: string
          format: date-time
          readOnly: true
          description: Date at which the user account was created
        last_login:
          type: string
          format: date-time
          readOnly: true
          description: Date at which the user last logged in
        email_code:
          type: integer
          writeOnly: true
          description: Email verification code
        phone_code:
          type: integer
          writeOnly: true
          description: Phone verification code
        new_password:
          type: string
          writeOnly: true
          description: Password with which a user can authenticate with the service
      required:
      - created_at
      - credentials
      - last_login
      - new_password
      - otp_enabled
      - picture
      - printable_name
    UserCartItemCreate:
      type: object
      description: |-
        Extends `CartItemCreateSerializer` to include user.
        It's used during the creation of new cart items to
        ensure necessary data is captured.
      properties:
        user:
          type: string
          description: The user for whom the cart item is being created
        created_at:
          type: string
          format: date-time
          readOnly: true
          description: Date/time of creation (in ISO format)
        plan:
          type: string
          description: The plan to add into the request.user cart.
        option:
          type: integer
          description: Index in the list of discounts for advance payments
        use:
          type: string
          description: The use charge to add into the request.user cart.
        quantity:
          type: integer
          description: Number of periods to be paid in advance
        sync_on:
          type: string
          nullable: true
          description: identifier of the person that will benefit from the subscription
            (GroupBuy)
          maxLength: 255
        full_name:
          type: string
          description: Full name of the person that will benefit from the subscription
            (GroupBuy)
          maxLength: 150
        email:
          type: string
          nullable: true
          description: e-mail of the person that will benefit from the subscription
            (GroupBuy)
          maxLength: 255
      required:
      - created_at
      - plan
      - user
    UserCreate:
      type: object
      properties:
        slug:
          type: string
          description: Unique identifier that can safely be used in place of username
          pattern: ^[\w.@+-]+$
        username:
          type: string
          description: Unique identifier for the user, typically used in URLs
        printable_name:
          type: string
          readOnly: true
          description: Name that can be safely used for display in HTML pages
        picture:
          type: string
          readOnly: true
          description: URL location of the profile picture
        email:
          type: string
          format: email
          description: Primary e-mail address to contact user
        phone:
          type: string
          description: Primary phone number to contact user
        full_name:
          type: string
          description: Full name (effectively first name followed by last name)
        nick_name:
          type: string
          description: Short casual name used to address the user
        lang:
          allOf:
          - $ref: '#/components/schemas/LangEnum'
          description: Preferred communication language
        credentials:
          type: string
          readOnly: true
          description: True if the user has valid login credentials
        otp_enabled:
          type: string
          readOnly: true
          description: True if the user has valid login credentials
        created_at:
          type: string
          format: date-time
          readOnly: true
          description: Date at which the user account was created
        last_login:
          type: string
          format: date-time
          readOnly: true
          description: Date at which the user last logged in
        email_code:
          type: integer
          writeOnly: true
          description: Email verification code
        phone_code:
          type: integer
          writeOnly: true
          description: Phone verification code
        new_password:
          type: string
          writeOnly: true
          description: Password with which a user can authenticate with the service
      required:
      - created_at
      - credentials
      - full_name
      - last_login
      - otp_enabled
      - picture
      - printable_name
    UserDetail:
      type: object
      properties:
        slug:
          type: string
          description: Unique identifier that can safely be used in place of username
          pattern: ^[\w.@+-]+$
        username:
          type: string
          readOnly: true
          description: Unique identifier for the user, typically used in URLs
          pattern: ^[\w.@+-]+$
        printable_name:
          type: string
          readOnly: true
          description: Name that can be safely used for display in HTML pages
        picture:
          type: string
          readOnly: true
          description: URL location of the profile picture
        email:
          type: string
          format: email
          description: Primary e-mail address to contact user
        phone:
          type: string
          description: Primary phone number to contact user
        full_name:
          type: string
          description: Full name (effectively first name followed by last name)
        nick_name:
          type: string
          description: Short casual name used to address the user
        lang:
          allOf:
          - $ref: '#/components/schemas/LangEnum'
          description: Preferred communication language
        credentials:
          type: string
          readOnly: true
          description: True if the user has valid login credentials
        otp_enabled:
          type: string
          readOnly: true
          description: True if the user has valid login credentials
        created_at:
          type: string
          format: date-time
          readOnly: true
          description: Date at which the user account was created
        last_login:
          type: string
          format: date-time
          readOnly: true
          description: Date at which the user last logged in
        email_code:
          type: integer
          writeOnly: true
          description: Email verification code
        phone_code:
          type: integer
          writeOnly: true
          description: Phone verification code
      required:
      - created_at
      - credentials
      - full_name
      - last_login
      - otp_enabled
      - picture
      - printable_name
      - username
    UserEngagement:
      type: object
      properties:
        username:
          type: string
          description: Username
        engagements:
          type: string
          readOnly: true
          description: Engagement tags for username
      required:
      - engagements
      - username
    ValidationError:
      type: object
      description: Details on why token is invalid.
      properties:
        detail:
          type: string
          description: Describes the reason for the error in plain text
      required:
      - detail
    Version:
      type: object
      properties:
        version:
          type: string
          readOnly: true
          description: Version of the API being used
      required:
      - version
    WithSubscription:
      type: object
      properties:
        created_at:
          type: string
          format: date-time
          readOnly: true
          description: Date/time of creation (in ISO format)
        ends_at:
          type: string
          format: date-time
          description: Date/time when the subscription period currently ends (in ISO
            format)
        plan:
          allOf:
          - $ref: '#/components/schemas/Plan'
          readOnly: true
          description: Plan the profile is subscribed to
        auto_renew:
          type: boolean
          description: The subscription is set to auto-renew at the end of the period
      required:
      - created_at
      - ends_at
      - plan
