Network API
Author:
Fluent Commerce
Changed on:
3 July 2024
Overview
A network is a collection of physical fulfillment or collection locations such as stores, warehouses, distribution centres, or even lockers. Fluent Retail allows users to manage their network from a centralized position with control of network-specific order logic via custom rules. The Network API defines the creation and addition of networks as well as retrieval of details pertaining to a network and updating the parameters of a network.
There are three default networks,Collection Point Network,C&C Network, and Home Delivery Network. These can be extended and configured with subnetworks.
Key points
- Overview
- Network Properties
- What you can do with Network
- Response on Failures
Network API
Network Properties
Below are the properties available in the Article object which can be updated and retrieved through the APIs in this document.
1. name
Type: String
Description: Network name. Must be unique to the account.
2. type
Type: String
Description: The type of network. Allowed values: Determined by retailer setting NETWORK_TYPES
e.g.: Settings cane be created using settings API
`{ "setting": { "key": "NETWORK_TYPES", "value": ["CC", "CP","HD","My Network"], "type": "JSON" } }`
If retailer setting not available, API will allow creating default networks of types CC, CP or HD.
If type is not provided, default type NORMAL will apply.
3. retailers
Type: Array
Description: The retailer(s) associated with the network. Allowed values: RetailerId(String) within Account.
4. status
Type: String
Description: Status of network
5. attributes
Type: Array
Description: Array of attributes with name, type, value
e.g.:
1"attributes": [
2 {
3 "name": "Supplier address",
4 "type": "address",
5 "value": {
6 "Address 1": "46 Kippax Street",
7 "Suburb": "Surry Hills",
8 "Post code": "2010",
9 "State": "NSW"
10 }
11 },
12 {
13 "name": "ECP",
14 "type": "string",
15 "value": "XCD123"
16 }
17]
Language: java
Name: Code Example
Description:
[Warning: empty required content area]What you can do with Network
Create a Network
Create a Network API is used to add a network to the Fluent Retail system.
POST:
`/api/v4.1/network`
Request and response
Request parameters and sample
Network request
1{
2
3 name (string, compulsory),
4 type (string, optional),
5 status (string, optional),
6 retailers ((Array, compulsory),
7 attributes (Array[Attribute], optional)
8}
9
10Attribute {
11
12 name (string, optional),
13 type (string, optional) = ['STRING', 'INTEGER'],
14 value (string, optional)
15 }
Language: java
Name: Network request
Description:
[Warning: empty required content area]Example request
1{
2 "name": "Network",
3 "type": "CP",
4 "status": "CREATED",
5 "retailers": [
6 "1"
7 ],
8 "attributes": [
9 {
10 "name": "address",
11 "type": "ADDRESS",
12 "value": {
13 "address": "46 Kippax Street",
14 "suburb": "Surry Hills",
15 "postcode": "2010",
16 "state": "NSW"
17 }
18 },
19 {
20 "name": "ECP",
21 "type": "STRING",
22 "value": "XCD123"
23 }
24 ]
25}
Language: java
Name: Example request
Description:
[Warning: empty required content area]Response Parameters and sample
1{
2 id (object, optional),
3 message (string, optional),
4 status (string, optional)
5}
Language: java
Name: Network response
Description:
[Warning: empty required content area]1{
2 "id": 9
3}
Language: java
Name: Example response
Description:
[Warning: empty required content area]View Details
Get details of a network
GET:
`/api/v4.1/network/{networkId} or ~{name}`
Request and response
Request parameters and sample
Parameters in URL
Name | Type | Required | Description |
networkId | String | Conditional | The network Id. Should be available conditionally if name not provided |
| String | Conditional | The network name with “
|
Example request
`/api/v4.1/network/123`
`/api/v4.1/network/~network1`
Response Parameters and sample
Network response
1{
2 name (string),
3 type (string),
4 status (string),
5 retailers ((Array),
6 attributes (Array[Attribute])
7
8
9 Attribute {
10 name (string, optional),
11 type (string, optional) = ['STRING', 'INTEGER'],
12 value (string, optional)
13 }
14
15}
Language: java
Name: Network response
Description:
[Warning: empty required content area]1{
2 "name": "network1",
3 "type": "CP",
4 "status": "CREATED",
5 "retailers": [
6 "1"
7 ],
8 "attributes": [
9 {
10 "name": "address",
11 "type": "ADDRESS",
12 "value": {
13 "address": "46 Kippax Street",
14 "suburb": "Surry Hills",
15 "postcode": "2010",
16 "state": "NSW"
17 }
18 },
19 {
20 "name": "ECP",
21 "type": "STRING",
22 "value": "XCD123"
23 }
24 ]
25}
Language: json
Name: Example response
Description:
[Warning: empty required content area]Update Network
Update parameters of the Network
PUT:
`/api/v4.1/network/{networkId}`
Request and response
Request parameters and sample
Network request
1{
2 name (string, compulsory),
3 retailers ((Array, compulsory),
4 attributes (Array[Attribute], optional)
5
6
7 Attribute {
8 name (string, optional),
9 type (string, optional) = ['STRING', 'INTEGER'],
10 value (string, optional)
11 }
12
13}
Language: java
Name: Network response
Description:
[Warning: empty required content area]1{
2 "name": "Network",
3 "retailers": [
4 "1"
5 ],
6 "attributes": [
7 {
8 "name": "address",
9 "type": "ADDRESS",
10 "value": {
11 "address": "46 Kippax Street",
12 "suburb": "Surry Hills",
13 "postcode": "2010",
14 "state": "NSW"
15 }
16 },
17 {
18 "name": "ECP",
19 "type": "STRING",
20 "value": "XCD123"
21 }
22 ]
23}
Language: json
Name: Example response
Description:
[Warning: empty required content area]Response Parameters and sample
Network response
1{
2 id (object, optional),
3 message (string, optional),
4 status (string, optional)
5}
Language: java
Name: Example response
Description:
[Warning: empty required content area]1{
2 "id": 9
3}
Language: json
Name: Example response
Description:
[Warning: empty required content area]Response on Failures
NAME | TYPE | DESCRIPTION |
error | Array | Array of errors |
message | String | Additional information on the code Unauthorized | Bad Request | Forbidden | Not Found | Status 500 Error |
code | String | Status Code for the above messages 401 | 400 | 403 | 404 | 500 |