{
  "name": "Create a self-hosted blockchain payment processor with x402 and 1Shot API",
  "nodes": [
    {
      "id": "18ef87da-599a-4aa9-89cb-dab6ac024abe",
      "name": "Simulate Payment",
      "type": "n8n-nodes-1shot.oneShot",
      "position": [
        208,
        32
      ]
    },
    {
      "id": "d6d7add8-77b1-4083-9dbb-f4140e96dd56",
      "name": "/verify",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -688,
        416
      ]
    },
    {
      "id": "734689a3-1a5a-4e75-aeff-0cfe1906147a",
      "name": "/settle",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -688,
        608
      ]
    },
    {
      "id": "21939197-b339-42fc-94d8-2bbdb2442a0e",
      "name": "Settlement Response",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        432,
        224
      ]
    },
    {
      "id": "5fa377a6-f450-497d-bec0-ad19c08bdcfc",
      "name": "Verify Response",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        432,
        32
      ]
    },
    {
      "id": "3a22826f-7857-4e5b-9239-a504b6a4b918",
      "name": "Response: Bad POST Body (/verify)",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        -16,
        704
      ]
    },
    {
      "id": "954e3c34-dad9-4c62-b5a6-97cff5a642dd",
      "name": "Response: Bad POST Body (/settle)",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        -16,
        896
      ]
    },
    {
      "id": "63d9fe6a-7618-429b-9e47-db9451542337",
      "name": "1Shot API Submit & Wait",
      "type": "n8n-nodes-1shot.oneShotSynch",
      "position": [
        208,
        224
      ]
    },
    {
      "id": "019b8699-64d1-4404-9ba2-3c61a377fd8a",
      "name": "Check POST Payload",
      "type": "n8n-nodes-base.if",
      "position": [
        -464,
        512
      ]
    },
    {
      "id": "08df85be-f602-4710-a9ca-340e39c9816b",
      "name": "/supported",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -688,
        1120
      ]
    },
    {
      "id": "5b19047c-d340-4cfc-9909-b7589b999a32",
      "name": "Response: Return Supported Networks",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        -240,
        1120
      ]
    },
    {
      "id": "ac002b7a-108e-49b6-bed7-16bb8477fe6e",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1168,
        64
      ],
      "parameters": {
        "width": 448,
        "height": 464,
        "content": "## /verify endpoint\n\nThe verify endpoint will check that the given `x-payment` header, given the associated `paymentRequirements`, are valid. If the payment details are valid this endpoint will return"
      }
    },
    {
      "id": "cea02913-92b7-45aa-bcb2-1e3dc3a8d588",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1168,
        592
      ],
      "parameters": {
        "width": 432,
        "height": 464,
        "content": "## /settle endpoint\n\nThe settle endpoint will attempt to settle a payment to the target blockchain given the provided payment details. If this endpoint fails it will return with:\n```sh\n{\n  success: fa"
      }
    },
    {
      "id": "9cd414aa-fa67-4c9c-8177-6a3568d43af2",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -464,
        48
      ],
      "parameters": {
        "width": 320,
        "height": 240,
        "content": "## Accepted Tokens Config \n\nYou must edit the payment tokens `config` object in the `Lookup Payments Config` node with the token details of all tokens you wish to support with your facilitator. \n\n*Imp"
      }
    },
    {
      "id": "e788d782-8540-437e-b86f-a3d14c75b885",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1152,
        1152
      ],
      "parameters": {
        "width": 416,
        "height": 320,
        "content": "## /supported endpoint\n\nThis endpoint returns the blockchain networks your facilitator will support. Its output looks like: \n\n\n```sh\n{\n  kinds: [\n    {\n      \"scheme\": string,\n      \"network\": string,"
      }
    },
    {
      "id": "64f5beea-0952-4aca-9c07-3ec3eef523d8",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -544,
        1344
      ],
      "parameters": {
        "width": 384,
        "height": 176,
        "content": "## Supported Networks Config\n\nBe sure to update the `Supported Networks Config` node to reflect the networks you have configured your 1Shot API account to process. "
      }
    },
    {
      "id": "c6292c7a-cac1-46be-a61c-b80170aa1a93",
      "name": "Supported Networks Config",
      "type": "n8n-nodes-base.code",
      "position": [
        -464,
        1120
      ]
    },
    {
      "id": "9fb18099-c840-47af-b8d6-9f8107c05dd3",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2000,
        400
      ],
      "parameters": {
        "width": 800,
        "height": 928,
        "content": "## Example Facilitator Curl Request\n\nHere is a complete curl request you can use to test your node (be sure to change the URL to point at your n8n webhook):\n\n```sh\ncurl -X POST \\\n  https://n8n.1shotap"
      }
    },
    {
      "id": "7c69392c-d424-4639-909e-588a5f17cee2",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        16,
        -240
      ],
      "parameters": {
        "width": 432,
        "height": 224,
        "content": "## Create Your 1Shot API Credential\n\nDon't forget to authenticate against your 1Shot API business by creating an n8n credential. \n\nClick on one of the 1Shot API nodes, then click on `Credential to con"
      }
    },
    {
      "id": "efa373f0-b6ae-4a46-b6f2-ec6f6d2eae67",
      "name": "Unsupported Token",
      "type": "n8n-nodes-base.if",
      "position": [
        -16,
        512
      ]
    },
    {
      "id": "c7ab50fa-af33-41ec-849f-a53f7ec7b54d",
      "name": "verify or settle",
      "type": "n8n-nodes-base.if",
      "position": [
        -16,
        128
      ]
    },
    {
      "id": "b80d7ac0-14bc-4dfb-936b-a09c3644ba53",
      "name": "Response: Unsupported Token (/verify)",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        208,
        416
      ]
    },
    {
      "id": "f57b3f31-2f63-482a-87d7-cdeb8884f0de",
      "name": "Response: Unsupported Token (/settle)",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        208,
        608
      ]
    },
    {
      "id": "c94b228a-7a92-45b9-9ded-fb34186eaa2e",
      "name": "Bad Payload",
      "type": "n8n-nodes-base.if",
      "position": [
        -240,
        800
      ]
    },
    {
      "id": "68d961ac-3d63-40ff-aecb-acb5d3c8e8f4",
      "name": "Lookup Payment Configs & Split Signature",
      "type": "n8n-nodes-base.code",
      "position": [
        -240,
        320
      ]
    },
    {
      "id": "788f68b0-4429-4828-b77a-4e58b4dad955",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1904,
        -80
      ],
      "parameters": {
        "width": 576,
        "height": 432,
        "content": "## Docs & Setup Tutorial\n\n@[youtube](J4ftyV-wz50)\n\nYou can check out our [docs link](https://docs.1shotapi.com/automation/n8n.html#host-your-own-x402-facilitator) or start with the [YouTube tutorial]("
      }
    }
  ],
  "connections": {
    "/settle": {
      "main": [
        [
          {
            "node": "Check POST Payload",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "/verify": {
      "main": [
        [
          {
            "node": "Check POST Payload",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "/supported": {
      "main": [
        [
          {
            "node": "Supported Networks Config",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Bad Payload": {
      "main": [
        [
          {
            "node": "Response: Bad POST Body (/verify)",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Response: Bad POST Body (/settle)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Simulate Payment": {
      "main": [
        [
          {
            "node": "Verify Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "verify or settle": {
      "main": [
        [
          {
            "node": "Simulate Payment",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "1Shot API Submit & Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Unsupported Token": {
      "main": [
        [
          {
            "node": "Response: Unsupported Token (/verify)",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Response: Unsupported Token (/settle)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check POST Payload": {
      "main": [
        [
          {
            "node": "Lookup Payment Configs & Split Signature",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Bad Payload",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "1Shot API Submit & Wait": {
      "main": [
        [
          {
            "node": "Settlement Response",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Settlement Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Supported Networks Config": {
      "main": [
        [
          {
            "node": "Response: Return Supported Networks",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Lookup Payment Configs & Split Signature": {
      "main": [
        [
          {
            "node": "verify or settle",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Unsupported Token",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}