---
agentTools:
  projectIndex: https://virtualpos.readme.io/llms.txt
---

# Crear un Plan

Permite crear un plan

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "VirtualPOS",
    "version": "3.0"
  },
  "servers": [
    {
      "url": "https://api.virtualpos.cl"
    }
  ],
  "security": [
    {}
  ],
  "paths": {
    "/v3/plan": {
      "post": {
        "summary": "Crear un Plan",
        "description": "Permite crear un plan",
        "operationId": "crear-un-plan",
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "API KEY del comercio",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Signature",
            "in": "header",
            "description": "Firma del mensaje",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name",
                  "description",
                  "currency"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Nombre del plan recurrente"
                  },
                  "description": {
                    "type": "string",
                    "description": "Descripción del plan recurrente"
                  },
                  "type": {
                    "type": "string",
                    "description": "Tipo de plan",
                    "enum": [
                      "MONTO_FIJO",
                      "MONTO_VARIABLE",
                      "PROGRAMA_DE_PAGOS"
                    ]
                  },
                  "currency": {
                    "type": "string",
                    "description": "Moneda utilizada",
                    "enum": [
                      "CLP",
                      "UF"
                    ]
                  },
                  "amount": {
                    "type": "number",
                    "description": "Monto fijo",
                    "format": "float"
                  },
                  "trial_days": {
                    "type": "integer",
                    "format": "int32"
                  },
                  "num_charges": {
                    "type": "integer",
                    "format": "int32"
                  },
                  "frequency_type": {
                    "type": "string",
                    "description": "Frecuencia de los cobros",
                    "enum": [
                      "Diario",
                      "Semanal",
                      "Mensual"
                    ]
                  },
                  "fixed_amount_day_charge": {
                    "type": "string",
                    "enum": [
                      "0",
                      "01",
                      "05",
                      "10",
                      "15",
                      "20",
                      "25",
                      "28",
                      "30"
                    ]
                  },
                  "return_url": {
                    "type": "string",
                    "description": "URL de su aplicación a la cual se retornará una vez que se haya finalizado la suscripción. En esta URL se deberá ejecutar la consulta del resultado de suscripción, ya que por motivos de seguridad la respuesta no se entrega en forma directa a la URL de retorno"
                  },
                  "automatic_renewal": {
                    "type": "string",
                    "description": "Flag de renovación automática.",
                    "default": "F",
                    "enum": [
                      "T",
                      "F"
                    ]
                  },
                  "show_in_terminal": {
                    "type": "string",
                    "description": "Flag para visualización en SmartPOS",
                    "default": "F",
                    "enum": [
                      "T",
                      "F"
                    ]
                  },
                  "shipping_address": {
                    "type": "string",
                    "description": "Flag para indicar que requiere direcciones de despacho.",
                    "enum": [
                      "\"T\"",
                      "\"F\""
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n  \"status\": \"OK\",\n  \"code\": 200,\n  \"plan\": {\n    \t\"id\": \"fd53ead26f78b56113312609b668411b\",\n    \t\"name\": \"Seguro automotriz\",\n    \t\"description\": \"Asegura tu vehiculo\",\n    \t\"is_active\": \"T\",\n      \"amount\": 9990,\n      \"currency\": \"CLP\",\n      \"trial_days\" : 0,\n      \"num_charges\" : 12,\n      \"frequency_type\" : \"Mensual\",\n      \"return_url\" : \"https://www.misitio.com\",\n      \"suscription_url\": \"https://pat.virtualpos.cl/suscripcion/acme-corp/31a2b726a23ff92487984ba17e0b7258\",\n      \"type\" : \"MONTO_FIJO\",\n      \"fixed_amount_day_charge\" : \"05\",  \n      \"automatic_renewal\": \"T\",\n      \"show_in_terminal\" : \"F\",\n      \"created_at\" : \"2023-05-15 23:15:00\",\n      \"shipping_address\": \"F\"\n  }\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "example": "OK"
                    },
                    "code": {
                      "type": "integer",
                      "example": 200,
                      "default": 0
                    },
                    "plan": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "example": "fd53ead26f78b56113312609b668411b"
                        },
                        "name": {
                          "type": "string",
                          "example": "Seguro automotriz"
                        },
                        "description": {
                          "type": "string",
                          "example": "Asegura tu vehiculo"
                        },
                        "is_active": {
                          "type": "string",
                          "example": "T"
                        },
                        "amount": {
                          "type": "integer",
                          "example": 9990,
                          "default": 0
                        },
                        "currency": {
                          "type": "string",
                          "example": "CLP"
                        },
                        "trial_days": {
                          "type": "integer",
                          "example": 0,
                          "default": 0
                        },
                        "num_charges": {
                          "type": "integer",
                          "example": 12,
                          "default": 0
                        },
                        "frequency_type": {
                          "type": "string",
                          "example": "Mensual"
                        },
                        "return_url": {
                          "type": "string",
                          "example": "https://www.misitio.com"
                        },
                        "suscription_url": {
                          "type": "string",
                          "example": "https://pat.virtualpos.cl/suscripcion/acme-corp/31a2b726a23ff92487984ba17e0b7258"
                        },
                        "type": {
                          "type": "string",
                          "example": "MONTO_FIJO"
                        },
                        "fixed_amount_day_charge": {
                          "type": "string",
                          "example": "05"
                        },
                        "automatic_renewal": {
                          "type": "string",
                          "example": "T"
                        },
                        "show_in_terminal": {
                          "type": "string",
                          "example": "F"
                        },
                        "created_at": {
                          "type": "string",
                          "example": "2023-05-15 23:15:00"
                        },
                        "shipping_address": {
                          "type": "string",
                          "example": "F"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {}
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true,
  "_id": "63d857da7710f60012144a5b:646d0a205491040043ef1fb4"
}
```