{
  "name": "Shopify Sipariş SMS Bildirimi (Başlıklı SMS)",
  "nodes": [
    {
      "parameters": {
        "topic": "orders/fulfilled"
      },
      "id": "shopify-trigger",
      "name": "Shopify Sipariş Tetikleyici",
      "type": "n8n-nodes-base.shopifyTrigger",
      "typeVersion": 1,
      "position": [220, 300]
    },
    {
      "parameters": {
        "jsCode": "const map = {'ç':'c','Ç':'C','ğ':'g','Ğ':'G','ı':'i','İ':'I','ö':'o','Ö':'O','ş':'s','Ş':'S','ü':'u','Ü':'U'};\nconst raw = items[0].json;\nconst phone = raw.shipping_address?.phone || raw.phone || raw.billing_address?.phone || raw.customer?.phone || '';\nconst name = `${raw.customer?.first_name || ''} ${raw.customer?.last_name || ''}`.trim() || 'Musterimiz';\nconst orderNo = raw.order_number || raw.name || raw.id;\nconst rawMsg = `Sayin ${name}, #${orderNo} nolu Shopify siparisiniz kargoya verildi.`;\nconst message = rawMsg.replace(/[çÇğĞıİöÖşŞüÜ]/g, (c) => map[c]);\nreturn [{ json: { orderId: raw.id, phone, message } }];"
      },
      "id": "shopify-gsm7",
      "name": "GSM-7 Türkçe Karakter Dönüştür",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [460, 300]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://basliklisms.com/api/v1/sms/send",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            { "name": "X-API-Key", "value": "={{ $env.BASLIKLISMS_API_KEY }}" },
            { "name": "Idempotency-Key", "value": "={{ 'shopify-' + $json.orderId }}" }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify({ header: 'MAGAZANIZ', message: $json.message, recipients: [$json.phone] }) }}"
      },
      "id": "shopify-send-sms",
      "name": "Başlıklı SMS Gönder",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [700, 300]
    }
  ],
  "connections": {
    "Shopify Sipariş Tetikleyici": {
      "main": [[{ "node": "GSM-7 Türkçe Karakter Dönüştür", "type": "main", "index": 0 }]]
    },
    "GSM-7 Türkçe Karakter Dönüştür": {
      "main": [[{ "node": "Başlıklı SMS Gönder", "type": "main", "index": 0 }]]
    }
  },
  "active": false,
  "settings": { "executionOrder": "v1" }
}
