{
  "name": "Automatically send WhatsApp discount codes to Shopify customers using Rapiwa",
  "nodes": [
    {
      "id": "f168dde7-9e0e-407c-b303-6ea10aac4353",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        1232,
        624
      ]
    },
    {
      "id": "8195a385-5359-49ac-98ec-fa1b420f2f1d",
      "name": "If",
      "type": "n8n-nodes-base.if",
      "position": [
        3024,
        640
      ]
    },
    {
      "id": "0c976026-d9ac-4ee2-a5ee-e37bb007c50e",
      "name": "Wait",
      "type": "n8n-nodes-base.wait",
      "position": [
        3504,
        704
      ]
    },
    {
      "id": "31e045f5-511e-49f7-8695-0043fe6fb5bb",
      "name": "Clean WhatsApp Number",
      "type": "n8n-nodes-base.code",
      "position": [
        2512,
        640
      ]
    },
    {
      "id": "aaa23891-6e2d-4cca-bdcd-276b3b53ed17",
      "name": "Clean Webhooks Response Data",
      "type": "n8n-nodes-base.code",
      "position": [
        1456,
        624
      ]
    },
    {
      "id": "b1fdf13b-9648-4fb0-8785-255261aa84bd",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        2256,
        624
      ]
    },
    {
      "id": "484ecd1a-c9da-4e4e-aad6-663ada850870",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -128,
        336
      ],
      "parameters": {
        "width": 1168,
        "height": 1248,
        "content": "# Automatically Send WhatsApp Discount Codes to Shopify Customers Using Rapiwa\n\n## Overview\nThis n8n workflow **triggers when a new discount code is created in Shopify**. It **fetches customers**, **f"
      }
    },
    {
      "id": "d7993dbb-5885-4a16-81d8-2c9b9d868886",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1088,
        352
      ],
      "parameters": {
        "width": 624,
        "height": 560,
        "content": "## 1. Webhook \nReceives Shopify Webhook (discount creation) via HTTP POST request.  \nThis is triggered when a discount is created in your Shopify store.\n\n## 2. Clean Webhooks Response Data\nExtracts us"
      }
    },
    {
      "id": "dc59f834-6f18-42a8-870b-22cf09a92eda",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1728,
        352
      ],
      "parameters": {
        "width": 448,
        "height": 560,
        "content": "## 1. Get All Customer Data In Store\nFetches all customer data from the Shopify store using your API credentials.\n\n\n## 2. Clean HTTP Request Data (Filter & Format Customers) \nFilters customers whose t"
      }
    },
    {
      "id": "3366ce0c-0d80-4c99-b750-ddbe9a3565c7",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2448,
        352
      ],
      "parameters": {
        "width": 384,
        "height": 560,
        "content": "## 1. Clean WhatsApp Number\nCleans the WhatsApp number by:\n- Converting it to a string (if needed)  \n- Removing non-digit characters  \n\n## 2. Check Valid WhatsApp Number Using Rapiwa\n**API Endpoint:**"
      }
    },
    {
      "id": "e0f334ec-45b0-4ba4-bd92-fc72f687bf6a",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2928,
        176
      ],
      "parameters": {
        "width": 816,
        "height": 736,
        "content": "## 1. Node: If (Condition Check)  \nChecks the Rapiwa API response to see if the phone number is verified as a WhatsApp number.\n\n## 2. Node: Send Message Using Rapiwa  \nSends a personalized discount me"
      }
    },
    {
      "id": "56c123fc-edad-4d59-bb62-e3d009d0dbcf",
      "name": "Get All Customer Data In Shopify Store",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1776,
        624
      ]
    },
    {
      "id": "22ae91ae-2286-46ce-b1e6-8f6cac7d3fc4",
      "name": "Clean Customer Data In Shopify Store",
      "type": "n8n-nodes-base.code",
      "position": [
        1984,
        624
      ]
    },
    {
      "id": "4f0c8dca-3b77-4aeb-b61d-5d72951d8425",
      "name": "Save data Sheet Unverified & Not sent",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        3264,
        704
      ]
    },
    {
      "id": "91abd2bc-3bb1-4ebc-a1dd-d30218ffd60d",
      "name": "Save data in Sheet Verified & Sent",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        3472,
        512
      ]
    },
    {
      "id": "fc3e6a69-1504-4f5e-a514-281423af0edd",
      "name": "Rapiwa",
      "type": "n8n-nodes-rapiwa.rapiwa",
      "position": [
        2688,
        640
      ]
    },
    {
      "id": "5ecf41dc-a221-4b4c-b73f-bfd57f458392",
      "name": "Rapiwa1",
      "type": "n8n-nodes-rapiwa.rapiwa",
      "position": [
        3248,
        512
      ]
    }
  ],
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "Rapiwa1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Save data Sheet Unverified & Not sent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Rapiwa": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Rapiwa1": {
      "main": [
        [
          {
            "node": "Save data in Sheet Verified & Sent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook": {
      "main": [
        [
          {
            "node": "Clean Webhooks Response Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "Clean WhatsApp Number",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Clean WhatsApp Number": {
      "main": [
        [
          {
            "node": "Rapiwa",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Clean Webhooks Response Data": {
      "main": [
        [
          {
            "node": "Get All Customer Data In Shopify Store",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save data in Sheet Verified & Sent": {
      "main": [
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Clean Customer Data In Shopify Store": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save data Sheet Unverified & Not sent": {
      "main": [
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get All Customer Data In Shopify Store": {
      "main": [
        [
          {
            "node": "Clean Customer Data In Shopify Store",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}