> For the complete documentation index, see [llms.txt](https://docs.tupayonline.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tupayonline.com/documentacion-de-la-api/tu-multipay/proceso-suscripcion/suscripciones-de-pago.md). Agents can also search and read this documentation through its [MCP server](https://docs.tupayonline.com/~gitbook/mcp).

# Suscripciones de Pago

## Alta de una suscripción de pago

> Crea una solicitud de suscripción en el proveedor del payment method. No crea ningún pago.\
> \
> Es idempotente por pagador + merchant + payment method: si el pagador ya tiene una suscripción de ese payment method\
> \`CONFIRMED\`, o \`PENDING\` dentro de su ventana de confirmación, se devuelve esa misma con \`200\` y\
> \`already\_exists: true\`.<br>

```json
{"openapi":"3.0.3","info":{"title":"Payment Subscriptions API","version":"1.3.0"},"tags":[{"name":"Payment subscriptions"}],"servers":[{"url":"https://api.directa24.com","description":"Production"},{"url":"https://api-stg.directa24.com","description":"Staging"}],"paths":{"/v3/payment_subscriptions":{"post":{"tags":["Payment subscriptions"],"operationId":"createPaymentSubscription","summary":"Alta de una suscripción de pago","description":"Crea una solicitud de suscripción en el proveedor del payment method. No crea ningún pago.\n\nEs idempotente por pagador + merchant + payment method: si el pagador ya tiene una suscripción de ese payment method\n`CONFIRMED`, o `PENDING` dentro de su ventana de confirmación, se devuelve esa misma con `200` y\n`already_exists: true`.\n","parameters":[{"$ref":"#/components/parameters/XLogin"},{"$ref":"#/components/parameters/XDate"},{"$ref":"#/components/parameters/Authorization"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePaymentSubscriptionRequest"}}}},"responses":{"200":{"description":"El pagador ya tenía una suscripción de ese payment method (`already_exists`). No se creó otra.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentSubscription"}}}},"201":{"description":"Solicitud creada en `PENDING`. El usuario debe confirmarla en la app del proveedor.","headers":{"Location":{"description":"URL de la suscripción creada","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentSubscription"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"409":{"description":"`912 PAYMENT_SUBSCRIPTION_PENDING_CONFIRMATION`: el pagador tiene una solicitud pendiente cuya ventana ya\nvenció y todavía no se cerró. Reintentar en unos minutos.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"$ref":"#/components/responses/ProviderRejected"},"503":{"$ref":"#/components/responses/ProviderUnavailable"}}}}},"components":{"parameters":{"XLogin":{"name":"X-Login","in":"header","required":true,"description":"Login del merchant","schema":{"type":"string"}},"XDate":{"name":"X-Date","in":"header","required":true,"description":"Fecha UTC del request, `yyyy-MM-dd'T'HH:mm:ss'Z'`. Vale 15 segundos (fuera de ventana → `103 INVALID_DATE_RANGE`).","schema":{"type":"string"}},"Authorization":{"name":"Authorization","in":"header","required":true,"description":"`D24 ` + HMAC-SHA256 (hex) de `X-Date + X-Login + body` con el secret key del merchant.","schema":{"type":"string"}}},"schemas":{"CreatePaymentSubscriptionRequest":{"type":"object","additionalProperties":false,"required":["country","payment_method","payer"],"properties":{"country":{"type":"string","description":"País. Hoy solo `PE`."},"payment_method":{"type":"string","description":"Payment method con el que se cobrará la suscripción. No distingue mayúsculas.\nHoy: `YPOC` (on demand) o `YPOR` (recurrente). Cualquier otro responde `913`.\n"},"payer":{"$ref":"#/components/schemas/Payer"},"amount":{"type":"number","format":"decimal","minimum":0.01,"maximum":2000,"description":"**Obligatorio en `YPOR`** (en `YPOC` se ignora). Monto en PEN que el usuario ve y autoriza en la app del\nproveedor. No limita el monto de los depósitos.\n"},"periodicity_months":{"type":"integer","minimum":1,"maximum":12,"description":"**Obligatorio en `YPOR`** (en `YPOC` se ignora). Meses entre cobros."}}},"Payer":{"type":"object","additionalProperties":false,"required":["id"],"description":"Mismo objeto `payer` que en `/v3/deposits`. `id` es obligatorio: la suscripción se busca por pagador en cada\ndepósito, así que cada depósito debe enviar el mismo `id`.\n","properties":{"id":{"type":"string","maxLength":128,"description":"Id del usuario en el sistema del merchant. Obligatorio. Tiene que ser único por usuario, no reutilizarse\ny ser el mismo en el alta y en cada depósito que cobra la suscripción.\n"},"first_name":{"type":"string","maxLength":128},"last_name":{"type":"string","maxLength":128},"email":{"type":"string","format":"email","maxLength":255},"phone":{"type":"string","maxLength":32,"description":"Teléfono del pagador en el proveedor, con o sin `+51`. Si viene, `source` = `WEB` y el proveedor manda un\npush. Si no viene, `source` = `MOBILE` y la respuesta trae `confirmation_url`.\n"},"address":{"type":"object","additionalProperties":false,"properties":{"street":{"type":"string","maxLength":255},"city":{"type":"string","maxLength":128},"state":{"type":"string","maxLength":3},"zip_code":{"type":"string","maxLength":16}}}}},"PaymentSubscription":{"type":"object","description":"Los campos sin valor no se envían.","required":["subscription_id","status","type"],"properties":{"subscription_id":{"type":"string","format":"uuid","description":"Id de la suscripción (UUID del proveedor)"},"payment_method":{"type":"string","description":"Payment method de la suscripción (`YPOC`, `YPOR`)"},"status":{"type":"string","enum":["PENDING","CONFIRMED","FAILED","CANCELLED"],"description":"- `PENDING`: esperando que el usuario confirme.\n- `CONFIRMED`: activa; los depósitos la pueden cobrar.\n- `FAILED`: rechazada, vencida o con error del proveedor.\n- `CANCELLED`: dada de baja por el merchant o por el usuario desde la app.\n"},"type":{"type":"string","enum":["ON_DEMAND","RECURRENT"],"description":"`ON_DEMAND` (YPOC) o `RECURRENT` (YPOR)"},"source":{"type":"string","enum":["WEB","MOBILE"],"description":"`WEB` = push al teléfono; `MOBILE` = confirmación por `confirmation_url`."},"confirmation_url":{"type":"string","description":"Solo en `MOBILE` mientras está `PENDING`. Link que el usuario abre para confirmar la suscripción."},"expires_in":{"type":"integer","description":"Segundos que tiene el usuario para confirmar (solo en `PENDING`)"},"expiration_date":{"type":"string","description":"Fecha y hora UTC en que vence la solicitud (solo en `PENDING`), `yyyy-MM-dd'T'HH:mm:ss`"},"amount":{"type":"number","format":"decimal","description":"Solo RECURRENT"},"periodicity_months":{"type":"integer","description":"Solo RECURRENT"},"already_exists":{"type":"boolean","description":"Solo en el alta. `true` si se devolvió una suscripción existente en lugar de crear una nueva."},"created_at":{"type":"string","description":"Fecha de alta (UTC)"},"activated_at":{"type":"string","description":"Fecha de confirmación (UTC)"},"cancelled_at":{"type":"string","description":"Fecha de baja (UTC)"},"reason_code":{"type":"string","enum":["USER_REJECTED","ACCOUNT_INACTIVE","ACCOUNT_NOT_SUPPORTED","ACCOUNT_BLOCKED","CARD_INVALID","AUTHENTICATION_FAILED","AMOUNT_LIMIT_EXCEEDED","EXPIRED","PROVIDER_ERROR","CANCELLED_BY_MERCHANT","CANCELLED_BY_USER"],"description":"Solo en `FAILED` y `CANCELLED`. Motivo propio, igual para cualquier proveedor (no es el código de Yape).\n- `USER_REJECTED`: el usuario rechazó la solicitud en la app.\n- `ACCOUNT_INACTIVE`: la cuenta del usuario no existe o está inactiva.\n- `ACCOUNT_NOT_SUPPORTED`: el tipo de cuenta no admite suscripciones.\n- `ACCOUNT_BLOCKED`: la cuenta está bloqueada para pagos en línea.\n- `CARD_INVALID`: la tarjeta asociada es inválida, está bloqueada o vencida.\n- `AUTHENTICATION_FAILED`: el usuario no pasó la autenticación.\n- `AMOUNT_LIMIT_EXCEEDED`: el monto supera el límite del usuario.\n- `EXPIRED`: el usuario no confirmó a tiempo.\n- `PROVIDER_ERROR`: el proveedor no pudo procesar la solicitud.\n- `CANCELLED_BY_MERCHANT`: baja con `DELETE`.\n- `CANCELLED_BY_USER`: el usuario la canceló desde la app.\n\nPueden agregarse valores nuevos: un valor desconocido se trata como genérico.\n"},"reason_description":{"type":"string","description":"Descripción en inglés de `reason_code`."},"cancelled_by":{"type":"string","enum":["USER","MERCHANT"],"description":"Solo en `CANCELLED`. `USER` = el usuario la canceló desde la app; `MERCHANT` = baja con `DELETE`."}}},"Error":{"type":"object","required":["code","description","type"],"properties":{"code":{"type":"integer","description":"Código público de error"},"description":{"type":"string"},"type":{"type":"string","description":"Nombre del error"},"details":{"type":"array","items":{"type":"string"},"description":"Solo en `201 BEAN_VALIDATION_ERROR`, un elemento por campo inválido (`campo: motivo`)"}},"description":"Códigos propios de suscripciones:\n\n| code | type | HTTP |\n|---|---|---|\n| 910 | PAYMENT_SUBSCRIPTION_NOT_FOUND | 404 |\n| 911 | PAYMENT_SUBSCRIPTION_NOT_CANCELLABLE | 409 |\n| 912 | PAYMENT_SUBSCRIPTION_PENDING_CONFIRMATION | 409 |\n| 913 | PAYMENT_SUBSCRIPTION_INVALID_REQUEST | 400 |\n| 914 | PAYMENT_SUBSCRIPTION_PROVIDER_REJECTED | 502 |\n| 915 | PAYMENT_SUBSCRIPTION_PROVIDER_UNAVAILABLE | 503 |\n| 916 | PAYMENT_SUBSCRIPTION_REQUIRED | 400 (solo en `POST /v3/deposits` con YPOC / YPOR: sin suscripción `CONFIRMED` para ese `payer.id`) |\n\nCódigos de devoluciones (`POST /v3/refunds`, `GET /v3/refunds/{refund_id}`):\n\n| code | type | HTTP |\n|---|---|---|\n| 104 | IDEMPOTENCY_KEY_ALREADY_USED | 400 |\n| 208 | RESOURCE_NOT_FOUND | 404 |\n| 705 | REFUND_NOT_FOUND | 404 |\n| 800 | REFUND_NOT_ENABLED | 400 |\n| 801 | DEPOSIT_NOT_COMPLETED | 400 |\n| 802 | INVALID_AMOUNT_TO_REFUND | 400 |\n| 803 | INSUFFICIENT_FUNDS | 400 |\n| 807 | REFUND_IN_PROGRESS | 409 |\n| 808 | REFUND_PERIOD_EXPIRED | 400 |\n\nTambién aplican los errores generales de la API v3 (headers, credenciales, `INVALID_COUNTRY`,\n`PAYMENT_METHOD_NOT_FOUND` si el merchant no tiene el payment method habilitado).\n"}},"responses":{"BadRequest":{"description":"Request inválido: headers faltantes o mal formados, `X-Date` fuera de ventana, body inválido\n(`201 BEAN_VALIDATION_ERROR`, por ejemplo si falta `payer.id`) o campo desconocido, o\n`913 PAYMENT_SUBSCRIPTION_INVALID_REQUEST` (`payment_method` sin soporte; en `YPOR` falta\n`amount` / `periodicity_months` o están fuera de rango).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Unauthorized":{"description":"`100 INVALID_CREDENTIALS` (X-Login inválido), `102 INVALID_SIGNATURE` (firma inválida) o\n`202 INVALID_IP` (IP fuera de la whitelist del merchant).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"ProviderRejected":{"description":"`914 PAYMENT_SUBSCRIPTION_PROVIDER_REJECTED`: el proveedor rechazó la operación","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"ProviderUnavailable":{"description":"`915 PAYMENT_SUBSCRIPTION_PROVIDER_UNAVAILABLE`: falla de comunicación; se puede reintentar","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}
```

## Consulta de una suscripción de pago

> Devuelve el estado actual de la suscripción. Como no hay notificación, es la forma de saber si el\
> usuario la confirmó. Solo devuelve suscripciones del merchant autenticado.<br>

```json
{"openapi":"3.0.3","info":{"title":"Payment Subscriptions API","version":"1.3.0"},"tags":[{"name":"Payment subscriptions"}],"servers":[{"url":"https://api.directa24.com","description":"Production"},{"url":"https://api-stg.directa24.com","description":"Staging"}],"paths":{"/v3/payment_subscriptions/{subscription_id}":{"get":{"tags":["Payment subscriptions"],"operationId":"getPaymentSubscription","summary":"Consulta de una suscripción de pago","description":"Devuelve el estado actual de la suscripción. Como no hay notificación, es la forma de saber si el\nusuario la confirmó. Solo devuelve suscripciones del merchant autenticado.\n","responses":{"200":{"description":"Suscripción encontrada","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentSubscription"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"503":{"$ref":"#/components/responses/ProviderUnavailable"}}}}},"components":{"schemas":{"PaymentSubscription":{"type":"object","description":"Los campos sin valor no se envían.","required":["subscription_id","status","type"],"properties":{"subscription_id":{"type":"string","format":"uuid","description":"Id de la suscripción (UUID del proveedor)"},"payment_method":{"type":"string","description":"Payment method de la suscripción (`YPOC`, `YPOR`)"},"status":{"type":"string","enum":["PENDING","CONFIRMED","FAILED","CANCELLED"],"description":"- `PENDING`: esperando que el usuario confirme.\n- `CONFIRMED`: activa; los depósitos la pueden cobrar.\n- `FAILED`: rechazada, vencida o con error del proveedor.\n- `CANCELLED`: dada de baja por el merchant o por el usuario desde la app.\n"},"type":{"type":"string","enum":["ON_DEMAND","RECURRENT"],"description":"`ON_DEMAND` (YPOC) o `RECURRENT` (YPOR)"},"source":{"type":"string","enum":["WEB","MOBILE"],"description":"`WEB` = push al teléfono; `MOBILE` = confirmación por `confirmation_url`."},"confirmation_url":{"type":"string","description":"Solo en `MOBILE` mientras está `PENDING`. Link que el usuario abre para confirmar la suscripción."},"expires_in":{"type":"integer","description":"Segundos que tiene el usuario para confirmar (solo en `PENDING`)"},"expiration_date":{"type":"string","description":"Fecha y hora UTC en que vence la solicitud (solo en `PENDING`), `yyyy-MM-dd'T'HH:mm:ss`"},"amount":{"type":"number","format":"decimal","description":"Solo RECURRENT"},"periodicity_months":{"type":"integer","description":"Solo RECURRENT"},"already_exists":{"type":"boolean","description":"Solo en el alta. `true` si se devolvió una suscripción existente en lugar de crear una nueva."},"created_at":{"type":"string","description":"Fecha de alta (UTC)"},"activated_at":{"type":"string","description":"Fecha de confirmación (UTC)"},"cancelled_at":{"type":"string","description":"Fecha de baja (UTC)"},"reason_code":{"type":"string","enum":["USER_REJECTED","ACCOUNT_INACTIVE","ACCOUNT_NOT_SUPPORTED","ACCOUNT_BLOCKED","CARD_INVALID","AUTHENTICATION_FAILED","AMOUNT_LIMIT_EXCEEDED","EXPIRED","PROVIDER_ERROR","CANCELLED_BY_MERCHANT","CANCELLED_BY_USER"],"description":"Solo en `FAILED` y `CANCELLED`. Motivo propio, igual para cualquier proveedor (no es el código de Yape).\n- `USER_REJECTED`: el usuario rechazó la solicitud en la app.\n- `ACCOUNT_INACTIVE`: la cuenta del usuario no existe o está inactiva.\n- `ACCOUNT_NOT_SUPPORTED`: el tipo de cuenta no admite suscripciones.\n- `ACCOUNT_BLOCKED`: la cuenta está bloqueada para pagos en línea.\n- `CARD_INVALID`: la tarjeta asociada es inválida, está bloqueada o vencida.\n- `AUTHENTICATION_FAILED`: el usuario no pasó la autenticación.\n- `AMOUNT_LIMIT_EXCEEDED`: el monto supera el límite del usuario.\n- `EXPIRED`: el usuario no confirmó a tiempo.\n- `PROVIDER_ERROR`: el proveedor no pudo procesar la solicitud.\n- `CANCELLED_BY_MERCHANT`: baja con `DELETE`.\n- `CANCELLED_BY_USER`: el usuario la canceló desde la app.\n\nPueden agregarse valores nuevos: un valor desconocido se trata como genérico.\n"},"reason_description":{"type":"string","description":"Descripción en inglés de `reason_code`."},"cancelled_by":{"type":"string","enum":["USER","MERCHANT"],"description":"Solo en `CANCELLED`. `USER` = el usuario la canceló desde la app; `MERCHANT` = baja con `DELETE`."}}},"Error":{"type":"object","required":["code","description","type"],"properties":{"code":{"type":"integer","description":"Código público de error"},"description":{"type":"string"},"type":{"type":"string","description":"Nombre del error"},"details":{"type":"array","items":{"type":"string"},"description":"Solo en `201 BEAN_VALIDATION_ERROR`, un elemento por campo inválido (`campo: motivo`)"}},"description":"Códigos propios de suscripciones:\n\n| code | type | HTTP |\n|---|---|---|\n| 910 | PAYMENT_SUBSCRIPTION_NOT_FOUND | 404 |\n| 911 | PAYMENT_SUBSCRIPTION_NOT_CANCELLABLE | 409 |\n| 912 | PAYMENT_SUBSCRIPTION_PENDING_CONFIRMATION | 409 |\n| 913 | PAYMENT_SUBSCRIPTION_INVALID_REQUEST | 400 |\n| 914 | PAYMENT_SUBSCRIPTION_PROVIDER_REJECTED | 502 |\n| 915 | PAYMENT_SUBSCRIPTION_PROVIDER_UNAVAILABLE | 503 |\n| 916 | PAYMENT_SUBSCRIPTION_REQUIRED | 400 (solo en `POST /v3/deposits` con YPOC / YPOR: sin suscripción `CONFIRMED` para ese `payer.id`) |\n\nCódigos de devoluciones (`POST /v3/refunds`, `GET /v3/refunds/{refund_id}`):\n\n| code | type | HTTP |\n|---|---|---|\n| 104 | IDEMPOTENCY_KEY_ALREADY_USED | 400 |\n| 208 | RESOURCE_NOT_FOUND | 404 |\n| 705 | REFUND_NOT_FOUND | 404 |\n| 800 | REFUND_NOT_ENABLED | 400 |\n| 801 | DEPOSIT_NOT_COMPLETED | 400 |\n| 802 | INVALID_AMOUNT_TO_REFUND | 400 |\n| 803 | INSUFFICIENT_FUNDS | 400 |\n| 807 | REFUND_IN_PROGRESS | 409 |\n| 808 | REFUND_PERIOD_EXPIRED | 400 |\n\nTambién aplican los errores generales de la API v3 (headers, credenciales, `INVALID_COUNTRY`,\n`PAYMENT_METHOD_NOT_FOUND` si el merchant no tiene el payment method habilitado).\n"}},"responses":{"BadRequest":{"description":"Request inválido: headers faltantes o mal formados, `X-Date` fuera de ventana, body inválido\n(`201 BEAN_VALIDATION_ERROR`, por ejemplo si falta `payer.id`) o campo desconocido, o\n`913 PAYMENT_SUBSCRIPTION_INVALID_REQUEST` (`payment_method` sin soporte; en `YPOR` falta\n`amount` / `periodicity_months` o están fuera de rango).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Unauthorized":{"description":"`100 INVALID_CREDENTIALS` (X-Login inválido), `102 INVALID_SIGNATURE` (firma inválida) o\n`202 INVALID_IP` (IP fuera de la whitelist del merchant).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"`910 PAYMENT_SUBSCRIPTION_NOT_FOUND`: la suscripción no existe o es de otro merchant","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"ProviderUnavailable":{"description":"`915 PAYMENT_SUBSCRIPTION_PROVIDER_UNAVAILABLE`: falla de comunicación; se puede reintentar","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}
```

## Baja de una suscripción de pago

> Cancela la suscripción en el proveedor. Solo se puede cancelar una suscripción \`CONFIRMED\`. Si ya estaba\
> \`CANCELLED\`, responde \`200\` sin volver a llamar al proveedor (idempotente). Después de la baja, un depósito de\
> ese payment method responde \`916\` hasta que se haga una alta nueva.<br>

```json
{"openapi":"3.0.3","info":{"title":"Payment Subscriptions API","version":"1.3.0"},"tags":[{"name":"Payment subscriptions"}],"servers":[{"url":"https://api.directa24.com","description":"Production"},{"url":"https://api-stg.directa24.com","description":"Staging"}],"paths":{"/v3/payment_subscriptions/{subscription_id}":{"delete":{"tags":["Payment subscriptions"],"operationId":"cancelPaymentSubscription","summary":"Baja de una suscripción de pago","description":"Cancela la suscripción en el proveedor. Solo se puede cancelar una suscripción `CONFIRMED`. Si ya estaba\n`CANCELLED`, responde `200` sin volver a llamar al proveedor (idempotente). Después de la baja, un depósito de\nese payment method responde `916` hasta que se haga una alta nueva.\n","responses":{"200":{"description":"Suscripción cancelada","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentSubscription"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"description":"`911 PAYMENT_SUBSCRIPTION_NOT_CANCELLABLE`: la suscripción no está `CONFIRMED` (por ejemplo `PENDING` o\n`FAILED`), o el proveedor no la tiene confirmada.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"$ref":"#/components/responses/ProviderRejected"},"503":{"$ref":"#/components/responses/ProviderUnavailable"}}}}},"components":{"schemas":{"PaymentSubscription":{"type":"object","description":"Los campos sin valor no se envían.","required":["subscription_id","status","type"],"properties":{"subscription_id":{"type":"string","format":"uuid","description":"Id de la suscripción (UUID del proveedor)"},"payment_method":{"type":"string","description":"Payment method de la suscripción (`YPOC`, `YPOR`)"},"status":{"type":"string","enum":["PENDING","CONFIRMED","FAILED","CANCELLED"],"description":"- `PENDING`: esperando que el usuario confirme.\n- `CONFIRMED`: activa; los depósitos la pueden cobrar.\n- `FAILED`: rechazada, vencida o con error del proveedor.\n- `CANCELLED`: dada de baja por el merchant o por el usuario desde la app.\n"},"type":{"type":"string","enum":["ON_DEMAND","RECURRENT"],"description":"`ON_DEMAND` (YPOC) o `RECURRENT` (YPOR)"},"source":{"type":"string","enum":["WEB","MOBILE"],"description":"`WEB` = push al teléfono; `MOBILE` = confirmación por `confirmation_url`."},"confirmation_url":{"type":"string","description":"Solo en `MOBILE` mientras está `PENDING`. Link que el usuario abre para confirmar la suscripción."},"expires_in":{"type":"integer","description":"Segundos que tiene el usuario para confirmar (solo en `PENDING`)"},"expiration_date":{"type":"string","description":"Fecha y hora UTC en que vence la solicitud (solo en `PENDING`), `yyyy-MM-dd'T'HH:mm:ss`"},"amount":{"type":"number","format":"decimal","description":"Solo RECURRENT"},"periodicity_months":{"type":"integer","description":"Solo RECURRENT"},"already_exists":{"type":"boolean","description":"Solo en el alta. `true` si se devolvió una suscripción existente en lugar de crear una nueva."},"created_at":{"type":"string","description":"Fecha de alta (UTC)"},"activated_at":{"type":"string","description":"Fecha de confirmación (UTC)"},"cancelled_at":{"type":"string","description":"Fecha de baja (UTC)"},"reason_code":{"type":"string","enum":["USER_REJECTED","ACCOUNT_INACTIVE","ACCOUNT_NOT_SUPPORTED","ACCOUNT_BLOCKED","CARD_INVALID","AUTHENTICATION_FAILED","AMOUNT_LIMIT_EXCEEDED","EXPIRED","PROVIDER_ERROR","CANCELLED_BY_MERCHANT","CANCELLED_BY_USER"],"description":"Solo en `FAILED` y `CANCELLED`. Motivo propio, igual para cualquier proveedor (no es el código de Yape).\n- `USER_REJECTED`: el usuario rechazó la solicitud en la app.\n- `ACCOUNT_INACTIVE`: la cuenta del usuario no existe o está inactiva.\n- `ACCOUNT_NOT_SUPPORTED`: el tipo de cuenta no admite suscripciones.\n- `ACCOUNT_BLOCKED`: la cuenta está bloqueada para pagos en línea.\n- `CARD_INVALID`: la tarjeta asociada es inválida, está bloqueada o vencida.\n- `AUTHENTICATION_FAILED`: el usuario no pasó la autenticación.\n- `AMOUNT_LIMIT_EXCEEDED`: el monto supera el límite del usuario.\n- `EXPIRED`: el usuario no confirmó a tiempo.\n- `PROVIDER_ERROR`: el proveedor no pudo procesar la solicitud.\n- `CANCELLED_BY_MERCHANT`: baja con `DELETE`.\n- `CANCELLED_BY_USER`: el usuario la canceló desde la app.\n\nPueden agregarse valores nuevos: un valor desconocido se trata como genérico.\n"},"reason_description":{"type":"string","description":"Descripción en inglés de `reason_code`."},"cancelled_by":{"type":"string","enum":["USER","MERCHANT"],"description":"Solo en `CANCELLED`. `USER` = el usuario la canceló desde la app; `MERCHANT` = baja con `DELETE`."}}},"Error":{"type":"object","required":["code","description","type"],"properties":{"code":{"type":"integer","description":"Código público de error"},"description":{"type":"string"},"type":{"type":"string","description":"Nombre del error"},"details":{"type":"array","items":{"type":"string"},"description":"Solo en `201 BEAN_VALIDATION_ERROR`, un elemento por campo inválido (`campo: motivo`)"}},"description":"Códigos propios de suscripciones:\n\n| code | type | HTTP |\n|---|---|---|\n| 910 | PAYMENT_SUBSCRIPTION_NOT_FOUND | 404 |\n| 911 | PAYMENT_SUBSCRIPTION_NOT_CANCELLABLE | 409 |\n| 912 | PAYMENT_SUBSCRIPTION_PENDING_CONFIRMATION | 409 |\n| 913 | PAYMENT_SUBSCRIPTION_INVALID_REQUEST | 400 |\n| 914 | PAYMENT_SUBSCRIPTION_PROVIDER_REJECTED | 502 |\n| 915 | PAYMENT_SUBSCRIPTION_PROVIDER_UNAVAILABLE | 503 |\n| 916 | PAYMENT_SUBSCRIPTION_REQUIRED | 400 (solo en `POST /v3/deposits` con YPOC / YPOR: sin suscripción `CONFIRMED` para ese `payer.id`) |\n\nCódigos de devoluciones (`POST /v3/refunds`, `GET /v3/refunds/{refund_id}`):\n\n| code | type | HTTP |\n|---|---|---|\n| 104 | IDEMPOTENCY_KEY_ALREADY_USED | 400 |\n| 208 | RESOURCE_NOT_FOUND | 404 |\n| 705 | REFUND_NOT_FOUND | 404 |\n| 800 | REFUND_NOT_ENABLED | 400 |\n| 801 | DEPOSIT_NOT_COMPLETED | 400 |\n| 802 | INVALID_AMOUNT_TO_REFUND | 400 |\n| 803 | INSUFFICIENT_FUNDS | 400 |\n| 807 | REFUND_IN_PROGRESS | 409 |\n| 808 | REFUND_PERIOD_EXPIRED | 400 |\n\nTambién aplican los errores generales de la API v3 (headers, credenciales, `INVALID_COUNTRY`,\n`PAYMENT_METHOD_NOT_FOUND` si el merchant no tiene el payment method habilitado).\n"}},"responses":{"BadRequest":{"description":"Request inválido: headers faltantes o mal formados, `X-Date` fuera de ventana, body inválido\n(`201 BEAN_VALIDATION_ERROR`, por ejemplo si falta `payer.id`) o campo desconocido, o\n`913 PAYMENT_SUBSCRIPTION_INVALID_REQUEST` (`payment_method` sin soporte; en `YPOR` falta\n`amount` / `periodicity_months` o están fuera de rango).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Unauthorized":{"description":"`100 INVALID_CREDENTIALS` (X-Login inválido), `102 INVALID_SIGNATURE` (firma inválida) o\n`202 INVALID_IP` (IP fuera de la whitelist del merchant).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"`910 PAYMENT_SUBSCRIPTION_NOT_FOUND`: la suscripción no existe o es de otro merchant","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"ProviderRejected":{"description":"`914 PAYMENT_SUBSCRIPTION_PROVIDER_REJECTED`: el proveedor rechazó la operación","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"ProviderUnavailable":{"description":"`915 PAYMENT_SUBSCRIPTION_PROVIDER_UNAVAILABLE`: falla de comunicación; se puede reintentar","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.tupayonline.com/documentacion-de-la-api/tu-multipay/proceso-suscripcion/suscripciones-de-pago.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
