Multi-tenancy e-commerce setup and pricing

default discord avatar
Taun
last month
10

Hi. If I build an e-commerce platform where there's multiple vendors selling their own products, and therefore have their own vendor profile (eg. myecommerceplatform.com/johnscabbages).



1. What pricing model does that fall under and why? I'm not sure what custom-domains is specifically referring to within the Payload Pro model. I assume www.myeccommerceplatform.com counts as 1 custom domain, so I can have multiple tenants within that domain? (www.myeccommerceplatform.com/tenant1)



2. How might I go about setting this up within Payload? If they are to create a profile within the 1 platform. (myecommerceplatform.com/johnscabbages)

  • default discord avatar
    noheadphones
    last month

    1. that seems like the case to me tbh...basically you can assign your own domain to your payload instance



    2. you want to have a user collection for your tenants that they can login with and you attach all the other information to their collection there..in your frontend create an onboarding process where you gather all the data you need so you can spin up a stripe account for them...look into

    https://stripe.com/en-gb-th/connect

    i assume you're using stripe but the same principle would apply to other payment providers

  • default discord avatar
    Taun
    last month

    Thanks @noheadphones .



    This is a reply to a previous thread: "In my mind, you would configure each user to have a relationship to a business domain, then use access control that references this."



    Another response:


    "You can achieve multi-tenancy in Payload using role-based access control. There are many topics around this, a quick search using those keywords should get you pretty far. Essentially, you'd have an organizations or similar collection for each of your clients. Then, every piece of content is assigned to an organization using a basic relationship field. This way each time a request is made for content you check the content ownership and control access based on whether the user is a pat of that organization. Here are the docs around access control:

    https://payloadcms.com/docs/access-control/overview

    . In your case though, you may want to take this a step further so that your access control also checks domain origins off the request.


    As of today the "pro" plan only supports up to three custom domains, though. But you'll still be able to achieve your multi-tenancy setup just the same with the only exception being that the API url won't be unique across each client."



    What does it mean that the API URL won't be unique across each client and what are the limitations in the case I mentioned?

  • default discord avatar
    noheadphones
    last month

    i can reply in full later



    but to answer your last question, it just means that with payload cloud type of hosting you will need to point all frontends to the same API endpoint...so you cant have

    api.CLIENT.domain.com

    you'll have

    api.domain.com

    if you want and then

    CLIENT.domain.com

    and

    CLIENT2.domain.com

    can both talk to the same API and you handle your permission logic there



    this is how i understand it

  • default discord avatar
    Taun
    last month

    I'm too much of a noob to fully understand what you're referring to, though I assume this is refering to the case where each client has a unique custom domain and not myecommerceplatform.com/tenant1 , myecommerceplatform.com/tenant2 . For this case I'd like the platform to host their vendor profiles like that, and not tenant1.myecommerceplatform.com as I assume that will ramp up costs and setup complexity as that falls into creating a 'custom domain' per tenant territory?

  • default discord avatar
    noheadphones
    last month

    Im back, yes you're right



    have you built an information architecture diagram for this?

  • default discord avatar
    Taun
    last month

    Thanks Paul. Not yet, at this stage I'm doing a profit analysis. I'll make diagrams later, thanks for the tip. Any software you recommend for that?

  • default discord avatar
    noheadphones
    last month

    Miro/figjam work fine for this...it just helps a lot with planning and feasibility if you have a stronger idea of what you're building and how it's all gonna work together



    from there I always find it much easier to estimate the work and anticipate complexities

Open the post
Continue the discussion in Discord
Like what we're doing?
Star us on GitHub!

Star

Connect with the Payload Community on Discord

Discord

online

Can't find what you're looking for?

Get help straight from the Payload team with an Enterprise License.