Create a product rule
https://{FusionAppsHost}/crmRestApi/atcProductCatalog/11.13.18.05/productCatalogManagment/v1/productRule
Request
There are no request parameters for this operation.
- application/json
objectProductRulesDiscriminator Values
-
@baseType: string
-
@schemaLocation: string
-
@type: string
-
applicationName: string
name of the external application
-
created: string
(date-time)
Date and time of creation
-
createdBy: string
name of the person who created
-
customProfileSpec: array
customProfileSpec
-
description: string
-
externalId: string
id of the external application
-
href: string
-
id: string
Maximum Length:
30 -
lastUpdate: string
(date-time)
-
lastUpdatedBy: string
name of the person who updated
-
lifecycleStatus: string
-
name(required): string
-
project: object
ProjectRef
Title:
ProjectRefProject Reference -
ruleCondition: array
ruleCondition
-
ruleSubType: string
Allowed Values:
[ { } ] -
ruleType: string
Allowed Values:
[ "COMPATIBILITY", "ELIGIBILITY", "MIGRATION", "RECOMMENDATION", "CONSTRAINT" ] -
scope: string
Allowed Values:
[ "ALL", "BUNDLE", "PACKAGE" ] -
subject: object
SubjectRef
Title:
SubjectRefSubject Reference -
version: string
-
versionState: number
Version state of the product rule
array-
Array of:
object CustomProfileSpecRefOracle
Title:
CustomProfileSpecRefOracleCustom Profile specification reference.
objectProjectRef-
href: string
Unique reference of the project
-
id(required): string
Unique identifier of the project
-
name: string
Name of the project
-
version: string
Version of the project
array-
Array of:
object RuleConditionOracle
Title:
RuleConditionOracleA product rule condition
objectSubjectRef-
@baseType: string
Immediate base (class) type of the subject entity
-
@referredType: string
The actual type of the target instance when needed for disambiguation
-
entityPathExpression: string
Path represent the hierarchy of the component PO within the product offering(offer id along with the associated parents i.e package_Id.bundledPO_Id.atomicOffer_Id),which is used in the runtime system to identify the subject entity that may be used in some other packages.
-
href: string
Unique reference of the project
-
id(required): string
Unique identifier of the subject
-
name: string
Name of the project
objectCustomProfileSpecRefOracle-
@baseType: string
Indicates the base (class) type of this REST resource
-
@referredType: string
(Class) type of the referred custom Specification.
-
@schemaLocation: string
This field provides a link to the schema describing this REST resource
-
@type: string
Indicates the (class) type of customSpecificationRef.
-
href: string
Reference of the custom specification.
-
id(required): string
Unique identifier of the custom specification.
-
name: string
Name of the custom specification.
-
version: string
Version of the custom specification.
-
versionState: number
To hold the version state for the reference
objectRuleConditionOracle-
@baseType: string
The immediate base class type of the Product Rule
-
@schemaLocation: string
A link to the schema describing this Product Rule entity
-
@type: string
the class type of the Product Rule
-
description: string
A string. Description of the product rule.
-
id(required): string
A string. Unique identifier of the product rule.
-
name: string
A string. The name given to the product rule
-
productRuleExpression: array
productRuleExpression
-
productRuleResult: array
productRuleResult
-
roundingMethod: string
Rounding applicable to the product rule
-
stringExpression: string
Metering Expression applicable to the product rule
-
unitOfMeasure: string
Unit of Measure of Rules
-
validFor: object
TimePeriodOracle
Title:
TimePeriodOracleValidity period of the related party
array-
Array of:
object Discriminator: @type
Discriminator:
{ "propertyName":"@type", "mapping":{ "RuleExpressionOracle":"#/components/schemas/RuleExpressionOracle", "EntityRuleExpressionOracle":"#/components/schemas/EntityRuleExpressionOracle", "EligibilityRuleExpressionOracle":"#/components/schemas/EligibilityRuleExpressionOracle" } }
array-
Array of:
object Discriminator: @type
Discriminator:
{ "propertyName":"@type", "mapping":{ "RuleResultOracle":"#/components/schemas/RuleResultOracle", "RecommendationRuleResultOracle":"#/components/schemas/RecommendationRuleResultOracle", "MigrationRuleResultOracle":"#/components/schemas/MigrationRuleResultOracle" } }
objectTimePeriodOracle-
endDateTime: string
(date-time)
An instant of time, ending at the TimePeriod.
-
startDateTime: string
(date-time)
An instant of time, starting at the TimePeriod
objectDiscriminator Values
objectDiscriminator Values
Response
- application/json
201 Response
objectProductRulesDiscriminator Values
-
@baseType: string
-
@schemaLocation: string
-
@type: string
-
applicationName: string
name of the external application
-
created: string
(date-time)
Date and time of creation
-
createdBy: string
name of the person who created
-
customProfileSpec: array
customProfileSpec
-
description: string
-
externalId: string
id of the external application
-
href: string
-
id: string
Maximum Length:
30 -
lastUpdate: string
(date-time)
-
lastUpdatedBy: string
name of the person who updated
-
lifecycleStatus: string
-
name(required): string
-
project: object
ProjectRef
Title:
ProjectRefProject Reference -
ruleCondition: array
ruleCondition
-
ruleSubType: string
Allowed Values:
[ { } ] -
ruleType: string
Allowed Values:
[ "COMPATIBILITY", "ELIGIBILITY", "MIGRATION", "RECOMMENDATION", "CONSTRAINT" ] -
scope: string
Allowed Values:
[ "ALL", "BUNDLE", "PACKAGE" ] -
subject: object
SubjectRef
Title:
SubjectRefSubject Reference -
version: string
-
versionState: number
Version state of the product rule
array-
Array of:
object CustomProfileSpecRefOracle
Title:
CustomProfileSpecRefOracleCustom Profile specification reference.
objectProjectRef-
href: string
Unique reference of the project
-
id(required): string
Unique identifier of the project
-
name: string
Name of the project
-
version: string
Version of the project
array-
Array of:
object RuleConditionOracle
Title:
RuleConditionOracleA product rule condition
objectSubjectRef-
@baseType: string
Immediate base (class) type of the subject entity
-
@referredType: string
The actual type of the target instance when needed for disambiguation
-
entityPathExpression: string
Path represent the hierarchy of the component PO within the product offering(offer id along with the associated parents i.e package_Id.bundledPO_Id.atomicOffer_Id),which is used in the runtime system to identify the subject entity that may be used in some other packages.
-
href: string
Unique reference of the project
-
id(required): string
Unique identifier of the subject
-
name: string
Name of the project
objectCustomProfileSpecRefOracle-
@baseType: string
Indicates the base (class) type of this REST resource
-
@referredType: string
(Class) type of the referred custom Specification.
-
@schemaLocation: string
This field provides a link to the schema describing this REST resource
-
@type: string
Indicates the (class) type of customSpecificationRef.
-
href: string
Reference of the custom specification.
-
id(required): string
Unique identifier of the custom specification.
-
name: string
Name of the custom specification.
-
version: string
Version of the custom specification.
-
versionState: number
To hold the version state for the reference
objectRuleConditionOracle-
@baseType: string
The immediate base class type of the Product Rule
-
@schemaLocation: string
A link to the schema describing this Product Rule entity
-
@type: string
the class type of the Product Rule
-
description: string
A string. Description of the product rule.
-
id(required): string
A string. Unique identifier of the product rule.
-
name: string
A string. The name given to the product rule
-
productRuleExpression: array
productRuleExpression
-
productRuleResult: array
productRuleResult
-
roundingMethod: string
Rounding applicable to the product rule
-
stringExpression: string
Metering Expression applicable to the product rule
-
unitOfMeasure: string
Unit of Measure of Rules
-
validFor: object
TimePeriodOracle
Title:
TimePeriodOracleValidity period of the related party
array-
Array of:
object Discriminator: @type
Discriminator:
{ "propertyName":"@type", "mapping":{ "RuleExpressionOracle":"#/components/schemas/RuleExpressionOracle", "EntityRuleExpressionOracle":"#/components/schemas/EntityRuleExpressionOracle", "EligibilityRuleExpressionOracle":"#/components/schemas/EligibilityRuleExpressionOracle" } }
array-
Array of:
object Discriminator: @type
Discriminator:
{ "propertyName":"@type", "mapping":{ "RuleResultOracle":"#/components/schemas/RuleResultOracle", "RecommendationRuleResultOracle":"#/components/schemas/RecommendationRuleResultOracle", "MigrationRuleResultOracle":"#/components/schemas/MigrationRuleResultOracle" } }
objectTimePeriodOracle-
endDateTime: string
(date-time)
An instant of time, ending at the TimePeriod.
-
startDateTime: string
(date-time)
An instant of time, starting at the TimePeriod
objectDiscriminator Values
objectDiscriminator Values
400 Response
objectError-
@schemaLocation: string
It provides a link to the schema describing a REST resource.
-
@type: string
The class type of a REST resource.
-
code(required): string
Application related code (as defined in the API or from a common list)
-
message: string
Text that provide more details and corrective actions related to the error. This can be shown to a client user.
-
reason(required): string
Text that explains the reason for error. This can be shown to a client user.
-
referenceError: string
url pointing to documentation describing the error
-
status: string
http error code extension like 400-2
401 Response
objectError-
@schemaLocation: string
It provides a link to the schema describing a REST resource.
-
@type: string
The class type of a REST resource.
-
code(required): string
Application related code (as defined in the API or from a common list)
-
message: string
Text that provide more details and corrective actions related to the error. This can be shown to a client user.
-
reason(required): string
Text that explains the reason for error. This can be shown to a client user.
-
referenceError: string
url pointing to documentation describing the error
-
status: string
http error code extension like 400-2
404 Response
objectError-
@schemaLocation: string
It provides a link to the schema describing a REST resource.
-
@type: string
The class type of a REST resource.
-
code(required): string
Application related code (as defined in the API or from a common list)
-
message: string
Text that provide more details and corrective actions related to the error. This can be shown to a client user.
-
reason(required): string
Text that explains the reason for error. This can be shown to a client user.
-
referenceError: string
url pointing to documentation describing the error
-
status: string
http error code extension like 400-2
405 Response
objectError-
@schemaLocation: string
It provides a link to the schema describing a REST resource.
-
@type: string
The class type of a REST resource.
-
code(required): string
Application related code (as defined in the API or from a common list)
-
message: string
Text that provide more details and corrective actions related to the error. This can be shown to a client user.
-
reason(required): string
Text that explains the reason for error. This can be shown to a client user.
-
referenceError: string
url pointing to documentation describing the error
-
status: string
http error code extension like 400-2
500 Response
objectError-
@schemaLocation: string
It provides a link to the schema describing a REST resource.
-
@type: string
The class type of a REST resource.
-
code(required): string
Application related code (as defined in the API or from a common list)
-
message: string
Text that provide more details and corrective actions related to the error. This can be shown to a client user.
-
reason(required): string
Text that explains the reason for error. This can be shown to a client user.
-
referenceError: string
url pointing to documentation describing the error
-
status: string
http error code extension like 400-2
Examples
The following examples show how to create a product rule by submitting a POST request on the REST resource using cURL.
Compatibility product rule
cURL Command
curl -u username:password -X POST
https://{FusionAppsHost}/crmRestApi/atcProductCatalog/11.13.18.05/v1/productRule \ -H 'Content-Type: application/json' -D @productrule_create.json | json_pp
Example of Request Body
The following shows an example of creating a product rule based on compatibility rule in JSON format.
{
"id": "PSPRULE001100",
"name": "PSP iPhone12 Pro Rule",
"version": "1.0",
"ruleType": "COMPATIBILITY",
"description": "Rule007 Compatability Rule",
"lifecycleStatus": "In design",
"subject": {
"id": "iPhone12Pro",
"@referredType": "ProductOfferingOracle"
},
"ruleCondition": [
{
"id": "Condtion1",
"name": "Rule condition1",
"description": "Rule condition1",
"stringExpression": "REQUIRES ENTITY(SupremoZoom,ProductOfferingOracle)",
"validFor": {
"startDateTime": "2021-05-06T03:50:48.000Z",
"endDateTime": "2021-12-29T03:50:48.000Z"
}
},
{
"id": "Condtion2",
"name": "Rule condition2",
"description": "Rule condition2",
"stringExpression": "REQUIRES_MUTUAL ENTITY(SupremoZoom,ProductOfferingOracle)",
"validFor": {
"startDateTime": "2022-01-01T03:50:48.000Z",
"endDateTime": "2023-09-30T03:50:48.000Z"
}
}
],
"project": {
"id": "PSPChristmansInitiative",
"name": "Christmas Initiative"
}
}
Example of Response Body
The following shows an example of the response body in JSON format.
200 OK
Recommendation product rule
cURL Command
curl curl -u username:password -X POST
https://{FusionAppsHost}/crmRestApi/atcProductCatalog/11.13.18.05/v1/productRule \ -H 'Content-Type: application/json' -D @create_productrule.json | json_pp
Example of Request Body
The following shows an example of creating a product rule based on compatibility rule in JSON format.
{
"id": "RECOMMENDRULE001",
"name": "RECOMMEND-RULE-001",
"lifecycleStatus": "In design",
"version": "1.0",
"ruleType": "RECOMMENDATION",
"subject": {
"id": "iPhone12Pro",
"name": "iPhone12 Pro",
"@referredType": "ProductOfferingOracle"
},
"ruleCondition": [
{
"validFor": {
"startDateTime": "2022-02-01T00:00:00.000Z",
"endDateTime": "2023-03-31T00:00:00.000Z"
},
"description": "Rule condition1",
"name": "Rule condition1",
"id": "Condition1",
"productRuleResult": [
{
"id": "Result001",
"value": "iPhoneProMaxCre234455",
"valueType": "PRODUCT_OFFERING",
"messageType": "UPSELL_RECOMMEND",
"score": 1,
"message": "Recommended for iPhone12 device",
"@type": "RecommendationRuleResultOracle"
},
{
"id": "Result002",
"value": "Apple-redwood",
"valueType": "PRODUCT_OFFERING",
"messageType": "CROSS_SELL_RECOMMEND",
"score": 1,
"message": "Recommended for Apple device",
"@type": "RecommendationRuleResultOracle"
}
]
}
]
}
Example of Response Body
The following shows an example of the response body in JSON format.
{
"id": "RECOMMENDRULE001",
"name": "RECOMMEND-RULE-001",
"lifecycleStatus": "In design",
"href": "https://{FusionAppsHost}/crmRestApi/atcProductCatalog/11.13.18.05/v1/productRule/RECOMMENDRULE001",
"version": "1.0",
"created": "2021-08-30T06:30:50.000Z",
"createdBy": "booth",
"lastUpdate": "2021-08-31T12:21:12.377Z",
"lastUpdatedBy": "booth", "ruleType": "RECOMMENDATION",
"subject": {
"id": "iPhone12Pro",
"name": "iPhone12 Pro",
"@referredType": "ProductOfferingOracle"
},
"ruleCondition": [
{
"validFor": {
"startDateTime": "2022-02-01T00:00:00.000Z",
"endDateTime": "2023-03-31T00:00:00.000Z"
},
"description": "Rule condition1",
"name": "Rule condition1",
"id": "Condition1",
"productRuleResult": [
{
"id": "Result001",
"value": "iPhoneProMaxCre234455",
"valueType": "PRODUCT_OFFERING",
"messageType": "UPSELL_RECOMMEND",
"score": 1,
"message": "Recommended for iPhone12 device",
"@type": "RecommendationRuleResultOracle"
},
{
"id": "Result002",
"value": "Apple-redwood",
"valueType": "PRODUCT_OFFERING",
"messageType": "CROSS_SELL_RECOMMEND",
"score": 1,
"message": "Recommended for Apple device",
"@type": "RecommendationRuleResultOracle"
}
]
}
]
}
Migration product rule
cURL Command
curl -u username:password -X POST
https://{FusionAppsHost}/crmRestApi/atcProductCatalog/11.13.18.05/v1/productRule \ -H 'Content-Type: application/json' -D create_productrule.json | json_pp
Example of Request Body
The following shows an example of creating a product rule based on compatibility rule in JSON format.
{
"id": "RULE-MG-2428711991-16303049976",
"name": "Migration3008"
"lifecycleStatus": "In design",
"ruleType": "MIGRATION",
"@type": "ProductRuleOracle",
"version": "1.0",
"subject": {
"id": "ID-2748943967-1630348319691",
"name": "Test30Aug",
"@referredType": "ProductOfferingOracle"
},
"ruleCondition": [
{
"stringExpression": "UPG_TO ENTITY(Oracle_DPFTEB6S,ProductOfferingOracle)",
"description": "Rule Condition1",
"name": "Rule Condition1",
"id": "Condition1"
},
{
"productRuleResult": [
{
"@type": "MigrationRuleResultOracle",
"productOfferingPrice": [
{
"id": "MG_PP-1245125592-1630339279419",
"name": "MG_PP-1245125592-1630339279419",
"@referredType": "ProductOfferingPriceOracle",
"@type": "ProductOfferingPriceRef",
"@baseType": "ProductOfferingPriceOracle"
},
{
"id": "MG_PP-3357907241-1630339279419",
"name": "MG_PP-3357907241-1630339279419",
"@referredType": "ProductOfferingPriceOracle",
"@type": "ProductOfferingPriceRef",
"@baseType": "ProductOfferingPriceOracle"
}
],
"duration": "ORIGINAL_DURATION",
"id": "Result-1590826115-163041247168"
}
],
"validFor": {
"startDateTime": "2021-08-30T00:00:00.000Z",
"endDateTime": "2021-09-02T23:59:55.000Z"
},
"description": "MG-GRP-2293485690-163030499981",
"name": "MG-GRP-2293485690-163030499981",
"id": "MG-GRP-2293485690-163030499981"
},
{
"productRuleResult": [
{
"@type": "MigrationRuleResultOracle",
"commitmentStart": "ORIGINAL_END",
"duration": "NEW_DURATION",
"id": "Result-1476786685-163041247168"
}
],
"validFor": {
"startDateTime": "2021-09-03T00:00:00.000Z",
"endDateTime": "2021-09-30T00:00:00.000Z"
},
"description": "MG-GRP-1709107837-163033923660",
"name": "MG-GRP-1709107837-163033923660",
"id": "MG-GRP-1709107837-163033923660"
}
],
"project": {
"id": "Summer-Initiative",
"name": "Summer Initiative",
}
}
Example of Response Body
The following shows an example of the response body in JSON format.
{
"id": "RULE-MG-2428711991-16303049976",
"name": "Migration3008",
"href": "https://{FusionAppsHost}/crmRestApi/atcProductCatalog/11.13.18.05/v1/productRule/RULE-MG-2428711991-16303049976",
"lifecycleStatus": "In design",
"ruleType": "MIGRATION",
"@type": "ProductRuleOracle",
"created": "2021-08-30T06:30:50.000Z",
"createdBy": "booth",
"lastUpdate": "2021-08-31T12:21:12.377Z",
"lastUpdatedBy": "booth",
"version": "1.0",
"subject": {
"id": "ID-2748943967-1630348319691",
"name": "Test30Aug",
"href": "https://{FusionAppsHost}/crmRestApi/atcProductCatalog/11.13.18.05/tmf-api/productCatalogManagement/v4/productOffering/ID-2748943967-1630348319691",
"@referredType": "ProductOfferingOracle"
},
"ruleCondition": [
{
"stringExpression": "UPG_TO ENTITY(Oracle_DPFTEB6S,ProductOfferingOracle)",
"description": "Rule Condition1",
"name": "Rule Condition1",
"id": "Condition1"
},
{
"productRuleResult": [
{
"@type": "MigrationRuleResultOracle",
"productOfferingPrice": [
{
"id": "MG_PP-1245125592-1630339279419",
"name": "MG_PP-1245125592-1630339279419",
"href": "https://{FusionAppsHost}/crmRestApi/atcProductCatalog/11.13.18.05/tmf-api/productCatalogManagement/v4/productOfferingPrice/MG_PP-1245125592-1630339279419",
"@referredType": "ProductOfferingPriceOracle",
"@type": "ProductOfferingPriceRef",
"@baseType": "ProductOfferingPriceOracle"
},
{
"id": "MG_PP-3357907241-1630339279419",
"name": "MG_PP-3357907241-1630339279419",
"href": "https://{FusionAppsHost}/crmRestApi/atcProductCatalog/11.13.18.05/tmf-api/productCatalogManagement/v4/productOfferingPrice/MG_PP-3357907241-1630339279419",
"@referredType": "ProductOfferingPriceOracle",
"@type": "ProductOfferingPriceRef",
"@baseType": "ProductOfferingPriceOracle"
}
],
"duration": "ORIGINAL_DURATION",
"id": "Result-1590826115-163041247168"
}
],
"validFor": {
"startDateTime": "2021-08-30T00:00:00.000Z",
"endDateTime": "2021-09-02T23:59:55.000Z"
},
"description": "MG-GRP-2293485690-163030499981",
"name": "MG-GRP-2293485690-163030499981",
"id": "MG-GRP-2293485690-163030499981"
},
{
"productRuleResult": [
{
"@type": "MigrationRuleResultOracle",
"commitmentStart": "ORIGINAL_END",
"duration": "NEW_DURATION",
"id": "Result-1476786685-163041247168"
}
],
"validFor": {
"startDateTime": "2021-09-03T00:00:00.000Z",
"endDateTime": "2021-09-30T00:00:00.000Z"
},
"description": "MG-GRP-1709107837-163033923660",
"name": "MG-GRP-1709107837-163033923660",
"id": "MG-GRP-1709107837-163033923660"
}
],
"project": {
"id": "Summer-Initiative",
"name": "Summer Initiative",
"href": "https://{FusionAppsHost}/crmRestApi/atcProductCatalog/11.13.18.05/tmf-api/productCatalogManagement/v4/project/Summer-Initiative"
}
}