RCG Loyalty Management Cloud System System API - Implementation Template
home
This API implementation template is a component of the MuleSoft Accelerator for Consumer Goods, which accelerate the implementation of essential integration use cases.
The solution includes pre-built APIs, connectors, and integration templates that help unlock business-critical data from external systems and guide you in adopting best practices synthesized from thousands of customer implementations. Use these assets as is or extend them to meet your company’s unique needs.
Overview
This integration template implements the RCG Loyalty Management System API specification. It can be used to retrieve, create, and update Orders and Customers data.
Getting started
The Getting Started with MuleSoft Accelerators guide provides general information on getting started with the accelerator components. This includes instructions on setting up your local workstation for configuring and deploying the applications. |
Once your workstation has been set up and the application template imported into Anypoint Studio, proceed with the Prerequisites section.
Prerequisites
This implementation template has the following dependency:
- Custom objects
- Custom fields
Custom objects
- Store__c
- fulFillmentLocation__c
- productPriceAdjustment__c
- orderProductTax__c
Custom fields
The following fields must be created in the corresponding objects.
Salesforce Object | Field Label | Field Name | Data Type | Length | Unique* | ExternalId |
---|---|---|---|---|---|---|
Product2 | Global_Product_Id__c | Global_Product_Id__c | Text | 36 | Y | Y |
Order | Global_SalesOrder_Id__c | Global_SalesOrder_Id__c | Text | 36 | Y | Y |
Order | Total_Tax__c | Total_Tax__c | Currency | 10 | N | N |
Order | Shipping__c | Shipping__c | Currency | 16 | N | N |
Order | OrderTotalAmount__c | OrderTotalAmount__c | Formula | N | N | |
Account | Global_Customer_Id__c | Global_Customer_Id__c | Text | 36 | Y | Y |
Loyalty Member Tier | ImageURL__c | ImageURL__c | URL | 255 | N | N |
Loyalty Member Tier | Display__c | Display__c | Text | 255 | N | N |
Store__c | addressLine1__c | addressLine1__c | Text | 255 | N | N |
Store__c | cityName__c | cityName__c | Text | 255 | N | N |
Store__c | countryName__c | countryName__c | Text | 255 | N | N |
Store__c | contactPointType__c | contactPointType__c | Text | 255 | N | N |
Store__c | storeType__c | storeType__c | Text | 255 | N | N |
Store__c | postalCodeText__c | postalCodeText__c | Text | 255 | N | N |
Store__c | stateProvinceName__c | stateProvinceName__c | Text | 255 | N | N |
Store__c | activeFromDate__c | activeFromDate__c | Text | 255 | N | N |
Store__c | orderId__c | orderId__c | Lookup(Order) | 255 | N | N |
fulFillmentLocation__c | addressLine1__c | addressLine1__c | Text | 255 | N | N |
fulFillmentLocation__c | cityName__c | cityName__c | Text | 100 | N | N |
fulFillmentLocation__c | countryName__c | countryName__c | Text | 100 | N | N |
fulFillmentLocation__c | contactPointType__c | contactPointType__c | Text | 100 | N | N |
fulFillmentLocation__c | storeType__c | storeType__c | Text | 100 | N | N |
fulFillmentLocation__c | postalCodeText__c | postalCodeText__c | Text | 20 | N | N |
fulFillmentLocation__c | stateProvinceName__c | stateProvinceName__c | Text | 100 | N | N |
fulFillmentLocation__c | activeFromDate__c | activeFromDate__c | Text | 100 | N | N |
fulFillmentLocation__c | orderId__c | orderId__c | Lookup(Order) | N | N | |
productPriceAdjustment__c | adjustment__c | adjustment__c | Text | 255 | N | N |
productPriceAdjustment__c | reasonCodeType__c | reasonCodeType__c | Text | 255 | N | N |
productPriceAdjustment__c | price__c | price__c | Text | 100 | N | N |
productPriceAdjustment__c | description__c | description__c | Text | 255 | N | N |
productPriceAdjustment__c | priceAdjustmentType__c | priceAdjustmentType__c | Text | 255 | N | N |
productPriceAdjustment__c | orderId__c | orderId__c | Lookup(Order) | N | N | |
orderProductTax__c | salesOrderTaxAmount__c | salesOrderTaxAmount__c | Text | 100 | N | N |
orderProductTax__c | taxRatePercent__c | taxRatePercent__c | Text | 100 | N | N |
orderProductTax__c | taxCode__c | taxCode__c | Text | 100 | N | N |
orderProductTax__c | taxClass__c | taxClass__c | Text | 100 | N | N |
orderProductTax__c | taxAmount__c | taxAmount__c | Text | 100 | N | N |
orderProductTax__c | country__c | country__c | Text | 100 | N | N |
orderProductTax__c | description__c | description__c | Text | 100 | N | N |
orderProductTax__c | orderId__c | orderId__c | Lookup(Order) | N | N |
The following fields in Order object needs to be updated.
Field Name | Type | Updated Values |
---|---|---|
Type | Picklist | ADD_ON, CANCELLATION, INITIAL, JOURNAL, RENEWAL, RETURN, SUBSCRIPTION, UPGRADE |
Status | Picklist | CANCELLED, CREATED, CONFIRMED, DELIVERED, IN_CART, IN_TRANSIT, INVOICED, LOST, PARTIALLY_SHIPPED, PICKUP_AVAILABLE, PROCESSING, REJECTED, RETURNED |
Create Custom Field manually via Salesforce
To create each of these custom fields and enable visibility for them on page layouts:
- Click the Salesforce Setup icon.
- Select the
Object Manager
tab from the Setup home page. - Find and select the target Salesforce object.
- Select the
Fields & Relationships
page. - Click the New button and create the field as specified above.
- Once the field has been created, click the
Set Field-Level Security
button (or do these steps later - see below). - Enable for desired profile, or tick the checkbox next to
Visible
to enable visibility for the desired profile(s).
Repeat these steps for each custom field in the above list.
Tip: Instead of adjusting permissions for each field as you go, if you are only making them available to one or two profiles it may be more efficient to go to the Users -> Profiles -> {profile} -> Object Settings
for each object and adjust the permissions for multiple fields at once.
Deployment
Each Accelerator implementation template in Exchange includes Bash and Windows scripts for building and deploying the APIs to CloudHub. These scripts depend on repositories, global settings, deployment profiles, and associated properties configured in the Maven settings.xml
file. In particular, make sure the common properties for your environment have been provided in the CloudHub-DEV
profile (e.g., Anypoint Platform client ID and secret).
For additional details, please refer to the Application Deployment section of the Getting Started Guide.
Preparation
Ensure the Maven profile CloudHub-RCG-DEV
has been properly configured in your settings.xml
file. In particular, make sure the common properties for your environment have been provided (e.g., Anypoint Platform client ID and secret).
Required property overrides
Many templates can also be run from Anypoint Studio without having to customize the Run/Debug profiles. However, some templates make use of hidden deployment properties to protect sensitive information (e.g., passwords and secret keys). These properties must be supplied to the runtime by updating the configuration profile and adding them as VM arguments. At a minimum, the following properties must be customized to reflect the target deployment environment.
Property Name | Description |
---|---|
api.autodiscoveryID | Required if using API Manager to secure this API |
rcg-loyalty-management-system-api.loyalty-cloud.password | Password for Loyalty Management Cloud org |
rcg-loyalty-management-system-api.loyalty-cloud.consumerKey | Consumer Key of the Connected App |
rcg-loyalty-management-system-api.loyalty-cloud.consumerSecret | Consumer Secret of the Connected App |
rcg-loyalty-management-system-api.loyalty-cloud.securityToken | Security Token of the Connected App |
Additional resources
- The Data mappings tab describes how the request and response data structures are mapped between the API interface and Loyalty Management Cloud.
- Refer to the Accelerators documentation home for more information about the MuleSoft Accelerators.