{
  "name": "Monetize workflows with x402 Payment Protocol and 1Shot API",
  "nodes": [
    {
      "id": "bf854266-4250-4491-af67-ff8fc3b63ac6",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -768,
        -48
      ]
    },
    {
      "id": "a2f18d76-8bea-4d1c-9287-6c0a7594d6da",
      "name": "On Successful Payment Simulation",
      "type": "n8n-nodes-base.if",
      "position": [
        128,
        -144
      ]
    },
    {
      "id": "5b29d382-d7dc-484c-b700-3de0c5935c8a",
      "name": "Response: 200 - Payment Successful",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        576,
        -336
      ]
    },
    {
      "id": "ff4b8de5-6be4-4cce-abc6-05e3902eb535",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1424,
        -400
      ],
      "parameters": {
        "width": 536,
        "height": 492,
        "content": "## x402 Payment Endpoint \n\nThis workflow fragment can be used to monetize any workflow you can build in n8n by accepting stablecoin payments via an API call.\n\nLearn more about the [x402 payment](https"
      }
    },
    {
      "id": "7edff090-85d5-48e6-9d86-203bbf3cea11",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -784,
        -288
      ],
      "parameters": {
        "width": 584,
        "height": 208,
        "content": "## Configure Payment Tokens\n\n1. Log into 1Shot API and create an API key & Secret, then use those & your business ID to create an n8n credential for the 1Shot API nodes. \n2. Set the `Payment Token Con"
      }
    },
    {
      "id": "9b46463f-be85-47e2-a05c-96a696f1965f",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        400,
        -512
      ],
      "parameters": {
        "width": 496,
        "height": 168,
        "content": "## Put your workflow down here \n\nOnce the payment transaction has been confirmed, replace the `Response: 200 - Payment Successful` block with your workflow which responds to the user with the appropri"
      }
    },
    {
      "id": "4e74105c-cf34-45bb-a805-9e3dec1b2435",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1072,
        176
      ],
      "parameters": {
        "width": 840,
        "height": 280,
        "content": "## Example Curl Command\n\nGenerate x-payment headers with the 1Shot API [x402 tool](https://1shotapi.com/tools). You can test the webhook endpoint with a command like this (be sure to use a properly fo"
      }
    },
    {
      "id": "5692fcd3-9b3d-43c2-9144-278be366a557",
      "name": "Response: Missing or Invalid Payment Headers1",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        -96,
        48
      ]
    },
    {
      "id": "2ec2cab4-0200-4833-8a1a-7d45ea2d3461",
      "name": "Validate & Verify X-Payment Header",
      "type": "n8n-nodes-base.code",
      "position": [
        -320,
        -48
      ]
    },
    {
      "id": "8790cc26-6626-47fe-ae0f-8142b3fde734",
      "name": "Response: Payment Failed",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        576,
        -144
      ]
    },
    {
      "id": "44804e99-bc8a-4142-b819-665ffc93132e",
      "name": "Response: Payment Invalid",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        352,
        -48
      ]
    },
    {
      "id": "12531a0e-a77f-4aab-bce9-b4bc83a6b8c9",
      "name": "Payment Token Configs",
      "type": "n8n-nodes-base.code",
      "position": [
        -544,
        -48
      ]
    },
    {
      "id": "1f182441-25da-41cc-913d-8e724866d7d3",
      "name": "Settle Payment",
      "type": "n8n-nodes-1shot.oneShotSynch",
      "position": [
        352,
        -240
      ]
    },
    {
      "id": "6cad76b8-1a56-4028-92f4-a6fb696e1647",
      "name": "Verify Payment",
      "type": "n8n-nodes-1shot.oneShot",
      "position": [
        -96,
        -144
      ]
    }
  ],
  "connections": {
    "Webhook": {
      "main": [
        [
          {
            "node": "Payment Token Configs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Settle Payment": {
      "main": [
        [
          {
            "node": "Response: 200 - Payment Successful",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Response: Payment Failed",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Verify Payment": {
      "main": [
        [
          {
            "node": "On Successful Payment Simulation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Payment Token Configs": {
      "main": [
        [
          {
            "node": "Validate & Verify X-Payment Header",
            "type": "main",
            "index": 0
          }
        ],
        []
      ]
    },
    "On Successful Payment Simulation": {
      "main": [
        [
          {
            "node": "Settle Payment",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Response: Payment Invalid",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Validate & Verify X-Payment Header": {
      "main": [
        [
          {
            "node": "Verify Payment",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Response: Missing or Invalid Payment Headers1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}