{
  "name": "Create a cryptocurrency-powered API for selling resources with AgentGatePay",
  "nodes": [
    {
      "id": "2a5eb6b5-b01e-43fb-adef-7cc5aa35c92c",
      "name": "📡 GET /resource/{id}",
      "type": "n8n-nodes-base.webhook",
      "position": [
        592,
        208
      ]
    },
    {
      "id": "66292d2e-2752-48da-b970-bbb96cc87a5a",
      "name": "1️⃣ Parse Request",
      "type": "n8n-nodes-base.code",
      "position": [
        800,
        208
      ]
    },
    {
      "id": "256e6d34-a4d0-4d0b-9b0a-427b29a9ddb6",
      "name": "2️⃣ Has Payment?",
      "type": "n8n-nodes-base.if",
      "position": [
        992,
        208
      ]
    },
    {
      "id": "aa1acd74-3c89-4efc-96a3-e5a335a0f868",
      "name": "3️⃣ Generate 402",
      "type": "n8n-nodes-base.code",
      "position": [
        1200,
        32
      ]
    },
    {
      "id": "cb658f93-2039-4182-bec1-ac3214991bc7",
      "name": "4️⃣ Send 402",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        1408,
        32
      ]
    },
    {
      "id": "69e40d79-e0c8-473f-8fc4-87d20ad63071",
      "name": "5️⃣ Verify Payment",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1200,
        304
      ]
    },
    {
      "id": "9a0c0569-a791-4d26-bcaf-2712eb0d575c",
      "name": "6️⃣ Validate Payment",
      "type": "n8n-nodes-base.code",
      "position": [
        1408,
        304
      ]
    },
    {
      "id": "65e9dc23-b80b-4c7a-b64f-0720fff0273d",
      "name": "6B️⃣ Route: Valid?",
      "type": "n8n-nodes-base.if",
      "position": [
        1616,
        304
      ]
    },
    {
      "id": "8fca90fb-f0c5-49c5-8b9f-ec4053acb844",
      "name": "7️⃣ Deliver Resource",
      "type": "n8n-nodes-base.code",
      "position": [
        1808,
        128
      ]
    },
    {
      "id": "d2cba580-13ed-4815-afee-e77e296c985d",
      "name": "8️⃣ Send 200 OK",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        1984,
        128
      ]
    },
    {
      "id": "bdd63871-3b5c-49e3-b05c-1fda12928fd0",
      "name": "9️⃣ Send Error",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        1824,
        464
      ]
    },
    {
      "id": "b2d0e1f0-b135-49d5-9426-136260246560",
      "name": "START HERE",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        16,
        16
      ],
      "parameters": {
        "width": 500,
        "height": 620,
        "content": "# Seller Resource API\n\n**What it does:** Webhook that sells digital resources to AI agents. Verifies payments via AgentGatePay before delivering content.\n\n**Quick setup (3 min):**\n1. Edit Node 1: Add "
      }
    },
    {
      "id": "a3d381df-82d8-4298-9f0b-3e63a893cf5a",
      "name": "Sticky Note 1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        544,
        80
      ],
      "parameters": {
        "width": 600,
        "height": 300,
        "content": "## Request Processing\n\nWebhook receives GET request, parses your merchant config and headers, checks if buyer included a payment tx_hash, then routes accordingly."
      }
    },
    {
      "id": "0cde0860-3d4f-4f29-bcda-5a7a1ade6827",
      "name": "Sticky Note 2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1168,
        160
      ],
      "parameters": {
        "width": 480,
        "height": 300,
        "content": "## Payment Verification\n\nAsks AgentGatePay to verify the tx_hash. Checks if payment went to your wallet and matches the resource price. Routes to delivery or error."
      }
    },
    {
      "id": "62d614d0-0cf3-44f1-abf5-f0cbc40bb284",
      "name": "Sticky Note 3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1168,
        -80
      ],
      "parameters": {
        "width": 1040,
        "height": 348,
        "content": "## Response Handling\n\nGenerates 402 response when no payment, or delivers the paid resource with 200 OK. Handles errors like wrong amount or invalid tx_hash."
      }
    }
  ],
  "connections": {
    "2️⃣ Has Payment?": {
      "main": [
        [
          {
            "node": "5️⃣ Verify Payment",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "3️⃣ Generate 402",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "3️⃣ Generate 402": {
      "main": [
        [
          {
            "node": "4️⃣ Send 402",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "1️⃣ Parse Request": {
      "main": [
        [
          {
            "node": "2️⃣ Has Payment?",
            "type": "main",
            "index": 0
          },
          {
            "node": "9️⃣ Send Error",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "5️⃣ Verify Payment": {
      "main": [
        [
          {
            "node": "6️⃣ Validate Payment",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "6B️⃣ Route: Valid?": {
      "main": [
        [
          {
            "node": "7️⃣ Deliver Resource",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "9️⃣ Send Error",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "📡 GET /resource/{id}": {
      "main": [
        [
          {
            "node": "1️⃣ Parse Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "6️⃣ Validate Payment": {
      "main": [
        [
          {
            "node": "6B️⃣ Route: Valid?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "7️⃣ Deliver Resource": {
      "main": [
        [
          {
            "node": "8️⃣ Send 200 OK",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}