Best practice for seat-based product with optional add-ons

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • SailReal
    Member
    • Jun 2025
    • 34

    #1

    Best practice for seat-based product with optional add-ons

    Hi all,

    I’m trying to model a common SaaS subscription based pricing setup in EspoCRM Sales Pack and would like to ask for best practices.

    * base product: Software
    * billed per seat and month or year
    * optional add-ons: SSO, Audit Log, Advanced Policies, ...
    * each add-on adds an different extra per-seat price on the base price

    So if a customer buys 50 seats and wants to have SSO, regarding pricing the result should be:

    * Software Seat × 50
    * SSO Add-on × 50

    I'm also fine with just one line item and the price is accordingly adjusted.

    What is the best way to model something like this in the Sales Pack?

    Thanks!
    Last edited by SailReal; Yesterday, 03:16 PM.
  • yuri
    EspoCRM product developer
    • Mar 2014
    • 9739

    #2
    Hi,

    In Subscriptions we have line items for both the main product and add-ons. We do not have a separate add-on concept. The first item is considered as a primary product. Each line can have its quantity which is then mapped to an invoice.

    Comment

    • SailReal
      Member
      • Jun 2025
      • 34

      #3
      Thanks for the feedback.

      How can I best keep the quantity of the line items in sync so if I set the quantity of the primary product to e.g. 3000, that also the add-on item is set to quantity 3000 and is accordingly billed?

      Comment

      • yuri
        EspoCRM product developer
        • Mar 2014
        • 9739

        #4
        For new subscription, one can use the Subscription Templates feature. It will multiply each line item quantity by the entered factor (seats). For existing subscriptions, when you change items, there's not sync feature. You will need to update each line.

        Comment

        • SailReal
          Member
          • Jun 2025
          • 34

          #5
          This is to error prone, hmm...

          Is there some easy way I can archive this with some custom code or do I need to change a lot of logic to archive something like this?

          Comment

          • yuri
            EspoCRM product developer
            • Mar 2014
            • 9739

            #6
            You can have an API Before Save script to catch a mismatch and throw an error with instructions. This validation can check only specific products only. I think it will be a few lines of code.

            Comment


            • yuri
              yuri commented
              Editing a comment
              Although API Before Save script is not supported for Subscription Updates (the proration mechanism). It can be specified only for the Subscription.

              Though I think there must be some similar solution.
          • SailReal
            Member
            • Jun 2025
            • 34

            #7
            Is maybe something like this a way to go? https://docs.espocrm.com/development...-calculations/
            Or does it not apply to Subscription Updates either?

            Comment


            • yuri
              yuri commented
              Editing a comment
              I don't recommend ORM level hooks for this. They are called after all validations. There are multiple ways how to validate data.

              For example:

              recordDefs > {EntityType} > earlyBeforeCreateHookClassNameList
              entityDefs > {EntityType} > fields > {field} > validatorClassNameList

              Be sure to use "__APPEND__" to preserve existing classes in the list.
          • SailReal
            Member
            • Jun 2025
            • 34

            #8
            I did some further tests and think the most integrated way is to create a Template Product and with each addon an Product Attribute, then I can set via Price Books specific prices for each combination per quantity which is exactly what I want to have.
            As I do think that I have max 5 up to 10 addons and most of them are only true/false (were I just can set one value with the name of the key so that it is an variant) I think I'm very fine with this solution

            Edit: Oh no, after writing this post I noticed with those true/false things I have the problem that I also need to add e.g. for the attribute SSO also No-SSO as option which looks pretty weird in an invoice xD
            Last edited by SailReal; Today, 08:33 AM.

            Comment

            • SailReal
              Member
              • Jun 2025
              • 34

              #9
              Template Product would work I think for such scenarios if there are optional or boolean Product Attributes (could be recognized if the Product Attribute has only one value). Then we could have one variant with this Product Attribute and one without. Do you think something like this could be implemented?

              Comment


              • yuri
                yuri commented
                Editing a comment
                I'm not sure.
            Working...