Pull from Shopify

Shopify is an ecommerce platform for online stores and retail point-of-sale systems that consolidates shopping, payments, marketing, shipping, and customer engagement tools into a single unified experience.

Shopify is source of high quality data for both customer records and interaction records, including:

  • Complete profile data, including full names, full addresses, email address, and phone number

  • Orders, including order amounts, items and item quantities, location

  • Prices and discounts

  • Refunds and cancellations

  • Product catalog details

  • Abandoned carts

  • Customer searches

  • Guest checkout data, including email address and associated order details

This topic describes the steps that are required to pull customer profiles and orders to Amperity from Shopify:

  1. Get details

  2. Configure authorization access scopes

  3. Run courier

  4. Review feed and domain table

  5. Add to courier group

Get details

  1. Your Shopify Shop Name.

  2. A list of tables to be pulled to Amperity from Shopify.

    This is done by configuring Shopify to allow Amperity to read data from the Shopify Admin API using a set of authorization access scopes.

Configure authorization access scopes

You must configure read access within Shopify to allow Amperity to pull data from tables. The following authorization access scopes must be enabled:

To configure authorization access scopes for Amperity

Follow the steps outlined within Shopify documentation to enable the required scopes for your instance of Shopify.

  1. Open the Apps and sales channels page in your Shopify admin console.

  2. Click Develop, and then the name of the app you are using with Amperity.

  3. Click Configuration, and then in the Admin API integration section click Edit.

  4. Amperity requires the following authorization access scopes to be enabled:

    read_customers

    read_orders

    read_products

  5. Click Save.

Add courier

A courier brings data from an external system to Amperity.

To add a courier

  1. From the Sources page, click Add Courier. The Add Source page opens.

  2. Find, and then click the icon for Shopify. The Add Courier page opens.

    This automatically selects shopify as the Credential Type.

  3. Select the user account you added that is associated with authorization access scopes.

  4. Select the checkbox next to the table name to pull that table to Amperity from Shopify. You may select the following tables: Customer, Customer Address, Discount Allocations, Locations, Order, Order Line, Order Line Refund, Product, and Product Variant.

  5. Click Create.

Run courier manually

Run the courier again. This time, because the load operations are present and the feeds are configured, the courier will pull data from Shopify.

To run the courier manually

  1. From the Sources tab, open the    menu for the courier with updated load operations that is configured for Shopify, and then select Run. The Run Courier dialog box opens.

  2. Select the load option, either for a specific time period or all available data. Actual data will be loaded to a domain table because the feed is configured.

  3. Click Run.

    This time the notification will return a message similar to:

    Completed in 5 minutes 12 seconds
    

Review feed and domain table

After running the Shopify courier it will create a series of feeds and domain tables. Review the records for each domain table to ensure the right data was loaded from Shopify.

Customer

The feed and domain table for customer details will contain the following fields:

  • created_at

  • currency

  • email (assigned the email semantic tag)

  • first_name (assigned the given-name semantic tag)

  • id (assigned the ck semantic tag)

  • last_name (assigned the surname semantic tag)

  • last_order_id

  • last_order_name

  • multipass_identifier

  • note

  • orders_count

  • phone (assigned the phone semantic tag)

  • state

  • tags

  • tax_exempt

  • total_spent

  • updated_at

  • verified_email

Customer address

The feed and domain table for customer addresses will contain the following fields:

  • address1 (assigned the address semantic tag)

  • address2 (assigned the address2 semantic tag)

  • city (assigned the city semantic tag)

  • company (assigned the company semantic tag)

  • country (assigned the country semantic tag)

  • country_code

  • country_name

  • customer_id (assigned the ck semantic tag)

  • default

  • first_name (assigned the given-name semantic tag)

  • id

  • last_name (assigned the surname semantic tag)

  • phone (assigned the phone semantic tag)

  • province (assigned the state semantic tag)

  • province_code

  • zip (assigned the postal semantic tag)

Customer tags

The feed and domain table for customer tags will contain the following fields:

  • customer_id

  • value

Discount allocation

The feed and domain table for discount allocations will contain the following fields:

  • amount

  • discount_allocation_index

  • order_line_id (assigned the ck and pk semantic tags)

Discount codes

The feed and domain table for discount codes will contain the following fields:

  • amount

  • code

  • order_id (assigned the ck and pk semantic tags)

  • type

Locations

The feed and domain table for locations will contain the following fields:

  • active

  • address1 (assigned the addresss semantic tag)

  • address2 (assigned the addresss2 semantic tag)

  • city

  • country

  • country_code

  • country_name

  • created_at

  • id

  • legacy

  • localized_country_name

  • localized_province_name

  • name

  • phone

  • province

  • province_code

  • province_name

  • zip

Order

The feed and domain table for orders will contain the following fields:

  • app_id

  • browser_ip

  • buyer_accepts_marketing

  • cancel_reason

  • canceled_at

  • cart_token

  • checkout_token

  • closed_at

  • created_at

  • currency

  • current_subtotal_price

  • current_total_discounts

  • current_total_price

  • current_total_tax

  • customer_id

  • customer_locale

  • email

  • estimated_taxes

  • financial_status

  • fulfillment_status

  • id

  • landing_site

  • location_id

  • name

  • note

  • number

  • order_number

  • phone

  • presentment_currency

  • processed_at

  • processing_method

  • referring_site

  • source_name

  • source_identifier

  • source_url

  • subtotal_price

  • tags

  • taxes_included

  • test

  • token

  • total_discounts

  • total_line_items_price

  • total_outstanding

  • total_price

  • total_tax

  • total_tip_received

  • total_weight

  • updated_at

  • user_id

Order line

The feed and domain table for order lines will contain the following fields:

  • fulfillable_quantity

  • fulfillment_service

  • fulfillment_status

  • gift_card

  • grams

  • id

  • name

  • order_id

  • price

  • product_id

  • quantity

  • requires_shipping

  • sku

  • taxable

  • title

  • total_discount

  • variant_id

  • variant_title

  • vendor

Order line refund

The feed and domain table for order line refunds will contain the following fields:

  • id

  • line_item_id

  • location_id

  • subtotal

  • refund_id

  • restock_type

  • quantity

  • total_tax

Order tags

The feed and domain table for order tags will contain the following fields:

  • order_id (assigned the ck and pk semantic tags)

  • value

Product

The feed and domain table for products will contain the following fields:

  • body_html

  • created_at

  • handle

  • id (assigned the pc/product-id semantic tag)

  • product_type

  • published_at

  • published_scope

  • status

  • tags

  • template_suffix

  • title

  • updated_at

  • vendor

Product tags

The feed and domain table for product tags will contain the following fields:

  • product_id (assigned the ck and pk semantic tags)

  • value

Product variant

The feed and domain table for product variants will contain the following fields:

  • barcode

  • compare_at_price

  • created_at

  • fulfillment_service

  • grams

  • id

  • inventory_item_id

  • inventory_management

  • inventory_policy

  • inventory_quantity

  • option1

  • option2

  • option3

  • position

  • price

  • product_id

  • requires_shipping

  • sku

  • taxable

  • title

  • updated_at

  • weight

  • weight_unit

Add to courier group

A courier group is a list of one (or more) couriers that are run as a group, either ad hoc or as part of an automated schedule. A courier group can be configured to act as a constraint on downstream workflows.

To add the courier to a courier group

  1. From the Sources tab, click Add Courier Group. This opens the Create Courier Group dialog box.

  2. Enter the name of the courier. For example: “Shopify”.

  3. Add a cron string to the Schedule field to define a schedule for the orchestration group.

    A schedule defines the frequency at which a courier group runs. All couriers in the same courier group run as a unit and all tasks must complete before a downstream process can be started. The schedule is defined using cron.

    Cron syntax specifies the fixed time, date, or interval at which cron will run. Each line represents a job, and is defined like this:

    ┌───────── minute (0 - 59)
    │ ┌─────────── hour (0 - 23)
    │ │ ┌───────────── day of the month (1 - 31)
    │ │ │ ┌────────────── month (1 - 12)
    │ │ │ │ ┌─────────────── day of the week (0 - 6) (Sunday to Saturday)
    │ │ │ │ │
    │ │ │ │ │
    │ │ │ │ │
    * * * * * command to execute
    

    For example, 30 8 * * * represents “run at 8:30 AM every day” and 30 8 * * 0 represents “run at 8:30 AM every Sunday”. Amperity validates your cron syntax and shows you the results. You may also use crontab guru to validate cron syntax.

  4. Set Status to Enabled.

  5. Specify a time zone.

    A courier group schedule is associated with a time zone. The time zone determines the point at which a courier group’s scheduled start time begins. A time zone should be aligned with the time zone of system from which the data is being pulled.

    Note

    The time zone that is chosen for an courier group schedule should consider every downstream business processes that requires the data and also the time zone(s) in which the consumers of that data will operate.

  6. Add at least one courier to the courier group. Select the name of the courier from the Courier drop-down. Click + Add Courier to add more couriers.

  7. Click Add a courier group constraint, and then select a courier group from the drop-down list.

    A wait time is a constraint placed on a courier group that defines an extended time window for data to be made available at the source location.

    A courier group typically runs on an automated schedule that expects customer data to be available at the source location within a defined time window. However, in some cases, the customer data may be delayed and isn’t made available within that time window.

  8. For each courier group constraint, apply any offsets.

    An offset is a constraint placed on a courier group that defines a range of time that is older than the scheduled time, within which a courier group will accept customer data as valid for the current job. Offset times are in UTC.

    A courier group offset is typically set to be 24 hours. For example, it’s possible for customer data to be generated with a correct file name and datestamp appended to it, but for that datestamp to represent the previous day because of the customer’s own workflow. An offset ensures that the data at the source location is recognized by the courier as the correct data source.

    Warning

    An offset affects couriers in a courier group whether or not they run on a schedule. Manually run courier groups will not take their schedule into consideration when determining the date range; only the provided input day(s) to load data from are used as inputs.

  9. Click Save.