/lending/v1/products/{product_id}/segments

Crear segmento

El endpoint lending/v1/products/{product_id}/segments te permite crear un nuevo segmento para un producto con una configuración de pricing específica.

Parámetros disponibles

Path Parameters
product_idString
Cuerpo de solicitud
application/json
namestring
pricingobject2 propiedades
credit_cardobject2 propiedades
refinancingobject2 propiedades

Detalle de respuestas

Ejemplo de solicitud
{
  "name": "Premium Segment",
  "pricing": {
    "rates": {
      "financing": "15.00",
      "late_fee": "25.00",
      "cash_advance": "50.00",
      "revolving": "100.00",
      "revolving_by_limit": [
        {
          "from_amount": "0",
          "unit_type": "CLP",
          "rate": "100.00"
        }
      ]
    },
    "fees": [
      {
        "name": "cash_advance",
        "amount": "15.00",
        "frequency": "PER_OPERATION",
        "operation": "CASH_ADVANCE",
        "type": "FLAT"
      }
    ]
  },
  "credit_card": {
    "minimum_payment": 100,
    "minimum_payment_composition": {
      "revolving": 50,
      "cash_advances": 30,
      "financing": 80,
      "annuities": 100,
      "purchases": 20
    }
  },
  "refinancing": {
    "mandatory": {
      "enabled": true,
      "settings": {
        "type": "INCLUDE_CURRENT_DEBT",
        "installments": 6
      }
    },
    "manual": {
      "enabled": false,
      "type": "STACKING",
      "number_of_parallel_refinancing_to_apply": 2,
      "options": [
        {
          "quantity": 12,
          "rate": "1.5"
        }
      ],
      "minimum_value_to_apply": "500.0"
    }
  }
}
Ejemplo de código
curl -X POST "https://api.pomelo.la/lending/v1/products/example_value/segments" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
  "name": "Premium Segment",
  "pricing": {
    "rates": {
      "financing": "15.00",
      "late_fee": "25.00",
      "cash_advance": "50.00",
      "revolving": "100.00",
      "revolving_by_limit": [
        {
          "from_amount": "0",
          "unit_type": "CLP",
          "rate": "100.00"
        }
      ]
    },
    "fees": [
      {
        "name": "cash_advance",
        "amount": "15.00",
        "frequency": "PER_OPERATION",
        "operation": "CASH_ADVANCE",
        "type": "FLAT"
      }
    ]
  },
  "credit_card": {
    "minimum_payment": 100,
    "minimum_payment_composition": {
      "revolving": 50,
      "cash_advances": 30,
      "financing": 80,
      "annuities": 100,
      "purchases": 20
    }
  },
  "refinancing": {
    "mandatory": {
      "enabled": true,
      "settings": {
        "type": "INCLUDE_CURRENT_DEBT",
        "installments": 6
      }
    },
    "manual": {
      "enabled": false,
      "type": "STACKING",
      "number_of_parallel_refinancing_to_apply": 2,
      "options": [
        {
          "quantity": 12,
          "rate": "1.5"
        }
      ],
      "minimum_value_to_apply": "500.0"
    }
  }
}'
Ejemplo de respuesta (201)Created
{
  "data": {
    "id": "lsg-3mkvSzWjc5La6WDTlgFweXAmP23",
    "product_id": "lpr-2HMvSzWjc5La6WDTlgFweXAmPle",
    "name": "Premium Segment",
    "status": "ACTIVE",
    "pricing": {
      "start_date": "2022-04-30",
      "rates": {
        "financing": "15.00",
        "late_fee": "25.00",
        "cash_advance": "50.00",
        "revolving": "100.00",
        "revolving_by_limit": [
          {
            "from_amount": "0",
            "unit_type": "CLP",
            "rate": "100.00"
          }
        ]
      },
      "fees": [
        {
          "name": "Maintenance",
          "amount": "15.00",
          "currency": "CPL",
          "frequency": "MONTHLY",
          "operation": "CASH_ADVANCE",
          "type": "UF"
        }
      ]
    },
    "credit_card": {
      "minimum_payment": 100,
      "minimum_payment_composition": {
        "revolving": 50,
        "cash_advances": 30,
        "financing": 80,
        "annuities": 100,
        "purchases": 20
      }
    },
    "refinancing": {
      "mandatory": {
        "enabled": true,
        "settings": {
          "type": "INCLUDE_CURRENT_DEBT",
          "installments": 6
        }
      },
      "manual": {
        "enabled": false,
        "type": "STACKING",
        "number_of_parallel_refinancing_to_apply": 2,
        "options": [
          {
            "quantity": 12,
            "rate": "1.5"
          }
        ],
        "minimum_value_to_apply": "500.0"
      }
    },
    "created_at": "2022-04-30T00:00:00Z",
    "updated_at": "2022-04-30T00:00:00Z"
  }
}

Pomelo AI

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