/lending/v1/hierarchies/{id}/nodes

Crear nodo en una jerarquía

El endpoint lending/v1/hierarchies/{id}/nodes te permite crear un nodo dentro de la jerarquía de una línea de crédito.

  • Usá como parent_node_id un nodo de la misma jerarquía; si no existe, la solicitud responde 404 NOT_FOUND. Si el tipo del padre no admite el tipo del nodo nuevo, responde 400 BAD_REQUEST.
  • El nodo toma el país y la moneda de la línea de crédito de la jerarquía.
  • Los nodos COMPANY_AREA se crean en ACTIVE. Los nodos COMPANY_USER y END_USER_ADDITIONAL se crean en ACTIVE si enviás card_ids, y en PENDING si no. Una tarjeta que ya está asociada a un nodo se rechaza con 409 CONFLICT.
  • En rules se devuelven solo rule_id y type de cada regla; para ver su detalle, consultá el nodo con GET.

Parámetros disponibles

Variante:

Este endpoint acepta múltiples tipos de body. Seleccioná una variante para ver sus parámetros y ejemplo.

Path Parameters
idString
Cuerpo de solicitud
application/json
typeenum
parent_node_idstring
namestring
creditobject3 propiedades
rulesarray4 propiedades

Autenticación

🔒BearerAuthhttp

Detalle de respuestas

401
El token falta o es inválido. La respuesta no tiene cuerpo.
403
Sin cuerpo. El token es válido pero no tiene el scope que requiere el endpoint.

Ejemplo de solicitud
{
  "type": "COMPANY_AREA",
  "parent_node_id": "nod-2HMvSDccc5PZzCvZ98lfeXamPle",
  "name": "Marketing",
  "credit": {
    "validity_period": {
      "start_date": "2026-11-01",
      "end_date": "2027-10-31"
    },
    "renewal_policy": {
      "frequency": "MONTHLY"
    },
    "balance": {
      "source": "OWNED",
      "limits": {
        "single_payment": {
          "limit": 40000
        },
        "installments": {
          "limit": 20000
        },
        "cash_advance": {
          "limit": 5000
        }
      }
    }
  }
}
Ejemplo de código
curl -X POST "https://api.pomelo.la/lending/v1/hierarchies/example_value/nodes" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
  "type": "COMPANY_AREA",
  "parent_node_id": "nod-2HMvSDccc5PZzCvZ98lfeXamPle",
  "name": "Marketing",
  "credit": {
    "validity_period": {
      "start_date": "2026-11-01",
      "end_date": "2027-10-31"
    },
    "renewal_policy": {
      "frequency": "MONTHLY"
    },
    "balance": {
      "source": "OWNED",
      "limits": {
        "single_payment": {
          "limit": 40000
        },
        "installments": {
          "limit": 20000
        },
        "cash_advance": {
          "limit": 5000
        }
      }
    }
  }
}'
Ejemplo de respuesta (201)Nodo de la jerarquía
{
  "data": {
    "id": "nod-2HMwKzetERdOEhbT86UweXamPle",
    "hierarchy_id": "hie-2HMwKzetERdOEhbT86UweXamPle",
    "parent_node_id": "nod-2HMvSDccc5PZzCvZ98lfeXamPle",
    "lifecycle": {
      "status": {
        "value": {}
      },
      "created_at": "2026-10-03T14:20:11.120Z",
      "updated_at": "2026-10-03T14:20:11.120Z"
    },
    "name": "Marketing",
    "type": "COMPANY_AREA",
    "link_ref": {
      "id": "lcr-2HMwKzetERdOEhbT86UweXamPle",
      "type": "CREDIT_LINE"
    },
    "card_ids": [
      "crd-2HMvSDccc5PZzCvZ98lfeXamPle"
    ],
    "ancestor_ids": [
      "nod-2HMvSDccc5PZzCvZ98lfeXamPle"
    ],
    "credit": {
      "validity_period": {
        "start_date": "2026-11-01",
        "end_date": "2027-10-31"
      },
      "renewal_policy": {
        "frequency": "MONTHLY"
      },
      "balance": {
        "source": "OWNED",
        "currency": "PEN",
        "limit_type": "PER_OPERATION",
        "restitution_type": "EXTENDED",
        "single_payment": {
          "limit": 4000,
          "utilization": 1250,
          "available": 2750
        },
        "installments": {
          "limit": 4000,
          "utilization": 1250,
          "available": 2750
        },
        "cash_advance": {
          "limit": 1000,
          "utilization": 0,
          "available": 1000,
          "percentage_of_single_payment": 30
        }
      }
    },
    "rules": [
      {
        "rule_id": "2HMwKzetERdOEhbT86UweXamPle",
        "type": "MCC",
        "condition": {},
        "value": [
          "5411",
          "5412"
        ],
        "action": {}
      }
    ]
  }
}

Pomelo AI

Asistente de inteligencia artificial para consultas sobre la API de Pomelo
¡Hola!¿Cómo puedo ayudarte hoy?