{
  "name": "Nodbot - Ozon Seller API postings and stock sync",
  "nodes": [
    {
      "parameters": {
        "path": "integration-ozon-seller-api-n8n-stock-orders",
        "httpMethod": "POST",
        "responseMode": "responseNode"
      },
      "id": "8f1ddb4e-9a32-4389-a635-5af972864470",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        0,
        260
      ]
    },
    {
      "parameters": {
        "jsCode": "const src = $json.body ?? $json;\nconst posting = src.posting ?? src;\nconst postingNumber = String(posting.posting_number ?? posting.order_number ?? '').trim();\nif (!postingNumber) throw new Error('No Ozon posting_number');\nconst products = Array.isArray(posting.products) ? posting.products.map(p => ({\n  sku: String(p.sku ?? '').trim(),\n  offer_id: String(p.offer_id ?? '').trim(),\n  name: String(p.name ?? '').trim(),\n  quantity: Number(p.quantity ?? 0),\n  price: Number(p.price ?? 0)\n})) : [];\nif (!products.length) throw new Error(`No Ozon products for posting ${postingNumber}`);\nreturn products.map(product => ({ json: {\n  action: 'upsert_ozon_posting_line',\n  idempotency_key: `ozon:${postingNumber}:${product.sku || product.offer_id}`,\n  posting_number: postingNumber,\n  status: String(posting.status ?? '').trim(),\n  sku: product.sku,\n  offer_id: product.offer_id,\n  product_name: product.name,\n  quantity: product.quantity,\n  price: product.price,\n  region: String(posting.analytics_data?.region ?? '').trim(),\n  synced_at: new Date().toISOString()\n}}));"
      },
      "id": "62a78bb6-69ac-44b7-bfc3-6e0b54494d74",
      "name": "Build Ozon request window",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        280,
        260
      ]
    },
    {
      "parameters": {},
      "id": "dec85800-a0f1-4da0-be0a-f4ab63c8c227",
      "name": "Fetch Ozon Seller API",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 2,
      "position": [
        560,
        260
      ]
    },
    {
      "parameters": {
        "jsCode": "const src = $json.body ?? $json;\nconst posting = src.posting ?? src;\nconst postingNumber = String(posting.posting_number ?? posting.order_number ?? '').trim();\nif (!postingNumber) throw new Error('No Ozon posting_number');\nconst products = Array.isArray(posting.products) ? posting.products.map(p => ({\n  sku: String(p.sku ?? '').trim(),\n  offer_id: String(p.offer_id ?? '').trim(),\n  name: String(p.name ?? '').trim(),\n  quantity: Number(p.quantity ?? 0),\n  price: Number(p.price ?? 0)\n})) : [];\nif (!products.length) throw new Error(`No Ozon products for posting ${postingNumber}`);\nreturn products.map(product => ({ json: {\n  action: 'upsert_ozon_posting_line',\n  idempotency_key: `ozon:${postingNumber}:${product.sku || product.offer_id}`,\n  posting_number: postingNumber,\n  status: String(posting.status ?? '').trim(),\n  sku: product.sku,\n  offer_id: product.offer_id,\n  product_name: product.name,\n  quantity: product.quantity,\n  price: product.price,\n  region: String(posting.analytics_data?.region ?? '').trim(),\n  synced_at: new Date().toISOString()\n}}));"
      },
      "id": "1c8b64ea-6705-46ac-bf21-3f6663170ff8",
      "name": "Normalize Ozon data",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        840,
        260
      ]
    },
    {
      "parameters": {},
      "id": "d6e8e8b6-e382-4930-b907-ab88bd74ea16",
      "name": "Upsert CRM or warehouse",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 2,
      "position": [
        1120,
        260
      ]
    },
    {
      "parameters": {},
      "id": "372e2eda-2cf8-44fc-a5b7-9961d4c19fc9",
      "name": "Alert and save cursor",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 2,
      "position": [
        1400,
        260
      ]
    }
  ],
  "connections": {
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Build Ozon request window",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Build Ozon request window": {
      "main": [
        [
          {
            "node": "Fetch Ozon Seller API",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Ozon Seller API": {
      "main": [
        [
          {
            "node": "Normalize Ozon data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Normalize Ozon data": {
      "main": [
        [
          {
            "node": "Upsert CRM or warehouse",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upsert CRM or warehouse": {
      "main": [
        [
          {
            "node": "Alert and save cursor",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "staticData": null,
  "tags": [
    "nodbot",
    "integration",
    "production"
  ],
  "triggerCount": 1,
  "updatedAt": "2026-05-30T00:00:00.000Z",
  "versionId": "08b57119-5983-41c6-846f-d0ddb575f5a7",
  "meta": {
    "templateCredsSetupCompleted": false
  }
}