Fluent Commerce Logo
Docs
Sign In
Essential knowledge

Author:

Fluent Commerce

Changed on:

23 Oct 2023

Overview

The Plugin API provides methods for uploading, installing, and viewing Plugins.

A Plugin Bundle represents a collection of rules for a retailer that is uploaded and installed into Rubix for use in workflows. They can be developed and installed through the use of the Fluent SDK.

Key points

  • An explanation of each endpoint to use plugin API for Fluent OMS

Property

Value

URL

`<root_url>/orchestration/rest/v1/plugin/`

Methods

`GET`
 (
`POST`
 Coming Soon)

Scheme

`https`

Auth

`OAUTH`

Permissions

`PLUGIN_VIEW`

Content-Type

`application/json`

Operations

[GET]      /      Finds list of Rules

Returns the the list of all rules that are active in an ACCOUNT.

Authentication

Required

Permissions

PLUGIN_VIEW permission is required for the ACCOUNT context.

Responses

Response Content-Type: 

`application/json`

Code

Description

200

Successful Operation

400

Client Error - Bad Request

401

Authorization Error - Invalid Bearer Token / No permission

403

Authorization Error - Forbidden

404

Client Error - Not Found

500

Server Error

Example

Request:

`https://<AccountId>.sandbox.api.fluentretail.com/orchestration/rest/v1/plugin/`

1{
2    "FLUENTRETAIL.base.SendEventToVirtualCatalogue": {
3        "eventAttributes": [],
4        "ruleInfo": {
5            "name": "SendEventToVirtualCatalogue",
6            "description": "Send event {eventName} to all virtual catalogues {virtualCatalogueRefList}",
7            "accepts": [
8                {
9                    "entityType": "INVENTORY_CATALOGUE",
10                    "eventName": "",
11                    "entitySubtype": "",
12                    "status": ""
13                }
14            ],
15            "produces": [],
16            "ruleException": []
17        },
18        "description": "Send event {eventName} to all virtual catalogues {virtualCatalogueRefList}",
19        "name": "SendEventToVirtualCatalogue",
20        "parameters": [
21            {
22                "name": "eventName",
23                "description": "The name of event to be triggered",
24                "type": "STRING",
25                "multiple": false
26            },
27            {
28                "name": "virtualCatalogueRefList",
29                "description": "The name of event to be triggered",
30                "type": "STRING",
31                "multiple": false
32            }
33        ]
34    },
35    "FLUENTRETAIL.base.CreatePlanToFulfilFromLocationOrAddress": {
36        "eventAttributes": [],
37        "ruleInfo": {
38            "name": "CreatePlanToFulfilFromLocationOrAddress",
39            "description": "Provides a fulfilment plan for location or address with {fulfilmentCoverage} items to be fulfilled considerin virtual position statuses {statuses} from virtual catalogue {virtualCatalogueRef}.",
40            "accepts": [
41                {
42                    "entityType": "FULFILMENT_OPTIONS",
43                    "eventName": "",
44                    "entitySubtype": "",
45                    "status": ""
46                }
47            ],
48            "produces": [],
49            "ruleException": []
50        },
51        "description": "Provides a fulfilment plan for location or address with {fulfilmentCoverage} items to be fulfilled considering virtual position statuses {statuses} from virtual catalogue {virtualCatalogueRef}.",
52        "name": "CreatePlanToFulfilFromLocationOrAddress",
53        "parameters": [
54            {
55                "name": "fulfilmentCoverage",
56                "description": "Fulfilment coverage",
57                "type": "STRING",
58                "multiple": false
59            },
60            {
61                "name": "statuses",
62                "description": "Virtual Position Status",
63                "type": "STRING",
64                "multiple": false
65            },
66            {
67                "name": "virtualCatalogueRef",
68                "description": "Virtual Catalogue Ref",
69                "type": "STRING",
70                "multiple": false
71            }
72        ]
73    }
74}
75

Language: json

Name: Example Success Response

Description:

[Warning: empty required content area]
1{
2    "errors": [
3        {
4            "code": "401",
5            "message": "Invalid user, Authorization header value does not belong to a valid user"
6        }
7    ]
8}   

Language: json

Name: Example Error Response

Description:

[Warning: empty required content area]


[GET]      /{bundleName}/status      Returns the status and other metadata of the plugin identified by the bundle name

Returns the upload/installation status and other metadata of the bundle. Only bundles that belong to the logged-in account can be viewed.

Authentication

Required

Permissions

PLUGIN_VIEW permission is required for the ACCOUNT context.

Parameters

Name

Required

Description

bundleName

yes

Name used to identify the plugin.
This should in in the format 

`{accountID}.{pluginName}::{version}`
 eg. ACC1.common::1.0.5

Responses

Response Content-Type: 

`application/json`

Code

Description

200

Successful Operation

400

Client Error - Bad Request

403

Authorization Error - No permission

404

Not Found - Given bundle or version does not exist

Plugins can be expected to be in one of the following statuses

Bundle Status

Description

ACTIVE

Bundle was successfully installed and ready for use

VERIFIED

Bundle was successfully uploaded and ready to be installed

FAILED

Bundle was installed unsuccessfully. Field bundleErrorMessage may be populated with any error messages

Example

Request:

`https://ACC1.sandbox.api.fluentretail.com/orchestration/rest/v1/plugin/ACC1.common::1.0.5/status`

1{
2    accountId (string),
3    bundleName (string),
4    bundleStatus (string),
5    createOn (date),
6    bundleVersion (string),
7    bundleErrorMessage (string)
8} 

Language: json

Name: Response Data Model

Description:

[Warning: empty required content area]
1{
2    "accountId": "ACC1",
3    "bundleName": "ACC1common::1.0.5",
4    "bundleStatus": "ACTIVE",
5    "createOn": "2018-03-05T12:15:43.975Z",
6    "bundleVersion": "1.0.5"
7} 

Language: json

Name: Example Success Response

Description:

[Warning: empty required content area]
1{
2    "accountId": "ACC1",
3    "bundleName": "ACC1.common::1.0.5",
4    "bundleStatus": "FAILED",
5    "createOn": "2018-03-05T12:15:43.975Z",
6    "bundleVersion": "1.0.5",
7    "bundleErrorMessage": "Unable to resolve ACC1.common [1121](R 1121.9): missing requirement [ACC1.common [1121](R 1121.9)] osgi.wiring.package; (&(osgi.wiring.package=com.fasterxml.jackson.module.jsonSchema)(version>=2.8.0)(!(version>=3.0.0))) Unresolved requirements: [[ACC1.common [1121](R 1121.9)] osgi.wiring.package; (&(osgi.wiring.package=com.fasterxml.jackson.module.jsonSchema)(version>=2.8.0)(!(version>=3.0.0)))]"
8}

Language: json

Name: Example Error Response

Description:

[Warning: empty required content area]
1Bundle not found for the given bundle name

Language: text

Name: If no record for the specified Bundle exists, a text/plain response returned

Description:

[Warning: empty required content area]
1{
2    "errors": [
3        {
4            "code": "InvalidInput",
5            "message": "Logged in user has no retailer"
6        }
7    ]
8}

Language: json

Name: If the incorrect Auth token is used, or the User does not have the right permissions, an errors JSON response will be returned

Description:

[Warning: empty required content area]


[POST]      /upload      Uploads the Plugin file to the Rubix Engine

Uploads and validates a Rules Plugin to the Workflow Engine.

Authentication

Required

Permissions

PLUGIN_VIEW permission is required for the ACCOUNT context. PLUGIN_UPLOAD permission is required for the ACCOUNT context.

Parameters

Name

Required

Description

file

yes

The binary JAR file is to be uploaded.
For example rubix-plugin-acc1-common-1.0.5.jar

Responses

Response Content-Type: 

`application/json`

Code

Description

200

Successful Operation

400

Client Error - Bad Request

403

Authorization Error - No permission

404

Not Found

Example:

1{
2    "message": "51c364ef-1dbf-422d-a0b4-0e6e68b328a1",
3    "status": 200
4}

Language: json

Name: Example Success Response

Description:

[Warning: empty required content area]
1{
2  "message": "This version is currently ACTIVE. Please bump up the plugin version.",
3  "status": 400
4}

Language: json

Name: Example Error Response

Description:

[Warning: empty required content area]


[POST]      /install      Installs the Plugin file to the Rubix Engine

Installs and Activates a Rules Plugin in the Workflow Engine.

Authentication

Required

Permissions

PLUGIN_VIEW permission is required for the ACCOUNT context. PLUGIN_UPLOAD permission is required for the ACCOUNT context. PLUGIN_INSTALL permission is required for the ACCOUNT context.

Parameters

Name

Required

Description

accountId

yes

The Account ID

bundleName

yes

Name used to identify the plugin.
This should in in the format 

`{accountID}.{pluginName}::{version}`
 eg. ACC1.common::1.0.5

Request

1{
2    "accountId": "ACC1",
3    "bundleName": "ACC1.common::1.0.5"
4}

Language: json

Name: Example Request Body

Description:

[Warning: empty required content area]

Responses

Response Content-Type: 

`application/json`

Code

Description

200

Successful Operation

400

Client Error - Bad Request

403

Authorization Error - No permission

404

Not Found

406

Not Acceptable

Successful Response Example:

There is no response body returned when the request was successful. The HTTP Status Code 200 OK will signal the request was successful, however, it is important to execute a plugin status GET request to verify that the plugin activation was completed successfully.

Sample Error:

1Only Verified Bundles Can be Installed

Language: text

Name: If the Bundle to be installed is already ACTIVE or FAILED, the following text/plain message is returned

Description:

[Warning: empty required content area]


Fluent Commerce

Fluent Commerce