{
    "componentChunkName": "component---src-templates-article-page-template-js",
    "path": "/concepts/commissions-and-monetizing-your-platform/",
    "result": {"data":{"markdownRemark":{"frontmatter":{"title":"Commissions and monetizing your platform","slug":"commissions-and-monetizing-your-platform","updated":"2021-12-10T00:00:00.000Z","category":"concepts-pricing-and-commissions","ingress":"Flex provides configurable options for monetizing your platform. You can collect commissions from providers, customers, or both. This article provides you with basic information on the mechanisms supported by Flex for monetizing your platform.","skills":null},"htmlAst":{"type":"root","children":[{"type":"element","tagName":"h2","properties":{"id":"introduction","style":"position:relative;"},"children":[{"type":"element","tagName":"a","properties":{"href":"#introduction","ariaLabel":"introduction permalink","className":["anchor","before"]},"children":[{"type":"element","tagName":"svg","properties":{"ariaHidden":"true","focusable":"false","height":"16","version":"1.1","viewBox":"0 0 16 16","width":"16"},"children":[{"type":"element","tagName":"path","properties":{"fillRule":"evenodd","d":"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"},"children":[]}]}]},{"type":"text","value":"Introduction"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"If you have already defined a pricing model for your marketplace, this\narticle will provide you with basic information on the options Flex\nprovides and how to take them into use."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"If you need more information on how to decide the pricing, our\nMarketplace Academy has\n"},{"type":"element","tagName":"a","properties":{"href":"https://www.sharetribe.com/academy/how-to-set-pricing-in-your-marketplace/","target":"_blank","rel":["noopener","noreferrer"]},"children":[{"type":"text","value":"an article"}]},{"type":"text","value":"\ndescribing different pricing models and the tradeoffs behind different\noptions."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"As background, familiarizing yourself with\n"},{"type":"element","tagName":"a","properties":{"href":"/docs/legacy/concepts/pricing/#line-items"},"children":[{"type":"text","value":"line items"}]},{"type":"text","value":" and\n"},{"type":"element","tagName":"a","properties":{"href":"/docs/legacy/concepts/privileged-transitions/"},"children":[{"type":"text","value":"privileged transitions"}]},{"type":"text","value":" gives you a\ngood understanding of the concepts discussed in this article. In\naddition, the article that describes\n"},{"type":"element","tagName":"a","properties":{"href":"/docs/legacy/concepts/payments-overview/"},"children":[{"type":"text","value":"payments in Flex"}]},{"type":"text","value":" provides valuable\ninformation about how the payment flow in Flex works."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Configuring commissions happens with the\n"},{"type":"element","tagName":"a","properties":{"href":"/docs/legacy/references/transaction-process-actions/#actionprivileged-set-line-items"},"children":[{"type":"text","value":"privileged-set-line-items"}]},{"type":"text","value":"\ntransaction process action. In the FTW templates, this is done\n"},{"type":"element","tagName":"a","properties":{"href":"https://github.com/sharetribe/ftw-daily/blob/master/server/api-util/lineItems.js","target":"_blank","rel":["noopener","noreferrer"]},"children":[{"type":"text","value":"on the server side"}]},{"type":"text","value":"\nbecause of the privileged nature of this action. If you are developing a\nclient application that is not based on one of the FTW templates, you\ncan apply a similar logic."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h2","properties":{"id":"percentage-based-commissions","style":"position:relative;"},"children":[{"type":"element","tagName":"a","properties":{"href":"#percentage-based-commissions","ariaLabel":"percentage based commissions permalink","className":["anchor","before"]},"children":[{"type":"element","tagName":"svg","properties":{"ariaHidden":"true","focusable":"false","height":"16","version":"1.1","viewBox":"0 0 16 16","width":"16"},"children":[{"type":"element","tagName":"path","properties":{"fillRule":"evenodd","d":"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"},"children":[]}]}]},{"type":"text","value":"Percentage-based commissions"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"One of the simplest ways to configure commissions is to define a\npercentage of the listing price as a commission. Commissions can be\ncharged from the provider, the customer, or both."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{"id":"example","style":"position:relative;"},"children":[{"type":"element","tagName":"a","properties":{"href":"#example","ariaLabel":"example permalink","className":["anchor","before"]},"children":[{"type":"element","tagName":"svg","properties":{"ariaHidden":"true","focusable":"false","height":"16","version":"1.1","viewBox":"0 0 16 16","width":"16"},"children":[{"type":"element","tagName":"path","properties":{"fillRule":"evenodd","d":"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"},"children":[]}]}]},{"type":"text","value":"Example"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"A marketplace that charges 10 % from the customer and 12 % from the\nprovider would configure the commissions like this:"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"div","properties":{"className":["gatsby-highlight"],"dataLanguage":"text"},"children":[{"type":"element","tagName":"pre","properties":{"className":["language-text"]},"children":[{"type":"element","tagName":"code","properties":{"className":["language-text"]},"children":[{"type":"text","value":"const PROVIDER_COMMISSION_PERCENTAGE = -12; // Provider commission is negative\nconst CUSTOMER_COMMISSION_PERCENTAGE = 10; // Customer commission is positive\n\nconst booking = {\n  code: bookingUnitType,\n  unitPrice,\n  quantity: calculateQuantityFromDates(startDate, endDate, bookingUnitType),\n  includeFor: ['customer', 'provider'],\n};\n\nconst providerCommission = {\n  code: 'line-item/provider-commission',\n  unitPrice: calculateTotalFromLineItems([booking]),\n  percentage: PROVIDER_COMMISSION_PERCENTAGE,\n  includeFor: ['provider'],\n};\n\nconst customerCommission = {\n  code: 'line-item/customer-commission',\n  unitPrice: calculateTotalFromLineItems([booking]),\n  percentage: CUSTOMER_COMMISSION_PERCENTAGE,\n  includeFor: ['customer'],\n};\n\nconst lineItems = [booking, providerCommission, customerCommission];"}]}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"For a 100 EUR listing, this would result in a 110 EUR payin for the\ncustomer and a 88 EUR payout for the provider. The marketplace would\nreceive 22 EUR minus Stripe fees."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"extrainfo","properties":{"title":"Negative or positive commission?"},"children":[{"type":"text","value":"\nCommission line items are defined as either positive or negative depending on the transaction\nparty. \n"},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":" Provider commission is defined as "},{"type":"element","tagName":"b","properties":{},"children":[{"type":"text","value":"negative"}]},{"type":"text","value":", since the provider's total is the listing price minus the provider commission.\n"},{"type":"element","tagName":"span","properties":{"className":["gatsby-resp-image-wrapper"],"style":"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 397px; "},"children":[{"type":"text","value":"\n      "},{"type":"element","tagName":"a","properties":{"className":["gatsby-resp-image-link"],"href":"/docs/legacy/static/aa3071fe0be8a5774a99bf6201d36bce/d4ee3/provider_commission.png","style":"display: block","target":"_blank","rel":["noopener"]},"children":[{"type":"text","value":"\n    "},{"type":"element","tagName":"span","properties":{"className":["gatsby-resp-image-background-image"],"style":"padding-bottom: 93.71069182389938%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAATCAYAAACQjC21AAAACXBIWXMAABYlAAAWJQFJUiTwAAABgUlEQVQ4y42UiY7CMAxE+f8vRCrlEq3KUY7Sg9voWfIqaZotkSynZDx2xg6Tz+cjsTV0NoafsHm/3/J4POR+v8vz+dT96/X6A7nGMowZ3x4hwXVdS9M00nWdtG2rPkYI9nK5yPV6VRyFeIS3203W67XkeS7T6VQWi8UgmUvKWi6Xij8cDmI3VUIycIhlWSbn81l+0ZYikiTRGI8QDU6nk17D9HCDY1WCr6pKJfKuzAYdMQitORhZh8ywhgk0TNNUtSuKQjOjDZr2R8X2xICfzWay2+3CCi0bmW2MbB8zSLkNWI+QH1arlcznc/VjGrIYF5pIzH6/9wmtKcfjUQ/xjIIrdn9RIdMAnsYEhBCgxXa7VUJ8bLjdASeGAQ9eCj+a0RS3kr6xqMrmtizLsEIqonw6u9ls/h1sq44uM9z2Urwu0xi6Brn7njGCMRti3jweLDHBvw1XNoEpH482NMqahefMkjIuGN/BYLticxh7bmMyKOEYaCgolmiwwl8s9hwh/AJ3h8+YCFfBGQAAAABJRU5ErkJggg=='); background-size: cover; display: block;"},"children":[]},{"type":"text","value":"\n  "},{"type":"element","tagName":"picture","properties":{},"children":[{"type":"text","value":"\n          "},{"type":"element","tagName":"source","properties":{"srcSet":["/docs/legacy/static/aa3071fe0be8a5774a99bf6201d36bce/82e29/provider_commission.webp 159w","/docs/legacy/static/aa3071fe0be8a5774a99bf6201d36bce/ef33f/provider_commission.webp 318w","/docs/legacy/static/aa3071fe0be8a5774a99bf6201d36bce/4e179/provider_commission.webp 397w"],"sizes":"(max-width: 397px) 100vw, 397px","type":"image/webp"},"children":[]},{"type":"text","value":"\n          "},{"type":"element","tagName":"source","properties":{"srcSet":["/docs/legacy/static/aa3071fe0be8a5774a99bf6201d36bce/8b9b5/provider_commission.png 159w","/docs/legacy/static/aa3071fe0be8a5774a99bf6201d36bce/fa108/provider_commission.png 318w","/docs/legacy/static/aa3071fe0be8a5774a99bf6201d36bce/d4ee3/provider_commission.png 397w"],"sizes":"(max-width: 397px) 100vw, 397px","type":"image/png"},"children":[]},{"type":"text","value":"\n          "},{"type":"element","tagName":"img","properties":{"className":["gatsby-resp-image-image"],"src":"/docs/legacy/static/aa3071fe0be8a5774a99bf6201d36bce/d4ee3/provider_commission.png","alt":"provider commission","title":"provider commission","loading":"lazy","decoding":"async","style":"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;"},"children":[]},{"type":"text","value":"\n        "}]},{"type":"text","value":"\n  "}]},{"type":"text","value":"\n    "}]},{"type":"text","value":"\n"}]},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":" Customer commission is defined as "},{"type":"element","tagName":"b","properties":{},"children":[{"type":"text","value":"positive"}]},{"type":"text","value":", since the customer's total is the listing price plus the customer commission.\n"},{"type":"element","tagName":"span","properties":{"className":["gatsby-resp-image-wrapper"],"style":"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 397px; "},"children":[{"type":"text","value":"\n      "},{"type":"element","tagName":"a","properties":{"className":["gatsby-resp-image-link"],"href":"/docs/legacy/static/928ee46f78ae9fe8a85a9c4e2c3cca75/d4ee3/customer_commission.png","style":"display: block","target":"_blank","rel":["noopener"]},"children":[{"type":"text","value":"\n    "},{"type":"element","tagName":"span","properties":{"className":["gatsby-resp-image-background-image"],"style":"padding-bottom: 103.77358490566037%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAVCAYAAABG1c6oAAAACXBIWXMAABYlAAAWJQFJUiTwAAABxElEQVQ4y52UiY7CMAxE+f9/4i+4hbih5Ya2lLtePbPupgdldyNZTRNnMjNxUhMRud/vMh6PZbFYyGAwkNVqJcPhUKbTqcxmMzkej6RJkiRvw+ZrdB6PhwI0m01pt9symUy03+l0pF6v60Z/Anw+n+J5nsznc/F9XxnudjvdxJq76CMgnTiOJQxDiaIo/R4OB2X/CSwDaD9VLc1xFr/LSyWfz2eNy+Wi39vt9rN7Ihkm5LhBbgHwdDqlgXxAy2TSmDdryL9er0UPR6ORlkmj0ZBer/fxAGgcWqvV0oM0YgoIZUoFUEoEBkmFX685UQLULdVRkAwIfuRBqlia5wUP6eBFEATqDYn0GWOODd1gjNtFLnmu3ylDaCMZPzC73+9npOTZwYpriVXb7ba8bGIijvXfWp6dRpJowZOLCmQXAGHGjlzB0qLO/cMQBazhmhYeB4AITtnzX1+kl4Fa2+/37yWzGIPde4wNZYdiltjBZAv7e3NemPV6LcvlMpVQdiAGRk6329XitudNC9vkwAgJJJrUqgb7zWajJFBWqENOyuqQF9qAgzDQzQgbs7A7XfrAkgCQBQB5XxnHN7ec/vUe/va9BPALnfhmtf8ApNgAAAAASUVORK5CYII='); background-size: cover; display: block;"},"children":[]},{"type":"text","value":"\n  "},{"type":"element","tagName":"picture","properties":{},"children":[{"type":"text","value":"\n          "},{"type":"element","tagName":"source","properties":{"srcSet":["/docs/legacy/static/928ee46f78ae9fe8a85a9c4e2c3cca75/82e29/customer_commission.webp 159w","/docs/legacy/static/928ee46f78ae9fe8a85a9c4e2c3cca75/ef33f/customer_commission.webp 318w","/docs/legacy/static/928ee46f78ae9fe8a85a9c4e2c3cca75/4e179/customer_commission.webp 397w"],"sizes":"(max-width: 397px) 100vw, 397px","type":"image/webp"},"children":[]},{"type":"text","value":"\n          "},{"type":"element","tagName":"source","properties":{"srcSet":["/docs/legacy/static/928ee46f78ae9fe8a85a9c4e2c3cca75/8b9b5/customer_commission.png 159w","/docs/legacy/static/928ee46f78ae9fe8a85a9c4e2c3cca75/fa108/customer_commission.png 318w","/docs/legacy/static/928ee46f78ae9fe8a85a9c4e2c3cca75/d4ee3/customer_commission.png 397w"],"sizes":"(max-width: 397px) 100vw, 397px","type":"image/png"},"children":[]},{"type":"text","value":"\n          "},{"type":"element","tagName":"img","properties":{"className":["gatsby-resp-image-image"],"src":"/docs/legacy/static/928ee46f78ae9fe8a85a9c4e2c3cca75/d4ee3/customer_commission.png","alt":"customer commission","title":"customer commission","loading":"lazy","decoding":"async","style":"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;"},"children":[]},{"type":"text","value":"\n        "}]},{"type":"text","value":"\n  "}]},{"type":"text","value":"\n    "}]},{"type":"text","value":"\n"}]}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h2","properties":{"id":"fixed-commissions","style":"position:relative;"},"children":[{"type":"element","tagName":"a","properties":{"href":"#fixed-commissions","ariaLabel":"fixed commissions permalink","className":["anchor","before"]},"children":[{"type":"element","tagName":"svg","properties":{"ariaHidden":"true","focusable":"false","height":"16","version":"1.1","viewBox":"0 0 16 16","width":"16"},"children":[{"type":"element","tagName":"path","properties":{"fillRule":"evenodd","d":"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"},"children":[]}]}]},{"type":"text","value":"Fixed commissions"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"In addition to percentages, you can define commissions with fixed sums\nas the "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"unitPrice"}]},{"type":"text","value":" of the line item using "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"quantity"}]},{"type":"text","value":" instead of\n"},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"percentage"}]},{"type":"text","value":". In the following example, both the provider and customer\npay a fixed commission regardless of the listing price or quantity."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{"id":"example-1","style":"position:relative;"},"children":[{"type":"element","tagName":"a","properties":{"href":"#example-1","ariaLabel":"example 1 permalink","className":["anchor","before"]},"children":[{"type":"element","tagName":"svg","properties":{"ariaHidden":"true","focusable":"false","height":"16","version":"1.1","viewBox":"0 0 16 16","width":"16"},"children":[{"type":"element","tagName":"path","properties":{"fillRule":"evenodd","d":"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"},"children":[]}]}]},{"type":"text","value":"Example"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"div","properties":{"className":["gatsby-highlight"],"dataLanguage":"text"},"children":[{"type":"element","tagName":"pre","properties":{"className":["language-text"]},"children":[{"type":"element","tagName":"code","properties":{"className":["language-text"]},"children":[{"type":"text","value":"const FIXED_PROVIDER_COMMISSION = -1500; // Provider commission is negative\nconst FIXED_CUSTOMER_COMMISSION = 1050; // Customer commission is positive\n\nconst calculateCommission = (unitPrice, amount) => {\n  return new Money(amount, unitPrice.currency);\n};\n\nconst booking = {\n  code: bookingUnitType,\n  unitPrice,\n  quantity: calculateQuantityFromDates(startDate, endDate, bookingUnitType),\n  includeFor: ['customer', 'provider'],\n};\n\nconst providerCommission = {\n  code: 'line-item/provider-commission',\n  unitPrice: calculateCommission(unitPrice, FIXED_PROVIDER_COMMISSION),\n  quantity: 1,\n  includeFor: ['provider'],\n};\n\nconst customerCommission = {\n  code: 'line-item/customer-commission',\n  unitPrice: calculateCommission(unitPrice, FIXED_CUSTOMER_COMMISSION),\n  quantity: 1,\n  includeFor: ['customer'],\n};\n\nconst lineItems = [booking, providerCommission, customerCommission];"}]}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"For a 100 EUR listing, this would result in a 110.5 EUR payin for the\ncustomer and a 85 EUR payout for the provider. The marketplace would\nreceive 25.5 EUR minus Stripe fees."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h2","properties":{"id":"dynamically-calculated-commissions","style":"position:relative;"},"children":[{"type":"element","tagName":"a","properties":{"href":"#dynamically-calculated-commissions","ariaLabel":"dynamically calculated commissions permalink","className":["anchor","before"]},"children":[{"type":"element","tagName":"svg","properties":{"ariaHidden":"true","focusable":"false","height":"16","version":"1.1","viewBox":"0 0 16 16","width":"16"},"children":[{"type":"element","tagName":"path","properties":{"fillRule":"evenodd","d":"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"},"children":[]}]}]},{"type":"text","value":"Dynamically calculated commissions"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"You can also calculate the commissions with more complex logic. You can\nset the result of the calculation as either the "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"unitPrice"}]},{"type":"text","value":" or the\n"},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"percentage"}]},{"type":"text","value":" of the line item."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"In this example, the customer's commission percentage gets reduced when\nthey buy over 5 items. The provider's commission is percentage based,\nbut always at least 10 dollars."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{"id":"example-2","style":"position:relative;"},"children":[{"type":"element","tagName":"a","properties":{"href":"#example-2","ariaLabel":"example 2 permalink","className":["anchor","before"]},"children":[{"type":"element","tagName":"svg","properties":{"ariaHidden":"true","focusable":"false","height":"16","version":"1.1","viewBox":"0 0 16 16","width":"16"},"children":[{"type":"element","tagName":"path","properties":{"fillRule":"evenodd","d":"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"},"children":[]}]}]},{"type":"text","value":"Example"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"div","properties":{"className":["gatsby-highlight"],"dataLanguage":"text"},"children":[{"type":"element","tagName":"pre","properties":{"className":["language-text"]},"children":[{"type":"element","tagName":"code","properties":{"className":["language-text"]},"children":[{"type":"text","value":"const PROVIDER_COMMISSION_PERCENTAGE = -12; // Provider commission is negative\nconst MINIMUM_PROVIDER_COMMISSION = -1000; // Negative commission in minor units, i.e. in USD cents\n\nconst CUSTOMER_COMMISSION_PERCENTAGE = 10;\nconst REDUCED_CUSTOMER_COMMISSION_PERCENTAGE = 7;\n\nconst calculateProviderCommission = (booking) => {\n  // Use existing helper functions to calculate totals and percentages\n  const price = calculateTotalFromLineItems([booking]);\n  const commission = calculateTotalPriceFromPercentage(price, PROVIDER_COMMISSION_PERCENTAGE);\n\n  // Since provider commissions are negative, comparison must be negative as well\n  if (commission.amount < MINIMUM_PROVIDER_COMMISSION) {\n    return commission;\n  }\n\n  return new Money(MINIMUM_PROVIDER_COMMISSION, price.currency);\n};\n"}]}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"div","properties":{"className":["gatsby-highlight"],"dataLanguage":"text"},"children":[{"type":"element","tagName":"pre","properties":{"className":["language-text"]},"children":[{"type":"element","tagName":"code","properties":{"className":["language-text"]},"children":[{"type":"text","value":"const booking = {\n  code: bookingUnitType,\n  unitPrice,\n  quantity: calculateQuantityFromDates(startDate, endDate, bookingUnitType),\n  includeFor: ['customer', 'provider'],\n};\n\nconst providerCommission = {\n  code: 'line-item/provider-commission',\n  unitPrice: calculateProviderCommission(booking),\n  quantity: 1,\n  includeFor: ['provider'],\n};\n\nconst customerPercentage = booking.quantity > 5\n  ? REDUCED_CUSTOMER_COMMISSION_PERCENTAGE\n  : CUSTOMER_COMMISSION_PERCENTAGE;\n\nconst customerCommission = {\n  code: 'line-item/customer-commission',\n  unitPrice: calculateTotalFromLineItems([booking]),\n  percentage: customerPercentage,\n  includeFor: ['customer'],\n};\n\nconst lineItems = [booking, providerCommission, customerCommission];"}]}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h2","properties":{"id":"subscription-based-model","style":"position:relative;"},"children":[{"type":"element","tagName":"a","properties":{"href":"#subscription-based-model","ariaLabel":"subscription based model permalink","className":["anchor","before"]},"children":[{"type":"element","tagName":"svg","properties":{"ariaHidden":"true","focusable":"false","height":"16","version":"1.1","viewBox":"0 0 16 16","width":"16"},"children":[{"type":"element","tagName":"path","properties":{"fillRule":"evenodd","d":"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"},"children":[]}]}]},{"type":"text","value":"Subscription-based model"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"The line item commissions are the most straightforward way of monetizing\nyour marketplace and are directly supported by Flex. However, you might\nwant to experiment with other monetization models depending on your\nbusiness idea. For example, subscriptions might be a good way of\nmonetizing your marketplace. With the\n"},{"type":"element","tagName":"a","properties":{"href":"/docs/legacy/concepts/marketplace-api-integration-api/#when-to-use-the-integration-api"},"children":[{"type":"text","value":"Integration API"}]},{"type":"text","value":",\nyou can integrate a third-party service such as\n"},{"type":"element","tagName":"a","properties":{"href":"https://www.chargebee.com/","target":"_blank","rel":["noopener","noreferrer"]},"children":[{"type":"text","value":"Chargebee"}]},{"type":"text","value":" or\n"},{"type":"element","tagName":"a","properties":{"href":"https://stripe.com/en-fi/billing","target":"_blank","rel":["noopener","noreferrer"]},"children":[{"type":"text","value":"Stripe billing"}]},{"type":"text","value":" to process\nsubscription payments from users who want access to your marketplace."}]}],"data":{"quirksMode":false}},"headings":[{"value":"Introduction","depth":2},{"value":"Percentage-based commissions","depth":2},{"value":"Example","depth":3},{"value":"Fixed commissions","depth":2},{"value":"Example","depth":3},{"value":"Dynamically calculated commissions","depth":2},{"value":"Example","depth":3},{"value":"Subscription-based model","depth":2}]}},"pageContext":{"slug":"commissions-and-monetizing-your-platform","category":"concepts-pricing-and-commissions"}},
    "staticQueryHashes": ["3794076007","439097193","717698143"]}