Integrations
Stripe
Stripe Integration
23min
implementation steps follow these steps to configure licensing for products that you sell using stripe create product in licensespring platform create product in stripe dashboard add custom attributes to the product price metadata add webhook endpoint add restricted api key from stripe to licensespring platform account creating payment generate license keys 1\ create product in licensespring platform log in to https //saas licensespring com/login go to configure products → add new product and create a new product 2\ create product in stripe dashboard log in to your stripe dashboard and go to products → add product as a part of a product creation process in stripe, you need to create a price for this product if you select recurring billing type, licensespring integration will create subscription license type and use billing period from price settings as a valid duration in licensespring if you select one time billing type, licensespring will use products default license type value or custom price attribute to set license type in licensespring click on save product button in the top right corner of the screen to finish creating a product in stripe 3\ add custom attributes to the product price metadata to properly create licenses licensespring will use product price metadata custom attributes to add attributes to the price metadata, go to product page and select the price which you want to customize 3 1 license policy for every product in the licensespring platform you can define one or many license policies which act as a template when creating licenses license policy can be added to the stripe products as a price metadata key license policy with value of some license policy code when order is being created via stripe, our integration will take all the fields, product features and custom fields from included license policy and create the license based on those if license policy attribute is not included stripe integration will use default license policy for the product to create a license in case of subscription license type will be always set as subscription and valid duration period will use billing period from product price settings 3 2 custom attributes custom attributes are used to overwrite fields from license policy and to handle some specific use cases which license policies don't cover note that short code attribute is always required short code required add the product short code you configured licensespring product with max activations optional, int if this field is not included, the default from the product configuration in licensespring will be used floating cloud optional, int if this value is set licenses from this product will be created as floating cloud this value also sets the total number of machines / users that can concurrently use a floating cloud license ( max simultaneous license users value in licensespring configuration ) needs to be less than or equal to max activations attribute value license type optional, string if this field is not included, the default license type from the product configuration in licensespring is used ( perpetual, time limited, subscription, consumption ) for recurring product prices, license type can be either subscription or consumption in the case of consumption licenses, the total consumptions are reset at the start of each billing interval valid duration optional, string if this field is not included, the default valid duration from the product configuration in licensespring is used the format for this is n\[d/w/m/y] where n is number and option between d,w,m,y is possible (day, week, month, year ex "1y") not applicable for subscription licenses subscription licenses will use billing period from product price settings enable maintenance duration optional, bool turns on maintenance capability if not defined, default from licensespring is used maintenance duration optional, string behaves same as the valid duration field max license users optional, int, limits the number of users which can be added to the licenses example one license with multiple license users can be added only for products with user authorization method is license manager optional, bool, sets customer as a license manager useful on license key based products where customer is not set as a license manager per default if you are creating user based licenses, but do not want the customer to be assigned as a license manager, set this as false assign customer as user optional, bool, customer will be automatically assigned to the license as a license user can be added only for products with user authorization method unpaid active license period optional, string, used to define a period during which the licenses remain active even if they haven't been paid for yet the format for this is n\[d/w/m/y] where n is a number and d , w , m , or y represents days, weeks, months or years respectively (e g , "3d" for 3 days) 3 2 1 single license in your store, user can select different quantities for a product default behaviour is that multiple quantities will result in multiple licenses (both user and license key based!) if instead, when user selects >1 quantity you want to make a single license that can be activated multiple times (for license key based) or a single license that supports multiple users (for user based licenses), you need to add this custom attribute is single license optional, bool 3 2 2 max simultaneous license users from quantity on a single license in case of single floating cloud license, quantity can be used to determine max simultaneous license users instead of max activations for license key based or number of users for user based products to enable this, please use this following combination of custom attributes on the product price floating users from quantity true floating cloud 1 max activations optional, int if this field is not included, the default from the product configuration in licensespring will be used 3 2 3 product bundles product bundle is a unique type of product in licensespring that requires specific configuration this section outlines all the currently available product attributes for product bundles and instructions on how to use them only one product bundle can be processed per order multiple quantities of the same product bundle are supported ; however, including two or more different product bundles in the same order on stripe is not supported how to set up product bundles in licensespring? go to the products section in licensespring platform click the add new bundle button insert the desired bundle name and bundle code , choose which authorization method to use , and finally, select all the products that you want inside the bundle after the bundle is created, it should look something like the following picture take the bundle code value and use it as the short code in the stripe configuration (look at the list below to see all the available product attributes for bundle products ) all other setup steps are the same as they are for basic products the only difference is in the supported product attributes if a product bundle contains, for example, three products, then four licenses will be created in licensespring one license will be for the bundle itself, which can be used for all products within the bundle the remaining three licenses will be created for each individual product in the bundle the value of these individual licenses is determined by the default license policy of each product each license will include the features defined in the default license policy of the product for which the license was created product attributes is product bundle required , boolean, has to be set to true short code required , with the code you configured licensespring product bundle with max activations optional, int if this field is not included, the value from the default license policy on the product in licensespring will be used floating cloud optional, int if this value is set licenses from this product bundle will be created as floating cloud this value also sets the total number of machines / users that can concurrently use a floating cloud license ( max simultaneous license users value in licensespring configuration ) needs to be less than or equal to max activations attribute value license type optional, string if this field is not included, the default license type of each product inside the bundle configuration in licensespring is used ( perpetual , time limited , subscription , consumption ) for subscription products license type is always subscription valid duration optional, string if this field is not included, the default valid duration of each product inside the bundle configuration in licensespring is used the format for this is n\[d/w/m/y] where n is number and option between d,w,m,y is possible (day, week, month, year) applicable for time limited licenses only maintenance duration optional, string behaves same as the valid duration field enable maintenance duration optional, turns on maintenance capability if not defined, default from ls is used max license users optional, int, limits the number of users which can be added to the licenses example one license with multiple license users can be added only for products with user authorization method is license manager optional, sets customer as a license manager useful on license key or user based products where the customer is not set as a license manager by default assign customer as user optional, bool, customer will be automatically assigned to the license as a license user can be added only for products with user authorization method unpaid active license period optional, string, used to define a period during which the licenses remain active even if they haven't been paid for yet the format for this is n\[d/w/m/y] where n is a number and d , w , m , or y represents days, weeks, months or years respectively (e g , "3d" for 3 days) 4\ add webhook endpoint licensespring will listen to some events sent from stripe to create orders and licenses in the platform to enable this you need to create a stripe webhook which will send those events to licensespring server to create a webhook go to developers > webhooks and click on add endpoint button endpoint url will be https //integrations licensespring com/api/stripe?uuid={uuid} example url https //integrations licensespring com/api/stripe?uuid=12345678 7121 6bcb a355 bbd6b6df0b84 to retrieve the uuid (api key) go to licensespring → settings → keys select these events to listen to customer subscription created (order and licenses will be created in licensespring) customer subscription deleted (licenses from the subscription will be deactivated) customer subscription updated (licenses from the subscription will be updated with new values ( quantity, policy and trial changes )) invoice payment succeeded (on successful payment licenses will be prolonged with new expiration date written in license validity period field) charge refunded (licenses associated with the refunded charge will be disabled) 5\ add restricted api key from stripe to licensespring platform account licensespring needs limited access to your stripe account to update subscription metadata after order is created and to fetch and copy customer from stripe to licensespring to enable this create restricted api key in your stripe dashboard go to developer > api keys and click on the create restricted key button the title of this key can be anything you like, but we recommend something relating to licensespring set all permissions to read except subscriptions , invoices and stripe cli permissions which need to be set to write save this key and add it to the licensespring account by going to settings > integrations press activate for stripe copy the key to the stripe secret key text field select the management api key and license api key (uuid) that you want to use the license api key (uuid) needs to be the same as the one you used for the webhook endpoint 6\ creating payment a) one time products with invoices to generate an invoice, first select your customer and item (a one time product) then, set the payment collection method to 'autocharge customer ' once you've reviewed everything, you can proceed to charge the customer with payment link in the right upper corner click on the '+' sign and then on payment link once the page for payment link creation opens, firstly select the one time product price for which you want to create the link after you've selected the product click on after payment! make sure to select the 'create an invoice pdf' checkbox b) subscription licenses when dealing with subscription products, you should utilize a payment link to do so, first choose 'payment link,' then select the product, and finally create the link after creating the link, access it to complete the payment process 7\ generate license keys there are currently two ways how you can create licenses keys which will be then used for licensing your products a) attaching to metadata of the new subscription ( preferred ) if stripe api will be used to create subscriptions, attach the generated license keys to the subscription metadata licensespring integration will use those keys to create licenses in the licensespring platform more about stripe api subscriptions methods here to generate licenses please use this generate licenses endpoint from our management api instead of {short code here} placeholders add a product short code for which you want to use those license keys b) licensespring updates subscription metadata after order creation if you are creating stripe subscriptions and invoices ( in case of one time order, ex perpetual licenses ) manually without the ability to create the subscription or invoice with prefilled metadata then licensespring will detect that metadata doesn't contain keys for the product in question and it will generate them automatically upon order create is finished, subscriptions / invoice metadata on stripe will be updated with those license keys to access them you can subscribe your application to stripe customer subscription updated event in case of a subscription or invoice updated event in case of a one time order alternatively you can fetch the subscription or invoice afterwards using stripe api license keys will be visible on stripe dashboard on metadata section of the created subscription / invoice