Link

Product Services

Products list

Return a list of all configured products for the current vendor.

HTTP Method / URL

GET /core/v2/rest/product

Security
  • Basic Authentication
  • API Key Identification
    • ROLE_APIKEY_ADMIN
    • ROLE_APIKEY_MAINTENANCE
    • ROLE_APIKEY_OPERATION
    • ROLE_APIKEY_ANALYTICS

Request Header

Accept: application/json | application/xml

Request Parameters

- None -

HTTP Status Code

200 - Successful request
400 - Malformed or illegal request
403 - Access is denied
404 - Resource not found
500 - Internal service error

See also JavaDoc: ProductService.list

Example

Request

GET https://go.netlicensing.io/core/v2/rest/product
Accept: application/xml

Response

<netlicensing xmlns="http://netlicensing.labs64.com/schema/context">
    <items>
        <item type="Product">
            <property name="number">P001</property>
            <property name="active">true</property>
            <property name="name">Product Numero Uno</property>
            <property name="version">v1.0</property>
            <property name="CustomProperty">CustomPropertyValue</property>
        </item>
    </items>
</netlicensing>

Try it now

$ curl --header "Accept: application/xml" --insecure --user demo:demo --request GET https://go.netlicensing.io/core/v2/rest/product

Get product

Return a product by productNumber.

HTTP Method / URL

GET /core/v2/rest/product/{productNumber}

Security
  • Basic Authentication
  • API Key Identification
    • ROLE_APIKEY_ADMIN
    • ROLE_APIKEY_MAINTENANCE
    • ROLE_APIKEY_OPERATION
    • ROLE_APIKEY_ANALYTICS

Request Header

Accept: application/json | application/xml

Request Parameters

productNumber (string) - Product number.

HTTP Status Code

200 - Successful request
400 - Malformed or illegal request
403 - Access is denied
404 - Resource not found
500 - Internal service error

See also JavaDoc: ProductService.get

Example

Request

GET https://go.netlicensing.io/core/v2/rest/product/P014
Accept: application/xml

Response

<netlicensing xmlns="http://netlicensing.labs64.com/schema/context">
    <items>
        <item type="Product">
            <property name="number">P014</property>
            <property name="active">true</property>
            <property name="name">Product Numero Uno</property>
            <property name="version">v1.0</property>
            <property name="CustomProperty">CustomPropertyValue</property>
        </item>
    </items>
</netlicensing>

Try it now

$ curl --header "Accept: application/xml" --insecure --user demo:demo --request GET https://go.netlicensing.io/core/v2/rest/product/P014

Create product

Creates a new product.

 

HTTP Method / URL

POST /core/v2/rest/product

Security

Request Header

Accept: application/json | application/xml
Content-Type: application/x-www-form-urlencoded

Request Parameters

number (string) - Unique number that identifies the product. Vendor can assign this number when creating a product or let NetLicensing generate one. Read-only after creation of the first licensee for the product.

active (boolean) - If set to false, the product is disabled. No new licensees can be registered for the product, existing licensees can not obtain new licenses.

name (string) - Product name. Together with the version identifies the product for the end customer.

version (string) - Product version. Convenience parameter, additional to the product name.

licenseeAutoCreate (boolean) - If set to 'true', non-existing licensees will be created at first validation attempt.

description (string) - Product description. Optional.

licensingInfo (string) - Licensing information. Optional.

licenseeSecretMode (enum) - Licensee secret mode for product ((info) available in selected pricing plans). Optional. (warning) Deprecated, use Node-Locked Licensing Model instead.

- DISABLED - licensee secret ignored.

- PREDEFINED - licensee secret must be set in NetLicensing (can't be used with Auto-create Licensee).

- CLIENT - client sets the licensee secret on first validate.

vatMode (Enum) - Vat mode for product. Optional.

- GROSS: VAT is included in the prices.

- NET: VAT is not included in the prices.

discount (list) - Product discounts list. Optional, multiple allowed (list). Parameters of each product discount are passed using the following format:

discount=totalPrice;currency;discountAmount
<totalPrice> (string)
 - Total Price
<
currency>  (string) - Currency
<discountAmount>
 (string) - Discount Amount: absolute (e.g. "1.50") or percent (e.g. "5%")

HTTP Status Code

200 - Successful request
400 - Malformed or illegal request
402 - Not allowed within your pricing plan
403 - Access is denied
404 - Resource not found
500 - Internal service error

See also JavaDoc: ProductService.create

Example

Request

POST https://go.netlicensing.io/core/v2/rest/product
number=PQVJQ5F7H&active=false&name=Product+6QP3NKHO&version=v3.4&discount=100;EUR;10&discount=10;EUR;9%
Accept: application/xml
Content-Type: application/x-www-form-urlencoded

Response

<netlicensing xmlns="http://netlicensing.labs64.com/schema/context">
    <items>
        <item type="Product">
            <property name="number">PQVJQ5F7H</property>
            <property name="active">false</property>
            <property name="name">Product 6QP3NKHO</property>
            <property name="version">v3.4</property>
            <list name="discount">
                <property name="totalPrice">100.00</property>
                <property name="currency">EUR</property>
                <property name="amountFix">10</property>
            </list>
            <list name="discount">
                <property name="totalPrice">10.00</property>
                <property name="currency">EUR</property>
                <property name="amountPercent">9</property>
            </list>
        </item>
    </items>
</netlicensing>

Update product

Sets the provided properties to a product. Return an updated product.

HTTP Method / URL

POST /core/v2/rest/product/{productNumber}

Security

Request Header

Accept: application/json | application/xml
Content-Type: application/x-www-form-urlencoded

Request Parameters

productNumber (string) - Unique number that identifies the product.

number (string) - New product number (update)

active (boolean) - If set to false, the product is disabled. No new licensees can be registered for the product, existing licensees can not obtain new licenses.

name (string) - Product name. Together with the version identifies the product for the end customer.

version (string) - Product version. Convenience parameter, additional to the product name.

licenseeAutoCreate (boolean) - If set to 'true', non-existing licensees will be created at first validation attempt.

description (string) - Product description. Optional.

licensingInfo (string) - Licensing information. Optional.

licenseeSecretMode (enum) - Licensee secret mode for product ((info) available in selected pricing plans). Optional. (warning) Deprecated, use Node-Locked Licensing Model instead.

- DISABLED - licensee secret ignored.

- PREDEFINED - licensee secret must be set in NetLicensing (can't be used with Auto-create Licensee).

- CLIENT - client sets the licensee secret on first validate.

vatMode (Enum) - Vat mode for product. Optional.

- GROSS: VAT is included in the prices.

- NET: VAT is not included in the prices.

discount (list) - Product discounts list. Optional, multiple allowed (list). Parameters of each product discount are passed using the following format:

discount=totalPrice;currency;discountAmount
<totalPrice> (string)
 - Total Price
<
currency>  (string) - Currency
<discountAmount>
 (string) - Discount Amount: absolute (e.g. "1.50") or percent (e.g. "5%")

Discounts are always replaced all or none - specify all required discounts on update, even if some are unchanged. Discounts can also be deleted completely by specifying a single discount with an empty value:

discount=

HTTP Status Code

200 - Successful request
400 - Malformed or illegal request
402 - Not allowed within your pricing plan
403 - Access is denied
404 - Resource not found
500 - Internal service error

See also JavaDoc: ProductService.update

Example

Request

POST https://go.netlicensing.io/core/v2/rest/product/PJIF898SP
number=PQVJQ5F7H&active=false&name=Product+6QP3NKHO&version=v3.4&discount=100;EUR;20&discount=10;EUR;9%
Accept: application/xml
Content-Type: application/x-www-form-urlencoded

Response

<netlicensing xmlns="http://netlicensing.labs64.com/schema/context">
    <items>
        <item type="Product">
            <property name="number">PJIF898SP</property>
            <property name="active">false</property>
            <property name="name">testproduct</property>
            <property name="version">1.1</property>
            <property name="myProperty">myValue</property>
            <list name="discount">
                <property name="totalPrice">100.00</property>
                <property name="currency">EUR</property>
                <property name="amountFix">20</property>
            </list>
            <list name="discount">
                <property name="totalPrice">10.00</property>
                <property name="currency">EUR</property>
                <property name="amountPercent">9</property>
            </list>
        </item>
    </items>
</netlicensing>

Delete product

Delete a product by number.

HTTP Method / URL

DELETE /core/v2/rest/product/{productNumber}?forceCascade

Security

Request Header

Accept: application/json | application/xml

Request Parameters

productNumber (string) - Product number.
forceCascade (boolean) - Force object deletion and all descendants.

HTTP Status Code

204 - Successful request
400 - Malformed or illegal request
403 - Access is denied
404 - Resource not found
500 - Internal service error

See also JavaDoc: ProductService.delete

Example

Request

DELETE https://go.netlicensing.io/core/v2/rest/product/P001
Accept: application/xml

Response

HTTP/1.1 204 No Content