{
  "name": "Etsy Variations - Sheet to per-SKU inventory (56 Design x Size)",
  "flow": [
    {
      "id": 1,
      "module": "google-sheets:searchRows",
      "version": 6,
      "parameters": {
        "__IMTCONN__": "<GOOGLE_CONNECTION_ID>"
      },
      "mapper": {
        "mode": "select",
        "spreadsheetId": "/<SPREADSHEET_ID>",
        "sheetId": "Variations",
        "includesHeaders": true,
        "filter": [],
        "limit": "500"
      },
      "metadata": {
        "designer": {
          "x": 0,
          "y": 0,
          "name": "Sheets: get 56 variation rows"
        }
      }
    },
    {
      "id": 2,
      "module": "etsy:createDraftListing",
      "version": 1,
      "parameters": {
        "__IMTCONN__": "<ETSY_CONNECTION_ID>"
      },
      "mapper": {
        "shop_id": "<SHOP_ID>",
        "quantity": "1",
        "title": "{{1.`0`.title}}",
        "description": "{{1.`0`.description}}",
        "price": "{{1.`0`.price}}",
        "who_made": "i_did",
        "when_made": "made_to_order",
        "taxonomy_id": "{{1.`0`.taxonomy_id}}",
        "type": "physical",
        "tags": "{{split(1.`0`.tags; \",\")}}"
      },
      "metadata": {
        "designer": {
          "x": 300,
          "y": 0,
          "name": "Etsy: create base draft listing"
        }
      }
    },
    {
      "id": 3,
      "module": "builtin:BasicFeeder",
      "version": 1,
      "mapper": {
        "array": "{{1.array}}"
      },
      "metadata": {
        "designer": {
          "x": 600,
          "y": 0,
          "name": "Iterator: each variation row"
        }
      }
    },
    {
      "id": 4,
      "module": "builtin:BasicAggregator",
      "version": 1,
      "parameters": {
        "feeder": 3
      },
      "mapper": {
        "sku": "{{3.sku}}",
        "property_values": "[{\"property_id\":513,\"property_name\":\"Design\",\"value_ids\":[{{3.design_value_id}}],\"values\":[\"{{3.design}}\"]},{\"property_id\":514,\"property_name\":\"Size\",\"value_ids\":[{{3.size_value_id}}],\"values\":[\"{{3.size}}\"]}]",
        "offerings": "[{\"price\":{{3.price}},\"quantity\":{{3.quantity}},\"is_enabled\":true,\"readiness_state_id\":1}]"
      },
      "metadata": {
        "designer": {
          "x": 900,
          "y": 0,
          "name": "Aggregator: build products[] array"
        }
      }
    },
    {
      "id": 5,
      "module": "etsy:makeApiCall",
      "version": 1,
      "parameters": {
        "__IMTCONN__": "<ETSY_CONNECTION_ID>"
      },
      "mapper": {
        "url": "/v3/application/listings/{{2.listing_id}}/inventory",
        "method": "PUT",
        "headers": [
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "body": "{\"products\":[{{4.array}}],\"price_on_property\":[513,514],\"sku_on_property\":[513,514],\"quantity_on_property\":[513,514]}"
      },
      "metadata": {
        "designer": {
          "x": 1200,
          "y": 0,
          "name": "Etsy: updateListingInventory (56 products)"
        }
      }
    }
  ],
  "metadata": {
    "instant": false,
    "version": 1,
    "scenario": {
      "roundtrips": 1,
      "maxErrors": 3,
      "autoCommit": true,
      "autoCommitTriggerLast": true,
      "sequential": false,
      "slots": null,
      "confidential": false,
      "dataloss": false,
      "dlq": false,
      "freshVariables": false
    },
    "designer": {
      "orphans": []
    },
    "zone": "eu2.make.com"
  }
}