{
  "name": "DatosPerú · Consulta RUC con HTTP Request",
  "nodes": [
    {
      "parameters": {},
      "id": "manual",
      "name": "Ejecutar manualmente",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        0,
        0
      ]
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "ruc-input",
              "name": "ruc",
              "value": "",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "id": "input",
      "name": "Completa un RUC autorizado",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        240,
        0
      ],
      "notes": "Introduce un RUC real cuya consulta tengas autorizada. Una respuesta exitosa consume un crédito.",
      "notesInFlow": true
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.datosperu.net/api/v1/ruc",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify({ ruc: $json.ruc }) }}",
        "options": {
          "timeout": 30000
        }
      },
      "id": "request",
      "name": "DatosPerú · API RUC",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        480,
        0
      ],
      "retryOnFail": false,
      "notes": "Selecciona una credencial Header Auth: Name = Authorization; Value = Bearer seguido de tu API Key. No pegues secretos en este workflow.",
      "notesInFlow": true
    }
  ],
  "connections": {
    "Ejecutar manualmente": {
      "main": [
        [
          {
            "node": "Completa un RUC autorizado",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Completa un RUC autorizado": {
      "main": [
        [
          {
            "node": "DatosPerú · API RUC",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1",
    "saveDataSuccessExecution": "none",
    "saveDataErrorExecution": "none",
    "saveManualExecutions": false
  },
  "pinData": {},
  "tags": []
}
