Link
✎

Transaction Services

Transactions record purchases and automatic license changes.

Authentication, formats, error codes, paging and role levels are the same for all endpoints and described on the Conventions page. Paths are relative to https://go.netlicensing.io/core/v2/rest. Every call can be tried in the API Test Center.

Endpoint Purpose Role
GET /transaction List transactions Analytics+
GET /transaction/{transactionNumber} Get transaction Analytics+
POST /transaction Create transaction Admin
POST /transaction/{transactionNumber} Update transaction Admin

A role followed by “+” means that role and every higher one, see Roles.


Transactions list

GET /transaction

Required role: Analytics+

Return a list of all transactions for the current vendor.

Extra filter keys: licenseeNumber=<number> returns only that licensee’s transactions. shopOnly=true returns only transactions with source SHOP. Results are always sorted newest first: sortorder and sortdirection are ignored.

Parameters

Name In Type Required Description
filter query string   ;-separated key=value pairs, e.g. page=0;items=50;sortorder=number;sortdirection=DESC.

Example

Request
curl --user demo:demo --header "Accept: application/xml" \
  https://go.netlicensing.io/core/v2/rest/transaction
Response
<netlicensing xmlns="http://netlicensing.labs64.com/schema/context">
    <items>
        <item type="Transaction">
            <property name="number">T001</property>
            <property name="active">true</property>
            <property name="status">PENDING</property>
            <property name="source">SHOP</property>
        </item>
    </items>
</netlicensing>

Try it in the API Test Center


Get transaction

GET /transaction/{transactionNumber}

Required role: Analytics+

Return a transaction by transactionNumber.

Parameters

Name In Type Required Description
transactionNumber path string yes Number of the transaction.

Example

Request
curl --user demo:demo --header "Accept: application/xml" \
  https://go.netlicensing.io/core/v2/rest/transaction/T001
Response
<netlicensing xmlns="http://netlicensing.labs64.com/schema/context">
    <items>
        <item type="Transaction">
            <property name="number">T001</property>
            <property name="active">true</property>
            <property name="status">PENDING</property>
            <property name="source">SHOP</property>
        </item>
    </items>
</netlicensing>

Try it in the API Test Center


Create transaction

POST /transaction

Required role: Admin

Creates a new transaction. The body is form encoded (application/x-www-form-urlencoded).

Parameters

Name In Type Required Description
number body string   Unique number that identifies the entity. Optional on create: when omitted, NetLicensing generates one. On update, a new value renames the entity.
active body boolean   false disables the entity. Defaults to true when omitted on create. On update, an omitted value leaves the current state unchanged.
status body string   Values: PENDING, CLOSED.
source body string   Use SHOP for transactions you create. The other values are set by NetLicensing for automatic transactions.
grandTotal body string   Decimal grand total.
discount body string   Decimal discount.
currency body string   Values: EUR, USD.

Any other body field is stored as a custom property.

Example

Request
curl --user demo:demo --header "Accept: application/xml" \
  --data "licenseeNumber=IP53OX9PF&number=TFMEIR1B9&active=true&status=PENDING&source=SHOP" \
  https://go.netlicensing.io/core/v2/rest/transaction
Response
<netlicensing xmlns="http://netlicensing.labs64.com/schema/context">
    <items>
        <item type="Transaction">
            <property name="number">TFMEIR1B9</property>
            <property name="active">true</property>
            <property name="status">PENDING</property>
            <property name="source">SHOP</property>
        </item>
    </items>
</netlicensing>

Try it in the API Test Center


Update transaction

POST /transaction/{transactionNumber}

Required role: Admin

Sets the provided properties to a transaction. Return an updated transaction. The body is form encoded (application/x-www-form-urlencoded).

Parameters

Name In Type Required Description
transactionNumber path string yes Number of the transaction.
number body string   Unique number that identifies the entity. Optional on create: when omitted, NetLicensing generates one. On update, a new value renames the entity.
active body boolean   false disables the entity. Defaults to true when omitted on create. On update, an omitted value leaves the current state unchanged.
status body string   Values: PENDING, CLOSED.
source body string   Use SHOP for transactions you create. The other values are set by NetLicensing for automatic transactions.
grandTotal body string   Decimal grand total.
discount body string   Decimal discount.
currency body string   Values: EUR, USD.

Any other body field is stored as a custom property.

Example

Request
curl --user demo:demo --header "Accept: application/xml" \
  --data "number=TGG8UTJS8&active=false&status=CANCELLED" \
  https://go.netlicensing.io/core/v2/rest/transaction/TGG8UTJS8
Response
<netlicensing xmlns="http://netlicensing.labs64.com/schema/context">
    <items>
        <item type="Transaction">
            <property name="number">TGG8UTJS8</property>
            <property name="active">false</property>
            <property name="status">CANCELLED</property>
            <property name="source">SHOP</property>
        </item>
    </items>
</netlicensing>

Try it in the API Test Center