---
schema_version: "1"
id: 18184a7ba53e7bf069b90f1f0dfccaa087367bd53bccb9ec3c963bea56443435
title: Retail Cloud API
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/industries-integrations/loyalty/references/generated-api-specs/loyalty_retail_api.md
canonical_url: https://developer.salesforce.com/docs/industries/loyalty/references/loyalty_retail_api
source_site: developer.salesforce.com
content_type: documentation
content_hash: c5f192c76aa10bc6ad01424cd0e75aad8babe5332ca428788265ed8822a3dc48
products:
  - Loyalty Management Integrations API
  - Industries Integrations
---
Retail Cloud API

# Retail Cloud API

The integration between Salesforce Retail Cloud and Loyalty Management strengthens the Point-of-Sale (POS) capabilities across the Salesforce ecosystem. The core of this integration involves exposing RESTful APIs within a Salesforce managed package that allows Salesforce Retail Cloud to consume these services via a Service Provider Interface (SPI).

**Version:** 1.0.0

## Servers

*   `/services/apexrest`
*   `/services/apexrest/predictspring01`

## Operations

### GET Search for customers

`GET /services/apexrest/spi/customer/search`

Operation ID: `searchForCustomers`.

Retrieves a list of customers matching the given search criteria.

#### Parameters

*   `firstName` (query, string) Enter the first name of the customer.
*   `lastName` (query, string) Enter the last name of the customer.
*   `phone` (query, string) Enter the mobile phone number of the customer.
*   `email` (query, string) Enter the email address of the customer.
*   `id` (query, string) Enter the Salesforce Account ID of the customer.

#### Responses

*   **200** Successful response with customer details
    
    Media type: `application/json`. Schema: `object`.
    
    *   `errorMessage` (_string_, nullable)
    *   `errorCode` (_string_, nullable)
    *   `customers` (_array of object_)
        *   `profile` (_object_)
            *   `phoneMobile` (_string_, nullable)
            *   `loyaltyId` (_string_, nullable)
            *   `lastName` (_string_)
            *   `firstName` (_string_)
            *   `email` (_string_, nullable)
            *   `customerId` (_string_)
        *   `loyaltyProfile` (_object_, nullable)
            *   `rewards` (_array of object_)
                *   `rewardName` (_string_)
                *   `rewardId` (_string_)
                *   `code` (_string_)
                *   `amount` (_number_, nullable)
            *   `loyaltyId` (_string_)
            *   `lastName` (_string_)
            *   `firstName` (_string_)
            *   `currentPoints` (_number_)
            *   `accountNumber` (_string_)
*   **400** Invalid request parameters
*   **500** Internal server error

### POST Create a customer

`POST /services/apexrest/spi/customer/create`

Operation ID: `createCustomer`.

#### Request body (required)

Media type: `application/json`. Schema: `object`.

*   `profile` (_object_) An object that contains customer details.
    *   `email` (_string_) Enter the email address of the customer.
    *   `firstName` (_string_, required) Enter the first name of the customer.
    *   `lastName` (_string_, required) Enter the last name of the customer.
    *   `phoneMobile` (_string_) Enter the mobile phone number of the customer.
*   `consents` (_object_) An object that contains loyalty sign-up value. It denotes whether the customer has signed up for the loyalty program or not.
    *   `loyaltySignUp` (_boolean_) Indicates whether the customer has signed up for a loyalty program (true) or not (false).

#### Responses

*   **200** Customer created successfully
    
    Media type: `application/json`. Schema: `CustomerResponse`.
    

### GET Get Customer Details

`GET /services/apexrest/spi/customer/{customerId}`

Operation ID: `getCustomerDetails`.

#### Parameters

*   `customerId` (path, string, required) Enter the unique ID of the customer.

#### Responses

*   **200** Successful response with customer details
    
    Media type: `application/json`. Schema: `object`.
    
    *   `errorMessage` (_string_, nullable)
    *   `errorCode` (_string_, nullable)
    *   `error` (_string_, nullable)
    *   `profile` (_object_)
        *   `phoneMobile` (_string_)
        *   `loyaltyId` (_string_)
        *   `lastName` (_string_)
        *   `firstName` (_string_)
        *   `email` (_string_)
        *   `customerId` (_string_)
    *   `loyaltyProfile` (_object_)
        *   `rewards` (_array of object_)
        *   `loyaltyId` (_string_)
        *   `lastName` (_string_)
        *   `firstName` (_string_)
        *   `currentTier` (_object_)
            *   `name` (_string_)
        *   `currentPoints` (_number (float)_)
        *   `accountNumber` (_string_)
*   **400** Invalid customer ID provided
*   **404** Customer not found
*   **500** Internal server error

### POST Get Loyalty Points

`POST /services/apexrest/spi/loyalty/points`

Operation ID: `getLoyaltyPoints`.

#### Request body (required)

Media type: `application/json`. Schema: `object`.

*   `cartId` (_string_) Enter the ID of the shopping cart.  
    Example: `PS00000013`.
*   `cartItemList` (_array of object_) An array of cart items with the required details.
    *   `productId` (_string_) Enter the product ID.  
        Example: `1010117AA4AEE`.
    *   `price` (_number_) Enter the price of the product.  
        Example: `149`.
    *   `quantity` (_integer_) Enter the quantity for purchase.  
        Example: `1`.
    *   `subTotal` (_number_) Enter the sub-total value of the cart.  
        Example: `149`.
    *   `total` (_number_) Enter the total value of the cart.  
        Example: `161.67`.
*   `loyaltyProfile` (_object_) An object that contains the details of a loyalty member.
    *   `loyaltyId` (_string_) Enter the Loyalty ID of the member.  
        Example: `0lMfK0000000DK8UAM`.
    *   `firstName` (_string_) Enter the first name of the loyalty member.  
        Example: `Trevor`.
    *   `lastName` (_string_) Enter the last name of the loyalty member.  
        Example: `Davis`.
    *   `accountNumber` (_string_) Enter the account number of the loyalty member.  
        Example: `124345692`.
    *   `currentPoints` (_number_) Enter the number of points available to the loyalty member.  
        Example: `822`.
    *   `currentStoreCredit` (_number_) Enter the available store credit points.  
        Example: `0`.
    *   `lifetimePoints` (_number_) Enter the available lifetime points.  
        Example: `0`.
    *   `nextRewardPoints` (_number_) Enter the available reward points.  
        Example: `0`.
    *   `rewards` (_array of object_) An array of rewards with the required details.
        *   `amount` (_number_) Enter the amount for the reward.  
            Example: `400`.
        *   `rewardName` (_string_) Enter the reward name.  
            Example: `Gold Tier Welcome Kit`.
        *   `code` (_string_) Enter the reward code.  
            Example: `ZUK6M0TB`.
        *   `canRedeemNow` (_boolean_) Indicates whether the reward can be redeemed (true) or not (false).  
            Example: `true`.
        *   `rewardId` (_string_) Enter the reward ID.  
            Example: `0kDfK00000007O5UAI`.
        *   `combinable` (_boolean_) Indicates whether the reward can be combined with another reward (true) or not (false).  
            Example: `false`.
*   `pointsEarned` (_number_) Enter the amount of points earned in this transaction.  
    Example: `0`.

#### Responses

*   **200** Successful response
    
    Media type: `application/json`. Schema: `object`.
    
    *   `errorMessage` (_string_, nullable)
    *   `errorCode` (_string_, nullable)
    *   `error` (_string_, nullable)
    *   `pointsEarned` (_number_)  
        Example: `3`.
*   **400** Bad Request
    
    Media type: `application/json`. Schema: `object`.
    
    *   `errorMessage` (_string_)  
        Example: `Invalid request format`.
    *   `errorCode` (_string_)  
        Example: `400`.

### POST Process an order

`POST /services/apexrest/spi/orders/create`

Operation ID: `createOrder`.

#### Request body (required)

Media type: `application/json`. Schema: `OrderRequest`.

#### Responses

*   **200** Successful operation
    
    Media type: `application/json`. Schema: `OrderResponse`.
    

### PUT Update Customer Details

`PUT /services/apexrest/spi/customer/update`

Operation ID: `updateCustomer`.

Updates an existing customer’s details. Only the provided fields are updated.

#### Request body (required)

Media type: `application/json`. Schema: `object`.

*   `profile` (_object_) An object that contains customer details.
    *   `email` (_string (email)_) Enter the customer email ID.  
        Example: `ed@loyalty.com`.
    *   `firstName` (_string_) Enter the first name of the customer.  
        Example: `es`.
    *   `lastName` (_string_) Enter the last name of the customer.  
        Example: `georgew4`.
    *   `phoneMobile` (_string_) Enter the mobile phone number of the customer.  
        Example: `0123456778`.
    *   `customerId` (_string_) Enter the customer ID.  
        Example: `001fK00000CtpMNQAZ`.
*   `consents` (_object_) An object that contains sign-up related details.
    *   `loyaltySignUp` (_boolean_) Indicates whether the customer has signed up for a loyalty program (true) or not (false).  
        Example: `true`.
    *   `smsSignUp` (_boolean_) Indicates whether the customer has signed up for updates through SMS (true) or not (false).  
        Example: `true`.
    *   `directMailSignUp` (_boolean_) Indicates whether the customer has signed up for updates through email (true) or not (false).  
        Example: `false`.

#### Responses

*   **200** Customer details updated successfully.
    
    Media type: `application/json`. Schema: `object`.
    
    *   `errorMessage` (_string_, nullable)
    *   `errorCode` (_string_, nullable)
    *   `error` (_string_, nullable)
    *   `profile` (_object_)
        *   `phoneMobile` (_string_)  
            Example: `0123456778`.
        *   `loyaltyId` (_string_)  
            Example: `HAYT327M9Q`.
        *   `lastName` (_string_)  
            Example: `georgew4`.
        *   `firstName` (_string_)  
            Example: `es`.
        *   `email` (_string_)  
            Example: `ed@loyalty.com`.
        *   `customerId` (_string_)  
            Example: `001fK00000CvJLeQAN`.
    *   `loyaltyProfile` (_object_)
        *   `rewards` (_array of object_)
            
            _Example_
            
            ```
            []
            ```
            
        *   `loyaltyId` (_string_)  
            Example: `HAYT327M9Q`.
        *   `lastName` (_string_)  
            Example: `georgew4`.
        *   `firstName` (_string_)  
            Example: `es`.
        *   `currentTier` (_object_)
            *   `name` (_string_)  
                Example: `Silver`.
        *   `currentPoints` (_integer_)  
            Example: `0`.
        *   `accountNumber` (_string_)  
            Example: `HAYT327M9Q`.

### GET Retrieve customer address details

`GET /services/apexrest/predictspring01/customer-address/{customerId}`

Operation ID: `retrieveCustomerAddress`.

#### Parameters

*   `customerId` (path, string, required) Enter the customer ID.

#### Responses

*   **200** Customer address retrieved successfully
    
    Media type: `application/json`. Schema: `object`.
    
    *   `customerId` (_string_)
    *   `address` (_object_)
        *   `state` (_string_)
        *   `postalCode` (_string_)
        *   `phone` (_string_)
        *   `lastName` (_string_)
        *   `firstName` (_string_)
        *   `emailAddress` (_string_)
        *   `country` (_string_)
        *   `city` (_string_)
        *   `addressLine2` (_string_)
        *   `addressLine1` (_string_)

### PUT Update existing customer address

`PUT /services/apexrest/predictspring01/customer-address/{customerId}`

Operation ID: `updateCustomerAddress`.

#### Parameters

*   `customerId` (path, string, required) Enter the customer ID.

#### Request body (required)

Media type: `application/json`. Schema: `object`.

*   `customerId` (_string_) Enter the customer ID.
*   `address` (_object_) An object that contains details of an address.
    *   `state` (_string_) Enter the name of the state.
    *   `postalCode` (_string_) Enter the postal code.
    *   `phone` (_string_) Enter the contact number.
    *   `lastName` (_string_) Enter the last name of the customer.
    *   `firstName` (_string_) Enter the first name of the customer.
    *   `emailAddress` (_string_) Enter the customer email ID.
    *   `country` (_string_) Enter the name of the country.
    *   `city` (_string_) Enter the name of the city.
    *   `addressLine2` (_string_) Enter the address.
    *   `addressLine1` (_string_) Enter the address.

#### Responses

*   **200** Customer address successfully updated

### POST Create a new customer address

`POST /services/apexrest/predictspring01/customer-address/{customerId}`

Operation ID: `createNewCustomerAddress`.

#### Parameters

*   `customerId` (path, string, required) Enter the customer ID.

#### Request body (required)

Media type: `application/json`. Schema: `object`.

*   `customerId` (_string_) Enter the customer ID.
*   `address` (_object_) An object that contains details of an address.
    *   `state` (_string_) Enter the name of the state.
    *   `postalCode` (_string_) Enter the postal code.
    *   `phone` (_string_) Enter the contact number.
    *   `lastName` (_string_) Enter the last name of the customer.
    *   `firstName` (_string_) Enter the first name of the customer.
    *   `emailAddress` (_string_) Enter the customer email ID.
    *   `country` (_string_) Enter the name of the country.
    *   `city` (_string_) Enter the name of the city.
    *   `addressLine2` (_string_) Enter the address.
    *   `addressLine1` (_string_) Enter the address.

#### Responses

*   **201** Customer address successfully created

## Schemas

### CustomerResponse

An object representing CustomerResponse details.

*   `profile` (_object_) An object that contains customer details.
    *   `email` (_string_) Enter the customer email ID.
    *   `firstName` (_string_) Enter the first name of the customer.
    *   `lastName` (_string_) Enter the last name of the customer.
    *   `phoneMobile` (_string_) Enter the mobile phone number of the customer.
*   `consents` (_object_) An object that contains sign-up related details.
    *   `loyaltySignUp` (_boolean_) Indicates whether the customer has signed up for a loyalty program (true) or not (false).

### OrderRequest

An object representing OrderRequest details.

*   `orderId` (_string_) Enter the order ID.
*   `rewardList` (_array of object_) An array of the list of available rewards.
    
    Each item: An object representing items details.
    
    *   `amount` (_string_) Enter the amount of the reward.
    *   `code` (_string_) Enter the code of the reward.
*   `orderProductList` (_array of object_) An array of a list of objects that contains product details.
    
    Each item: An object representing items details.
    
    *   `productId` (_string_) Enter the product ID.
    *   `price` (_number_) Enter the price of the product.
    *   `quantity` (_integer_) Enter the quantity of purchase.
    *   `subTotal` (_number_) Enter the sub-total amount of the product.
    *   `total` (_number_) Enter the total amount of the product.
*   `customerProfile` (_CustomerProfile_) An object that contains customer details.
*   `pointsEarned` (_integer_) Enter the amount of points earned in this transaction.

### OrderResponse

An object representing OrderResponse details.

*   `errorMessage` (_string_, nullable) The error message returned after sending the API request.
*   `errorCode` (_string_, nullable) The error code returned after sending the API request.
*   `error` (_string_, nullable) The name of the error returned after sending the API request.
*   `statusLine` (_object_) Contains the HTTP status code and reason phrase from the response.
    *   `statusCode` (_integer_) The status code returned after sending the API request.
    *   `reasonPhrase` (_string_) The reason for the returned status code.
*   `params` (_object_) An object representing params details.
*   `locale` (_object_) An object representing locale details.
    *   `language` (_string_) The name of the language.
    *   `country` (_string_) The name of the country.
*   `header` (_object_) Represents a header object with name and value.
    *   `name` (_string_) The name of the customer.
    *   `value` (_string_) The value of the order.
*   `entity` (_object_) An object representing entity details.
    *   `content` (_object_) An object representing content details.
        *   `processResult` (_object_) An object representing processResult details.
            *   `memberPointsBalance` (_array of object_) A list of object items related to memberPointsBalance.
                
                Each item: An object representing items details.
                
                *   `memberCurrencies` (_array of object_) A list of object items related to memberCurrencies.
                    
                    Each item: An object representing items details.
                    
                    *   `currencyName` (_string_) The name of the currency in which order was executed.
                    *   `currencyType` (_string_) The type of currency in which order was executed.
                    *   `escrowPointsBalance` (_number_) The amount of remaining escrow points.
                    *   `pointsBalance` (_number_) The amount of remaining points.
                *   `memberShipNumber` (_string_) The membership number of the customer.
            *   `transactionJournalResult` (_array of object_) A list of object items related to transactionJournalResult.
                
                Each item: An object representing items details.
                
                *   `changeInMemberPoints` (_array of object_) A list of object items related to changeInMemberPoints.
                    
                    Each item: An object representing items details.
                    
                    *   `changeInMemberCurrencies` (_array of object_) A list of object items related to changeInMemberCurrencies.
                        
                        Each item: An object representing items details.
                        
                        *   `changeInPointsBalance` (_number_) The number of points that were used in a transaction.
                        *   `currencyName` (_string_) The name of the currency in which order was executed.
                        *   `currencyType` (_string_) The type of currency in which order was executed.
                        *   `promotionId` (_string_) The ID of the promotion.
                    *   `memberShipNumber` (_string_) The membership number of the customer.
                *   `id` (_string_) The id of the transaction.
                *   `voucherResult` (_object_) An object representing voucherResult details.
                    *   `vouchersIssued` (_array of string_) A list of string items related to vouchersIssued.
                        
                        Each item: The name of the item issued.
                        
        *   `programName` (_string_) The name of the program.
        *   `status` (_boolean_) Indicates whether the program is active (true) or not (false).
*   `allHeaders` (_array of object_) A list of all header objects from the response.
    
    Each item: An object representing items details.
    
    *   `name` (_string_) The name of the customer.
    *   `value` (_string_) The value of the order.

### CustomerProfile

An object representing CustomerProfile details.

*   `customerId` (_string_) Enter the unique ID of the customer.
*   `email` (_string_) Enter the email address of the customer.
*   `firstName` (_string_) Enter the first name of the customer.
*   `lastName` (_string_) Enter the last name of the customer.
*   `phoneMobile` (_string_) Enter the mobile phone number of the customer.
*   `loyaltyId` (_string_) Enter the Loyalty ID of the member.