Getting Started

Creating a marketplace product

  1. Install the q2-marketplace module by running q2 upgrade -p marketplace.

Note

This should also add the marketplace to your INSTALLED_ENTRYPOINTS list in your settings file. After that you can run q2 -h and any marketplace entrypoints will be visible, e.g. create_marketplace_product and marketplace * commands

  1. Run q2 create_marketplace_product {name_of_product}. Pick which extensions are a part of this product.

  2. A configuration/products.py was created with your product name, which extensions are bundled with this product and a unique identifier assigned. Any extensions you picked now also inherit from Q2MarketplaceMixin, this handler will enforce that an active subscription is available before users are allowed to access your product.

Subscription Events

When a user purchases, cancels, or changes their subscription on the marketplace an event will be triggered. When you provisioned your product on the marketplace (via q2 create_marketplace_product) an HTTP handler was created for you under /marketplace/{name_of_product}/extension.py. This handler has three default methods that must be implemented, and return a SubscriptionSuccess or SubscriptionFailure object.

A SubscriptionEvent is passed as an parameter in each of these methods.

See API reference for additional details.

Subscription Events in development

To trigger these subscription events in development, make sure your server is running, then open a new tab and run your choice of:

  • q2 marketplace invoke_subscribe

  • q2 marketplace invoke_cancel

  • q2 marketplace invoke_update