Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Version History

« Previous Version 2 Next »

Source:

  • Shopify based systems

Target:

  • CDP Epsilon

  • SFMC

Functionality

Description

Admin panel configuration

Confirmation

Send order confirmation message to Customer from Salesforce Marketing Cloud

instant-message-service

Order

Create or edit order in the CDP Epsilon

shopify-order-to-cdp

Middleware components:

Component

Functionalities

Admin Panel (blue star)

C, O - only configuration

e-shopify-order (blue star)

C, O

p-shopify-order (blue star)

C, O

p-instant-message-service (blue star)

C

p-sfmc-journey-service (blue star)

C

s-db-proxy (blue star)

C, O

cdd-s-db-proxy-docdb-cluster-prod (blue star)

C, O

p-shopify-order-adapter(blue star)

O

cdp-sftp-prod.services.rbcloud.io

O

Detail chart:

 Order Route

How to set up new Shopify shop for Brilliant Basic Order Integration?

Because of dependencies, the configuration should be performed bottom-up approach, meaning 1. SFMC 2. Middleware 3. Shopify

Shopify Configuration

  1. Setup Shopify Webhook

endpoint:

POST api.cdp-rb.com/shopify/order
 http headers
Content-Type: application/json
X-Shopify-Api-Version: 2023-01
X-Shopify-Hmac-Sha256: KIYHw2rMrjV*************GrhslwPlMFn8ig=
X-Shopify-Order-Id: 5293234553018
X-Shopify-Shop-Domain: enfashop-sg.myshopify.com
X-Shopify-Test: false
X-Shopify-Topic: orders/updated
X-Shopify-Triggered-At: 2023-10-24T00:44:14.161636249Z
X-Shopify-Webhook-Id: 63729c72-018f-4053-879e-354d7e8dfba7

 json payload
{
  "id": 5293234553018,
  "admin_graphql_api_id": "gid://shopify/Order/5293234553018",
  "app_id": 580111,
  "browser_ip": "138.75.3.200",
  "buyer_accepts_marketing": false,
  "cancel_reason": null,
  "cancelled_at": null,
  "cart_token": "6b30c4ae9e3993a7f1e5c4703c9fae27",
  "checkout_id": 32343507959994,
  "checkout_token": "c08876c875843a2508fd55d7f04105a5",
  "client_details": {
    "accept_language": "en-SG,en-GB;q=0.9,en;q=0.8",
    "browser_height": 659,
    "browser_ip": "138.75.3.200",
    "browser_width": 393,
    "session_hash": null,
    "user_agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 17_0_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0.1 Mobile/15E148 Safari/604.1"
  },
  "closed_at": null,
  "company": null,
  "confirmed": true,
  "contact_email": "tingting_09@hotmail.com",
  "created_at": "2023-10-24T08:44:13+08:00",
  "currency": "SGD",
  "current_subtotal_price": "233.04",
  "current_subtotal_price_set": {
    "shop_money": {
      "amount": "233.04",
      "currency_code": "SGD"
    },
    "presentment_money": {
      "amount": "233.04",
      "currency_code": "SGD"
    }
  },
  "current_total_discounts": "31.77",
  "current_total_discounts_set": {
    "shop_money": {
      "amount": "31.77",
      "currency_code": "SGD"
    },
    "presentment_money": {
      "amount": "31.77",
      "currency_code": "SGD"
    }
  },
  "current_total_duties_set": null,
  "current_total_price": "233.04",
  "current_total_price_set": {
    "shop_money": {
      "amount": "233.04",
      "currency_code": "SGD"
    },
    "presentment_money": {
      "amount": "233.04",
      "currency_code": "SGD"
    }
  },
  "current_total_tax": "17.26",
  "current_total_tax_set": {
    "shop_money": {
      "amount": "17.26",
      "currency_code": "SGD"
    },
    "presentment_money": {
      "amount": "17.26",
      "currency_code": "SGD"
    }
  },
  "customer_locale": "en-SG",
  "device_id": null,
  "discount_codes": [
    {
      "code": "12PEBP23",
      "amount": "31.77",
      "type": "percentage"
    }
  ],
  "email": "tingting_09@hotmail.com",
  "estimated_taxes": false,
  "financial_status": "paid",
  "fulfillment_status": null,
  "gateway": "shopify_payments",
  "landing_site": "/",
  "landing_site_ref": null,
  "location_id": null,
  "merchant_of_record_app_id": null,
  "name": "ENFASHOPSG29892",
  "note": "",
  "note_attributes": [
    
  ],
  "number": 28892,
  "order_number": 29892,
  "order_status_url": "https://shop.enfagrow.com.sg/2719318074/orders/26e9244a0dd7f55d30cff91d2df66bcf/authenticate?key=d0ebe4c128509e70cfc6ef15199ca733",
  "original_total_duties_set": null,
  "payment_gateway_names": [
    "shopify_payments"
  ],
  "phone": null,
  "presentment_currency": "SGD",
  "processed_at": "2023-10-24T08:44:12+08:00",
  "processing_method": "direct",
  "reference": null,
  "referring_site": "",
  "source_identifier": null,
  "source_name": "web",
  "source_url": null,
  "subtotal_price": "233.04",
  "subtotal_price_set": {
    "shop_money": {
      "amount": "233.04",
      "currency_code": "SGD"
    },
    "presentment_money": {
      "amount": "233.04",
      "currency_code": "SGD"
    }
  },
  "tags": "",
  "tax_lines": [
    {
      "price": "17.26",
      "rate": 0.08,
      "title": "GST",
      "price_set": {
        "shop_money": {
          "amount": "17.26",
          "currency_code": "SGD"
        },
        "presentment_money": {
          "amount": "17.26",
          "currency_code": "SGD"
        }
      },
      "channel_liable": false
    }
  ],
  "taxes_included": true,
  "test": false,
  "token": "26e9244a0dd7f55d30cff91d2df66bcf",
  "total_discounts": "31.77",
  "total_discounts_set": {
    "shop_money": {
      "amount": "31.77",
      "currency_code": "SGD"
    },
    "presentment_money": {
      "amount": "31.77",
      "currency_code": "SGD"
    }
  },
  "total_line_items_price": "264.81",
  "total_line_items_price_set": {
    "shop_money": {
      "amount": "264.81",
      "currency_code": "SGD"
    },
    "presentment_money": {
      "amount": "264.81",
      "currency_code": "SGD"
    }
  },
  "total_outstanding": "0.00",
  "total_price": "233.04",
  "total_price_set": {
    "shop_money": {
      "amount": "233.04",
      "currency_code": "SGD"
    },
    "presentment_money": {
      "amount": "233.04",
      "currency_code": "SGD"
    }
  },
  "total_shipping_price_set": {
    "shop_money": {
      "amount": "0.00",
      "currency_code": "SGD"
    },
    "presentment_money": {
      "amount": "0.00",
      "currency_code": "SGD"
    }
  },
  "total_tax": "17.26",
  "total_tax_set": {
    "shop_money": {
      "amount": "17.26",
      "currency_code": "SGD"
    },
    "presentment_money": {
      "amount": "17.26",
      "currency_code": "SGD"
    }
  },
  "total_tip_received": "0.00",
  "total_weight": 7700,
  "updated_at": "2023-10-24T08:44:16+08:00",
  "user_id": null,
  "billing_address": {
    "first_name": "Jas",
    "address1": "6 Balmoral Crescent",
    "phone": "91098052",
    "city": "Singapore",
    "zip": "259896",
    "province": null,
    "country": "Singapore",
    "last_name": "Neo",
    "address2": "#03-01",
    "company": null,
    "latitude": 1.3145677,
    "longitude": 103.8346119,
    "name": "Jas Neo",
    "country_code": "SG",
    "province_code": null
  },
  "customer": {
    "id": 1251662463034,
    "email": "tingting_09@hotmail.com",
    "accepts_marketing": true,
    "created_at": "2018-11-28T21:50:30+08:00",
    "updated_at": "2023-10-24T08:44:14+08:00",
    "first_name": "Jas",
    "last_name": "Neo",
    "state": "enabled",
    "note": "1984-11-26T00:00:00.000000Z",
    "verified_email": true,
    "multipass_identifier": null,
    "tax_exempt": false,
    "phone": "+6591098052",
    "email_marketing_consent": {
      "state": "subscribed",
      "opt_in_level": null,
      "consent_updated_at": "2019-02-14T01:58:02+08:00"
    },
    "sms_marketing_consent": {
      "state": "not_subscribed",
      "opt_in_level": "single_opt_in",
      "consent_updated_at": null,
      "consent_collected_from": "SHOPIFY"
    },
    "tags": "20_OFF_CAP_30_NEXT",
    "currency": "SGD",
    "accepts_marketing_updated_at": "2019-02-14T01:58:02+08:00",
    "marketing_opt_in_level": "single_opt_in",
    "tax_exemptions": [
      
    ],
    "admin_graphql_api_id": "gid://shopify/Customer/1251662463034",
    "default_address": {
      "id": 7567245869242,
      "customer_id": 1251662463034,
      "first_name": "Jas",
      "last_name": "Neo",
      "company": null,
      "address1": "6 Balmoral Crescent",
      "address2": "#03-01",
      "city": "Singapore",
      "province": null,
      "country": "Singapore",
      "zip": "259896",
      "phone": "91098052",
      "name": "Jas Neo",
      "province_code": null,
      "country_code": "SG",
      "country_name": "Singapore",
      "default": true
    }
  },
  "discount_applications": [
    {
      "target_type": "line_item",
      "type": "discount_code",
      "value": "12.0",
      "value_type": "percentage",
      "allocation_method": "across",
      "target_selection": "entitled",
      "code": "12PEBP23"
    }
  ],
  "fulfillments": [
    
  ],
  "line_items": [
    {
      "id": 12878062125242,
      "admin_graphql_api_id": "gid://shopify/LineItem/12878062125242",
      "fulfillable_quantity": 1,
      "fulfillment_service": "manual",
      "fulfillment_status": null,
      "gift_card": false,
      "grams": 2750,
      "name": "myFirst Camera 2 Blue",
      "pre_tax_price": "0.00",
      "pre_tax_price_set": {
        "shop_money": {
          "amount": "0.00",
          "currency_code": "SGD"
        },
        "presentment_money": {
          "amount": "0.00",
          "currency_code": "SGD"
        }
      },
      "price": "0.00",
      "price_set": {
        "shop_money": {
          "amount": "0.00",
          "currency_code": "SGD"
        },
        "presentment_money": {
          "amount": "0.00",
          "currency_code": "SGD"
        }
      },
      "product_exists": true,
      "product_id": 7289457213626,
      "properties": [
        
      ],
      "quantity": 1,
      "requires_shipping": true,
      "sku": "400117195",
      "taxable": true,
      "title": "myFirst Camera 2 Blue",
      "total_discount": "0.00",
      "total_discount_set": {
        "shop_money": {
          "amount": "0.00",
          "currency_code": "SGD"
        },
        "presentment_money": {
          "amount": "0.00",
          "currency_code": "SGD"
        }
      },
      "variant_id": 42048765821114,
      "variant_inventory_management": "shopify",
      "variant_title": "",
      "vendor": "Enfagrow Official Flagship Store",
      "tax_lines": [
        {
          "channel_liable": false,
          "price": "0.00",
          "price_set": {
            "shop_money": {
              "amount": "0.00",
              "currency_code": "SGD"
            },
            "presentment_money": {
              "amount": "0.00",
              "currency_code": "SGD"
            }
          },
          "rate": 0.08,
          "title": "GST"
        }
      ],
      "duties": [
        
      ],
      "discount_allocations": [
        
      ]
    },
    {
      "id": 12878062158010,
      "admin_graphql_api_id": "gid://shopify/LineItem/12878062158010",
      "fulfillable_quantity": 1,
      "fulfillment_service": "manual",
      "fulfillment_status": null,
      "gift_card": false,
      "grams": 4950,
      "name": "Bundle of 3: Enfagrow Pro A+ Stage 4, Original,  1.65kg x 3",
      "pre_tax_price": "215.78",
      "pre_tax_price_set": {
        "shop_money": {
          "amount": "215.78",
          "currency_code": "SGD"
        },
        "presentment_money": {
          "amount": "215.78",
          "currency_code": "SGD"
        }
      },
      "price": "264.81",
      "price_set": {
        "shop_money": {
          "amount": "264.81",
          "currency_code": "SGD"
        },
        "presentment_money": {
          "amount": "264.81",
          "currency_code": "SGD"
        }
      },
      "product_exists": true,
      "product_id": 7271902052538,
      "properties": [
        
      ],
      "quantity": 1,
      "requires_shipping": true,
      "sku": "540024224",
      "taxable": true,
      "title": "Bundle of 3: Enfagrow Pro A+ Stage 4, Original,  1.65kg x 3",
      "total_discount": "0.00",
      "total_discount_set": {
        "shop_money": {
          "amount": "0.00",
          "currency_code": "SGD"
        },
        "presentment_money": {
          "amount": "0.00",
          "currency_code": "SGD"
        }
      },
      "variant_id": 42013232824506,
      "variant_inventory_management": "shopify",
      "variant_title": "",
      "vendor": "Enfagrow Official Flagship Store",
      "tax_lines": [
        {
          "channel_liable": false,
          "price": "17.26",
          "price_set": {
            "shop_money": {
              "amount": "17.26",
              "currency_code": "SGD"
            },
            "presentment_money": {
              "amount": "17.26",
              "currency_code": "SGD"
            }
          },
          "rate": 0.08,
          "title": "GST"
        }
      ],
      "duties": [
        
      ],
      "discount_allocations": [
        {
          "amount": "31.77",
          "amount_set": {
            "shop_money": {
              "amount": "31.77",
              "currency_code": "SGD"
            },
            "presentment_money": {
              "amount": "31.77",
              "currency_code": "SGD"
            }
          },
          "discount_application_index": 0
        }
      ]
    }
  ],
  "payment_details": {
    "credit_card_bin": "542089",
    "avs_result_code": null,
    "cvv_result_code": "M",
    "credit_card_number": "•••• •••• •••• 5913",
    "credit_card_company": "Mastercard",
    "buyer_action_info": null,
    "credit_card_name": "Jas Neo ",
    "credit_card_wallet": null,
    "credit_card_expiration_month": 6,
    "credit_card_expiration_year": 2026
  },
  "payment_terms": null,
  "refunds": [
    
  ],
  "shipping_address": {
    "first_name": "Jas",
    "address1": "6 Balmoral Crescent",
    "phone": "91098052",
    "city": "Singapore",
    "zip": "259896",
    "province": null,
    "country": "Singapore",
    "last_name": "Neo",
    "address2": "#03-01",
    "company": null,
    "latitude": 1.3145677,
    "longitude": 103.8346119,
    "name": "Jas Neo",
    "country_code": "SG",
    "province_code": null
  },
  "shipping_lines": [
    {
      "id": 4233698181306,
      "carrier_identifier": null,
      "code": "Standard: 1-2 Working days, 09:00-12:00",
      "delivery_category": null,
      "discounted_price": "0.00",
      "discounted_price_set": {
        "shop_money": {
          "amount": "0.00",
          "currency_code": "SGD"
        },
        "presentment_money": {
          "amount": "0.00",
          "currency_code": "SGD"
        }
      },
      "phone": null,
      "price": "0.00",
      "price_set": {
        "shop_money": {
          "amount": "0.00",
          "currency_code": "SGD"
        },
        "presentment_money": {
          "amount": "0.00",
          "currency_code": "SGD"
        }
      },
      "requested_fulfillment_service_id": null,
      "source": "shopify",
      "title": "Standard: 1-2 Working days, 09:00-12:00",
      "tax_lines": [
        
      ],
      "discount_allocations": [
        
      ]
    }
  ]
}

Middleware Configuration

All configurations can be achieved by Admin Panel

 1. Setup routing node for delivery attempts
    "routing": [
      {
        "sink": "middleware-order-message-cdp-queue",
        "routerDeliveryCounter": 1
      },
      {
        "sink": "instant-message-service-queue",
        "routerDeliveryCounter": 2
      }
    ],

 2. Setup shopify node for shopify-order-to-cdp integration
    "shopify": {
      "shopifyToken": "shpat_cf175f************806f51e5d",  // get from Shopify
      "applicationType": "CUSTOM",
      "botProtection": false,
      "shopifyOrder": {
        "isOrderAdapter": true,
        "webhook": [
          "orders/create",
          "orders/updated"
        ],
        "hmacKey": "74cbf31**************f7e060a0c1d1", // get from Shopify
        "vendor": "SHOPIFY-SGP", 
        "bbFulfillment": false,
        "domain": "enfashop-sg.myshopify.com", // get from Shopify
        "txnSrcCode": "SHOPIFY_SGP_EN",
        "filesConfig": {  // for CDP Order
          "inputFilenamePattern": ".*[pgp|md5]$",  
          "outputPathPattern": "incoming/Shopify/${marketCode}",
          "fileNamePrefix": "RB_EN_ORDER_MJNSGP_SHOPIFY",
          "archivePathPattern": "",
          "inputPathPattern": "${workingDir}/${host}"
        }
      }
    },

 3. Setup instantMessage node for instant-message-service integration
    "instantMessage": {
      "dataExtensionKey": {
        "account_id": "6425437",
        "id": "0E2EF36F-09B7-4642-8F9A-53DF6AB7F57F_6425437",
        "client_secret": "75Nf***********9hvl92aR",
        "client_id": "nmt95fxy2vy7v56bw2e4zk33"
      },
      "APIEvent": {
        "account_id": "6425437",
        "id": "BB_Order_Confirmation_6425437",
        "client_secret": "75N*************92aR",
        "client_id": "nmt95fxy2vy7v56bw2e4zk33"
      },
      "entityType": "ORDER"
    }

 4. Setup other nodes:
    "owner": "Other",
    "2LetterLanguageCode": "EN",
    "brandOrgCode": "MJNSGP",
    "accountSourceCodeCustomer": "SGP_SHOPIFY_CUST",
    "countryCode": "SGP",
    "destination": "CDP",
    "accountSource": "SGP_SHOPIFY_SHIPTO",

SFMC Configuration

An API Event order confirmation template must be created on Salesforce Marketing Cloud to match middleware instant-message-service integration configuration

Middleware will send

 Click here to expand...
{
  "ContactKey": 1000053220746,
  "EventDefinitionKey": "BB_Order_Confirmation_6425437",
  "Data": {
    "OrderID": 5286303269050,
    "CreatedAt": "2023-10-20T15:44:05+08:00",
    "TotalPrice": "717.19",
    "TotalTax": "53.12",
    "Currency": "SGD",
    "FinancialStatus": "paid",
    "TotalDiscounts": "126.56",
    "DiscountCode": "THXAUG23",
    "BA_FirstName": "LIU",
    "BA_LastName": "WEIGUO",
    "BA_City": "Singapore",
    "BA_Zip": "368355",
    "BA_Country": "Singapore",
    "BillingAddress_1": "126 Joo Seng Road",
    "BillingAddress_2": "#09-13",
    "SA_FirstName": "LIU",
    "SA_LastName": "WEIGUO",
    "SA_City": "Singapore",
    "SA_Zip": "368355",
    "SA_Country": "Singapore",
    "ShippingAddress_1": "126 Joo Seng Road",
    "ShippingAddress_2": "#09-13",
    "FirstName": "Liu",
    "LastName": "Weiguo",
    "EmailAddress": "weiguo87@hotmail.com",
    "TotalShippingAmount": "0.00",
    "TotalShippingCurrencyCode": "SGD",
    "INDIVIDUAL_ID": "1000053220746",
    "Tags": "09:00-12:00, Reseller, Standard: 1-2 Working days",
    "PREFERRED_LANGUAGE_CODE": "",
    "source_name": "web",
    "Order_Name": "ENFASHOPSG29848",
    "DateAdd": "2023-10-24T17:42:04+08:00",
    "Payment_method": "American Express"
  }
}

  • No labels