For the complete documentation index, see llms.txt. This page is also available as Markdown.

3.4 🌿 Let's Create Data in Shopify

Let’s Create a New Product in Shopify (POST API Call with Mapping & Modifiers)

Scenario

Assume you receive product data from a PIM system in this format:

{
   "name": "burton custom freestyle 151",
   "body_html": "<strong>Good snowboard!</strong>",
   "vendor": "Burton",
   "type": "Snowboard",
   "status": 0
 }

But Shopify expects the data in this format:

{
 "product": {
   "title": "Burton Custom Freestyle 151",
   "body_html": "<strong>Good snowboard!</strong>",
   "vendor": "Burton",
   "product_type": "Snowboard",
   "status": "draft"
 }
}

👉 So, we need to:

  • Map fields (e.g., name → title)

  • Modify values (e.g., format text, convert status)

1

Mock Source Data Using Code Runner

To keep things simple, we will simulate (mock) the PIM system response.

  • Add a Code Runner step above the Shopify step

  • Paste the following code:

📌 This acts as the input data from the PIM system.

2

Configure Payload Using Data Hub

  • Edit the Shopify step

  • Remove the existing payload

  • Select the Code Runner step from Data Hub

  • The payload will appear as {{1}}

Add Mock Data

To help DCKAP Integrator understand the expected structure:

3

Add Mapping

  • Click Add Mapping

  • You will see:

    • Left side → Input fields (from PIM)

    • Right side → Required fields (Shopify format)

    👉 Drag and drop to map fields:

4

Apply Modifiers (Data Transformation)

Modifiers help you transform values during mapping.

Example Transformations

Input Field

Input Value

Modifier

Output Field

Output Value

name

"burton custom freestyle 151"

TITLE(name)

title

"Burton Custom Freestyle 151"

body_html

"<strong>Good snowboard!</strong>"

-

body_html

"<strong>Good snowboard!</strong>"

vendor

"Burton"

-

vendor

"Burton"

type

"Snowboard"

-

product_type

"Snowboard"

status

0

CONVERTER

(status, )

status

"draft"

Add modifiers by clicking on the Modifier icon between the source and destination fields.

Using Converter Modifier (for Status)

We need to convert numeric status into text:

  • 0 → draft

  • 1 → active

  • 2 → archived

Steps:

  • Click the modifier icon

  • Search for Converter

  • Add mappings:

  • 0 → draft

  • 1 → active

  • 2 → archived

  • Click Submit → Save

The steps where you have added Modifiers appear in Green.

Preview Your Mapping

  • Open the modifier icon

  • Enter a sample value

  • Click Check to see the output

Save Mapping

  • Click Save & Exit to return to the workflow

5

Run and Verify

  • Under Show Output in Console Logs, check Mapping & Modifiers Response

  • Save the workflow

  • Click Sync Now

  • Go to Logs → View Console

Check the final data sent to Shopify via API Request Information and Mapping & Modifiers Response.

🎉 Tada! You have successfully applied Mapping & Modifiers in your workflow.

Last updated

Was this helpful?