Overview
The Loyalty Rule service is a core component of Loyalty. This service is used to create rules in the system as well as process appropriate rules when the end user makes an activity on the storefront. All the user activities such as Registration, Order, Redemption, Rating, Review, and Tier Upgrades are processed by the Loyalty Rule service.
API Reference
/rules
This resourceType defines the GET, POST, DELETE methods and their responses for a collection resource.
/rules
Gets all rules
Accepted scopes:
- 'sap.loyengine_view' - Perform read operations on Loyalty Rule services
(Do not use) Creates a new rule for a Loyalty program. Use /saveRule for creating a new rule.
Accepted scopes:
- 'sap.loyengine_manage' - Perform create and update operations on Loyalty Rule services
get /rules
Gets all rules
Accepted scopes:
- 'sap.loyengine_view' - Perform read operations on Loyalty Rule services
Headers
- Authorization: required (string)
Used to send a valid OAuth2 access token.
Example:
Bearer access_token
Query Parameters
- sort: (string)
The list of comma-separated values. Property identifiers used to sort the result. By default, the column values are sorted in ascending order. If preceded by a minus sign (-), the values are sorted in descending order.
Example:
name,-description
- q: (string)
The simple query criteria based on available fields to limit returned results or a set of modified documents.
Example:
species:cat breed:"Norwegian Forest Cat" weight:(>3 AND <=5) age:(3,5,6) condition:exists
- pageNumber: (integer - minimum: 1)
The page number to be retrieved where the size of the pages must be specified by the pageSize parameter. The number of the first page is 1.
Example:
5
- pageSize: (integer - minimum: 1)
The number of records retrieved at one time.
Example:
45
HTTP status code 200
Resource successfully retrieved.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Collection of Rules",
"type": "array",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Rule",
"type": "object",
"properties": {
"ruleId": {
"type": "string",
"maxLength": 32
},
"name": {
"type": "string",
"maxLength": 50
},
"description": {
"type": "string",
"maxLength": 150
},
"ruleType": {
"enum": [
"REGISTRATION",
"ORDER",
"REDEEM",
"TIER",
"ACTIVITY",
"EXPIRATION",
"CUSTOM",
"CANCELLATION"
]
},
"refId": {
"type": "string"
},
"ruleFileUrl": {
"type": "string",
"format": "uri",
"deprecated": {
"deprecatedOn": "20160314",
"description": "Rule files are no longer stored as media but within this schema itself in rueFile field"
}
},
"ruleFile": {
"type": "string",
"description": "Base64 encoded binary of the DRL file"
},
"createdBy": {
"type": "string"
},
"updatedBy": {
"type": "string"
},
"ruleStatus": {
"enum": [
"ACTIVE",
"INACTIVE",
"ARCHIVED",
"NEW",
"DELETED"
],
"default": "NEW"
},
"validFrom": {
"type": "string",
"format": "date-time"
},
"validTo": {
"type": "string",
"format": "date-time"
},
"tiers": {
"type": "array",
"uniqueItems": true,
"items": {
"type": "string"
}
}
},
"required": [
"ruleId",
"ruleType",
"name",
"createdBy",
"ruleStatus",
"validFrom",
"validTo"
]
}
}
Example:
{
"ruleId": "d499b28e302c4f2d8ccf1c18f132cb0d",
"name": "Welcome Point Rule",
"description": " Loyalty Membership Welcome Point Rule",
"ruleType": "REGISTRATION",
"refId": "2399b28e302c4f2d8ccf1c18f132cb0e",
"ruleFileUrl": "http://yourserver.com/media/d499b28e302c4f2d8ccf1c18f132cb0d.drl",
"createdBy": "1w99b28e302c4f2d8ccf1c18f132cb6t",
"updatedBy": "",
"ruleStatus": "ACTIVE",
"validFrom": "2014-12-10T03:58:00.000Z",
"validTo": "2015-01-17T03:58:00.000Z"
}
HTTP status code 400
Request syntactically incorrect. Any details will be provided within the response payload.
HTTP status code 401
Given request is unauthorized. Bad or expired token. Reauthenticate the user. Any details will be provided within the response payload.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 401,
"message": "Authorization: Unauthorized. Bearer TOKEN is invalid",
"type": "insufficient_credentials",
"moreInfo": "https://pattern.yaas.io/errortypes.html"
}
HTTP status code 403
Evaluated request scopes in access token are not sufficient and do not match required scopes.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 403,
"message": "Given request does not have required scopes in access token. It is not authorized to perform this operation.",
"type": "insufficient_permissions"
}
HTTP status code 500
Some server side error occurred.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 500,
"message": "Something went wrong while processing the request. Please contact the administrator.",
"moreInfo": "https://pattern.yaas.io/errortypes.html",
"type": "internal_service_error"
}
post /rules
(Do not use) Creates a new rule for a Loyalty program. Use /saveRule for creating a new rule.
Accepted scopes:
- 'sap.loyengine_manage' - Perform create and update operations on Loyalty Rule services
Headers
- Authorization: required (string)
Used to send a valid OAuth2 access token.
Example:
Bearer access_token
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Rule",
"type": "object",
"properties": {
"ruleId": {
"type": "string",
"maxLength": 32
},
"name": {
"type": "string",
"maxLength": 50
},
"description": {
"type": "string",
"maxLength": 150
},
"ruleType": {
"enum": [
"REGISTRATION",
"ORDER",
"REDEEM",
"TIER",
"ACTIVITY",
"EXPIRATION",
"CUSTOM",
"CANCELLATION"
]
},
"refId": {
"type": "string"
},
"ruleFileUrl": {
"type": "string",
"format": "uri",
"deprecated": {
"deprecatedOn": "20160314",
"description": "Rule files are no longer stored as media but within this schema itself in rueFile field"
}
},
"ruleFile": {
"type": "string",
"description": "Base64 encoded binary of the DRL file"
},
"createdBy": {
"type": "string"
},
"updatedBy": {
"type": "string"
},
"ruleStatus": {
"enum": [
"ACTIVE",
"INACTIVE",
"ARCHIVED",
"NEW",
"DELETED"
],
"default": "NEW"
},
"validFrom": {
"type": "string",
"format": "date-time"
},
"validTo": {
"type": "string",
"format": "date-time"
},
"tiers": {
"type": "array",
"uniqueItems": true,
"items": {
"type": "string"
}
}
},
"required": [
"ruleId",
"ruleType",
"name",
"createdBy",
"ruleStatus",
"validFrom",
"validTo"
]
}
Example:
{
"ruleId": "d499b28e302c4f2d8ccf1c18f132cb0d",
"name": "Welcome Point Rule",
"description": " Loyalty Membership Welcome Point Rule",
"ruleType": "REGISTRATION",
"refId": "2399b28e302c4f2d8ccf1c18f132cb0e",
"ruleFileUrl": "http://yourserver.com/media/d499b28e302c4f2d8ccf1c18f132cb0d.drl",
"createdBy": "1w99b28e302c4f2d8ccf1c18f132cb6t",
"updatedBy": "",
"ruleStatus": "ACTIVE",
"validFrom": "2014-12-10T03:58:00.000Z",
"validTo": "2015-01-17T03:58:00.000Z"
}
HTTP status code 201
The collection resource has been successfully created.
Headers
- Location: required (string)
The Location of the new resource which was created by the request. The value consists of a single absolute URI.
Example:
http://www.hybris.com/items/myItem
HTTP status code 400
Request syntactically incorrect. Any details will be provided within the response payload.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 400,
"message": "The request payload has incorrect syntax.",
"moreInfo": "https://pattern.yaas.io/errortypes.html",
"type": "bad_payload_syntax"
}
HTTP status code 401
Given request is unauthorized. Bad or expired token. Reauthenticate the user. Any details will be provided within the response payload.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 401,
"message": "Authorization: Unauthorized. Bearer TOKEN is invalid",
"type": "insufficient_credentials",
"moreInfo": "https://pattern.yaas.io/errortypes.html"
}
HTTP status code 403
Evaluated request scopes in access token are not sufficient and do not match required scopes.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 403,
"message": "Given request does not have required scopes in access token. It is not authorized to perform this operation.",
"type": "insufficient_permissions"
}
HTTP status code 409
Creation failed because there was a conflict with another resource. Any details will be provided within the response payload.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 409,
"message": "The requested resource could not be created due to server-side validation.",
"moreInfo": "https://pattern.yaas.io/errortypes.html",
"type": "conflict_resource"
}
HTTP status code 500
Some server side error occurred.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 500,
"message": "Something went wrong while processing the request. Please contact the administrator.",
"moreInfo": "https://pattern.yaas.io/errortypes.html",
"type": "internal_service_error"
}
/rules/aggr
Gets Average, Sum and Count aggregation for Rules
Accepted scopes:
- 'sap.loyengine_view' - Perform read operations on Loyalty Rule services
get /rules/aggr
Gets Average, Sum and Count aggregation for Rules
Accepted scopes:
- 'sap.loyengine_view' - Perform read operations on Loyalty Rule services
Headers
- Authorization: required (string)
Used to send a valid OAuth2 access token.
Example:
Bearer access_token
Query Parameters
- totalCount: (boolean)
This parameter requests to return the total number of object in the collection fulfilling the criteria together with the response. This number will be returned in the 'hybris-count' header.
Example:
true
- q: (string)
The simple query criteria based on available fields to limit returned results or a set of modified documents.
Example:
species:cat breed:"Norwegian Forest Cat" weight:(>3 AND <=5) age:(3,5,6) condition:exists
- avg: (string)
List of comma separated attributes for Average
Example:
attribute1, attribute2
- sum: (string)
List of comma separated attributes for Sum
Example:
attribute1, attribute2
HTTP status code 200
Headers
- hybris-count: (integer)
The total number of objects that fulfil the criteria.
Example:
1000
HTTP status code 400
Request syntactically incorrect. Any details will be provided within the response payload.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 400,
"message": "There are validation problems, see details section for more information",
"moreInfo": "https://pattern.yaas.io/errortypes.html",
"type": "validation_violation",
"details": [
{
"field": "totalCount",
"message": "must be a boolean",
"type": "invalid_query_parameter"
}
]
}
HTTP status code 401
Given request is unauthorized. Bad or expired token. Reauthenticate the user. Any details will be provided within the response payload.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 401,
"message": "Authorization: Unauthorized. Bearer TOKEN is invalid",
"type": "insufficient_credentials",
"moreInfo": "https://pattern.yaas.io/errortypes.html"
}
HTTP status code 403
Evaluated request scopes in access token are not sufficient and do not match required scopes.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 403,
"message": "Given request does not have required scopes in access token. It is not authorized to perform this operation.",
"type": "insufficient_permissions"
}
/rules/{ruleId}
This resource type defines the GET, PUT, DELETE methods and their responses for a single element resource.
Gets a specific rule of a Loyalty program based on the rule id provided
Accepted scopes:
- 'sap.loyengine_view' - Perform read operations on Loyalty Rule services
(Do not use) Updates a specific rule of a Loyalty program based on the rule id provided
Accepted scopes:
- 'sap.loyengine_manage' - Perform create and update operations on Loyalty Rule services
Deletes a specific rule of a Loyalty program based on the rule id provided
Accepted scopes:
- 'sap.loyengine_delete' - Perform delete operations on Loyalty Rule services
get /rules/{ruleId}
Gets a specific rule of a Loyalty program based on the rule id provided
Accepted scopes:
- 'sap.loyengine_view' - Perform read operations on Loyalty Rule services
URI Parameters
- ruleId: required (string)
the id of the rule to work on
Example:
d499b28e302c4f2d8ccf1c18f132cb0d
Headers
- Authorization: required (string)
Used to send a valid OAuth2 access token.
Example:
Bearer access_token
HTTP status code 200
rule successfully retrieved.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Rule",
"type": "object",
"properties": {
"ruleId": {
"type": "string",
"maxLength": 32
},
"name": {
"type": "string",
"maxLength": 50
},
"description": {
"type": "string",
"maxLength": 150
},
"ruleType": {
"enum": [
"REGISTRATION",
"ORDER",
"REDEEM",
"TIER",
"ACTIVITY",
"EXPIRATION",
"CUSTOM",
"CANCELLATION"
]
},
"refId": {
"type": "string"
},
"ruleFileUrl": {
"type": "string",
"format": "uri",
"deprecated": {
"deprecatedOn": "20160314",
"description": "Rule files are no longer stored as media but within this schema itself in rueFile field"
}
},
"ruleFile": {
"type": "string",
"description": "Base64 encoded binary of the DRL file"
},
"createdBy": {
"type": "string"
},
"updatedBy": {
"type": "string"
},
"ruleStatus": {
"enum": [
"ACTIVE",
"INACTIVE",
"ARCHIVED",
"NEW",
"DELETED"
],
"default": "NEW"
},
"validFrom": {
"type": "string",
"format": "date-time"
},
"validTo": {
"type": "string",
"format": "date-time"
},
"tiers": {
"type": "array",
"uniqueItems": true,
"items": {
"type": "string"
}
}
},
"required": [
"ruleId",
"ruleType",
"name",
"createdBy",
"ruleStatus",
"validFrom",
"validTo"
]
}
Example:
{
"ruleId": "d499b28e302c4f2d8ccf1c18f132cb0d",
"name": "Welcome Point Rule",
"description": " Loyalty Membership Welcome Point Rule",
"eventType": "REGISTER",
"ruleType": "REGISTRATION",
"refId": "2399b28e302c4f2d8ccf1c18f132cb0e",
"ruleFileUrl": "http://yourserver.com/media/d499b28e302c4f2d8ccf1c18f132cb0d.drl",
"createdBy": "1w99b28e302c4f2d8ccf1c18f132cb6t",
"updatedBy": "",
"ruleStatus": "ACTIVE",
"validFrom": "2014-12-10T03:58:00.000Z",
"validTo": "2015-01-17T03:58:00.000Z"
}
HTTP status code 401
Given request is unauthorized. Bad or expired token. Reauthenticate the user. Any details will be provided within the response payload.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 401,
"message": "Authorization: Unauthorized. Bearer TOKEN is invalid",
"type": "insufficient_credentials",
"moreInfo": "https://pattern.yaas.io/errortypes.html"
}
HTTP status code 403
Evaluated request scopes in access token are not sufficient and do not match required scopes.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 403,
"message": "Given request does not have required scopes in access token. It is not authorized to perform this operation.",
"type": "insufficient_permissions"
}
HTTP status code 404
The requested resource does not exist.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 404,
"message": "The requested URI does not map to a single element resource.",
"moreInfo": "https://pattern.yaas.io/errortypes.html",
"type": "element_resource_non_existing"
}
HTTP status code 500
Some server side error occurred.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 500,
"message": "Something went wrong while processing the request. Please contact the administrator.",
"moreInfo": "https://pattern.yaas.io/errortypes.html",
"type": "internal_service_error"
}
put /rules/{ruleId}
(Do not use) Updates a specific rule of a Loyalty program based on the rule id provided
Accepted scopes:
- 'sap.loyengine_manage' - Perform create and update operations on Loyalty Rule services
URI Parameters
- ruleId: required (string)
the id of the rule to work on
Example:
d499b28e302c4f2d8ccf1c18f132cb0d
Headers
- Authorization: required (string)
Used to send a valid OAuth2 access token.
Example:
Bearer access_token
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Rule",
"type": "object",
"properties": {
"ruleId": {
"type": "string",
"maxLength": 32
},
"name": {
"type": "string",
"maxLength": 50
},
"description": {
"type": "string",
"maxLength": 150
},
"ruleType": {
"enum": [
"REGISTRATION",
"ORDER",
"REDEEM",
"TIER",
"ACTIVITY",
"EXPIRATION",
"CUSTOM",
"CANCELLATION"
]
},
"refId": {
"type": "string"
},
"ruleFileUrl": {
"type": "string",
"format": "uri",
"deprecated": {
"deprecatedOn": "20160314",
"description": "Rule files are no longer stored as media but within this schema itself in rueFile field"
}
},
"ruleFile": {
"type": "string",
"description": "Base64 encoded binary of the DRL file"
},
"createdBy": {
"type": "string"
},
"updatedBy": {
"type": "string"
},
"ruleStatus": {
"enum": [
"ACTIVE",
"INACTIVE",
"ARCHIVED",
"NEW",
"DELETED"
],
"default": "NEW"
},
"validFrom": {
"type": "string",
"format": "date-time"
},
"validTo": {
"type": "string",
"format": "date-time"
},
"tiers": {
"type": "array",
"uniqueItems": true,
"items": {
"type": "string"
}
}
},
"required": [
"ruleId",
"ruleType",
"name",
"createdBy",
"ruleStatus",
"validFrom",
"validTo"
]
}
Example:
{
"ruleId": "d499b28e302c4f2d8ccf1c18f132cb0d",
"name": "Welcome Point Rule",
"description": " Loyalty Membership Welcome Point Rule",
"eventType": "REGISTER",
"ruleType": "REGISTRATION",
"refId": "2399b28e302c4f2d8ccf1c18f132cb0e",
"ruleFileUrl": "http://yourserver.com/media/d499b28e302c4f2d8ccf1c18f132cb0d.drl",
"createdBy": "1w99b28e302c4f2d8ccf1c18f132cb6t",
"updatedBy": "",
"ruleStatus": "ACTIVE",
"validFrom": "2014-12-10T03:58:00.000Z",
"validTo": "2015-01-17T03:58:00.000Z"
}
HTTP status code 200
The resource has been successfully updated
HTTP status code 400
Request syntactically incorrect. Any details will be provided within the response payload.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 400,
"message": "The request payload has incorrect syntax.",
"moreInfo": "https://pattern.yaas.io/errortypes.html",
"type": "bad_payload_syntax"
}
HTTP status code 401
Given request is unauthorized. Bad or expired token. Reauthenticate the user. Any details will be provided within the response payload.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 401,
"message": "Authorization: Unauthorized. Bearer TOKEN is invalid",
"type": "insufficient_credentials",
"moreInfo": "https://pattern.yaas.io/errortypes.html"
}
HTTP status code 403
Evaluated request scopes in access token are not sufficient and do not match required scopes.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 403,
"message": "Given request does not have required scopes in access token. It is not authorized to perform this operation.",
"type": "insufficient_permissions"
}
HTTP status code 404
The requested resource does not exist.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 404,
"message": "The requested URI does not map to a single element resource.",
"moreInfo": "https://pattern.yaas.io/errortypes.html",
"type": "element_resource_non_existing"
}
HTTP status code 409
Creation failed because there was a conflict with another resource. Any details will be provided within the response payload.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 409,
"message": "The requested resource could not be updated due to server-side validation.",
"moreInfo": "https://pattern.yaas.io/errortypes.html",
"type": "conflict_resource"
}
HTTP status code 500
Some server side error occurred.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 500,
"message": "Something went wrong while processing the request. Please contact the administrator.",
"moreInfo": "https://pattern.yaas.io/errortypes.html",
"type": "internal_service_error"
}
delete /rules/{ruleId}
Deletes a specific rule of a Loyalty program based on the rule id provided
Accepted scopes:
- 'sap.loyengine_delete' - Perform delete operations on Loyalty Rule services
URI Parameters
- ruleId: required (string)
the id of the rule to work on
Example:
d499b28e302c4f2d8ccf1c18f132cb0d
Headers
- Authorization: required (string)
Used to send a valid OAuth2 access token.
Example:
Bearer access_token
HTTP status code 204
The resource has been successfully deleted.
HTTP status code 401
Given request is unauthorized. Bad or expired token. Reauthenticate the user. Any details will be provided within the response payload.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 401,
"message": "Authorization: Unauthorized. Bearer TOKEN is invalid",
"type": "insufficient_credentials",
"moreInfo": "https://pattern.yaas.io/errortypes.html"
}
HTTP status code 403
Evaluated request scopes in access token are not sufficient and do not match required scopes.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 403,
"message": "Given request does not have required scopes in access token. It is not authorized to perform this operation.",
"type": "insufficient_permissions"
}
HTTP status code 404
The requested resource does not exist.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 404,
"message": "The requested URI does not map to a single element resource.",
"moreInfo": "https://pattern.yaas.io/errortypes.html",
"type": "element_resource_non_existing"
}
HTTP status code 500
Some server side error occurred.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 500,
"message": "Something went wrong while processing the request. Please contact the administrator.",
"moreInfo": "https://pattern.yaas.io/errortypes.html",
"type": "internal_service_error"
}
/saveRule
This resourceType defines the POST, PUT methods and their responses for a collection resource.
/saveRule
Creates a rule and generates a DRL file.Use this endpoint to create a new rule.
Details:
- A DRL file is generated for rule saved from the rule builder UI
- The DRL is stored as a base64 encoded content in the document repository
Accepted scopes:
- 'sap.loyengine_manage' - Perform create and update operations on Loyalty Rule services
Updates a rule and generates a DRL file. Use this endpoint to update an existing rule.
Details:
- A DRL file is generated for rule saved from the rule builder UI
- The DRL is stored as a base64 encoded content in the document repository
Accepted scopes:
- 'sap.loyengine_manage' - Perform create and update operations on Loyalty Rule services
post /saveRule
Creates a rule and generates a DRL file.Use this endpoint to create a new rule.
Details:
- A DRL file is generated for rule saved from the rule builder UI
- The DRL is stored as a base64 encoded content in the document repository
Accepted scopes:
- 'sap.loyengine_manage' - Perform create and update operations on Loyalty Rule services
Headers
- Authorization: required (string)
Used to send a valid OAuth2 access token.
Example:
Bearer access_token
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Rule with DRL details",
"type": "object",
"properties": {
"rule": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Rule",
"properties": {
"ruleId": {
"type": "string",
"maxLength": 32
},
"name": {
"type": "string",
"maxLength": 50
},
"description": {
"type": "string",
"maxLength": 150
},
"ruleType": {
"enum": [
"REGISTRATION",
"ORDER",
"REDEEM",
"TIER",
"ACTIVITY",
"EXPIRATION",
"CUSTOM",
"CANCELLATION"
]
},
"refId": {
"type": "string"
},
"ruleFileUrl": {
"type": "string",
"format": "uri",
"deprecated": {
"deprecatedOn": "20160314",
"description": "Rule files are no longer stored as media but within this schema itself in rueFile field"
}
},
"ruleFile": {
"type": "string",
"description": "Base64 encoded binary of the DRL file"
},
"createdBy": {
"type": "string"
},
"updatedBy": {
"type": "string"
},
"ruleStatus": {
"enum": [
"ACTIVE",
"INACTIVE",
"ARCHIVED",
"NEW",
"DELETED"
],
"default": "NEW"
},
"validFrom": {
"type": "string",
"format": "date-time"
},
"validTo": {
"type": "string",
"format": "date-time"
},
"tiers": {
"type": "array",
"uniqueItems": true,
"items": {
"type": "string"
}
}
},
"required": [
"ruleId",
"ruleType",
"name",
"createdBy",
"ruleStatus",
"validFrom",
"validTo"
]
},
"ruleFile": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Rule group: a collection of rulesGens",
"properties": {
"ruleType": {
"enum": [
"REGISTRATION",
"ORDER",
"REDEEM",
"TIER",
"ACTIVITY",
"EXPIRATION",
"CUSTOM",
"CANCELLATION"
]
},
"rules": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "ruleGen",
"properties": {
"ruleName": {
"type": "string",
"maxLength": 50
},
"who": {
"type": "array",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "keyVal",
"type": "object",
"properties": {
"key": {
"type": "string"
},
"value": {
"type": "string"
},
"metaKey": {
"type": "string"
},
"childKeys": {
"type": "array",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "keyVal",
"type": "object",
"properties": {
"key": {
"type": "string"
},
"value": {
"type": "string"
},
"metaKey": {
"type": "string"
},
"childKeys": {
"type": "array",
"items": {
"$ref": "keyVal"
}
}
}
}
}
}
}
},
"when": {
"type": "array",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "keyVal",
"type": "object",
"properties": {
"key": {
"type": "string"
},
"value": {
"type": "string"
},
"metaKey": {
"type": "string"
},
"childKeys": {
"type": "array",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "keyVal",
"type": "object",
"properties": {
"key": {
"type": "string"
},
"value": {
"type": "string"
},
"metaKey": {
"type": "string"
},
"childKeys": {
"type": "array",
"items": {
"$ref": "keyVal"
}
}
}
}
}
}
}
},
"actions": {
"type": "array",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "keyVal",
"type": "object",
"properties": {
"key": {
"type": "string"
},
"value": {
"type": "string"
},
"metaKey": {
"type": "string"
},
"childKeys": {
"type": "array",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "keyVal",
"type": "object",
"properties": {
"key": {
"type": "string"
},
"value": {
"type": "string"
},
"metaKey": {
"type": "string"
},
"childKeys": {
"type": "array",
"items": {
"$ref": "keyVal"
}
}
}
}
}
}
}
}
}
}
}
}
}
}
Example:
{
"rule": {
"ruleId": "d499b28e302c4f2d8ccf1c18f132cb0d",
"name": "Order Rule",
"description": " Loyalty Membership Order",
"eventType": "ORDER",
"ruleType": "ORDER",
"refId": "2399b28e302c4f2d8ccf1c18f132cb0e",
"ruleStatus": "ACTIVE",
"validFrom": "2014-12-10T03:58:00.000Z",
"validTo": "2020-01-17T03:58:00.000Z"
},
"ruleFile": {
"ruleType": "ORDER",
"rules": {
"ruleName": "Order",
"who": [
{
"key": "TIER",
"value": "854606757193476cb47fe1702700eb5d"
}
],
"when": [
{
"key": "ACTIVITY_TYPE",
"value": "ORDER"
},
{
"key": "PRODUCT_ATTRIBUTE",
"value": "CUSTOM",
"childKeys": [
{
"key": "CUSTOM_ATTR_KEY",
"value": "Brand"
},
{
"key": "OPERATOR",
"value": "=="
},
{
"key": "VALUE",
"value": "Apple"
}
]
}
],
"actions": [
{
"key": "AWARD_POINTS",
"value": "100"
}
]
}
}
}
HTTP status code 201
The collection resource has been successfully created.
Headers
- Location: required (string)
The Location of the new resource which was created by the request. The value consists of a single absolute URI.
Example:
http://www.hybris.com/items/myItem
HTTP status code 400
Request syntactically incorrect. Any details will be provided within the response payload.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 400,
"message": "The request payload has incorrect syntax.",
"moreInfo": "https://api.yaas.io/patterns/errortypes.html",
"type": "bad_payload_syntax"
}
HTTP status code 401
Given request is unauthorized. Bad or expired token. Reauthenticate the user. Any details will be provided within the response payload.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 401,
"message": "Authorization: Unauthorized. Bearer TOKEN is invalid",
"type": "insufficient_credentials",
"moreInfo": "https://pattern.yaas.io/errortypes.html"
}
HTTP status code 403
Evaluated request scopes in access token are not sufficient and do not match required scopes.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 403,
"message": "Given request does not have required scopes in access token. It is not authorized to perform this operation.",
"type": "insufficient_permissions"
}
HTTP status code 409
Creation failed because there was a conflict with another resource. Any details will be provided within the response payload.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 409,
"message": "The requested resource could not be created due to server-side validation.",
"moreInfo": "https://api.yaas.io/patterns/errortypes.html",
"type": "conflict_resource"
}
HTTP status code 500
Some server side error occurred.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 500,
"message": "Something went wrong while processing the request. Please contact the administrator.",
"moreInfo": "https://api.yaas.io/patterns/errortypes.html",
"type": "internal_service_error"
}
put /saveRule
Updates a rule and generates a DRL file. Use this endpoint to update an existing rule.
Details:
- A DRL file is generated for rule saved from the rule builder UI
- The DRL is stored as a base64 encoded content in the document repository
Accepted scopes:
- 'sap.loyengine_manage' - Perform create and update operations on Loyalty Rule services
Headers
- Authorization: required (string)
Used to send a valid OAuth2 access token.
Example:
Bearer access_token
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Rule with DRL details",
"type": "object",
"properties": {
"rule": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Rule",
"properties": {
"ruleId": {
"type": "string",
"maxLength": 32
},
"name": {
"type": "string",
"maxLength": 50
},
"description": {
"type": "string",
"maxLength": 150
},
"ruleType": {
"enum": [
"REGISTRATION",
"ORDER",
"REDEEM",
"TIER",
"ACTIVITY",
"EXPIRATION",
"CUSTOM",
"CANCELLATION"
]
},
"refId": {
"type": "string"
},
"ruleFileUrl": {
"type": "string",
"format": "uri",
"deprecated": {
"deprecatedOn": "20160314",
"description": "Rule files are no longer stored as media but within this schema itself in rueFile field"
}
},
"ruleFile": {
"type": "string",
"description": "Base64 encoded binary of the DRL file"
},
"createdBy": {
"type": "string"
},
"updatedBy": {
"type": "string"
},
"ruleStatus": {
"enum": [
"ACTIVE",
"INACTIVE",
"ARCHIVED",
"NEW",
"DELETED"
],
"default": "NEW"
},
"validFrom": {
"type": "string",
"format": "date-time"
},
"validTo": {
"type": "string",
"format": "date-time"
},
"tiers": {
"type": "array",
"uniqueItems": true,
"items": {
"type": "string"
}
}
},
"required": [
"ruleId",
"ruleType",
"name",
"createdBy",
"ruleStatus",
"validFrom",
"validTo"
]
},
"ruleFile": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Rule group: a collection of rulesGens",
"properties": {
"ruleType": {
"enum": [
"REGISTRATION",
"ORDER",
"REDEEM",
"TIER",
"ACTIVITY",
"EXPIRATION",
"CUSTOM",
"CANCELLATION"
]
},
"rules": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "ruleGen",
"properties": {
"ruleName": {
"type": "string",
"maxLength": 50
},
"who": {
"type": "array",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "keyVal",
"type": "object",
"properties": {
"key": {
"type": "string"
},
"value": {
"type": "string"
},
"metaKey": {
"type": "string"
},
"childKeys": {
"type": "array",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "keyVal",
"type": "object",
"properties": {
"key": {
"type": "string"
},
"value": {
"type": "string"
},
"metaKey": {
"type": "string"
},
"childKeys": {
"type": "array",
"items": {
"$ref": "keyVal"
}
}
}
}
}
}
}
},
"when": {
"type": "array",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "keyVal",
"type": "object",
"properties": {
"key": {
"type": "string"
},
"value": {
"type": "string"
},
"metaKey": {
"type": "string"
},
"childKeys": {
"type": "array",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "keyVal",
"type": "object",
"properties": {
"key": {
"type": "string"
},
"value": {
"type": "string"
},
"metaKey": {
"type": "string"
},
"childKeys": {
"type": "array",
"items": {
"$ref": "keyVal"
}
}
}
}
}
}
}
},
"actions": {
"type": "array",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "keyVal",
"type": "object",
"properties": {
"key": {
"type": "string"
},
"value": {
"type": "string"
},
"metaKey": {
"type": "string"
},
"childKeys": {
"type": "array",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "keyVal",
"type": "object",
"properties": {
"key": {
"type": "string"
},
"value": {
"type": "string"
},
"metaKey": {
"type": "string"
},
"childKeys": {
"type": "array",
"items": {
"$ref": "keyVal"
}
}
}
}
}
}
}
}
}
}
}
}
}
}
Example:
{
"rule": {
"ruleId": "d499b28e302c4f2d8ccf1c18f132cb0d",
"name": "Order Rule",
"description": " Loyalty Membership Order",
"eventType": "ORDER",
"ruleType": "ORDER",
"refId": "2399b28e302c4f2d8ccf1c18f132cb0e",
"ruleStatus": "ACTIVE",
"validFrom": "2014-12-10T03:58:00.000Z",
"validTo": "2020-01-17T03:58:00.000Z"
},
"ruleFile": {
"ruleType": "ORDER",
"rules": {
"ruleName": "Order",
"who": [
{
"key": "TIER",
"value": "854606757193476cb47fe1702700eb5d"
}
],
"when": [
{
"key": "ACTIVITY_TYPE",
"value": "ORDER"
},
{
"key": "PRODUCT_ATTRIBUTE",
"value": "CUSTOM",
"childKeys": [
{
"key": "CUSTOM_ATTR_KEY",
"value": "Brand"
},
{
"key": "OPERATOR",
"value": "=="
},
{
"key": "VALUE",
"value": "Apple"
}
]
}
],
"actions": [
{
"key": "AWARD_POINTS",
"value": "100"
}
]
}
}
}
HTTP status code 200
The resource has been successfully updated
Body
Type: application/json
Example:
{
"ruleFileURL": "http://media-repository-v2.test.cf.hybris.com/loyaltyApp/test/media/5463525479ae1910e8850132"
}
HTTP status code 400
Request syntactically incorrect. Any details will be provided within the response payload.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 400,
"message": "The request payload has incorrect syntax.",
"moreInfo": "https://api.yaas.io/patterns/errortypes.html",
"type": "bad_payload_syntax"
}
HTTP status code 401
Given request is unauthorized. Bad or expired token. Reauthenticate the user. Any details will be provided within the response payload.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 401,
"message": "Authorization: Unauthorized. Bearer TOKEN is invalid",
"type": "insufficient_credentials",
"moreInfo": "https://pattern.yaas.io/errortypes.html"
}
HTTP status code 403
Evaluated request scopes in access token are not sufficient and do not match required scopes.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 403,
"message": "Given request does not have required scopes in access token. It is not authorized to perform this operation.",
"type": "insufficient_permissions"
}
HTTP status code 404
The requested resource does not exist.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 404,
"message": "The requested URI does not map to a single element resource.",
"moreInfo": "https://api.yaas.io/patterns/errortypes.html",
"type": "element_resource_non_existing"
}
HTTP status code 409
Creation failed because there was a conflict with another resource. Any details will be provided within the response payload.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 409,
"message": "The requested resource could not be updated due to server-side validation.",
"moreInfo": "https://api.yaas.io/patterns/errortypes.html",
"type": "conflict_resource"
}
HTTP status code 500
Some server side error occurred.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 500,
"message": "Something went wrong while processing the request. Please contact the administrator.",
"moreInfo": "https://api.yaas.io/patterns/errortypes.html",
"type": "internal_service_error"
}
/ruleFile
/ruleFile/{ruleId}
Retrieves the raw json input data of DRL generator to rerender the rule builder UI in edit scenario. This is the same json which is parsed and converted into a DRL in the /saveRule endpoint.
Accepted scopes:
- 'sap.loyengine_view' - Perform read operations on Loyalty Rule services
get /ruleFile/{ruleId}
Retrieves the raw json input data of DRL generator to rerender the rule builder UI in edit scenario. This is the same json which is parsed and converted into a DRL in the /saveRule endpoint.
Accepted scopes:
- 'sap.loyengine_view' - Perform read operations on Loyalty Rule services
URI Parameters
- ruleId: required (string)
Headers
- Authorization: required (string)
Used to send a valid OAuth2 access token.
Example:
Bearer access_token
HTTP status code 401
Given request is unauthorized. Bad or expired token. Reauthenticate the user. Any details will be provided within the response payload.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 401,
"message": "Authorization: Unauthorized. Bearer TOKEN is invalid",
"type": "insufficient_credentials",
"moreInfo": "https://pattern.yaas.io/errortypes.html"
}
HTTP status code 403
Evaluated request scopes in access token are not sufficient and do not match required scopes.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 403,
"message": "Given request does not have required scopes in access token. It is not authorized to perform this operation.",
"type": "insufficient_permissions"
}
/fireRules
This resourceType defines the POST method and their responses for a collection resource.
/fireRules
Executes multiple rules in real time.
Details:
- Executes all the relevant rules for the supplied rule type and activity.
- Calculates points for the supplied member id for the current activity.
- Sends or schedules emails if emails are configured in the rules which are being executed.
- Triggers a custom action event if custom actions are configured in the rules which are being executed
- Response consists of updated points information.
Accepted scopes:
- 'sap.loyengine_manage' - Perform create and update operations on Loyalty Rule services
post /fireRules
Executes multiple rules in real time.
Details:
- Executes all the relevant rules for the supplied rule type and activity.
- Calculates points for the supplied member id for the current activity.
- Sends or schedules emails if emails are configured in the rules which are being executed.
- Triggers a custom action event if custom actions are configured in the rules which are being executed
- Response consists of updated points information.
Accepted scopes:
- 'sap.loyengine_manage' - Perform create and update operations on Loyalty Rule services
Headers
- Authorization: required (string)
Used to send a valid OAuth2 access token.
Example:
Bearer access_token
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "fireRule",
"type": "object",
"properties": {
"ruleType": {
"enum": [
"REGISTRATION",
"ORDER",
"REDEEM",
"TIER",
"ACTIVITY",
"EXPIRATION",
"CUSTOM",
"CANCELLATION"
]
},
"member": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "member",
"properties": {
"memberId": {
"type": "string",
"maxLength": 32
},
"memberNumber": {
"type": "string",
"maxLength": 50
},
"programId": {
"type": "string",
"maxLength": 32
},
"customerId": {
"type": "string",
"maxlength": "32"
},
"customerFirstName": {
"type": "string",
"maxlength": "64"
},
"customerLastName": {
"type": "string",
"maxlength": "64"
},
"customerEmail": {
"type": "string",
"maxlength": "255"
},
"customerPhone": {
"type": "string",
"maxlength": "20"
},
"dateValidFrom": {
"type": "string",
"format": "date-time"
},
"dateValidTo": {
"type": "string",
"format": "date-time"
},
"tierId": {
"type": "string",
"maxLength": 32
},
"tierHistory": {
"type": "array",
"minItems": 1,
"uniqueItems": true,
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Tier Item for a Loyalty Membership Object",
"type": "object",
"properties": {
"tierId": {
"type": "string",
"maxLength": 32
},
"tierUpdateDate": {
"type": "number",
"default": 0
},
"tierActivity": {
"enum": [
"Upgrade",
"Downgrade"
]
}
}
}
},
"totalEarnedPoints": {
"type": "number",
"default": "0"
},
"totalBalancePoints": {
"type": "number",
"default": "0"
},
"totalQualifyingPoints": {
"type": "number",
"default": "0"
},
"totalExpiredPoints": {
"type": "number",
"default": "0"
},
"createdBy": {
"type": "string",
"maxLength": 32
},
"updatedBy": {
"type": "string",
"maxLength": 32
},
"referralCode": {
"type": "string",
"maxLength": 8
},
"memberStatus": {
"enum": [
"ACTIVE",
"INACTIVE",
"CANCELLED",
"REJECTED",
"EXPIRED"
],
"default": "ACTIVE"
},
"customAttributes": {
"type": "array",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Custom Attributes",
"type": "object",
"properties": {
"cname": {
"type": "string",
"maxlength": "255"
},
"cvalue": {
"type": "string",
"maxlength": "255"
}
}
}
},
"description": {
"type": "string",
"maxlen": 250
},
"preferredLanguage": {
"type": "string",
"maxLength": "10"
}
},
"required": [
"memberId",
"memberNumber",
"programId",
"customerId",
"dateValidFrom",
"dateValidTo",
"tierHistory",
"createdBy",
"memberStatus"
]
},
"memberActivity": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "memberActivity",
"properties": {
"memberActivityId": {
"type": "string",
"maxLength": 32
},
"memberId": {
"type": "string",
"maxLength": 32
},
"refId": {
"type": "string"
},
"activityType": {
"enum": [
"Registration",
"Order",
"Redeem",
"Rating",
"Review",
"Referral",
"Award",
"Deduct",
"Expiration",
"Expiration_Qualifying",
"Activity",
"Custom",
"Cancellation"
]
},
"transactionAmount": {
"type": "number",
"default": 0,
"minimum": 0
},
"transactionCurrency": {
"type": "string",
"maxLength": 3
},
"transactionPoints": {
"type": "number",
"default": 0
},
"qualifyingPoints": {
"type": "number",
"default": 0
},
"rulesApplied": {
"type": "array",
"minItems": 1,
"uniqueItems": true,
"items": {
"type": "string"
}
},
"programId": {
"type": "string",
"maxLength": 32
},
"tierId": {
"type": "string",
"maxLength": 32
},
"year": {
"type": "string",
"maxLength": 4
},
"quarter": {
"enum": [
"Q1",
"Q2",
"Q3",
"Q4"
]
},
"month": {
"enum": [
"JAN",
"FEB",
"MAR",
"APR",
"MAY",
"JUN",
"JUL",
"AUG",
"SEP",
"OCT",
"NOV",
"DEC"
]
},
"week": {
"type": "integer",
"minimum": 1,
"maximum": 53
},
"discountId": {
"type": "string",
"maxLength": 50
},
"createdBy": {
"type": "string"
},
"updatedBy": {
"type": "string"
},
"activityStatus": {
"enum": [
"Active",
"Cancelled",
"Rejected",
"Expired",
"Inactive",
"Processed",
"New"
]
},
"customAttributes": {
"type": "array",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Custom Attributes",
"type": "object",
"properties": {
"cname": {
"type": "string",
"maxlength": "255"
},
"cvalue": {
"type": "string",
"maxlength": "255"
}
}
}
},
"description": {
"type": "string",
"maxlen": 250
}
},
"required": [
"memberActivityId",
"memberId",
"refId",
"activityType",
"createdBy",
"activityStatus"
]
},
"productAttributes": {
"type": "array",
"items": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "productAttributes",
"properties": {
"productId": {
"type": "string"
},
"productName": {
"type": "string"
},
"price": {
"type": "number"
},
"quantity": {
"type": "integer"
},
"imageURL": {
"type": "string"
},
"productCategory": {
"type": "array",
"items": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"properties": {
"categoryId": {
"type": "string"
},
"name": {
"type": "string"
},
"description": {
"type": "string"
}
}
}
},
"customAttributes": {
"type": "array",
"items": {
"type": "object",
"properties": {
"key": {
"type": "string"
},
"value": {
"type": "string"
}
}
}
}
}
}
},
"orderAttributes": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "orderAttributes",
"properties": {
"total": {
"type": "number"
},
"subTotal": {
"type": "number"
},
"totalItems": {
"type": "integer"
},
"shippingAmount": {
"type": "number"
},
"discountAmount": {
"type": "number"
},
"shippingCountry": {
"type": "string"
},
"shippingState": {
"type": "string"
},
"transactionCurrency": {
"type": "string"
},
"customAttributes": {
"type": "array",
"items": {
"type": "object",
"properties": {
"key": {
"type": "string"
},
"value": {
"type": "string"
}
}
}
}
}
},
"customAttributes": {
"type": "array",
"items": {
"type": "object",
"properties": {
"key": {
"type": "string"
},
"value": {
"type": "string"
}
}
}
}
}
}
Example:
{
"ruleType": "ORDER",
"member": {
"createdBy": "SYSTEM",
"memberId": "c6fa9055298b406f83567ae287c36f5c",
"programId": "088baaddf3c048999541eda53f68bcc7",
"updatedBy": "SYSTEM",
"memberNumber": "m1234567890",
"customerId": "6cfce0bea7f24779b97a4a2f834c0ce7",
"customerFirstName": "John",
"customerLastName": "Doe",
"customerEmail": "john.doe@gmail.com",
"customerPhone": "(650) 123-1234",
"dateValidFrom": 1409472603511,
"dateValidTo": 1409472603511,
"tierId": "77a451f8eae44f8e9082b37ff1bde179",
"tierHistory": [
{
"tierActivity": "UPGRADE",
"tierUpdateDate": 1409472603511,
"tierId": "13ad15e8fc9046c99d535edf0304a032"
},
{
"tierActivity": "UPGRADE",
"tierUpdateDate": 1409472603513,
"tierId": "33ad15e8fc9046c99d535edf0304a033"
}
],
"totalEarnedPoints": 1000,
"totalBalancePoints": 1000,
"totalQualifyingPoints": 1000,
"totalExpiredPoints": 0,
"memberStatus": "ACTIVE"
},
"memberActivity": {
"createdBy": "SYSTEM",
"memberActivityId": "dddd9055298b406f83567ae287c36f5c",
"memberId": "cccc9055298b406f83567ae287c36f5c",
"quarter": "Q_1",
"week": 3,
"refId": "",
"activityType": "ORDER",
"transactionAmount": 1398,
"transactionCurrency": "USD",
"transactionPoints": 0,
"qualifyingPoints": 0,
"rulesApplied": [
"test"
],
"programId": "088baaddf3c048999541eda53f68bcc7",
"tierId": "29f0f3dd405c449d878e3246dd122bb7",
"discountId": "",
"updatedBy": "SYSTEM",
"activityStatus": "ACTIVE",
"year": "2015",
"month": "JAN"
},
"productAttributes": [
{
"productId": "55518618a86e7c1f624d03c5",
"productName": "Apple Iphone 6",
"price": 699,
"quantity": 2,
"imageURL": "www.google.com",
"productCategory": [
{
"categoryId": "320610816",
"name": "Mobiles"
},
{
"categoryId": "473601024",
"name": "Tablets"
}
],
"customAttributes": [
{
"key": "STORE_ID",
"value": "123456"
}
]
}
],
"customAttributes": [
{
"key": "STORE_ID",
"value": "123456"
}
],
"orderAttributes": {
"total": 1403,
"subTotal": 1398,
"shippingAmount": 5,
"discountAmount": 0,
"shippingCountry": "USA",
"shippingState": "NC",
"customAttributes": [
{
"key": "STORE_ID",
"value": "123456"
}
]
}
}
HTTP status code 200
Body
Type: application/json
Example:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "fireRuleResponse",
"type": "object",
"properties": {
"membershipId": {
"type": "string",
"description": "Loyalty Membership Identifier",
"maxLength": 32
},
"qualifyingPointsEarned": {
"type": "number",
"description": "Qualifying Points Earned in this transaction",
"default": 0
},
"redeemablePointsEarned": {
"type": "number",
"description": "Redeemable Points Earned in this transaction",
"default": 0
},
"redeemablePointsUsed": {
"type": "number",
"description": "Redeemable Points Used in this transaction",
"default": 0
},
"redeemablePointsBalance": {
"type": "number",
"description": "Total Redeemable Points remaining after this transaction",
"default": 0
},
"qualifyingPointsBalance": {
"type": "number",
"description": "Total Qualifying Points remaining after this transaction",
"default": 0
},
"qualifyingPointsExpired": {
"type": "number",
"description": "Total Qualifying Points expired",
"default": 0
},
"redeemablePointsExpired": {
"type": "number",
"description": "Total Redeemable Points expired",
"default": 0
},
"processingTime": {
"type": "string",
"description": "Total processing time( in ms) for this rule execution",
"maxLength": 32
},
"processedAt": {
"type": "string",
"description": "Start time of this rule execution",
"format": "date-time"
},
"newTierId": {
"type": "string",
"description": "New Tier ID on tier upgrade",
"maxLength": 32
},
"rulesApplied": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": [
"membershipId",
"qualifyingPointsEarned",
"redeemablePointsEarned",
"redeemablePointsBalance",
"qualifyingPointsBalance",
"processedAt"
]
}
HTTP status code 201
The collection resource has been successfully created.
Headers
- Location: required (string)
The Location of the new resource which was created by the request. The value consists of a single absolute URI.
Example:
http://www.hybris.com/items/myItem
HTTP status code 400
Request syntactically incorrect. Any details will be provided within the response payload.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 400,
"message": "The request payload has incorrect syntax.",
"moreInfo": "https://api.yaas.io/patterns/errortypes.html",
"type": "bad_payload_syntax"
}
HTTP status code 401
Given request is unauthorized. Bad or expired token. Reauthenticate the user. Any details will be provided within the response payload.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 401,
"message": "Authorization: Unauthorized. Bearer TOKEN is invalid",
"type": "insufficient_credentials",
"moreInfo": "https://pattern.yaas.io/errortypes.html"
}
HTTP status code 403
Evaluated request scopes in access token are not sufficient and do not match required scopes.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 403,
"message": "Given request does not have required scopes in access token. It is not authorized to perform this operation.",
"type": "insufficient_permissions"
}
HTTP status code 409
Creation failed because there was a conflict with another resource. Any details will be provided within the response payload.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 409,
"message": "The requested resource could not be created due to server-side validation.",
"moreInfo": "https://api.yaas.io/patterns/errortypes.html",
"type": "conflict_resource"
}
HTTP status code 500
Some server side error occurred.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 500,
"message": "Something went wrong while processing the request. Please contact the administrator.",
"moreInfo": "https://pattern.yaas.io/errortypes.html",
"type": "internal_service_error"
}
/dummyFire
This resourceType defines the POST method and their responses for a collection resource.
/dummyFire
Displays the points that the customer may accrue for an order
Details:
- Executes all the relevant rules for the supplied rule type and activity.
- Calculates points for the supplied member id for the current activity.
- Response consists of updated points information.
Accepted scopes:
- 'sap.loyengine_manage' - Perform create and update operations on Loyalty Rule services
post /dummyFire
Displays the points that the customer may accrue for an order
Details:
- Executes all the relevant rules for the supplied rule type and activity.
- Calculates points for the supplied member id for the current activity.
- Response consists of updated points information.
Accepted scopes:
- 'sap.loyengine_manage' - Perform create and update operations on Loyalty Rule services
Headers
- Authorization: required (string)
Used to send a valid OAuth2 access token.
Example:
Bearer access_token
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "dummyFire",
"type": "object",
"properties": {
"ruleType": {
"enum": [
"REGISTRATION",
"ORDER",
"REDEEM",
"TIER",
"ACTIVITY",
"EXPIRATION",
"CUSTOM",
"CANCELLATION"
]
},
"member": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "member",
"properties": {
"memberId": {
"type": "string",
"maxLength": 32
},
"memberNumber": {
"type": "string",
"maxLength": 50
},
"programId": {
"type": "string",
"maxLength": 32
},
"customerId": {
"type": "string",
"maxlength": "32"
},
"customerFirstName": {
"type": "string",
"maxlength": "64"
},
"customerLastName": {
"type": "string",
"maxlength": "64"
},
"customerEmail": {
"type": "string",
"maxlength": "255"
},
"customerPhone": {
"type": "string",
"maxlength": "20"
},
"dateValidFrom": {
"type": "string",
"format": "date-time"
},
"dateValidTo": {
"type": "string",
"format": "date-time"
},
"tierId": {
"type": "string",
"maxLength": 32
},
"tierHistory": {
"type": "array",
"minItems": 1,
"uniqueItems": true,
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Tier Item for a Loyalty Membership Object",
"type": "object",
"properties": {
"tierId": {
"type": "string",
"maxLength": 32
},
"tierUpdateDate": {
"type": "number",
"default": 0
},
"tierActivity": {
"enum": [
"Upgrade",
"Downgrade"
]
}
}
}
},
"totalEarnedPoints": {
"type": "number",
"default": "0"
},
"totalBalancePoints": {
"type": "number",
"default": "0"
},
"totalQualifyingPoints": {
"type": "number",
"default": "0"
},
"totalExpiredPoints": {
"type": "number",
"default": "0"
},
"createdBy": {
"type": "string",
"maxLength": 32
},
"updatedBy": {
"type": "string",
"maxLength": 32
},
"referralCode": {
"type": "string",
"maxLength": 8
},
"memberStatus": {
"enum": [
"ACTIVE",
"INACTIVE",
"CANCELLED",
"REJECTED",
"EXPIRED"
],
"default": "ACTIVE"
},
"customAttributes": {
"type": "array",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Custom Attributes",
"type": "object",
"properties": {
"cname": {
"type": "string",
"maxlength": "255"
},
"cvalue": {
"type": "string",
"maxlength": "255"
}
}
}
},
"description": {
"type": "string",
"maxlen": 250
},
"preferredLanguage": {
"type": "string",
"maxLength": "10"
}
},
"required": [
"memberId",
"memberNumber",
"programId",
"customerId",
"dateValidFrom",
"dateValidTo",
"tierHistory",
"createdBy",
"memberStatus"
]
},
"memberActivity": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "memberActivity",
"properties": {
"memberActivityId": {
"type": "string",
"maxLength": 32
},
"memberId": {
"type": "string",
"maxLength": 32
},
"refId": {
"type": "string"
},
"activityType": {
"enum": [
"Registration",
"Order",
"Redeem",
"Rating",
"Review",
"Referral",
"Award",
"Deduct",
"Expiration",
"Expiration_Qualifying",
"Activity",
"Custom",
"Cancellation"
]
},
"transactionAmount": {
"type": "number",
"default": 0,
"minimum": 0
},
"transactionCurrency": {
"type": "string",
"maxLength": 3
},
"transactionPoints": {
"type": "number",
"default": 0
},
"qualifyingPoints": {
"type": "number",
"default": 0
},
"rulesApplied": {
"type": "array",
"minItems": 1,
"uniqueItems": true,
"items": {
"type": "string"
}
},
"programId": {
"type": "string",
"maxLength": 32
},
"tierId": {
"type": "string",
"maxLength": 32
},
"year": {
"type": "string",
"maxLength": 4
},
"quarter": {
"enum": [
"Q1",
"Q2",
"Q3",
"Q4"
]
},
"month": {
"enum": [
"JAN",
"FEB",
"MAR",
"APR",
"MAY",
"JUN",
"JUL",
"AUG",
"SEP",
"OCT",
"NOV",
"DEC"
]
},
"week": {
"type": "integer",
"minimum": 1,
"maximum": 53
},
"discountId": {
"type": "string",
"maxLength": 50
},
"createdBy": {
"type": "string"
},
"updatedBy": {
"type": "string"
},
"activityStatus": {
"enum": [
"Active",
"Cancelled",
"Rejected",
"Expired",
"Inactive",
"Processed",
"New"
]
},
"customAttributes": {
"type": "array",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Custom Attributes",
"type": "object",
"properties": {
"cname": {
"type": "string",
"maxlength": "255"
},
"cvalue": {
"type": "string",
"maxlength": "255"
}
}
}
},
"description": {
"type": "string",
"maxlen": 250
}
},
"required": [
"memberActivityId",
"memberId",
"refId",
"activityType",
"createdBy",
"activityStatus"
]
},
"productAttributes": {
"type": "array",
"items": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "productAttributes",
"properties": {
"productId": {
"type": "string"
},
"productName": {
"type": "string"
},
"price": {
"type": "number"
},
"quantity": {
"type": "integer"
},
"imageURL": {
"type": "string"
},
"productCategory": {
"type": "array",
"items": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"properties": {
"categoryId": {
"type": "string"
},
"name": {
"type": "string"
},
"description": {
"type": "string"
}
}
}
},
"customAttributes": {
"type": "array",
"items": {
"type": "object",
"properties": {
"key": {
"type": "string"
},
"value": {
"type": "string"
}
}
}
}
}
}
},
"orderAttributes": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "orderAttributes",
"properties": {
"total": {
"type": "number"
},
"subTotal": {
"type": "number"
},
"totalItems": {
"type": "integer"
},
"shippingAmount": {
"type": "number"
},
"discountAmount": {
"type": "number"
},
"shippingCountry": {
"type": "string"
},
"shippingState": {
"type": "string"
},
"transactionCurrency": {
"type": "string"
},
"customAttributes": {
"type": "array",
"items": {
"type": "object",
"properties": {
"key": {
"type": "string"
},
"value": {
"type": "string"
}
}
}
}
}
},
"customAttributes": {
"type": "array",
"items": {
"type": "object",
"properties": {
"key": {
"type": "string"
},
"value": {
"type": "string"
}
}
}
}
}
}
Example:
{
"ruleType": "ORDER",
"member": {
"createdBy": "SYSTEM",
"memberId": "c6fa9055298b406f83567ae287c36f5c",
"programId": "088baaddf3c048999541eda53f68bcc7",
"updatedBy": "SYSTEM",
"memberNumber": "m1234567890",
"customerId": "6cfce0bea7f24779b97a4a2f834c0ce7",
"customerFirstName": "John",
"customerLastName": "Doe",
"customerEmail": "john.doe@gmail.com",
"customerPhone": "(650) 123-1234",
"dateValidFrom": 1409472603511,
"dateValidTo": 1409472603511,
"tierId": "77a451f8eae44f8e9082b37ff1bde179",
"tierHistory": [
{
"tierActivity": "UPGRADE",
"tierUpdateDate": 1409472603511,
"tierId": "13ad15e8fc9046c99d535edf0304a032"
},
{
"tierActivity": "UPGRADE",
"tierUpdateDate": 1409472603513,
"tierId": "33ad15e8fc9046c99d535edf0304a033"
}
],
"totalEarnedPoints": 1000,
"totalBalancePoints": 1000,
"totalQualifyingPoints": 1000,
"totalExpiredPoints": 0,
"memberStatus": "ACTIVE"
},
"memberActivity": {
"createdBy": "SYSTEM",
"memberActivityId": "dddd9055298b406f83567ae287c36f5c",
"memberId": "cccc9055298b406f83567ae287c36f5c",
"quarter": "Q_1",
"week": 3,
"refId": "",
"activityType": "ORDER",
"transactionAmount": 1398,
"transactionCurrency": "USD",
"transactionPoints": 0,
"qualifyingPoints": 0,
"rulesApplied": [
"test"
],
"programId": "088baaddf3c048999541eda53f68bcc7",
"tierId": "29f0f3dd405c449d878e3246dd122bb7",
"discountId": "",
"updatedBy": "SYSTEM",
"activityStatus": "ACTIVE",
"year": "2015",
"month": "JAN"
},
"productAttributes": [
{
"productId": "55518618a86e7c1f624d03c5",
"productName": "Apple Iphone 6",
"price": 699,
"quantity": 2,
"imageURL": "www.google.com",
"productCategory": [
{
"categoryId": "320610816",
"name": "Mobiles"
},
{
"categoryId": "473601024",
"name": "Tablets"
}
],
"customAttributes": [
{
"key": "STORE_ID",
"value": "123456"
}
]
}
],
"customAttributes": [
{
"key": "STORE_ID",
"value": "123456"
}
],
"orderAttributes": {
"total": 1403,
"subTotal": 1398,
"shippingAmount": 5,
"discountAmount": 0,
"shippingCountry": "USA",
"shippingState": "NC",
"customAttributes": [
{
"key": "STORE_ID",
"value": "123456"
}
]
}
}
HTTP status code 200
Body
Type: application/json
Example:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "fireRuleResponse",
"type": "object",
"properties": {
"membershipId": {
"type": "string",
"description": "Loyalty Membership Identifier",
"maxLength": 32
},
"qualifyingPointsEarned": {
"type": "number",
"description": "Qualifying Points Earned in this transaction",
"default": 0
},
"redeemablePointsEarned": {
"type": "number",
"description": "Redeemable Points Earned in this transaction",
"default": 0
},
"redeemablePointsUsed": {
"type": "number",
"description": "Redeemable Points Used in this transaction",
"default": 0
},
"redeemablePointsBalance": {
"type": "number",
"description": "Total Redeemable Points remaining after this transaction",
"default": 0
},
"qualifyingPointsBalance": {
"type": "number",
"description": "Total Qualifying Points remaining after this transaction",
"default": 0
},
"qualifyingPointsExpired": {
"type": "number",
"description": "Total Qualifying Points expired",
"default": 0
},
"redeemablePointsExpired": {
"type": "number",
"description": "Total Redeemable Points expired",
"default": 0
},
"processingTime": {
"type": "string",
"description": "Total processing time( in ms) for this rule execution",
"maxLength": 32
},
"processedAt": {
"type": "string",
"description": "Start time of this rule execution",
"format": "date-time"
},
"newTierId": {
"type": "string",
"description": "New Tier ID on tier upgrade",
"maxLength": 32
},
"rulesApplied": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": [
"membershipId",
"qualifyingPointsEarned",
"redeemablePointsEarned",
"redeemablePointsBalance",
"qualifyingPointsBalance",
"processedAt"
]
}
HTTP status code 201
The collection resource has been successfully created.
Headers
- Location: required (string)
The Location of the new resource which was created by the request. The value consists of a single absolute URI.
Example:
http://www.hybris.com/items/myItem
HTTP status code 400
Request syntactically incorrect. Any details will be provided within the response payload.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 400,
"message": "The request payload has incorrect syntax.",
"moreInfo": "https://api.yaas.io/patterns/errortypes.html",
"type": "bad_payload_syntax"
}
HTTP status code 401
Given request is unauthorized. Bad or expired token. Reauthenticate the user. Any details will be provided within the response payload.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 401,
"message": "Authorization: Unauthorized. Bearer TOKEN is invalid",
"type": "insufficient_credentials",
"moreInfo": "https://pattern.yaas.io/errortypes.html"
}
HTTP status code 403
Evaluated request scopes in access token are not sufficient and do not match required scopes.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 403,
"message": "Given request does not have required scopes in access token. It is not authorized to perform this operation.",
"type": "insufficient_permissions"
}
HTTP status code 409
Creation failed because there was a conflict with another resource. Any details will be provided within the response payload.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 409,
"message": "The requested resource could not be created due to server-side validation.",
"moreInfo": "https://api.yaas.io/patterns/errortypes.html",
"type": "conflict_resource"
}
HTTP status code 500
Some server side error occurred.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 500,
"message": "Something went wrong while processing the request. Please contact the administrator.",
"moreInfo": "https://pattern.yaas.io/errortypes.html",
"type": "internal_service_error"
}
/scheduledJobs
This resourceType defines the GET, POST, DELETE methods and their responses for a collection resource.
/scheduledJobs
Do not use. Lists all scheduled jobs such as scheduled emails and expiration jobs.
Accepted scopes:
- 'sap.loyengine_view' - Perform read operations on Loyalty Rule services
get /scheduledJobs
Do not use. Lists all scheduled jobs such as scheduled emails and expiration jobs.
Accepted scopes:
- 'sap.loyengine_view' - Perform read operations on Loyalty Rule services
Headers
- Authorization: required (string)
Used to send a valid OAuth2 access token.
Example:
Bearer access_token
HTTP status code 200
Resource successfully retrieved.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Scheduled Jobs List",
"type": "array",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Scheduled Jobs",
"type": "object",
"properties": {
"jobId": {
"type": "string",
"maxLength": 32
},
"jobDescription": {
"type": "string",
"maxLength": 50
},
"nextFireTime": {
"type": "string",
"format": "date-time"
},
"previousFireTime": {
"type": "string",
"format": "date-time"
},
"status": {
"type": "string",
"maxLength": 32
}
}
}
}
Example:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Scheduled Jobs List",
"type": "array",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Scheduled Jobs",
"type": "object",
"properties": {
"jobId": {
"type": "string",
"maxLength": 32
},
"jobDescription": {
"type": "string",
"maxLength": 50
},
"nextFireTime": {
"type": "string",
"format": "date-time"
},
"previousFireTime": {
"type": "string",
"format": "date-time"
},
"status": {
"type": "string",
"maxLength": 32
}
}
}
}
HTTP status code 401
Given request is unauthorized. Bad or expired token. Reauthenticate the user. Any details will be provided within the response payload.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 401,
"message": "Authorization: Unauthorized. Bearer TOKEN is invalid",
"type": "insufficient_credentials",
"moreInfo": "https://pattern.yaas.io/errortypes.html"
}
HTTP status code 403
Evaluated request scopes in access token are not sufficient and do not match required scopes.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 403,
"message": "Given request does not have required scopes in access token. It is not authorized to perform this operation.",
"type": "insufficient_permissions"
}
HTTP status code 500
Some server side error occurred.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 500,
"message": "Something went wrong while processing the request. Please contact the administrator.",
"moreInfo": "https://pattern.yaas.io/errortypes.html",
"type": "internal_service_error"
}
/rewardInfo/{memberId}
This resource type defines the GET method and its responses for a single element resource.
/rewardInfo/{memberId}
Gets reward point details for the supplied memberId.
Details:
- Response contains the current tier details, next tier details, current points balance.
- This endpoint can be used to project the members progress through the tiers of the Loyalty program.
get /rewardInfo/{memberId}
Gets reward point details for the supplied memberId.
Details:
- Response contains the current tier details, next tier details, current points balance.
- This endpoint can be used to project the members progress through the tiers of the Loyalty program.
URI Parameters
- memberId: required (string)
member id
Example:
d499b28e302c4f2d8ccf1c18f132cb0d
Headers
- Authorization: required (string)
Used to send a valid OAuth2 access token.
Example:
Bearer access_token
HTTP status code 200
rewardInfo successfully retrieved.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Job",
"type": "object",
"properties": {
"memberId": {
"type": "string"
},
"currentTierId": {
"type": "string"
},
"currentTierName": {
"type": "string"
},
"nextTierId": {
"type": "string"
},
"nextTierName": {
"type": "string"
},
"nextTierThreshold": {
"type": "number",
"default": 0
},
"totalBalancePoints": {
"type": "number",
"default": 0
},
"totalQualifyingPoints": {
"type": "number",
"default": 0
}
}
}
HTTP status code 401
Given request is unauthorized. Bad or expired token. Reauthenticate the user. Any details will be provided within the response payload.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 401,
"message": "Authorization: Unauthorized. Bearer TOKEN is invalid",
"type": "insufficient_credentials",
"moreInfo": "https://pattern.yaas.io/errortypes.html"
}
HTTP status code 403
Evaluated request scopes in access token are not sufficient and do not match required scopes.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 403,
"message": "Given request does not have required scopes in access token. It is not authorized to perform this operation.",
"type": "insufficient_permissions"
}
HTTP status code 404
The requested resource does not exist.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 404,
"message": "The requested URI does not map to a single element resource.",
"moreInfo": "https://api.yaas.io/patterns/errortypes.html",
"type": "element_resource_non_existing"
}
HTTP status code 500
Some server side error occurred.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 500,
"message": "Something went wrong while processing the request. Please contact the administrator.",
"moreInfo": "https://api.yaas.io/patterns/errortypes.html",
"type": "internal_service_error"
}
/customActions
This resourceType defines the GET, POST, DELETE methods and their responses for a collection resource.
/customActions
Gets all custom actions
Accepted scopes:
- 'sap.loyengine_view' - Perform read operations on Loyalty Rule services
Creates a new custom action for rule execution
Accepted scopes:
- 'sap.loyengine_manage' - Perform create and update operations on Loyalty Rule services
get /customActions
Gets all custom actions
Accepted scopes:
- 'sap.loyengine_view' - Perform read operations on Loyalty Rule services
Headers
- Authorization: required (string)
Used to send a valid OAuth2 access token.
Example:
Bearer access_token
Query Parameters
- sort: (string)
The list of comma-separated values. Property identifiers used to sort the result. By default, the column values are sorted in ascending order. If preceded by a minus sign (-), the values are sorted in descending order.
Example:
name,-description
- q: (string)
The simple query criteria based on available fields to limit returned results or a set of modified documents.
Example:
species:cat breed:"Norwegian Forest Cat" weight:(>3 AND <=5) age:(3,5,6) condition:exists
- pageNumber: (integer - minimum: 1)
The page number to be retrieved where the size of the pages must be specified by the pageSize parameter. The number of the first page is 1.
Example:
5
- pageSize: (integer - minimum: 1)
The number of records retrieved at one time.
Example:
45
HTTP status code 200
Resource successfully retrieved.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Collection of Custom Actions",
"type": "array",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Custom Actions",
"type": "object",
"properties": {
"customActionId": {
"type": "string",
"maxLength": 32
},
"name": {
"type": "string",
"maxLength": 50
},
"description": {
"type": "string",
"maxLength": 150
},
"createdBy": {
"type": "string"
},
"updatedBy": {
"type": "string"
},
"customActionStatus": {
"enum": [
"ACTIVE",
"INACTIVE"
],
"default": "ACTIVE"
}
},
"required": [
"customActionId",
"name",
"description"
]
}
}
Example:
{
"customActionId": "d499b28e302c4f2d8ccf1c18f132cb0d",
"name": "Send an SMS",
"description": "Custom API which will send SMS to customer ",
"createdBy": "sysadmin@felton.com",
"updatedBy": "sysadmin@felton.com",
"customActionStatus": "ACTIVE"
}
HTTP status code 400
Request syntactically incorrect. Any details will be provided within the response payload.
HTTP status code 401
Given request is unauthorized. Bad or expired token. Reauthenticate the user. Any details will be provided within the response payload.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 401,
"message": "Authorization: Unauthorized. Bearer TOKEN is invalid",
"type": "insufficient_credentials",
"moreInfo": "https://pattern.yaas.io/errortypes.html"
}
HTTP status code 403
Evaluated request scopes in access token are not sufficient and do not match required scopes.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 403,
"message": "Given request does not have required scopes in access token. It is not authorized to perform this operation.",
"type": "insufficient_permissions"
}
HTTP status code 500
Some server side error occurred.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 500,
"message": "Something went wrong while processing the request. Please contact the administrator.",
"moreInfo": "https://pattern.yaas.io/errortypes.html",
"type": "internal_service_error"
}
post /customActions
Creates a new custom action for rule execution
Accepted scopes:
- 'sap.loyengine_manage' - Perform create and update operations on Loyalty Rule services
Headers
- Authorization: required (string)
Used to send a valid OAuth2 access token.
Example:
Bearer access_token
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Custom Actions",
"type": "object",
"properties": {
"customActionId": {
"type": "string",
"maxLength": 32
},
"name": {
"type": "string",
"maxLength": 50
},
"description": {
"type": "string",
"maxLength": 150
},
"createdBy": {
"type": "string"
},
"updatedBy": {
"type": "string"
},
"customActionStatus": {
"enum": [
"ACTIVE",
"INACTIVE"
],
"default": "ACTIVE"
}
},
"required": [
"customActionId",
"name",
"description"
]
}
Example:
{
"customActionId": "d499b28e302c4f2d8ccf1c18f132cb0d",
"name": "Send an SMS",
"description": "Custom API which will send SMS to customer ",
"createdBy": "sysadmin@felton.com",
"updatedBy": "sysadmin@felton.com",
"customActionStatus": "ACTIVE"
}
HTTP status code 201
The collection resource has been successfully created.
Headers
- Location: required (string)
The Location of the new resource which was created by the request. The value consists of a single absolute URI.
Example:
http://www.hybris.com/items/myItem
HTTP status code 400
Request syntactically incorrect. Any details will be provided within the response payload.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 400,
"message": "The request payload has incorrect syntax.",
"moreInfo": "https://pattern.yaas.io/errortypes.html",
"type": "bad_payload_syntax"
}
HTTP status code 401
Given request is unauthorized. Bad or expired token. Reauthenticate the user. Any details will be provided within the response payload.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 401,
"message": "Authorization: Unauthorized. Bearer TOKEN is invalid",
"type": "insufficient_credentials",
"moreInfo": "https://pattern.yaas.io/errortypes.html"
}
HTTP status code 403
Evaluated request scopes in access token are not sufficient and do not match required scopes.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 403,
"message": "Given request does not have required scopes in access token. It is not authorized to perform this operation.",
"type": "insufficient_permissions"
}
HTTP status code 409
Creation failed because there was a conflict with another resource. Any details will be provided within the response payload.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 409,
"message": "The requested resource could not be created due to server-side validation.",
"moreInfo": "https://pattern.yaas.io/errortypes.html",
"type": "conflict_resource"
}
HTTP status code 500
Some server side error occurred.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 500,
"message": "Something went wrong while processing the request. Please contact the administrator.",
"moreInfo": "https://pattern.yaas.io/errortypes.html",
"type": "internal_service_error"
}
/customActions/aggr
Gets Average, Sum and Count aggregation for custom action
Accepted scopes:
- 'sap.loyengine_view' - Perform read operations on Loyalty Rule services
get /customActions/aggr
Gets Average, Sum and Count aggregation for custom action
Accepted scopes:
- 'sap.loyengine_view' - Perform read operations on Loyalty Rule services
Headers
- Authorization: required (string)
Used to send a valid OAuth2 access token.
Example:
Bearer access_token
Query Parameters
- totalCount: (boolean)
This parameter requests to return the total number of object in the collection fulfilling the criteria together with the response. This number will be returned in the 'hybris-count' header.
Example:
true
- q: (string)
The simple query criteria based on available fields to limit returned results or a set of modified documents.
Example:
species:cat breed:"Norwegian Forest Cat" weight:(>3 AND <=5) age:(3,5,6) condition:exists
- avg: (string)
List of comma separated attributes for Average
Example:
attribute1, attribute2
- sum: (string)
List of comma separated attributes for Sum
Example:
attribute1, attribute2
HTTP status code 200
Headers
- hybris-count: (integer)
The total number of objects that fulfil the criteria.
Example:
1000
HTTP status code 400
Request syntactically incorrect. Any details will be provided within the response payload.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 400,
"message": "There are validation problems, see details section for more information",
"moreInfo": "https://pattern.yaas.io/errortypes.html",
"type": "validation_violation",
"details": [
{
"field": "totalCount",
"message": "must be a boolean",
"type": "invalid_query_parameter"
}
]
}
HTTP status code 401
Given request is unauthorized. Bad or expired token. Reauthenticate the user. Any details will be provided within the response payload.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 401,
"message": "Authorization: Unauthorized. Bearer TOKEN is invalid",
"type": "insufficient_credentials",
"moreInfo": "https://pattern.yaas.io/errortypes.html"
}
HTTP status code 403
Evaluated request scopes in access token are not sufficient and do not match required scopes.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 403,
"message": "Given request does not have required scopes in access token. It is not authorized to perform this operation.",
"type": "insufficient_permissions"
}
/customActions/{customActionId}
This resource type defines the GET, PUT, DELETE methods and their responses for a single element resource.
Gets a specific custom action of a Loyalty program based on the id provided
Accepted scopes:
- 'sap.loyengine_view' - Perform read operations on Loyalty Rule services
Updates a specific custom action based on the id provided
Accepted scopes:
- 'sap.loyengine_manage' - Perform create and update operations on Loyalty Rule services
Deletes a specific custom action based on the id provided
Accepted scopes:
- 'sap.loyengine_delete' - Perform delete operations on Loyalty Rule services
get /customActions/{customActionId}
Gets a specific custom action of a Loyalty program based on the id provided
Accepted scopes:
- 'sap.loyengine_view' - Perform read operations on Loyalty Rule services
URI Parameters
- customActionId: required (string)
the id of the custom action to work on
Example:
d499b28e302c4f2d8ccf1c18f132cb0d
Headers
- Authorization: required (string)
Used to send a valid OAuth2 access token.
Example:
Bearer access_token
HTTP status code 200
customAction successfully retrieved.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Custom Actions",
"type": "object",
"properties": {
"customActionId": {
"type": "string",
"maxLength": 32
},
"name": {
"type": "string",
"maxLength": 50
},
"description": {
"type": "string",
"maxLength": 150
},
"createdBy": {
"type": "string"
},
"updatedBy": {
"type": "string"
},
"customActionStatus": {
"enum": [
"ACTIVE",
"INACTIVE"
],
"default": "ACTIVE"
}
},
"required": [
"customActionId",
"name",
"description"
]
}
Example:
{
"customActionId": "d499b28e302c4f2d8ccf1c18f132cb0d",
"name": "Send an SMS",
"description": "Custom API which will send SMS to customer ",
"createdBy": "sysadmin@felton.com",
"updatedBy": "sysadmin@felton.com",
"customActionStatus": "ACTIVE"
}
HTTP status code 401
Given request is unauthorized. Bad or expired token. Reauthenticate the user. Any details will be provided within the response payload.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 401,
"message": "Authorization: Unauthorized. Bearer TOKEN is invalid",
"type": "insufficient_credentials",
"moreInfo": "https://pattern.yaas.io/errortypes.html"
}
HTTP status code 403
Evaluated request scopes in access token are not sufficient and do not match required scopes.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 403,
"message": "Given request does not have required scopes in access token. It is not authorized to perform this operation.",
"type": "insufficient_permissions"
}
HTTP status code 404
The requested resource does not exist.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 404,
"message": "The requested URI does not map to a single element resource.",
"moreInfo": "https://pattern.yaas.io/errortypes.html",
"type": "element_resource_non_existing"
}
HTTP status code 500
Some server side error occurred.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 500,
"message": "Something went wrong while processing the request. Please contact the administrator.",
"moreInfo": "https://pattern.yaas.io/errortypes.html",
"type": "internal_service_error"
}
put /customActions/{customActionId}
Updates a specific custom action based on the id provided
Accepted scopes:
- 'sap.loyengine_manage' - Perform create and update operations on Loyalty Rule services
URI Parameters
- customActionId: required (string)
the id of the custom action to work on
Example:
d499b28e302c4f2d8ccf1c18f132cb0d
Headers
- Authorization: required (string)
Used to send a valid OAuth2 access token.
Example:
Bearer access_token
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Custom Actions",
"type": "object",
"properties": {
"customActionId": {
"type": "string",
"maxLength": 32
},
"name": {
"type": "string",
"maxLength": 50
},
"description": {
"type": "string",
"maxLength": 150
},
"createdBy": {
"type": "string"
},
"updatedBy": {
"type": "string"
},
"customActionStatus": {
"enum": [
"ACTIVE",
"INACTIVE"
],
"default": "ACTIVE"
}
},
"required": [
"customActionId",
"name",
"description"
]
}
Example:
{
"customActionId": "d499b28e302c4f2d8ccf1c18f132cb0d",
"name": "Send an SMS",
"description": "Custom API which will send SMS to customer ",
"createdBy": "sysadmin@felton.com",
"updatedBy": "sysadmin@felton.com",
"customActionStatus": "ACTIVE"
}
HTTP status code 200
The resource has been successfully updated
HTTP status code 400
Request syntactically incorrect. Any details will be provided within the response payload.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 400,
"message": "The request payload has incorrect syntax.",
"moreInfo": "https://pattern.yaas.io/errortypes.html",
"type": "bad_payload_syntax"
}
HTTP status code 401
Given request is unauthorized. Bad or expired token. Reauthenticate the user. Any details will be provided within the response payload.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 401,
"message": "Authorization: Unauthorized. Bearer TOKEN is invalid",
"type": "insufficient_credentials",
"moreInfo": "https://pattern.yaas.io/errortypes.html"
}
HTTP status code 403
Evaluated request scopes in access token are not sufficient and do not match required scopes.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 403,
"message": "Given request does not have required scopes in access token. It is not authorized to perform this operation.",
"type": "insufficient_permissions"
}
HTTP status code 404
The requested resource does not exist.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 404,
"message": "The requested URI does not map to a single element resource.",
"moreInfo": "https://pattern.yaas.io/errortypes.html",
"type": "element_resource_non_existing"
}
HTTP status code 409
Creation failed because there was a conflict with another resource. Any details will be provided within the response payload.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 409,
"message": "The requested resource could not be updated due to server-side validation.",
"moreInfo": "https://pattern.yaas.io/errortypes.html",
"type": "conflict_resource"
}
HTTP status code 500
Some server side error occurred.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 500,
"message": "Something went wrong while processing the request. Please contact the administrator.",
"moreInfo": "https://pattern.yaas.io/errortypes.html",
"type": "internal_service_error"
}
delete /customActions/{customActionId}
Deletes a specific custom action based on the id provided
Accepted scopes:
- 'sap.loyengine_delete' - Perform delete operations on Loyalty Rule services
URI Parameters
- customActionId: required (string)
the id of the custom action to work on
Example:
d499b28e302c4f2d8ccf1c18f132cb0d
Headers
- Authorization: required (string)
Used to send a valid OAuth2 access token.
Example:
Bearer access_token
HTTP status code 204
The resource has been successfully deleted.
HTTP status code 401
Given request is unauthorized. Bad or expired token. Reauthenticate the user. Any details will be provided within the response payload.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 401,
"message": "Authorization: Unauthorized. Bearer TOKEN is invalid",
"type": "insufficient_credentials",
"moreInfo": "https://pattern.yaas.io/errortypes.html"
}
HTTP status code 403
Evaluated request scopes in access token are not sufficient and do not match required scopes.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 403,
"message": "Given request does not have required scopes in access token. It is not authorized to perform this operation.",
"type": "insufficient_permissions"
}
HTTP status code 404
The requested resource does not exist.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 404,
"message": "The requested URI does not map to a single element resource.",
"moreInfo": "https://pattern.yaas.io/errortypes.html",
"type": "element_resource_non_existing"
}
HTTP status code 500
Some server side error occurred.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 500,
"message": "Something went wrong while processing the request. Please contact the administrator.",
"moreInfo": "https://pattern.yaas.io/errortypes.html",
"type": "internal_service_error"
}
/migration
/migration
Migrates offer data to relevant format for the latest release
Accepted scopes:
- 'sap.loyengine_view' - Required to do read operations
get /migration
Migrates offer data to relevant format for the latest release
Accepted scopes:
- 'sap.loyengine_view' - Required to do read operations
Headers
- Authorization: required (string)
Used to send a valid OAuth2 access token.
Example:
Bearer access_token
HTTP status code 200
Body
Type: application/json
HTTP status code 401
Given request is unauthorized. Bad or expired token. Reauthenticate the user. Any details will be provided within the response payload.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 401,
"message": "Authorization: Unauthorized. Bearer TOKEN is invalid",
"type": "insufficient_credentials",
"moreInfo": "https://pattern.yaas.io/errortypes.html"
}
HTTP status code 403
Evaluated request scopes in access token are not sufficient and do not match required scopes.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 403,
"message": "Given request does not have required scopes in access token. It is not authorized to perform this operation.",
"type": "insufficient_permissions"
}
Events
The topic owner client is: hybris.loy-rule
EVENT TYPE | DESCRIPTION | EXAMPLE |
---|---|---|
customActionInvoked | Triggered when a custom action is invoked during rule processing |
|
Error Types
For more information about error codes, see the detailed error description for each API operation in API Reference. You can also check the standard error codes at API best practices.
Scopes
Scopes are strings that let you specify exactly what type of access you need to resources and operations in the Loyalty Rule service.
The table presents all the scopes supported by the Loyalty Rule service.
Scope | Description |
---|---|
sap.loyengine_view | Use this scope to view existing rules. |
sap.loyengine_manage | Use this scope to create or modify existing rules. |
sap.loyengine_delete | Use this scope to delete an existing rule. |
If a certain operation requires two scopes to be allowed, then your role will need to have these two scopes assigned. Let's see an example where you want to view existing rules and change some properties of the rules and update it:
- You want to view a specific loyalty rule and change some of the properties and update it. To do this operation, your role needs the sap.loyengine_view and sap.loyengine_manage scope.
- However, if you want to view specific loyalty rule and delete it. To do this operation , your role needs the sap.loyengine_view and sap.loyengine_delete scope.
‘Create/Update/Retrieve a rule’
Introduction
This tutorial is about creating, updating and retrieving rules.
The /saveRule is a mashup endpoint which lets you create a new rule. This endpoint is expected to be used by the Rule Builder UI to create and update rules. This mashup orchestrates the creation of a drools DRL file and saves the rule in document repository.
/ruleFile endpoint retrieves the JSON represntation of the rule.
/rule endpoint lets you retrieve the DRL content of the rule.
To perform the basic operations supported by the Loyalty Rule service, you need to be properly authorized. This is achieved through the header that carries the correct access token. The examples in this tutorial will lead you through those operations, showing what you need to provide to the methods, and what you get in return.
clientId = clientIdPlaceholder;
clientSecret = clientSecretPlaceholder;
tenant = projectIdPlaceholder;
client = appIdPlaceholder;;
scopesRequired = 'hybris.tenant='+tenant+' sap.loyengine_manage sap.loyengine_view sap.loyengine_delete';
token = tokenPlaceholder;
assert = chai.assert;
Get access token
To perform any operations with a specific service, you always need an access token. For this purpose, create an API Client for the oAuth2 service:
API.createClient('oAuth2Service',
'/services/oauth2/v1/api.raml');
Now get the token:
AccessToken = oAuth2Service.token.post({
'client_id' : clientId,
'client_secret': clientSecret,
'grant_type' : 'client_credentials',
'token_type': 'Bearer',
'scope': scopesRequired
});
access_token = AccessToken.body.access_token;
Create API client for Loyalty Rule service
API.createClient('ruleService',
'/services/loyaltyrule/v1/api.raml');
Create a new rule
Please note that it is advised to create new rules using the Rule Builder UI instead of API calls. Th creation of a rule requires a JSON input in a very specific format with specific keywords. This is internally handled in the Rule Builder UI.
/saveRule POST will let you create a new rule.This endpoint orchestrates the creation of a DRL file. This DRL content along with other rule data is then saved in the document repository.
response_obj = ruleService.saveRule.post({
"rule":{
"ruleId":"New",
"name":"Tutorial Rule",
"description":"Tutorial Rule",
"ruleType":"ORDER",
"refId":"3fcf90ddcf704d52a8d8da7863d74d11",
"tiers":[
"dd17c36127d146dab2036b37e7650ce2"
],
"createdBy":"arun.suresh@sap.com",
"updatedBy":"arun.suresh@sap.com",
"ruleStatus":"ACTIVE",
"validFrom":"2016-07-14T18:30:00.000Z",
"validTo":"2020-12-30T18:30:00.000Z"
},
"ruleFile":{
"ruleType":"ORDER",
"rules":{
"ruleName":"Tutorial Rule",
"who":[
{
"key":"TIER",
"value":"dd17c36127d146dab2036b37e7650ce2"
}
],
"when":[
{
"key":"ACTIVITY_TYPE",
"value":"ORDER",
"metaKey":"ORDER"
}
],
"actions":[
{
"key":"AWARD_POINTS",
"value":10,
"metaKey":"AWARD_POINTS"
},
{
"key":"SEND_EMAIL",
"value":"OrderEmail",
"metaKey":"SEND_EMAIL"
}
]
}
}
}, {
headers: {
'Authorization': 'Bearer ' + access_token,
'Content-type' : 'application/json'
}
}
)
Retrieve the rule's JSON representation by its id
Retrieve the rule by its id to get a JSON representation of the rule.The Rule Builder UI interprets this JSON representation and renders the UI in a user friendly manner.
ruleLocation = response_obj.headers.location.toString();
ruleId = ruleLocation.substring(ruleLocation.lastIndexOf('/')+1,ruleLocation.length);
response = ruleService.ruleFile.ruleId(ruleId).get(null, {
headers: {
'Authorization': 'Bearer ' + access_token,
'Content-type' : 'application/json'
}
}
)
Retrieve the rule's DRL representation by its id
Retrieve the rule by its id to get a DRL representation of the rule. The response body contains the base64 encoded DRL representation of the rule in the ruleFile field.
response = ruleService.rules.ruleId(ruleId).get(null, {
headers: {
'Authorization': 'Bearer ' + access_token,
'Content-type' : 'application/json'
}
}
)
Update the previously created rule
Now update the rule created previously. Please note that the ruleId field in the JSON payload should have the correct rule id generated previously during the POST operation. In this example we are changing the rule status to INACTIVE.
response = ruleService.saveRule.put({
"rule":{
"ruleId":ruleId,
"name":"Tutorial Rule",
"description":"Tutorial Rule",
"ruleType":"ORDER",
"refId":"3fcf90ddcf704d52a8d8da7863d74d11",
"tiers":[
"dd17c36127d146dab2036b37e7650ce2"
],
"createdBy":"arun.suresh@sap.com",
"updatedBy":"arun.suresh@sap.com",
"ruleStatus":"INACTIVE",
"validFrom":"2016-07-14T18:30:00.000Z",
"validTo":"2020-12-30T18:30:00.000Z"
},
"ruleFile":{
"ruleType":"ORDER",
"rules":{
"ruleName":"Tutorial Rule",
"who":[
{
"key":"TIER",
"value":"dd17c36127d146dab2036b37e7650ce2"
}
],
"when":[
{
"key":"ACTIVITY_TYPE",
"value":"ORDER",
"metaKey":"ORDER"
}
],
"actions":[
{
"key":"AWARD_POINTS",
"value":10,
"metaKey":"AWARD_POINTS"
},
{
"key":"SEND_EMAIL",
"value":"OrderEmail",
"metaKey":"SEND_EMAIL"
}
]
}
}
}, {
headers: {
'Authorization': 'Bearer ' + access_token,
'Content-type' : 'application/json'
}
}
)
Delete the rule by its id
response = ruleService.rules.ruleId(ruleId).delete(null, {
headers: {
'Authorization': 'Bearer ' + access_token,
'Content-type' : 'application/json'
}
}
)
assert.equal(response.status, '204');
Register a custom action
Introduction
You can register a custom action, which a rule can trigger if certain conditions are satisfied. With custom actions you can control the outcome of a rule and trigger your own action instead of the standard actions available in the Rule Builder UI. Implement your own action using any technology, which listens to the customActionInvoked event. The event payload will contain the custom action id which your implementation can then use to perform an appropriate action. /customAction lets you register your custom action, which can be triggered as an outcome of a rule. To perform the basic operations supported by the Loyalty Rule service, you need to be properly authorized. This is achieved through the header that carries the correct access token. The examples in this tutorial will lead you through those operations, showing what you need to provide to the methods, and what you get in return.
clientId = clientIdPlaceholder;
clientSecret = clientSecretPlaceholder;
tenant = projectIdPlaceholder;
client = appIdPlaceholder;
scopesRequired = 'hybris.tenant='+tenant+' sap.loyengine_manage sap.loyengine_view sap.loyengine_delete';
token = tokenPlaceholder;
assert = chai.assert;
Get access token
To perform any operations with a specific service, you always need an access token. For this purpose, create an API Client for the oAuth2 service:
API.createClient('oAuth2Service',
'/services/oauth2/v1/api.raml');
Now get the token:
AccessToken = oAuth2Service.token.post({
'client_id' : clientId,
'client_secret': clientSecret,
'grant_type' : 'client_credentials',
'token_type': 'Bearer',
'scope': scopesRequired
});
access_token = AccessToken.body.access_token;
Create API client for Loyalty Rule service
API.createClient('ruleService',
'/services/loyaltyrule/v1/api.raml');
Register a Custom Action
customAction_obj = ruleService.customActions.post({
'customActionId':'','name':'Send an instant message','customActionStatus':'ACTIVE','description':'Send an instant message using IRC'
}, {
headers: {
'Authorization': 'Bearer ' + access_token,
'Content-type' : 'application/json'
}
}
)
Retrieve the Custom Action created with the previous step
customActionLocation = customAction_obj.headers.location.toString();
customActionId = customActionLocation.substring(customActionLocation.lastIndexOf('/')+1,customActionLocation.length);
ruleService.customActions.customActionId(customActionId).get(null, {
headers: {
'Authorization': 'Bearer ' + access_token,
'Content-type' : 'application/json'
}
}
)
Update the Custom Action object
Perform a partial update on the object:
ruleService.customActions.customActionId(customActionId).put({
'customActionId':customActionId,'name':'Send an instant message','customActionStatus':'INACTIVE','description':'Send an instant message using IRC'
}, {
headers: {
'Authorization': 'Bearer ' + access_token,
'Content-type' : 'application/json'
}
}
)
Retrieve the same Custom Action object to ensure that proper information is updated
Get the Custom Action object to make sure that it was updated.
response = ruleService.customActions.customActionId(customActionId).get(null, {
headers: {
'Authorization': 'Bearer ' + access_token,
'Content-type' : 'application/json'
}
}
)
assert.equal(response.body.customActionStatus, 'INACTIVE');
Delete the above iBeacon Major Object
ruleService.customActions.customActionId(customActionId).delete(null, {
headers: {
'Authorization': 'Bearer ' + access_token,
}
})
Retrieve the deleted Custom Action object to ensure it is really deleted
response = ruleService.customActions.customActionId(customActionId).get(null, {
headers: {
'Authorization': 'Bearer ' + access_token,
'Content-type' : 'application/json'
}
}
)
assert.equal(response.status, '404');
‘Executing custom rules with custom attributes’
Introduction
Loyalty Rule service now supports a custom rule type. Using this rule type, you can deifne a rule with custom attributes to create rule conditions as per your business use case. Before running this interactive tutorial make sure that you have created rule of CUSTOM type using the /saveRule api endpoint or via the builder UI.
You can also use custom attributes with other rule types like ORDER, REGISTRATION, TIER and ACTIVITY.
To perform the basic operations supported by the Loyalty Rule service, you need to be properly authorized. This is achieved through the header that carries the correct access token. The examples in this tutorial will lead you through those operations, showing what you need to provide to the methods, and what you get in return.
clientId = clientIdPlaceholder;
clientSecret = clientSecretPlaceholder;
tenant = projectIdPlaceholder;
client = appIdPlaceholder;;
scopesRequired = 'hybris.tenant='+tenant+' sap.loyengine_manage sap.loyengine_view sap.loyengine_delete';
token = tokenPlaceholder;
assert = chai.assert;
Get access token
To perform any operations with a specific service, you always need an access token. For this purpose, create an API Client for the oAuth2 service:
API.createClient('oAuth2Service',
'/services/oauth2/v1/api.raml');
Now get the token:
AccessToken = oAuth2Service.token.post({
'client_id' : clientId,
'client_secret': clientSecret,
'grant_type' : 'client_credentials',
'token_type': 'Bearer',
'scope': scopesRequired
});
access_token = AccessToken.body.access_token;
Create API client for Loyalty Rule service
API.createClient('ruleService',
'/services/loyaltyrule/v1/api.raml');
Trigger a dummy fire of custom rules
In this example we will perform a dummy fire on custom rules. This will execute all rules of CUSTOM rule type and calculate loyalty points for the activity, but will not perform any actions like sending emails, offers etc which are configured in the rule. This endpoint can thus be used to predict how many loyalty points can be earned for a particular activity.
Edit the below payload to pass an actual member id, tier id and program id.In this example we are passing two custom attributes STORE_ID and PAYMENT_OPTION. Please note the ruleType and the activityType fields, make sure that you pass both the values as CUSTOM.
The default example here is executing rules of type ORDER and activityType ORDER for a member with id ecd42052569c74f563108c6ac6fa000e , belonging to tier with id dd17c36127d146dab2036b37e7650ce2 and program with id 3fcf90ddcf704d52a8d8da7863d74d11.Change these values to match the ones in your project.
The Response of the dummy fire contains information like the qualyfing points earned, redeemable points earned etc for the current transaction or activity.
memberId = "ecd42052569c74f563108c6ac6fa000e";
tierId = "dd17c36127d146dab2036b37e7650ce2";
programId = "3fcf90ddcf704d52a8d8da7863d74d11";
response = ruleService.dummyFire.post({
"ruleType":"CUSTOM",
"memberActivity":{
"createdBy":"SYSTEM",
"memberActivityId":"",
"memberId":memberId,
"quarter":"Q_1",
"week":1,
"refId":"",
"activityType":"CUSTOM",
"transactionAmount":200,
"transactionCurrency":"USD",
"transactionPoints":0,
"qualifyingPoints":0,
"rulesApplied":[
"TEST"
],
"programId":"",
"tierId":"",
"discountId":"",
"updatedBy":"SYSTEM",
"activityStatus":"ACTIVE",
"year":"",
"month":"JAN"
},
"member":{
"createdBy":"C4173571841",
"customerEmail":"arun.suresh@sap.com",
"customerId":"C4173571841",
"dateValidFrom":"2016-04-04T00:00:00.000+0000",
"dateValidTo":"2090-05-05T00:00:00.000+0000",
"memberId":"ecd42052569c74f563108c6ac6fa000e",
"memberNumber":"9743681454",
"memberStatus":"ACTIVE",
"preferredLanguage":"en",
"programId":programId,
"tierHistory":[
{
"tierActivity":"UPGRADE",
"tierId":"dd17c36127d146dab2036b37e7650ce2",
"tierUpdateDate":1459743681470
}
],
"tierId":tierId,
"totalBalancePoints":953,
"totalEarnedPoints":1953,
"totalExpiredPoints":1401,
"totalQualifyingPoints":552,
"updatedBy":"SYSTEM"
},
"customAttributes":[{"key":"STORE_ID","value":"12345"},{"key":"PAYMENT_OPTION","value":"CASH"}
]
}, {
headers: {
'Authorization': 'Bearer ' + access_token,
'Content-type' : 'application/json'
}
}
)
Execute custom rules with custom attributes
In this example we will execute custom rules. This will execute all rules for a given rule type and calculate loyalty points for the activity and perform actions like sending emails, offers etc which are configured in the rule.
Edit the below payload to pass an actual member id, tier id and program id.In this example we are passing two custom attributes STORE_ID and PAYMENT_OPTION. Please note the ruleType and the activityType fields. Make sure that you pass both the values as CUSTOM.
The default example here is executing rules of type CUSTOM and activityType CUSTOM for a member with id ecd42052569c74f563108c6ac6fa000e , belonging to tier with id dd17c36127d146dab2036b37e7650ce2 and program with id 3fcf90ddcf704d52a8d8da7863d74d11.Change these values to match the ones in your project.
The response of /fireRules contains information like the qualifying points earned, redeemable points earned etc for the current transaction or activity.
memberId = "ecd42052569c74f563108c6ac6fa000e";
tierId = "dd17c36127d146dab2036b37e7650ce2";
programId = "3fcf90ddcf704d52a8d8da7863d74d11";
response = ruleService.fireRules.post({
"ruleType":"CUSTOM",
"memberActivity":{
"createdBy":"SYSTEM",
"memberActivityId":"",
"memberId":"ecd42052569c74f563108c6ac6fa000e",
"quarter":"Q_1",
"week":1,
"refId":"",
"activityType":"CUSTOM",
"transactionAmount":200,
"transactionCurrency":"USD",
"transactionPoints":0,
"qualifyingPoints":0,
"rulesApplied":[
"TEST"
],
"programId":"",
"tierId":"",
"discountId":"",
"updatedBy":"SYSTEM",
"activityStatus":"ACTIVE",
"year":"",
"month":"JAN"
},
"member":{
"createdBy":"C4173571841",
"customerEmail":"arun.suresh@sap.com",
"customerId":"C4173571841",
"dateValidFrom":"2016-04-04T00:00:00.000+0000",
"dateValidTo":"2090-05-05T00:00:00.000+0000",
"memberId":"ecd42052569c74f563108c6ac6fa000e",
"memberNumber":"9743681454",
"memberStatus":"ACTIVE",
"preferredLanguage":"en",
"programId":"3fcf90ddcf704d52a8d8da7863d74d11",
"tierHistory":[
{
"tierActivity":"UPGRADE",
"tierId":"dd17c36127d146dab2036b37e7650ce2",
"tierUpdateDate":1459743681470
}
],
"tierId":"dd17c36127d146dab2036b37e7650ce2",
"totalBalancePoints":953,
"totalEarnedPoints":1953,
"totalExpiredPoints":1401,
"totalQualifyingPoints":552,
"updatedBy":"SYSTEM"
},
"customAttributes":[
{
"key":"STORE_ID",
"value":"12345"
},
{
"key":"PAYMENT_OPTION",
"value":"CASH"
}
]
}, {
headers: {
'Authorization': 'Bearer ' + access_token,
'Content-type' : 'application/json'
}
}
)
‘Perform a dummy fire of rules’
Introduction
The existing active rules created in the project can be tested by using the dummy fire feature. This API endpoint will execute all rules for a given rule type and calculate loyalty points for the activity, but will not perform any actions like sending emails, offers etc which are configured in the rule. This endpoint can thus be used to predict how many loyalty points can be earned for a particular activity.To perform the basic operations supported by the Loyalty Rule service, you need to be properly authorized. This is achieved through the header that carries the correct access token. The examples in this tutorial will lead you through those operations, showing what you need to provide to the methods, and what you get in return.
clientId = clientIdPlaceholder;
clientSecret = clientSecretPlaceholder;
tenant = projectIdPlaceholder;
client = appIdPlaceholder;;
scopesRequired = 'hybris.tenant='+tenant+' sap.loyengine_manage sap.loyengine_view sap.loyengine_delete';
token = tokenPlaceholder;
assert = chai.assert;
Get access token
To perform any operations with a specific service, you always need an access token. For this purpose, create an API Client for the oAuth2 service:
API.createClient('oAuth2Service',
'/services/oauth2/v1/api.raml');
Now get the token:
AccessToken = oAuth2Service.token.post({
'client_id' : clientId,
'client_secret': clientSecret,
'grant_type' : 'client_credentials',
'token_type': 'Bearer',
'scope': scopesRequired
});
access_token = AccessToken.body.access_token;
Create API client for Loyalty Rule service
API.createClient('ruleService',
'/services/loyaltyrule/v1/api.raml');
Trigger a dummy fire
Make sure that you have active rules in your project.Edit the below payload to pass an actual member id, tier id and program id.You can additionally also pass product attributes, order attributes and custom attributes. If you are using any of these attributes in the rule conditions, these will be considered while executing the rules.
The default example here is executing rules of type ORDER and activityType ORDERfor a member with id ecd42052569c74f563108c6ac6fa000e , belonging to tier with id dd17c36127d146dab2036b37e7650ce2 and program with id 3fcf90ddcf704d52a8d8da7863d74d11. Change these values to match the ones in your project.
The response of the dummy fire contains information like the qualifying points earned, redeemable points earned etc for the current transaction or activity.
memberId = "ecd42052569c74f563108c6ac6fa000e";
tierId = "dd17c36127d146dab2036b37e7650ce2";
programId = "3fcf90ddcf704d52a8d8da7863d74d11";
response = ruleService.dummyFire.post({
"ruleType":"ORDER",
"memberActivity":{
"createdBy":"SYSTEM",
"memberActivityId":"",
"memberId":memberId,
"quarter":"Q_1",
"week":1,
"refId":"",
"activityType":"ORDER",
"transactionAmount":200,
"transactionCurrency":"USD",
"transactionPoints":0,
"qualifyingPoints":0,
"rulesApplied":[
"TEST"
],
"programId":"",
"tierId":"",
"discountId":"",
"updatedBy":"SYSTEM",
"activityStatus":"ACTIVE",
"year":"",
"month":"JAN"
},
"member":{
"createdBy":"C4173571841",
"customerEmail":"arun.suresh@sap.com",
"customerId":"C4173571841",
"dateValidFrom":"2016-04-04T00:00:00.000+0000",
"dateValidTo":"2090-05-05T00:00:00.000+0000",
"memberId":"ecd42052569c74f563108c6ac6fa000e",
"memberNumber":"9743681454",
"memberStatus":"ACTIVE",
"preferredLanguage":"en",
"programId":programId,
"tierHistory":[
{
"tierActivity":"UPGRADE",
"tierId":"dd17c36127d146dab2036b37e7650ce2",
"tierUpdateDate":1459743681470
}
],
"tierId":tierId,
"totalBalancePoints":953,
"totalEarnedPoints":1953,
"totalExpiredPoints":1401,
"totalQualifyingPoints":552,
"updatedBy":"SYSTEM"
},
"customAttributes":[
],
"productAttributes":[
{
"productId":"56fe2e9448ed90001df646e6",
"productName":"Fossil Chronograph Black Dial Men's Watch - CH2891",
"price":200,
"quantity":1,
"imageURL":"",
"productCategory":[
{
"name":"Watches",
"description":"watches",
"media":[
],
"categoryId":"864139264"
}
],
"customAttributes":[
]
}
],
"orderAttributes":{
"transactionCurrency":"USD",
"total":"",
"subTotal":"",
"shippingAmount":"",
"discountAmount":"",
"shippingCountry":"",
"shippingState":"",
"customAttributes":[
]
}
}, {
headers: {
'Authorization': 'Bearer ' + access_token,
'Content-type' : 'application/json'
}
}
)
‘Execute the rules’
Introduction
The existing active rules created in the project can be executed by using the /fireRules endpoint. This will execute all rules for a given rule type and calculate loyalty points for the activity and perform any actions like sending emails, offers etc which are configured in the rule.To perform the basic operations supported by the Loyalty Rule service, you need to be properly authorized. This is achieved through the header that carries the correct access token. The examples in this tutorial will lead you through those operations, showing what you need to provide to the methods, and what you get in return.
clientId = clientIdPlaceholder;
clientSecret = clientSecretPlaceholder;
tenant = projectIdPlaceholder;
client = appIdPlaceholder;;
scopesRequired = 'hybris.tenant='+tenant+' sap.loyengine_manage sap.loyengine_view sap.loyengine_delete';
token = tokenPlaceholder;
assert = chai.assert;
Get access token
To perform any operations with a specific service, you always need an access token. For this purpose, create an API Client for the oAuth2 service:
API.createClient('oAuth2Service',
'/services/oauth2/v1/api.raml');
Now get the token:
AccessToken = oAuth2Service.token.post({
'client_id' : clientId,
'client_secret': clientSecret,
'grant_type' : 'client_credentials',
'token_type': 'Bearer',
'scope': scopesRequired
});
access_token = AccessToken.body.access_token;
Create API client for Loyalty Rule service
API.createClient('ruleService',
'/services/loyaltyrule/v1/api.raml');
Execute rules of a particular rule type
Make sure that you have active rules in your project. Edit the below payload to pass an actual member id, tier id and program id. You can additionally also pass product attributes, order attributes and custom attributes. If you are using any of these attributes in the rule conditions, these will be considered while executing the rules.
The default example here is executing rules of type CUSTOM and activityType CUSTOM for a member with id ecd42052569c74f563108c6ac6fa000e , belonging to tier with id dd17c36127d146dab2036b37e7650ce2 and program with id 3fcf90ddcf704d52a8d8da7863d74d11.Change these values to match the ones in your project.
The response of /fireRules contains information like the qualifying points earned, redeemable points earned etc for the current transaction or activity.
memberId = "ecd42052569c74f563108c6ac6fa000e";
tierId = "dd17c36127d146dab2036b37e7650ce2";
programId = "3fcf90ddcf704d52a8d8da7863d74d11";
response = ruleService.fireRules.post({
"ruleType":"CUSTOM",
"memberActivity":{
"createdBy":"SYSTEM",
"memberActivityId":"",
"memberId":"ecd42052569c74f563108c6ac6fa000e",
"quarter":"Q_1",
"week":1,
"refId":"",
"activityType":"CUSTOM",
"transactionAmount":200,
"transactionCurrency":"USD",
"transactionPoints":0,
"qualifyingPoints":0,
"rulesApplied":[
"TEST"
],
"programId":"",
"tierId":"",
"discountId":"",
"updatedBy":"SYSTEM",
"activityStatus":"ACTIVE",
"year":"",
"month":"JAN"
},
"member":{
"createdBy":"C4173571841",
"customerEmail":"arun.suresh@sap.com",
"customerId":"C4173571841",
"dateValidFrom":"2016-04-04T00:00:00.000+0000",
"dateValidTo":"2090-05-05T00:00:00.000+0000",
"memberId":"ecd42052569c74f563108c6ac6fa000e",
"memberNumber":"9743681454",
"memberStatus":"ACTIVE",
"preferredLanguage":"en",
"programId":"3fcf90ddcf704d52a8d8da7863d74d11",
"tierHistory":[
{
"tierActivity":"UPGRADE",
"tierId":"dd17c36127d146dab2036b37e7650ce2",
"tierUpdateDate":1459743681470
}
],
"tierId":"dd17c36127d146dab2036b37e7650ce2",
"totalBalancePoints":953,
"totalEarnedPoints":1953,
"totalExpiredPoints":1401,
"totalQualifyingPoints":552,
"updatedBy":"SYSTEM"
},
"customAttributes":[
{
"key":"ACTIVITY",
"value":"TWEET"
},
{
"key":"HASHTAG",
"value":"#SAP"
}
],
"productAttributes":[
{
"productId":"56fe2e9448ed90001df646e6",
"productName":"Fossil Chronograph Black Dial Men's Watch - CH2891",
"price":200,
"quantity":1,
"imageURL":"",
"productCategory":[
{
"name":"Watches",
"description":"watches",
"media":[
],
"categoryId":"864139264"
}
],
"customAttributes":[
]
}
],
"orderAttributes":{
"transactionCurrency":"USD",
"total":"",
"subTotal":"",
"shippingAmount":"",
"discountAmount":"",
"shippingCountry":"",
"shippingState":"",
"customAttributes":[
]
}
}, {
headers: {
'Authorization': 'Bearer ' + access_token,
'Content-type' : 'application/json'
}
}
)
‘Retrieve the progress of a loyalty member’
Introduction
The /rewardInfo endpoint lets you project where the current Loyalty member stands in the loyalty program. The response contains the current tier details, next tier details, current points balance for the supplied member id. This information can be used to project the member's progress through the various tiers of the loyalty program. In order to accurately calculate the progress of the member, a loyalty program must be defined with tiers and tier rules must be set up with details on when to upgrade/downgrade a tier. To perform the basic operations supported by the Loyalty Rule service, you need to be properly authorized. This is achieved through the header that carries the correct access token. The examples in this tutorial will lead you through those operations, showing what you need to provide to the methods, and what you get in return.
clientId = clientIdPlaceholder;
clientSecret = clientSecretPlaceholder;
tenant = projectIdPlaceholder;
client = appIdPlaceholder;;
scopesRequired = 'hybris.tenant='+tenant+' sap.loyengine_manage sap.loyengine_view sap.loyengine_delete';
token = tokenPlaceholder;
assert = chai.assert;
Get access token
To perform any operations with a specific service, you always need an access token. For this purpose, create an API Client for the oAuth2 service:
API.createClient('oAuth2Service',
'/services/oauth2/v1/api.raml');
Now get the token:
AccessToken = oAuth2Service.token.post({
'client_id' : clientId,
'client_secret': clientSecret,
'grant_type' : 'client_credentials',
'token_type': 'Bearer',
'scope': scopesRequired
});
access_token = AccessToken.body.access_token;
Create API client for Loyalty Rule service
API.createClient('ruleService',
'/services/loyaltyrule/v1/api.raml');
Find the loyalty member's progress in the Loyalty Program
Make sure that you have active tier rules in your project. Edit the below payload to pass an actual member id.
The default example here calculates the progress of a loyalty member with id ecd42052569c74f563108c6ac6fa000e. Change this value to match an existing member in your project.
The response of the /rewardInfo contains information like the current tier details, next tier details, current points balance for the supplied member id.
memberId = "ecd42052569c74f563108c6ac6fa000e";
response = ruleService.rewardInfo.memberId(memberId).get(null, {
headers: {
'Authorization': 'Bearer ' + access_token,
'Content-type' : 'application/json'
}
}
)
If you find any information that is unclear or incorrect, please let us know so that we can improve the Dev Portal content.
Use our private help channel. Receive updates over email and contact our specialists directly.
If you need more information about this topic, visit hybris Experts to post your own question and interact with our community and experts.