Import Orders from Shopify to Salesforce

Import Orders from Shopify to Salesforce

Use this recipe to import orders from Shopify to Salesforce.

Note: This recipe is available as Shopify — Salesforce | Import Orders in the Integration Store. Oracle provides this recipe as a sample only. The recipe is meant only for guidance, and is not warranted to be error-free. No support is provided for this recipe.

Overview

This is an application-driven recipe that creates an order in Salesforce whenever an order is created in Shopify.

To use the recipe, you must install the recipe package and configure the connections and other resources within the package. When an order is created in Shopify, the integration flow of the recipe is triggered, and it creates a corresponding order in Salesforce.
Basic data such as billing city, postal code, province, billing street, and so on are synchronized between the Shopify and Salesforce platforms.

System and Access Requirements

Before You Install the Recipe

You must perform the following configuration tasks on your Shopify and Salesforce instances in order to successfully connect to these external systems using Oracle Integration and transfer orders between them.

Configure Shopify

To configure Shopify, see Prerequisites for Creating a Connection.

Configure Salesforce

To access Salesforce from Oracle Integration and create orders, you must perform certain configurations on your Salesforce instance.

You must create a user account on Salesforce for Oracle Integration. You’ll use the credentials of this user account while configuring the Salesforce connection in Oracle Integration.

In addition, you must identify your Salesforce instance type and your current Salesforce API version. Finally, you must create a custom field for order and account records.

Log in to your Salesforce instance as an Administrator and execute the following tasks.

Note: The steps provided here apply to the Salesforce Classic UI. If you’re using the Lightning Experience UI on your Salesforce instance, switch to the Classic UI. See Toggle or switch between Lightning Experience and Salesforce Classic.

  1. Create an API-enabled custom role. You’ll assign this role to the user account you’ll subsequently create for Oracle Integration.

    1. On the Salesforce Setup page:

      1. Expand Manage Users under the Administer section in the left navigation pane.

      2. Click Profiles.

    2. On the Profiles page, click New Profile.

    3. On the resulting page:

      1. Select Standard User in the Existing Profile field.

      2. Enter a name for the new profile, for example, API Enabled, and click Save.

      The new profile is now saved, and the Profile Detail page of the new profile is displayed.

    4. Click Edit on the Profile Detail page.

    5. On the Profile Edit page:

      1. Scroll to the Administrative Permissions section and ensure that the API Enabled check box is selected.

      2. Scroll to the Standard Object Permissions section and perform the following actions.

        • In the Accounts row, leave the ReadCreateEdit, and Delete boxes checked. Additionally, select the ViewAll check box.

        • In the Price Books row, leave the Read box checked. Additionally, select the CreateEdit, and Delete check boxes.

        • In the Products row, leave the Read box checked. Additionally, select the CreateEdit, and Delete check boxes.

        • In the Orders row, leave the Read box checked. Additionally, select the CreateEdit, and Delete check boxes.

      3. Scroll to the end of the page and click Save.

  2. Create a user account for Oracle Integration and assign the custom role created previously to this account.

    Note: If you have already created a user account for Oracle Integration, you can assign the API-enabled custom role to the existing account.

    1. On the Profile Detail page of the API Enabled profile, click View Users.

    2. Click New User in the resulting page.

    3. On the New User page:

      1. Enter a first name and last name for the user, for example, Integration User05.

      2. In the Email field, enter a valid email address.
        The email address you enter is automatically populated in the Username field. Note down this username.

      3. In the User License field, select Salesforce.

      4. In the Profile field, select the profile you created previously, that is, API Enabled.

      5. Scroll to the end of the page, ensure that the Generate new password and notify user immediately check box is selected, and click Save.
        The user account is now created, and a verification email is sent to the email address you provided for the account.

    4. Log in to the corresponding email account and click the Verify Account button in the email message from Salesforce.
      You’re redirected to the Salesforce instance to set a password for the new user account.

    5. Set a password and note down the same.
      Subsequently, you’re signed in to the Salesforce instance with the new account.

      Note: If you’re shown the Lighting Experience UI, switch to the Salesforce Classic UI. See Toggle or switch between Lightning Experience and Salesforce Classic.

    6. Generate a security token for the new user account. You’ll need this security token along with the password to access Salesforce using Oracle Integration.

      1. Stay signed in as the new user, and click the user name at the top of the page to open a menu.

      2. Click My Settings in the menu.

      3. On the My Settings page, in the Quick Links section, click Edit my personal information.

      4. On the resulting page, click Reset My Security Token in the left navigation pane.

      5. Click the Reset Security Token button.
        A new security token is sent to the email address associated with the account. Note down the security token.

      6. On the Salesforce instance, click the user name again and select Logout from the menu. Log back in as the Administrator.

  3. Identify your current Salesforce API version.

    1. On the Salesforce Setup page:

      1. Scroll to the Build section in the left navigation pane.

      2. Expand Develop, and then click API.

    2. On the API WSDL page, click the Generate Enterprise WSDL link.  The WSDL is displayed in a new browser tab, and your current API version is present in the second line. For example:

      Salesforce.com Enterprise Web Services API Version 52.0
      
    3. Note down the API version.

  4. Identify your Salesforce instance type.

    1. If you use the URL https://login.salesforce.com to log in to your Salesforce account, your instance type is Production.

    2. If you use the URL https://test.salesforce.com to log in to your Salesforce account, your instance type is Sandbox.

  5. Create a custom field in Salesforce to store the Shopify Order ID.
    This recipe uses unique IDs associated with Shopify and Salesforce instances to synchronize orders and customer records. Create a custom field in Salesforce to store Shopify Order ID.

    1. On the Salesforce Setup page:

      1. Scroll to the Build section in the left navigation pane.

      2. Expand Customize, then Orders, and then click Fields.

    2. On the Order Fields page, scroll to the Order Custom Fields & Relationships section and click New.

    3. On the New Custom Field page:

      1. Find and select the Text radio button, and click Next.

      2. Enter the following details for the new custom field:

        • Enter ShopifyOrderId as the field label. Note that the field name is automatically populated based on the label you enter.

        • Enter 50 as the length.

        • Optionally, enter a description for the new field.

        • Select the External ID check box.

        • Click Next.

      3. On the Establish field-level security page, select the Visible check box in the header row to grant edit access to the new field for all profiles. Click Next.

      4. Leave all the layout check boxes selected and click Save.

    On the Order Fields page, you can see the new field added under the Order Custom Fields & Relationships section.

  6. Similarly, create a custom field in Salesforce to store the Shopify Customer ID.

    1. On the Salesforce Setup page:

      1. Scroll to the Build section in the left navigation pane.

      2. Expand Customize, then Accounts, and then click Fields.

    2. On the Account Fields page, scroll to the Account Custom Fields & Relationships section and click New.

    3. On the New Custom Field page:

      1. Find and select the Text radio button, and click Next.

      2. Enter the following details for the new custom field:

        • Enter ShopifyCustomer_id as the field label. Note that the field name is automatically populated based on the label you enter.

        • Enter 50 as the length.

        • Optionally, enter a description for the new field.

        • Select the External ID check box.

        • Click Next.

      3. On the Establish field-level security page, select the Visible check box in the header row to grant edit access to the new field for all profiles. Click Next.

      4. Leave all the layout check boxes selected and click Save.

    On the Account Fields page, you can see the new field added under the Account Custom Fields & Relationships section.

Install and Configure the Recipe

On your Oracle Integration instance, install the recipe package to deploy and configure the integration and associated resources.

  1. On the Oracle Integration home page, scroll to the Accelerators & Recipes section.

  2. Click Search All.

  3. Find the recipe package that you want to install.

  4. Select the package, and then click the Install Install icon icon.

  5. After the package is installed, click the Configure Configure icon icon on the recipe card to configure the resources deployed by the package.

    The Configuration Editor page opens, displaying all the resources of the recipe package. Configure the following resources before you activate and run the recipe.

Configure the Oracle Shopify Connection

  1. On the Configuration Editor page, select Oracle Shopify Connection, then click Edit Edit icon.
    The connection configuration page appears.

  2. In the Connection Properties section, enter the following details.

    Field Information to Enter
    Host Name Enter the Shopify host name. The Shopify host name appears in the Shopify home URL. For example: https://hostname.myshopify.com.
    Shopify REST API Version Enter the REST API version.
  3. In the Security section, enter the following details.

    Field Information to Enter
    Security Policy Leave Shopify Security Policy selected.
    Username Enter the API key obtained earlier. See Configure Shopify.
    Password Enter the password obtained earlier.
    Shared secret Enter the shared secret obtained earlier.
  4. Click Save. If prompted, click Save for a second time.

  5. Click Test to ensure that your connection is successfully configured. In the resulting dialog, click Test again.
    A confirmation message is displayed if your test is successful.

  6. Click Back Back icon to return to the Configuration Editor page. Click Save again if prompted.

Configure the Oracle Salesforce Connection

  1. On the Configuration Editor page, select Oracle Salesforce Connection, then click Edit Edit icon.
    The connection configuration page appears.

  2. In the Connection Properties section, enter the following details.

    Field Information to Enter
    Select Salesforce.com Instance Type Select Production or Sandbox based on your Salesforce instance type.
    API Version Enter your current Salesforce API version. To obtain the API version, see  Configure Salesforce.
  3. In the Security section, enter the following details.

    Field Information to Enter
    Security Policy Leave Salesforce Username Password Policy selected.
    Username Enter the username of the account created for Oracle Integration on Salesforce. See Configure Salesforce.
    Password

    Enter the password of the account created for Oracle Integration on Salesforce.

    Note: To the password, you must also append the security token generated for the same account.

  4. Click Save. If prompted, click Save for a second time.

  5. Click Test to ensure that your connection is successfully configured. In the resulting dialog, click Test again.
    A confirmation message is displayed if your test is successful.

  6. Click Back Back icon to return to the Configuration Editor page. Click Save again if prompted.

Update Integration Property

Update the integration property with appropriate value.

The recipe’s integration flow contains the following property:

For the procedure to update the integration property, see Steps 7 to 9 in Override Design-Time Properties in an Integration.

Note: This is an app-driven integration, and you can update the property values only before activating the recipe.

Configure the Lookup Table

Edit the lookup table to map the price book names.

  1. On the Configuration Editor page, select the lookup table, and click Edit Edit icon.

  2. In the Property column, enter the name of the property. For example, Salesforce_PriceBook_Name.

  3. In the Value column, enter the name of the price book to which the property name has to be auto mapped.

  4. Click Save.

  5. Click Back Back icon to return to the Configuration Editor page.

Activate and Run the Recipe

After you’ve configured the connections and the lookup table, activate the recipe package and run it.

  1. On the Configuration Editor page, click Activate in the title bar. In the Activate Package dialog, click Activate again.
    A confirmation message is displayed informing that the integration has been submitted for activation. Refresh the page to view the updated status of the integration.

  2. Run the recipe.
    To run the recipe, you must create an order in Shopify.

    Note: Ensure that all the products in Shopify are available in Salesforce and are listed under a price book.

    1. Log in to the Shopify instance.

    2. On the left navigation pane, click Orders.

    3. To create a new order, click Create Order.

    4. Enter the following details:

      • In the Customer field, select the customer for whom the order has to be created.

      • In the Product field, select the required product.

      • Modify the quantity as required, and click Collect Payment. A pop-up window appears.

    5. Click Create Order.

    You’ve now created an order record in Shopify and triggered the recipe.

  3. Monitor the execution of the recipe’s integration flow in Oracle Integration.

    1. On the Configuration Editor page, select the integration flow.

    2. Click Run Run icon, then click Track Instances.

    3. On the Track Instances page, you’ll see the integration flow of the recipe being triggered and executing successfully. The recipe now creates a corresponding order in Salesforce.

  4. Log in to your Salesforce instance and check for the new orders created.

    1. On the Salesforce instance, click the Orders tab.

    2. On the Orders Home page, select All Activated Orders in the View field. Click Go if necessary. The list of orders is displayed.

    3. To view an order record, click its name.

Related Documentation