---
title: Suscripciones
slug: suscripciones
description: Learn how to manage subscriptions using the Mobbex API with this comprehensive document. Explore code examples in multiple programming languages for creating, editing, retrieving, and deleting subscriptions. Get valuable insights into required parameters,
icon: {"faIcon":"fa-solid fa-arrows-rotate"}
docTags: 
createdAt: 2022-01-12T14:18:57.000Z
---

Al crear suscripciones de tipo "manual", no se debe generar una suscripción por suscriptor.
En estos casos, si bien se configura un monto a nivel suscripción, este es por defecto, y el cobro se generará con el monto que se envíe a cobrar a nivel suscriptor.

:::ApiMethodV2
```json
{
  "tab": "examples",
  "url": "https://api.unicobros.com.ar/p/subscriptions/{id}?",
  "name": "Crear/Editar Suscripciones",
  "method": "POST",
  "request": {
    "pathParameters": [
      {
        "kind": "optional",
        "name": "id",
        "type": "string",
        "description": "Identificador de la suscripción. Sólo para edición de una suscripción, no enviar para crear."
      }
    ],
    "queryParameters": [],
    "headerParameters": [
      {
        "kind": "required",
        "name": "x-api-key",
        "type": "string",
        "description": "Clave API de su aplicación."
      },
      {
        "kind": "required",
        "name": "x-access-token",
        "type": "string",
        "description": "Token de Acceso a la entidad para la cual desea realizar la operación."
      },
      {
        "kind": "optional",
        "name": "Content-Type",
        "type": "string",
        "description": "application/json"
      }
    ],
    "bodyDataParameters": [
      {
        "kind": "required",
        "name": "total",
        "type": "Number",
        "description": "Monto de la operación. Formato XXX.xx donde el PUNTO es el separador decimal."
      },
      {
        "kind": "optional",
        "name": "setupFee",
        "type": "Number",
        "description": "Monto inicial diferente al cobrado cada período. Sólo se cobrará una vez. Formato XXX.xx donde el PUNTO es el separador decimal."
      },
      {
        "kind": "required",
        "name": "currency",
        "type": "string",
        "description": "Moneda de la operación. Sólo admite ARS."
      },
      {
        "kind": "required",
        "name": "type",
        "type": "string",
        "description": "Valores posibles: dynamic o manual. Las suscripciones de tipo manual deberán procesarse externamente llamando al servicio, no se tendrá en cuenta intervalo en este tipo."
      },
      {
        "kind": "required",
        "name": "name",
        "type": "string",
        "description": "Nombre de la suscripción"
      },
      {
        "kind": "required",
        "name": "description",
        "type": "string",
        "description": "Descripción de la suscripción que será mostrada al suscribirse a la misma."
      },
      {
        "kind": "optional",
        "name": "interval",
        "type": "string",
        "description": "Intervalo de Cobro de la suscripción. Sólo puede editarse si la suscripción no posee suscriptores, de lo contrario arroja error. Valores Admitidos: 7d, 15d, 1m, 2m, 3m, 6m, 1y. Donde \"d\" es Dias, \"m\" es Meses y \"y\" es Años. Este parámetro NO aplica a suscripciones manuales."
      },
      {
        "kind": "optional",
        "name": "trial",
        "type": "Number",
        "description": "Cantidad de Periodos de Prueba."
      },
      {
        "kind": "required",
        "name": "limit",
        "type": "Integer",
        "description": "Cantidad de Periodos que se ejecutarán. Colocar 0 para anular los periodos y cobrar ilimitadamente. Colocar un número mayor a 0 para limitar los periodos. Este número siempre debe ser un entero."
      },
      {
        "kind": "optional",
        "name": "test",
        "type": "Boolean",
        "description": "Permite colocar la suscripción en modo test. De esta forma, todos los suscriptores creados serán también de prueba. Valores admitidos: true / false. Valor por defecto: false"
      },
      {
        "kind": "required",
        "name": "return_url",
        "type": "string",
        "description": "URL a la que se enviará al usuario una vez suscripto. Debe ser HTTPs."
      },
      {
        "kind": "optional",
        "name": "webhook",
        "type": "string",
        "description": "URL en la que se recibirán las notificaciones de cambios en la suscripción via POST. Debe ser HTTPs."
      },
      {
        "kind": "optional",
        "name": "features",
        "type": "Array",
        "description": "Permite activar o desactivar características internas de Suscripciones. Este campo debe enviarse como array de strings."
      },
      {
        "kind": "optional",
        "name": "sources",
        "type": "Array",
        "description": "La suscripción permite la limitación de los medios de pago aceptados para suscribir posteriormente a los suscriptores. Para realizar dicha limitación se debe enviar un array de medios a aceptar."
      },
      {
        "kind": "optional",
        "name": "split",
        "type": "Array",
        "description": "Permite dividir el cobro de la suscripción en varios comercios Unicobros. Para más detalles ver la sección \"Marketplace, Split, Cobro con Comisión\".",
        "": "Permite dividir el cobro de la suscripción en varios comercios Unicobros. Para más detalles ver la sección \"Marketplace, Split, Cobro con Comisión\"."
      },
      {
        "kind": "optional",
        "name": "options",
        "type": "Object",
        "description": "Permite definir ciertas características propias de la suscripción."
      },
      {
        "kind": "optional",
        "name": "options.theme",
        "type": "Object",
        "description": "Le permite personalizar su Experiencia de Cobro. Para más detalles ver la sección \"Personalización de la UI de Pago\"."
      },
      {
        "kind": "optional",
        "name": "options.embed",
        "type": "Boolean",
        "description": "Permite utilizar la suscripción en modo embebido. Valores admitidos true/false. Valor por defecto False. Para más información ver la sección \"Integración Embebida\""
      },
      {
        "kind": "optional",
        "name": "options.domain",
        "type": "String",
        "description": "Permite definir el dominio desde donde se utilizará la suscripción en modo embebido. Es requerido para utilizarlo en este modo."
      },
      {
        "kind": "optional",
        "name": "reference",
        "type": "string",
        "description": "Referencia que identifique a la Suscripción. Este debe ser único para evitar errores. "
      },
      {
        "kind": "optional",
        "name": "initialDay",
        "type": "Number",
        "description": "Opción para crear una suscripción del tipo \"Agenda Fija\". \n\nEs decir que dado el valor ingresado, se cobrará todos los meses en la misma fecha. \n\nSólo válido para suscripciones del tipo dynamic y de intervalos mensuales. "
      },
      {
        "kind": "optional",
        "name": "startOnInitialDay",
        "type": "Boolean",
        "description": "Opción para cobrar un proporcional de la suscripción o no. \n\nValor por defecto: true. Es decir que el primer cobro se realiza a partir del primer periodo agendando del initialDay. \n\nEn caso contrario (false), al suscribirse se realiza un cobro de un valor proporcional. \n\nSólo aplica cuando las suscripciones son del tipo \"Agenda Fija\"."
      },
      {
        "kind": "optional",
        "name": "notes",
        "type": "string",
        "description": "Permite definir notas legales para la suscripción."
      }
    ],
    "formDataParameters": []
  },
  "results": {
    "languages": [
      {
        "id": "bu-lWpgSIiC6wGhCryIlP",
        "code": "{\n    \"result\": true,\n    \"data\": {\n        \"uid\": \"NHQTDFOJLB137VL9IL\",\n        \"name\": \"Suscripción Demo\",\n        \"description\": \"Unicobros.dev\",\n        \"limit\": 0,\n        \"interval\": \"1m\",\n        \"total\": 100,\n        \"trial\": 0,\n        \"url\": \"https://Unicobros.com/p/subscriptions/subscribe/NHQTDFOJLB137VL9IL\",\n        \"return_url\": \"https://unicobros.com\",\n        \"shorten_url\": \"http://unicobros.co/7RJKoYJ\"\n    }\n}",
        "language": "200"
      }
    ],
    "selectedLanguageId": "bu-lWpgSIiC6wGhCryIlP"
  },
  "examples": {
    "languages": [
      {
        "id": "mU1POMhdKx9YUMNe-Kt4t",
        "code": "curl --location --request POST 'https://api.unicobros.com.ar/p/subscriptions/' \\\n--header 'x-api-key: zJ8LFTBX6Ba8D611e9io13fDZAwj0QmKO1Hn1yIj' \\\n--header 'x-access-token: d31f0721-2f85-44e7-bcc6-15e19d1a53cc' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n    \"total\": 100,\n    \"setupFee\": 0,\n    \"currency\": \"ARS\",\n    \"type\": \"dynamic\",\n    \"name\": \"Suscripción Demo\",\n    \"description\": \"Unicobros.dev\",\n    \"interval\": \"1m\",\n    \"trial\": 0,\n    \"test\": false,\n    \"limit\": 0,\n    \"return_url\": \"https://Unicobros.com\",\n    \"reference\": \"subscription_0001\",\n    \"features\": [\n        \"accept_no_funds\"\n    ],\n    \"options\": {\n        \"theme\": {\n            \"type\": \"dark\"\n        }\n    }\n}'",
        "language": "curl"
      },
      {
        "id": "_-eufhnCsdr5LO7CXjhDX",
        "code": "var data = JSON.stringify({\"total\":100,\"setupFee\":0,\"currency\":\"ARS\",\"type\":\"dynamic\",\"name\":\"Suscripción Demo\",\"description\":\"Mobbex.dev\",\"interval\":\"1m\",\"trial\":0,\"test\":false,\"limit\":0,\"return_url\":\"https://mobbex.com\",\"reference\":\"subscription_0001\",\"features\":[\"accept_no_funds\"],\"options\":{\"theme\":{\"type\":\"dark\"}}});\n\nvar xhr = new XMLHttpRequest();\nxhr.withCredentials = true;\n\nxhr.addEventListener(\"readystatechange\", function() {\n  if(this.readyState === 4) {\n    console.log(this.responseText);\n  }\n});\n\nxhr.open(\"POST\", \"https://api.unicobros.com.ar/p/subscriptions/\");\nxhr.setRequestHeader(\"x-api-key\", \"zJ8LFTBX6Ba8D611e9io13fDZAwj0QmKO1Hn1yIj\");\nxhr.setRequestHeader(\"x-access-token\", \"d31f0721-2f85-44e7-bcc6-15e19d1a53cc\");\nxhr.setRequestHeader(\"Content-Type\", \"application/json\");\n\nxhr.send(data);",
        "language": "javascript"
      },
      {
        "id": "XYP8XDyiUfpLtRMtQbprN",
        "code": "<?php\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, array(\n  CURLOPT_URL => 'https://api.unicobros.com.ar/p/subscriptions/',\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_ENCODING => '',\n  CURLOPT_MAXREDIRS => 10,\n  CURLOPT_TIMEOUT => 0,\n  CURLOPT_FOLLOWLOCATION => true,\n  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST => 'POST',\n  CURLOPT_POSTFIELDS =>'{\n    \"total\": 100,\n    \"setupFee\": 0,\n    \"currency\": \"ARS\",\n    \"type\": \"dynamic\",\n    \"name\": \"Suscripción Demo\",\n    \"description\": \"Unicobros.dev\",\n    \"interval\": \"1m\",\n    \"trial\": 0,\n    \"test\": false,\n    \"limit\": 0,\n    \"return_url\": \"https://unicobros.com\",\n    \"reference\": \"subscription_0001\",\n    \"features\": [\n        \"accept_no_funds\"\n    ],\n    \"options\": {\n        \"theme\": {\n            \"type\": \"dark\"\n        }\n    }\n}',\n  CURLOPT_HTTPHEADER => array(\n    'x-api-key: zJ8LFTBX6Ba8D611e9io13fDZAwj0QmKO1Hn1yIj',\n    'x-access-token: d31f0721-2f85-44e7-bcc6-15e19d1a53cc',\n    'Content-Type: application/json'\n  ),\n));\n\n$response = curl_exec($curl);\n\ncurl_close($curl);\necho $response;\n",
        "language": "php"
      },
      {
        "id": "usGGciNtj_PXYbZd8axwt",
        "code": "import requests\n\nurl = \"https://api.unicobros.com.ar/p/subscriptions/\"\n\npayload=\"{\\r\\n    \\\"total\\\": 100,\\r\\n    \\\"setupFee\\\": 0,\\r\\n    \\\"currency\\\": \\\"ARS\\\",\\r\\n    \\\"type\\\": \\\"dynamic\\\",\\r\\n    \\\"name\\\": \\\"Suscripción Demo\\\",\\r\\n    \\\"description\\\": \\\"Unicobros.dev\\\",\\r\\n    \\\"interval\\\": \\\"1m\\\",\\r\\n    \\\"trial\\\": 0,\\r\\n    \\\"test\\\": false,\\r\\n    \\\"limit\\\": 0,\\r\\n    \\\"return_url\\\": \\\"https://Unicobros.com\\\",\\r\\n    \\\"reference\\\": \\\"subscription_0001\\\",\\r\\n    \\\"features\\\": [\\r\\n        \\\"accept_no_funds\\\"\\r\\n    ],\\r\\n    \\\"options\\\": {\\r\\n        \\\"theme\\\": {\\r\\n            \\\"type\\\": \\\"dark\\\"\\r\\n        }\\r\\n    }\\r\\n}\"\nheaders = {\n  'x-api-key': 'zJ8LFTBX6Ba8D611e9io13fDZAwj0QmKO1Hn1yIj',\n  'x-access-token': 'd31f0721-2f85-44e7-bcc6-15e19d1a53cc',\n  'Content-Type': 'application/json'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n",
        "language": "python"
      }
    ],
    "selectedLanguageId": "mU1POMhdKx9YUMNe-Kt4t"
  },
  "description": "",
  "currentNewParameter": {
    "label": "Body Parameter",
    "value": "bodyDataParameters"
  },
  "autoGeneratedAnchorSlug": "creareditar-suscripciones",
  "legacyHash": "T_nGjB6gsmJi2XQWao51X"
}
```
:::



**Ejemplos del nodo&#x20;**`features`**:**

- *validate\_id*: Validate ID controlará el DNI del suscriptor contra el Tarjeta-Habiente rechazando la operación en caso de no coincidir.
- *accept\_no\_funds*: Accept No Funds aceptará los casos donde la tarjeta no posea fondos como un caso válido de tokenización.
- *no\_email*: Desactivará los emails de aviso al Suscriptor pero no los emails de aviso al comercio.
- *no\_cc*: Desactivará la cuenta corriente, por lo tanto si el cliente posee deuda no intentará recobrarla automáticamente. Sólo válido para suscripciones del tipo dynamic.
- *no\_retry*: Desactivará el reintento de cobro automático. Si un cobro falla deberá ejecutarlo manualmente.
- *no\_retry\_with\_secondary*: Desactivará el reintento de cobro automático con el medio de pago secundario en caso de estar cargado.
- *charge\_on\_first\_source*: Permite ejecutar el primer cobro de la suscripción automáticamente al cargar el medio de pago.

```json
{
    "features": ["validate_id", "accept_no_funds", "no_email", "no_cc", "no_retry"]
}
```

**Ejemplos del nodo&#x20;**`sources`**:**

```json
{
    "sources": ["visa", "mastercard"]
}
```

:::ApiMethodV2
```json
{
  "tab": "request",
  "url": "https://api.unicobros.com.ar/p/subscriptions",
  "name": "Obtener Suscripciones",
  "method": "GET",
  "request": {
    "pathParameters": [],
    "queryParameters": [],
    "headerParameters": [
      {
        "kind": "required",
        "name": "x-api-key",
        "type": "string",
        "description": "Clave API de su aplicación."
      },
      {
        "kind": "required",
        "name": "x-access-token",
        "type": "string",
        "description": "Token de Acceso a la entidad para la cual desea realizar la operación."
      }
    ],
    "bodyDataParameters": [],
    "formDataParameters": []
  },
  "results": {
    "languages": [
      {
        "id": "GN6cv-akKL5-aOKnWJA-6",
        "code": "{\n  \"result\": true,\n  \"data\": {\n    \"docs\": [\n      {\n        \"uid\": \"qLLSnBV35\",\n        \"type\": \"dynamic\",\n        \"interval\": \"1m\",\n        \"limit\": 4,\n        \"trial\": 0,\n        \"initialDay\": 1,\n        \"shorten_url\": \"http://unicobros.co/j7zcKwR\",\n        \"return_url\": \"\",\n        \"webhook\": \"\",\n        \"currency\": \"ARS\",\n        \"status\": \"active\",\n        \"customerForm\": \"default\",\n        \"features\": [\n          \"validate_id\",\n          \"accept_no_funds\",\n          \"no_email\"\n        ],\n        \"sources\": [],\n        \"entity\": \"5761a3dd8aad6c120042b287\",\n        \"name\": \"Mi suscripción 1\",\n        \"description\": \"Descripción de mi suscripción\",\n        \"reference\": \"qLLSnBV35\",\n        \"total\": 2555,\n        \"options\": {\n          \"button\": false,\n          \"embed\": false,\n          \"domain\": null,\n          \"theme\": {\n            \"type\": \"light\",\n            \"background\": \"\",\n            \"showHeader\": true,\n            \"showBack\": true,\n            \"header\": false,\n            \"colors\": {\n              \"primary\": \"#6f00ff\"\n            }\n          }\n        },\n        \"created\": \"2020-11-19T18:26:33.038Z\",\n        \"updated\": \"2020-11-19T18:26:33.041Z\",\n        \"agenda\": [],\n        \"__v\": 0,\n        \"url\": \"https://unicobros.com/p/subscriptions/subscribe/qLLSnBV35\",\n        \"count\": 1\n      },\n    ]\n  }\n}",
        "language": "200"
      }
    ],
    "selectedLanguageId": "GN6cv-akKL5-aOKnWJA-6"
  },
  "examples": {
    "languages": [
      {
        "id": "R_s4hSKURWQBp7tpaRA_v",
        "code": "curl --location --request GET 'https://api.unicobros.com.ar/p/subscriptions/' \\\n--header 'x-api-key: zJ8LFTBX6Ba8D611e9io13fDZAwj0QmKO1Hn1yIj' \\\n--header 'x-access-token: d31f0721-2f85-44e7-bcc6-15e19d1a53cc'",
        "language": "curl"
      },
      {
        "id": "6RIxvP0kLHcfNHRo90eja",
        "code": "var xhr = new XMLHttpRequest();\nxhr.withCredentials = true;\n\nxhr.addEventListener(\"readystatechange\", function() {\n  if(this.readyState === 4) {\n    console.log(this.responseText);\n  }\n});\n\nxhr.open(\"GET\", \"https://api.unicobros.com.ar/p/subscriptions/\");\nxhr.setRequestHeader(\"x-api-key\", \"zJ8LFTBX6Ba8D611e9io13fDZAwj0QmKO1Hn1yIj\");\nxhr.setRequestHeader(\"x-access-token\", \"d31f0721-2f85-44e7-bcc6-15e19d1a53cc\");\n\nxhr.send();",
        "language": "javascript"
      },
      {
        "id": "HkUgSMDNCUbUv3aqNcNiF",
        "code": "<?php\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, array(\n  CURLOPT_URL => 'https://api.unicobros.com.ar/p/subscriptions/',\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_ENCODING => '',\n  CURLOPT_MAXREDIRS => 10,\n  CURLOPT_TIMEOUT => 0,\n  CURLOPT_FOLLOWLOCATION => true,\n  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST => 'GET',\n  CURLOPT_HTTPHEADER => array(\n    'x-api-key: zJ8LFTBX6Ba8D611e9io13fDZAwj0QmKO1Hn1yIj',\n    'x-access-token: d31f0721-2f85-44e7-bcc6-15e19d1a53cc'\n  ),\n));\n\n$response = curl_exec($curl);\n\ncurl_close($curl);\necho $response;\n",
        "language": "php"
      }
    ],
    "selectedLanguageId": "HkUgSMDNCUbUv3aqNcNiF"
  },
  "description": "Permite obtener un listado de las primeras 15 suscripciones creadas en la entidad",
  "currentNewParameter": {
    "label": "Header Parameter",
    "value": "headerParameters"
  },
  "autoGeneratedAnchorSlug": "obtener-suscripciones",
  "legacyHash": "I3UXkoiQ9dOfhXBAAymzo"
}
```
:::

:::ApiMethodV2
```json
{
  "tab": "request",
  "url": "https://api.unicobros.com.ar/p/subscriptions?",
  "name": "Filtrar Suscripciones",
  "method": "GET",
  "request": {
    "pathParameters": [],
    "queryParameters": [
      {
        "kind": "optional",
        "name": "page",
        "type": "Number",
        "description": "Número de página a filtrar. Por defecto se devuelve la primera página (0)"
      },
      {
        "kind": "optional",
        "name": "status",
        "type": "string",
        "description": "Permite filtrar suscripciones por estado (único o múltiples). Valores admitidos: active, inactive\nEjemplo:\n*status=active\n*status=active,inactive"
      },
      {
        "kind": "optional",
        "name": "search",
        "type": "string",
        "description": "Permite buscar suscripciones por un valor específico de nombre, descripción, identificador o referencia."
      }
    ],
    "headerParameters": [
      {
        "kind": "required",
        "name": "x-api-key",
        "type": "string",
        "description": "Clave API de su aplicación."
      },
      {
        "kind": "required",
        "name": "x-access-token",
        "type": "string",
        "description": "Token de Acceso a la entidad para la cual desea realizar la operación."
      }
    ],
    "bodyDataParameters": [],
    "formDataParameters": []
  },
  "results": {
    "languages": [
      {
        "id": "-a51Dy6pPr9zmaCIvDfmL",
        "code": "{\n    \"result\": true,\n    \"data\": {\n        \"docs\": [\n            {\n                \"uid\": \"HF53JXQ474A0MOJE5N\",\n                \"type\": \"dynamic\",\n                \"interval\": \"1m\",\n                \"limit\": 12,\n                \"trial\": 0,\n                \"initialDay\": 1,\n                \"shorten_url\": \"http://unicobros.co/2AjGnWA\",\n                \"return_url\": \"http://localhost:3000\",\n                \"webhook\": \"\",\n                \"setupFee\": 0,\n                \"test\": false,\n                \"intent\": \"payment.v2\",\n                \"currency\": \"ARS\",\n                \"status\": \"active\",\n                \"customerForm\": \"default\",\n                \"features\": [],\n                \"sources\": [],\n                \"entity\": \"5761a3dd8aad6c120042b287\",\n                \"name\": \"test\",\n                \"description\": \"test\",\n                \"reference\": \"c8226f3e-7b55-4d6b-9453-20b200df7a9b\",\n                \"total\": 10,\n                \"options\": {\n                    \"button\": false,\n                    \"embed\": false,\n                    \"domain\": null,\n                    \"theme\": {\n                        \"type\": \"light\",\n                        \"background\": \"\",\n                        \"showHeader\": true,\n                        \"showBack\": true,\n                        \"header\": false,\n                        \"colors\": {\n                            \"primary\": \"#6f00ff\"\n                        }\n                    }\n                },\n                \"created\": \"2021-03-23T12:30:14.125Z\",\n                \"updated\": \"2021-03-23T12:30:14.128Z\",\n                \"split\": [],\n                \"agenda\": [],\n                \"__v\": 0,\n                \"url\": \"https://unicobros.com/p/subscriptions/subscribe/HF53JXQ474A0MOJE5N\",\n                \"count\": 0\n            }\n        ],\n        \"page\": 1,\n        \"prevPage\": -1,\n        \"nextPage\": 2,\n        \"limit\": 15\n    }\n}",
        "language": "200"
      }
    ],
    "selectedLanguageId": "-a51Dy6pPr9zmaCIvDfmL"
  },
  "examples": {
    "languages": [
      {
        "id": "UgWv1s0XI8a4QUlsqyTCi",
        "code": "curl --location --request GET 'https://api.unicobros.com.ar/p/subscriptions?page=0' \\\n--header 'x-api-key: zJ8LFTBX6Ba8D611e9io13fDZAwj0QmKO1Hn1yIj' \\\n--header 'x-access-token: d31f0721-2f85-44e7-bcc6-15e19d1a53cc'",
        "language": "curl"
      },
      {
        "id": "yiHFMcs2u_G2e6y0LTAPi",
        "code": "var xhr = new XMLHttpRequest();\nxhr.withCredentials = true;\n\nxhr.addEventListener(\"readystatechange\", function() {\n  if(this.readyState === 4) {\n    console.log(this.responseText);\n  }\n});\n\nxhr.open(\"GET\", \"https://api.unicobros.com.ar/p/subscriptions?page=0\");\nxhr.setRequestHeader(\"x-api-key\", \"zJ8LFTBX6Ba8D611e9io13fDZAwj0QmKO1Hn1yIj\");\nxhr.setRequestHeader(\"x-access-token\", \"d31f0721-2f85-44e7-bcc6-15e19d1a53cc\");\n\nxhr.send();",
        "language": "javascript"
      },
      {
        "id": "Jor-VECjcTIkp0bDcH8AT",
        "code": "<?php\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, array(\n  CURLOPT_URL => 'https://api.unicobros.com.ar/p/subscriptions?page=0',\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_ENCODING => '',\n  CURLOPT_MAXREDIRS => 10,\n  CURLOPT_TIMEOUT => 0,\n  CURLOPT_FOLLOWLOCATION => true,\n  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST => 'GET',\n  CURLOPT_HTTPHEADER => array(\n    'x-api-key: zJ8LFTBX6Ba8D611e9io13fDZAwj0QmKO1Hn1yIj',\n    'x-access-token: d31f0721-2f85-44e7-bcc6-15e19d1a53cc'\n  ),\n));\n\n$response = curl_exec($curl);\n\ncurl_close($curl);\necho $response;\n",
        "language": "php"
      }
    ],
    "selectedLanguageId": "UgWv1s0XI8a4QUlsqyTCi"
  },
  "description": "Permite obtener suscripciones de forma paginada y/o aplicando filtros.",
  "currentNewParameter": {
    "label": "Query Parameter",
    "value": "queryParameters"
  },
  "autoGeneratedAnchorSlug": "filtrar-suscripciones",
  "legacyHash": "_gCPsosXj07qUnOnDYXch"
}
```
:::

:::ApiMethodV2
```json
{
  "tab": "examples",
  "url": "https://api.unicobros.com.ar/p/subscriptions/{id}",
  "name": "Obtener Suscripción",
  "method": "GET",
  "request": {
    "pathParameters": [],
    "queryParameters": [
      {
        "kind": "required",
        "name": "id",
        "type": "string",
        "description": "ID de la suscripción"
      },
      {
        "name": "REF:",
        "kind": "optional",
        "type": "string",
        "description": "Referencia de la suscripción",
        "children": []
      }
    ],
    "headerParameters": [
      {
        "kind": "required",
        "name": "x-api-key",
        "type": "string",
        "description": "Clave API de su aplicación."
      },
      {
        "kind": "required",
        "name": "x-access-token",
        "type": "string",
        "description": "Token de Acceso a la entidad para la cual desea realizar la operación."
      }
    ],
    "bodyDataParameters": [],
    "formDataParameters": []
  },
  "results": {
    "languages": [
      {
        "id": "wW4kz_yM882pv682AlUsd",
        "code": "{\n    \"result\": true,\n    \"data\": {\n        \"uid\": \"qLLsnBV37\",\n        \"type\": \"dynamic\",\n        \"interval\": \"1m\",\n        \"limit\": 3,\n        \"trial\": 0,\n        \"shorten_url\": \"http://unicobros.co/j7zcKwR\",\n        \"return_url\": \"https://demo.test.com/return\",\n        \"webhook\": \"https://demo.test.com/webhook\",\n        \"currency\": \"ARS\",\n        \"status\": \"active\",\n        \"customerForm\": \"default\",\n        \"features\": [\n            \"validate_id\",\n            \"accept_no_funds\",\n            \"no_email\"\n        ],\n        \"sources\": [],\n        \"name\": \"Suscripción de Prueba\",\n        \"description\": \"102\",\n        \"reference\": \"qLLsnBV37\",\n        \"total\": 1547,\n        \"options\": {\n            \"button\": false,\n            \"embed\": false,\n            \"domain\": null,\n            \"theme\": {\n                \"type\": \"light\",\n                \"background\": \"\",\n                \"showHeader\": true,\n                \"showBack\": true,\n                \"header\": false,\n                \"colors\": {\n                    \"primary\": \"#6f00ff\"\n                }\n            }\n        },\n        \"created\": \"2020-11-19T18:26:33.038Z\",\n        \"intent\": \"payment.v2\",\n        \"url\": \"https://unicobros.com/p/subscriptions/subscribe/qLLsnBV37\",\n        \"count\": 0\n    }\n}",
        "language": "200"
      }
    ],
    "selectedLanguageId": "wW4kz_yM882pv682AlUsd"
  },
  "examples": {
    "languages": [
      {
        "id": "HRmo_TSHYOGDHQc0NoFo3",
        "code": "curl --location --request GET 'https://api.unicobros.com.ar/p/subscriptions/qLLSnBV35' \\\n--header 'x-api-key: zJ8LFTBX6Ba8D611e9io13fDZAwj0QmKO1Hn1yIj' \\\n--header 'x-access-token: d31f0721-2f85-44e7-bcc6-15e19d1a53cc'",
        "language": "curl"
      },
      {
        "id": "JXh65P9pJyShddvOZCQuq",
        "code": "var xhr = new XMLHttpRequest();\nxhr.withCredentials = true;\n\nxhr.addEventListener(\"readystatechange\", function() {\n  if(this.readyState === 4) {\n    console.log(this.responseText);\n  }\n});\n\nxhr.open(\"GET\", \"https://api.unicobros.com.ar/p/subscriptions/qLLSnBV35\");\nxhr.setRequestHeader(\"x-api-key\", \"zJ8LFTBX6Ba8D611e9io13fDZAwj0QmKO1Hn1yIj\");\nxhr.setRequestHeader(\"x-access-token\", \"d31f0721-2f85-44e7-bcc6-15e19d1a53cc\");\n\nxhr.send();",
        "language": "javascript"
      },
      {
        "id": "X-j3YyCocL2Zh9yDcazBY",
        "code": "<?php\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, array(\n  CURLOPT_URL => 'https://api.unicobros.com.ar/p/subscriptions/qLLSnBV37',\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_ENCODING => '',\n  CURLOPT_MAXREDIRS => 10,\n  CURLOPT_TIMEOUT => 0,\n  CURLOPT_FOLLOWLOCATION => true,\n  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST => 'GET',\n  CURLOPT_HTTPHEADER => array(\n    'x-api-key: zJ8LFTBX6Ba8D611e9io13fDZAwj0QmKO1Hn1yIj',\n    'x-access-token: d31f0721-2f85-44e7-bcc6-15e19d1a53cc'\n  ),\n));\n\n$response = curl_exec($curl);\n\ncurl_close($curl);\necho $response;\n",
        "language": "php"
      }
    ],
    "selectedLanguageId": "X-j3YyCocL2Zh9yDcazBY"
  },
  "description": "Permite obtener una suscripción en base a su ID o referencia",
  "currentNewParameter": {
    "label": "Query Parameter",
    "value": "queryParameters"
  },
  "autoGeneratedAnchorSlug": "obtener-suscripcin",
  "legacyHash": "dLuzQElXIJJ8E4GLYkYVu"
}
```
:::

:::hint{type="info"}
La utilización de la referencia en los endpoints mencionados NO es obligatoria, todos los endpoints mejorados para utilizar REF permiten continuar utilizando UID.
:::

## Cambiar estado de la suscripción

:::ApiMethodV2
```json
{
  "tab": "examples",
  "url": "https://api.unicobros.com.ar/p/subscriptions/${uid}/action/activate",
  "name": "Activar Suscripción",
  "method": "POST",
  "request": {
    "pathParameters": [],
    "queryParameters": [
      {
        "kind": "required",
        "name": "id",
        "type": "string",
        "description": "ID de la suscripción"
      }
    ],
    "headerParameters": [
      {
        "kind": "required",
        "name": "x-api-key",
        "type": "string",
        "description": "Clave API de su aplicación."
      },
      {
        "kind": "required",
        "name": "x-access-token",
        "type": "string",
        "description": "Token de Acceso a la entidad para la cual desea realizar la operación."
      }
    ],
    "bodyDataParameters": [],
    "formDataParameters": []
  },
  "results": {
    "languages": [
      {
        "id": "JM3hrhJ9f3GAcqwwS5OId",
        "code": "{\n    \"result\": true\n}",
        "language": "200"
      }
    ],
    "selectedLanguageId": "JM3hrhJ9f3GAcqwwS5OId"
  },
  "examples": {
    "languages": [
      {
        "id": "7ndw1EYXpK_VV-Rovzq8N",
        "code": "curl --location --request GET 'https://api.unicobros.com.ar/p/subscriptions/qLLSnBV35/action/activate' \\\n--header 'x-api-key: zJ8LFTBX6Ba8D611e9io13fDZAwj0QmKO1Hn1yIj' \\\n--header 'x-access-token: d31f0721-2f85-44e7-bcc6-15e19d1a53cc'",
        "language": "curl"
      },
      {
        "id": "QdlKFQv-Wpt3j9HSO7QTZ",
        "code": "var xhr = new XMLHttpRequest();\nxhr.withCredentials = true;\n\nxhr.addEventListener(\"readystatechange\", function() {\n  if(this.readyState === 4) {\n    console.log(this.responseText);\n  }\n});\n\nxhr.open(\"GET\", \"https://api.unicobros.com.ar/p/subscriptions/qLLSnBV35/action/activate\");\nxhr.setRequestHeader(\"x-api-key\", \"zJ8LFTBX6Ba8D611e9io13fDZAwj0QmKO1Hn1yIj\");\nxhr.setRequestHeader(\"x-access-token\", \"d31f0721-2f85-44e7-bcc6-15e19d1a53cc\");\n\nxhr.send();",
        "language": "javascript"
      },
      {
        "id": "1Ah6yWn5xLjvBZVHaupAz",
        "code": "<?php\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, array(\n  CURLOPT_URL => 'https://api.unicobros.com.ar/p/subscriptions/qLLSnBV35/action/activate',\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_ENCODING => '',\n  CURLOPT_MAXREDIRS => 10,\n  CURLOPT_TIMEOUT => 0,\n  CURLOPT_FOLLOWLOCATION => true,\n  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST => 'POST',\n  CURLOPT_HTTPHEADER => array(\n    'x-api-key: zJ8LFTBX6Ba8D611e9io13fDZAwj0QmKO1Hn1yIj',\n    'x-access-token: d31f0721-2f85-44e7-bcc6-15e19d1a53cc'\n  ),\n));\n\n$response = curl_exec($curl);\n\ncurl_close($curl);\necho $response;\n",
        "language": "php"
      }
    ],
    "selectedLanguageId": "1Ah6yWn5xLjvBZVHaupAz"
  },
  "description": "Permite cambiar el estado de la suscripción a \"Activo\" y reanudar el cobro a todos sus suscriptores",
  "currentNewParameter": {
    "label": "Header Parameter",
    "value": "headerParameters"
  },
  "autoGeneratedAnchorSlug": "activar-suscripcin",
  "legacyHash": "uMQSN14eXGl-Mgzazly0W"
}
```
:::

:::ApiMethodV2
```json
{
  "tab": "examples",
  "url": "p/subscriptions/${uid}/action/suspend",
  "name": "Suspender Suscripción",
  "method": "POST",
  "request": {
    "pathParameters": [],
    "queryParameters": [
      {
        "kind": "required",
        "name": "id",
        "type": "string",
        "description": "ID de la suscripción"
      }
    ],
    "headerParameters": [
      {
        "kind": "required",
        "name": "x-api-key",
        "type": "string",
        "description": "Clave API de su aplicación."
      },
      {
        "kind": "required",
        "name": "x-access-token",
        "type": "string",
        "description": "Token de Acceso a la entidad para la cual desea realizar la operación."
      }
    ],
    "bodyDataParameters": [],
    "formDataParameters": []
  },
  "results": {
    "languages": [
      {
        "id": "BX1xGhfHLjwRf4Wgo7Hdc",
        "code": "{\n    \"result\": true\n}",
        "language": "200"
      }
    ],
    "selectedLanguageId": "BX1xGhfHLjwRf4Wgo7Hdc"
  },
  "examples": {
    "languages": [
      {
        "id": "9DBltYaSug4muZ6yu01Aa",
        "code": "var xhr = new XMLHttpRequest();\nxhr.withCredentials = true;\n\nxhr.addEventListener(\"readystatechange\", function() {\n  if(this.readyState === 4) {\n    console.log(this.responseText);\n  }\n});\n\nxhr.open(\"POST\", \"https://api.unicobros.com.ar/p/subscriptions/qLLSnBV35/action/suspend\");\nxhr.setRequestHeader(\"x-api-key\", \"zJ8LFTBX6Ba8D611e9io13fDZAwj0QmKO1Hn1yIj\");\nxhr.setRequestHeader(\"x-access-token\", \"d31f0721-2f85-44e7-bcc6-15e19d1a53cc\");\n\nxhr.send();",
        "language": "javascript"
      },
      {
        "id": "RTnVjD0ecVB2AGB5Ths10",
        "code": "<?php\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, array(\n  CURLOPT_URL => 'https://api.unicobros.com.ar/p/subscriptions/qLLSnBV35/action/delete',\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_ENCODING => '',\n  CURLOPT_MAXREDIRS => 10,\n  CURLOPT_TIMEOUT => 0,\n  CURLOPT_FOLLOWLOCATION => true,\n  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST => 'GET',\n  CURLOPT_HTTPHEADER => array(\n    'x-api-key: zJ8LFTBX6Ba8D611e9io13fDZAwj0QmKO1Hn1yIj',\n    'x-access-token: d31f0721-2f85-44e7-bcc6-15e19d1a53cc'\n  ),\n));\n\n$response = curl_exec($curl);\n\ncurl_close($curl);\necho $response;\n",
        "language": "php"
      }
    ],
    "selectedLanguageId": "RTnVjD0ecVB2AGB5Ths10"
  },
  "description": "Permite cambiar el estado de la suscripción a \"Inactivo\" y detener el cobro a todos sus suscriptores",
  "currentNewParameter": {
    "label": "Header Parameter",
    "value": "headerParameters"
  },
  "autoGeneratedAnchorSlug": "suspender-suscripcin",
  "legacyHash": "Mrw4gsdnNQtKo2nwUOk0e"
}
```
:::

:::ApiMethodV2
```json
{
  "tab": "examples",
  "url": "https://api.unicobros.com.ar/p/subscriptions/{id}/action/delete",
  "name": "Eliminar Suscripción",
  "method": "DELETE",
  "request": {
    "pathParameters": [],
    "queryParameters": [
      {
        "kind": "required",
        "name": "id",
        "type": "string",
        "description": "ID de la suscripción"
      }
    ],
    "headerParameters": [
      {
        "kind": "required",
        "name": "x-api-key",
        "type": "string",
        "description": "Clave API de su aplicación."
      },
      {
        "kind": "required",
        "name": "x-access-token",
        "type": "string",
        "description": "Token de Acceso a la entidad para la cual desea realizar la operación."
      }
    ],
    "bodyDataParameters": [],
    "formDataParameters": []
  },
  "results": {
    "languages": [
      {
        "id": "BtZZjfAxewXO6Vy4hAOJH",
        "code": "{\n    \"result\": true\n}",
        "language": "200"
      }
    ],
    "selectedLanguageId": "BtZZjfAxewXO6Vy4hAOJH"
  },
  "examples": {
    "languages": [
      {
        "id": "IoCtac6IxVi37ZE043Pk2",
        "code": "var xhr = new XMLHttpRequest();\nxhr.withCredentials = true;\n\nxhr.addEventListener(\"readystatechange\", function() {\n  if(this.readyState === 4) {\n    console.log(this.responseText);\n  }\n});\n\nxhr.open(\"DELETE\", \"https://api.unicobros.com.ar/p/subscriptions/qLLSnBV35/action/delete\");\nxhr.setRequestHeader(\"x-api-key\", \"zJ8LFTBX6Ba8D611e9io13fDZAwj0QmKO1Hn1yIj\");\nxhr.setRequestHeader(\"x-access-token\", \"d31f0721-2f85-44e7-bcc6-15e19d1a53cc\");\n\nxhr.send();",
        "language": "javascript"
      },
      {
        "id": "jaHSs0x2LI2OHRxTviPzk",
        "code": "<?php\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, array(\n  CURLOPT_URL => 'https://api.unicobros.com.ar/p/subscriptions/qLLSnBV35/action/delete',\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_ENCODING => '',\n  CURLOPT_MAXREDIRS => 10,\n  CURLOPT_TIMEOUT => 0,\n  CURLOPT_FOLLOWLOCATION => true,\n  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST => 'GET',\n  CURLOPT_HTTPHEADER => array(\n    'x-api-key: zJ8LFTBX6Ba8D611e9io13fDZAwj0QmKO1Hn1yIj',\n    'x-access-token: d31f0721-2f85-44e7-bcc6-15e19d1a53cc'\n  ),\n));\n\n$response = curl_exec($curl);\n\ncurl_close($curl);\necho $response;\n",
        "language": "php"
      }
    ],
    "selectedLanguageId": "jaHSs0x2LI2OHRxTviPzk"
  },
  "description": "Permite hacer una eliminación lógica de una suscripción. Los suscriptores asociados no se modificarán de estado, pero los cobros no se ejecutarán a causa de la suscripción. ",
  "currentNewParameter": {
    "label": "Header Parameter",
    "value": "headerParameters"
  },
  "autoGeneratedAnchorSlug": "eliminar-suscripcin",
  "legacyHash": "M-8qJY17wQ8H0Z0gtBC5C"
}
```
:::

