Map Additional Details to ShipStation
This article explains how to map Additional Details (e.g., note attributes) from Shopify to ShipStation custom fields using Shopify’s custom data and Shopify Flow. This allows you to pass information like delivery dates, gift messages, or any order attributes to ShipStation’s custom fields.
Important Note: ShipStation currently treats all metafields as a single combined value. You cannot map individual metafields directly. All data stored in metafields will be sent to a single custom field, similar to how they currently combine order notes.
Shopify Settings
Custom Data Definition
- Navigate to Settings > Custom data > Orders > Add order metafield definition.
Define Metafield
- Name: Choose a simple, descriptive name (e.g., “Delivery Date”). The namespace and key will auto-generate (e.g.,
custom.delivery_date). - Type: Select “Multi-line text.” This is generally recommended for flexibility, even if your data is usually a single line.
- Save the metafield definition.
Shopify Flow
Create Workflow
- Create a new workflow in Shopify Flow.
Trigger
- Set the workflow to trigger when an Order is created.
Update Order Metafield Action
- Add an Update order metafield action.
Configure Action
- Metafield Namespace: Enter
custom. - Key: Enter
delivery_date(or the key generated for your metafield). - Value: Use the following Liquid code to extract the value from the order’s custom attributes (where the customer inputs the data) and assign it to the metafield. This code checks for a matching key and handles blank values:
Datepicker Code snippet:
{% for customAttributes_item in order.customAttributes %}
{% if customAttributes_item.key == "Delivery Date" and customAttributes_item.value != blank %}
{{ customAttributes_item.value }}
{% endif %}
{% endfor %}
Gift Message Code snippet:
{% assign gift_to = "" %}
{% assign gift_from = "" %}
{% assign gift_message = "" %}
{% for customAttributes_item in order.customAttributes %}
{% assign key_lower = customAttributes_item.key | downcase %}
{% if key_lower == "to" or key_lower == "message to" %}
{% assign gift_to = customAttributes_item.value %}
{% elsif key_lower == "from" or key_lower == "message from" %}
{% assign gift_from = customAttributes_item.value %}
{% elsif key_lower == "message" or key_lower == "gift-message" %}
{% assign gift_message = customAttributes_item.value %}
{% endif %}
{% endfor %}
{% if gift_to != "" or gift_message != "" or gift_from != "" %}
To: {{ gift_to }}, Message: {{ gift_message }}, From: {{ gift_from }}
{% endif %}
The above snippet supports the gift messages block obtained at the cart level, either through cart options, the drawer cart, or checkout options for Shopify Plus merchants. You can customize the string that controls how the gift message appears.
ShipStation Settings
Access Store Setup
- Go to Settings > Store Setup.
Edit Store Details
- Click the ellipsis (…) next to your store name and select Edit store details.
Custom Field Mapping
- Go to the General tab (or the appropriate tab for Shopify settings within your ShipStation store configuration).
- Find the Custom Field Mapping section.
- Map Custom Field 1 (or the desired custom field) to Order Meta Fields.
Important Note:
ShipStation currently treats all metafields as a single combined value. You cannot map individual metafields directly. All data stored in metafields will be sent to this custom field. If you have multiple metafields, they will be concatenated.
- Save your ShipStation settings.
Conclusion
Now, when an order is created in Shopify and includes the “Delivery Date” or “Gift Message” custom attribute, the Shopify Flow workflow will populate the corresponding metafield. ShipStation will then import all metafield data, into the specified custom field (Custom Field 1 in this example).