Work with Generic Configuration

Tenants can define configurations that they want to store in a central place and can be used by different channels or roles. These configurations can be as simple as that of a key-value pair to a complex structure. The omni channel ordering engine allows tenants to define their custom configurations that are flexible. The configurations must be provided in json format.

The definition of the generic business configuration is done by back office specialists but it must be readable by any other role. To maintain security, we must also enable the back office specialist to define the roles for a particular configuration, that any user with the role can read. To get the configuration details, run the following cURL command or use a REST API client:
curl -H Authorization: Bearer <accessToken> https://<hostName>/cx/industry/buying/configManagement/v1/genericConfig?name=<Config name> -X GET

Insert Generic Configuration

Here's how you insert or update the generic configuration:
  1. Create a payload for specifying the generic configuration with these details:

    Generic configuration table

    Field Description
    id Id. It can be either user passed unique id or auto generated by Config MS service.
    name Unique generic configuration name
    description It is optional field. Description of configuration.
    permittedRoles Roles permitted to view these configurations. Multiple roles must be sent as comma separated.
    configuration Configuration in json format
  2. Call the configuration API by running this cURL command or by using a REST API client:
     curl -H Authorization: Bearer <accessToken> https://<hostName>/cx/industry/buying/configManagement/v1/configuration/genericConfig -X POST -H "Content-Type: application/json" -d @sc-data.json
    where
    • <accessToken> is the OAuth access token for Back Office Specialist role.
    • <hostName> is the URL for the CX Industries Framework API Gateway.

    For update call, use PATCH HTTP method.

    Response Body:

    [
      {
            "id": "Id_1705516512",
            "href": "https://cptadceqy-buy-cluster4.dxbuying.ocs.oraclecloud.com/orch9f35cbf4/cx/industry/buying/configManagement/v1/configuration/genericConfig/Id_1705516512",
            "name": "Config_1705516512",
            "description": "Store front Configuration",
            "permittedRoles": "Back Office Specialist",
            "startDate": "2024-01-18T18:35:10.387Z",
            "endDate": "2024-02-16T18:35:10.387Z",
            "configuration": {
                "isBundle": false,
                "syncTime": "2023-08-02T08:41:44.076088Z",
                "popRelationship": [
                    {
                        "name": "",
                        "id": "0CX-1Z42O5",
                        "href": "https://api-dev-search.cxcomms.dxbuying.ocs.oraclecloud.com/orch168a6d8b/cx/industry/search/tmf-api/productCatalogManagement/v4/productOfferingPrice/0CX-1Z42O5"
                    },
                    {
                        "name": "",
                        "id": "0CX-1Z42O5",
                        "href": "https://api-dev-search.cxcomms.dxbuying.ocs.oraclecloud.com/orch168a6d8b/cx/industry/search/tmf-api/productCatalogManagement/v4/productOfferingPrice/0CX-1Z42O5"
                    }
                ],
                "lifecycleStatus": "active",
                "validFor": {
                    "startDateTime": "2021-01-01T00:00:00.000Z",
                    "endDateTime": "2999-12-31T00:00:00.000Z"
                },
                "@type": "ProductOfferingPriceOracle",
                "priceType": "alteration",
                "description": "",
                "priceList": [
                    {
                        "name": "DX4C NA Pricelist",
                        "id": "0CX-1YU1OD",
                        "href": "https://api-dev-search.cxcomms.dxbuying.ocs.oraclecloud.com/orch168a6d8b/cx/industry/search/tmf-api/productCatalogManagement/v4/priceList/0CX-1YU1OD"
                    }
                ],
                "@baseType": "ProductOfferingPrice",
                "percentage": 100.0,
                "name": " Fire TV Discount",
                "isTaxInclusive": false,
                "href": "https://api-dev-search.cxcomms.dxbuying.ocs.oraclecloud.com/orch168a6d8b/cx/industry/search/tmf-api/productCatalogManagement/v4/productOfferingPrice/0CX-1YUGFP",
                "id": "0CX-1YUGFP",
                "relativeValidFor": {
                    "endRelativeDateTime": {
                        "relativeEvent": "PURCHASE",
                        "offSetUnit": "MONTHS",
                        "offSetValue": 5
                    },
                    "startRelativeDateTime": {
                        "relativeEvent": "PURCHASE",
                        "offSetUnit": "MONTHS",
                        "offSetValue": 1
                    }
                }
            },
            "createdOn": "2024-01-17T18:35:12.450Z",
            "updatedOn": "2024-01-17T18:35:12.450Z"
        }
    ]

Delete Generic Configuration

Here's how you delete the generic configuration:

  1. Call the configuration API by running this cURL command or by using a REST API client:
     curl -H Authorization: Bearer <accessToken> https://<hostName>/cx/industry/buying/configManagement/v1/configuration/genericConfig/{id} -X DELETE -H "Content-Type: application/json"
    where
    • <accessToken> is the OAuth access token for Back Office Specialist role.
    • <hostName> is the URL for the CX Industries Framework API Gateway.

    Response Body:

    [
      {
            "id": "Id_1705516512",
            "href": "https://cptadceqy-buy-cluster4.dxbuying.ocs.oraclecloud.com/orch9f35cbf4/cx/industry/buying/configManagement/v1/configuration/genericConfig/Id_1705516512",
            "name": "Config_1705516512",
            "description": "Store front Configuration",
            "permittedRoles": "Back Office Specialist",
            "startDate": "2024-01-18T18:35:10.387Z",
            "endDate": "2024-02-16T18:35:10.387Z",
            "configuration": {
                "isBundle": false,
                "syncTime": "2023-08-02T08:41:44.076088Z",
                "popRelationship": [
                    {
                        "name": "",
                        "id": "0CX-1Z42O5",
                        "href": "https://api-dev-search.cxcomms.dxbuying.ocs.oraclecloud.com/orch168a6d8b/cx/industry/search/tmf-api/productCatalogManagement/v4/productOfferingPrice/0CX-1Z42O5"
                    },
                    {
                        "name": "",
                        "id": "0CX-1Z42O5",
                        "href": "https://api-dev-search.cxcomms.dxbuying.ocs.oraclecloud.com/orch168a6d8b/cx/industry/search/tmf-api/productCatalogManagement/v4/productOfferingPrice/0CX-1Z42O5"
                    }
                ],
                "lifecycleStatus": "active",
                "validFor": {
                    "startDateTime": "2021-01-01T00:00:00.000Z",
                    "endDateTime": "2999-12-31T00:00:00.000Z"
                },
                "@type": "ProductOfferingPriceOracle",
                "priceType": "alteration",
                "description": "",
                "priceList": [
                    {
                        "name": "DX4C NA Pricelist",
                        "id": "0CX-1YU1OD",
                        "href": "https://api-dev-search.cxcomms.dxbuying.ocs.oraclecloud.com/orch168a6d8b/cx/industry/search/tmf-api/productCatalogManagement/v4/priceList/0CX-1YU1OD"
                    }
                ],
                "@baseType": "ProductOfferingPrice",
                "percentage": 100.0,
                "name": " Fire TV Discount",
                "isTaxInclusive": false,
                "href": "https://api-dev-search.cxcomms.dxbuying.ocs.oraclecloud.com/orch168a6d8b/cx/industry/search/tmf-api/productCatalogManagement/v4/productOfferingPrice/0CX-1YUGFP",
                "id": "0CX-1YUGFP",
                "relativeValidFor": {
                    "endRelativeDateTime": {
                        "relativeEvent": "PURCHASE",
                        "offSetUnit": "MONTHS",
                        "offSetValue": 5
                    },
                    "startRelativeDateTime": {
                        "relativeEvent": "PURCHASE",
                        "offSetUnit": "MONTHS",
                        "offSetValue": 1
                    }
                }
            },
            "createdOn": "2024-01-17T18:35:12.450Z",
            "updatedOn": "2024-01-17T18:35:12.450Z"
        }
    ]

    You can also pass configuration name as query parameter to delete the configuration.

    curl -H Authorization: Bearer <accessToken> https://<hostName>/cx/industry/buying/configManagement/v1/configuration/genericConfig/{id} -X DELETE -H "Content-Type: application/json"
    where
    • <accessToken> is the OAuth access token for Back Office Specialist role.
    • <hostName> is the URL for the CX Industries Framework API Gateway.