{
  "name": "Mercado Pago - Processar Notifica\u00e7\u00e3o de Webhook",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "webhook-mercadopago",
        "responseMode": "lastNode"
      },
      "id": "webhook-trigger",
      "name": "Webhook - Notifica\u00e7\u00e3o",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 1,
      "position": [
        250,
        300
      ]
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict"
          },
          "conditions": [
            {
              "id": "check-type",
              "leftValue": "={{ $json.body.type }}",
              "rightValue": "payment",
              "operator": {
                "type": "string",
                "operation": "equals"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "id": "if-payment",
      "name": "Se for Pagamento",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2,
      "position": [
        450,
        300
      ]
    },
    {
      "parameters": {
        "resource": "pix",
        "operation": "get",
        "paymentId": "={{ $json.body.data.id }}"
      },
      "id": "consultar-pagamento",
      "name": "Consultar Pagamento",
      "type": "n8n-nodes-mercadopago-flow.mercadoPago",
      "typeVersion": 1,
      "position": [
        650,
        200
      ],
      "credentials": {
        "mercadoPagoApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "resource": "subscriptions",
        "operation": "get",
        "subscriptionId": "={{ $json.body.data.id }}"
      },
      "id": "consultar-assinatura",
      "name": "Consultar Assinatura",
      "type": "n8n-nodes-mercadopago-flow.mercadoPago",
      "typeVersion": 1,
      "position": [
        650,
        400
      ],
      "credentials": {
        "mercadoPagoApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "respondWith": "json",
        "responseBody": "={{ { \"status\": \"ok\", \"processed\": true } }}",
        "options": {}
      },
      "id": "respond-webhook",
      "name": "Responder Webhook",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1,
      "position": [
        850,
        300
      ]
    }
  ],
  "connections": {
    "Webhook - Notifica\u00e7\u00e3o": {
      "main": [
        [
          {
            "node": "Se for Pagamento",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Se for Pagamento": {
      "main": [
        [
          {
            "node": "Consultar Pagamento",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Consultar Assinatura",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Consultar Pagamento": {
      "main": [
        [
          {
            "node": "Responder Webhook",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Consultar Assinatura": {
      "main": [
        [
          {
            "node": "Responder Webhook",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "staticData": null,
  "tags": [],
  "triggerCount": 0,
  "updatedAt": "2025-01-02T00:00:00.000Z",
  "versionId": "1"
}