Create Order
Creates a order, if requesting manager has access permissions to it.
URL: /api/v1/orders/create_order/
Method: POST
Metadata should be in literal string format: "metadata":"{ \"flower\": \"license\" }"
- id - a unique order ID, this can be e.g. order ID in your CRM system
- items - an array of OrderItems purchased in this order
License Policy code can be used only with bundle licenses
Key-Based
User-Based
license_template_code- unique license policy code
Each OrderItem has the following format:
or
There are additional fields available for you to store in an Order and then leverage them through LicenseSpring platform. You can see a full example below:
- id - order ID. This is a unique identifier for an order within a company.
- append - boolean, defaults to False. If set to true and order ID already exists, licenses (items) sent will be appended to the existing order.
- is_test - whether or not this is a test order.
- created - date and time order is created.
- order_type - order type, current possible value is: normal
- language - order language, value should be language short code
- campaign_params - e.g. Google campaign params for the order
- download_id - custom order download id
- prevent_vm - if true, all created licenses won't be possible to activate on a VM
- "metadata"-JSON object
For customer these parameters are possible:
- email - customer's email address.
- first_name - customer's first name.
- last_name - customer's last name.
- company - customer's company name.
- phone - customer's phone number.
- reference - customer's custom reference. This can be any identifier for the customer in your system like an UUID.
- is_manager - if true, customer will be set as manager of licenses in this order
For items these parameters are possible:
- product_code - product code to identify the product license order is being created for.
- note - item description.
- licenses - licences details.
For each license these parameters are possible:
- key - the license key.
- max_activations - maximum number of time this license can be activated. If not set, product max activations is being used if defined for the product, if not - default value of 1 activation is being used.
- license_type - type of license - value can be either time-limited, perpetual consumption or subscription. If it is a time limited license, valid_duration should also be set for the license. If it is perpetual license then valid duration does not apply and if consumption, max_consumptions is being used and should be set in order, if not, product max consumptions is being used.
For subscription licneses, LicenseSpring requires an integration to an external source of truth (like a recurring billing system). LicenseSpring updates the status of the license according to the status of the subscription, which is handled by a 3rd party. Without this integration, subscription licenses remain valid until otherwise specified
- max_consumptions - used in pair with consumption license_type - defines how many times product can be used within the license.
- valid_duration - defines how long license should be valid - value examples: 1y (one year) or 2m (2 months) or 3d (3 days) or 4h (4 hours) or 5min (5 minutes).
- enable_maintenance_duration - whether license should consider maintenance duration, used in pair with maintenance_duration.
- start_date - start date of license "2024-03-12"
- maintenance_duration - duration of license maintenance period - value examples: 1y (one year) or 2m (2 months) or 3d (3 days).
- validity_period - final end date and time license is valid.
- product_features - array of additional product features
- shorter version with product feature code only: ["feature1", "feature2"]
- longer version, suitable for consumption features: [{code: "feature_code", max_consumption:33}].
- is_trial - boolean, defaults to False - whether this is a trial license or not.
- prevent_vm - boolean, defaults to False - whether license should be allowed on virtual machines.
- max_transfers - integer, defaults to 0 (Device transfer not allowed) - limit of license transfers between different devices.
For user-based licenses, instead of a license key, user is assigned as an object:
- email - required, email of the license user
- is_manager - optional (default false), if this user is license manager for all licenses in this order
Only for consumption licenses:
- allow_overages - boolean, defaults to False - whether license should allow overage license usage regardless the consumption, value example: true or false
- max_overages - number, maximum overage of consumption over the max_consumption.
- reset_consumption - boolean, defaults to False, whether license consumption my be reset, value example: true or false
- consumption_period - period over which licenses are reset - week, month or year
Code: 200 OK
Content Examples: