{
  "info": {
    "_postman_id": "winora-api-v1",
    "name": "Winora API",
    "description": "Colección de la API de Winora para integradores. Importa también el entorno \"Winora · pruebas\", pon tu llave wk_test_… en apiKey y prueba sin mover plata. Guía: https://merchant.winorapay.com/docs",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "auth": {
    "type": "bearer",
    "bearer": [
      {
        "key": "token",
        "value": "{{apiKey}}",
        "type": "string"
      }
    ]
  },
  "item": [
    {
      "name": "Cobros",
      "description": "Crear un cobro devuelve el link del checkout alojado por Winora.",
      "item": [
        {
          "name": "Listar transacciones (filtros + paginación)",
          "_postman_id": "getCharges",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/charges",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "charges"
              ],
              "query": [
                {
                  "key": "status",
                  "value": "PENDING",
                  "disabled": true
                },
                {
                  "key": "q",
                  "value": "texto",
                  "disabled": true
                },
                {
                  "key": "mode",
                  "value": "test",
                  "disabled": true
                },
                {
                  "key": "method",
                  "value": "card",
                  "disabled": true
                },
                {
                  "key": "source",
                  "value": "link",
                  "disabled": true
                },
                {
                  "key": "dateFrom",
                  "value": "2026-11-05T00:00:00.000Z",
                  "disabled": true
                },
                {
                  "key": "dateTo",
                  "value": "2026-11-05T00:00:00.000Z",
                  "disabled": true
                },
                {
                  "key": "amountMin",
                  "value": "0",
                  "disabled": true
                },
                {
                  "key": "amountMax",
                  "value": "0",
                  "disabled": true
                },
                {
                  "key": "page",
                  "value": "1",
                  "disabled": true
                },
                {
                  "key": "pageSize",
                  "value": "20",
                  "disabled": true
                }
              ]
            }
          }
        },
        {
          "name": "Crear un cobro (devuelve el link de pago alojado)",
          "_postman_id": "postCharges",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "description": "Una llave nueva por intento; repítela solo al reintentar el mismo."
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/charges",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "charges"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"amount\": 50000,\n  \"reference\": \"Pedido 1001\",\n  \"customerEmail\": \"comprador@ejemplo.test\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Consultar una transacción",
          "_postman_id": "getChargesId",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/charges/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "charges",
                ":id"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "{{chargeId}}"
                }
              ]
            }
          }
        }
      ]
    },
    {
      "name": "Reembolsos",
      "description": "Reembolsos totales o parciales de un cobro aprobado con tarjeta.",
      "item": [
        {
          "name": "Listar reembolsos de un cobro",
          "_postman_id": "getChargesIdRefunds",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/charges/:id/refunds",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "charges",
                ":id",
                "refunds"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "{{chargeId}}"
                }
              ]
            }
          }
        },
        {
          "name": "Reembolsar un cobro (total o parcial)",
          "_postman_id": "postChargesIdRefunds",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "description": "Una llave nueva por intento; repítela solo al reintentar el mismo."
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/charges/:id/refunds",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "charges",
                ":id",
                "refunds"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "{{chargeId}}"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"amount\": 10000,\n  \"reason\": \"Devolución parcial de prueba\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        }
      ]
    },
    {
      "name": "Cartera",
      "description": "Deudas y deudores: cada deuda tiene su propio link de pago.",
      "item": [
        {
          "name": "Crear un deudor (o traer el que ya existe con ese documento)",
          "_postman_id": "postDebtors",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "description": "Una llave nueva por intento; repítela solo al reintentar el mismo."
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/debtors",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "debtors"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"fullName\": \"Ana Pérez\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Listar deudas (por referencia, estado, documento o vencimiento)",
          "_postman_id": "getReceivables",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/receivables",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "receivables"
              ],
              "query": [
                {
                  "key": "externalRef",
                  "value": "FAC-1001",
                  "disabled": true
                },
                {
                  "key": "status",
                  "value": "open",
                  "disabled": true
                },
                {
                  "key": "debtorDoc",
                  "value": "texto",
                  "disabled": true
                },
                {
                  "key": "dueFrom",
                  "value": "2026-11-05",
                  "disabled": true
                },
                {
                  "key": "dueTo",
                  "value": "2026-11-05",
                  "disabled": true
                },
                {
                  "key": "page",
                  "value": "1",
                  "disabled": true
                },
                {
                  "key": "pageSize",
                  "value": "25",
                  "disabled": true
                }
              ]
            }
          }
        },
        {
          "name": "Crear una deuda (con su deudor) y obtener su link de pago",
          "_postman_id": "postReceivables",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "description": "Una llave nueva por intento; repítela solo al reintentar el mismo."
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/receivables",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "receivables"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"debtor\": {\n    \"fullName\": \"Ana Pérez\"\n  },\n  \"concept\": \"Cuota de noviembre\",\n  \"amount\": 50000,\n  \"dueDate\": \"2030-12-31\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Consultar una deuda",
          "_postman_id": "getReceivablesId",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/receivables/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "receivables",
                ":id"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "{{receivableId}}"
                }
              ]
            }
          }
        },
        {
          "name": "Corregir una deuda pendiente (concepto, referencia, monto, vencimiento…)",
          "_postman_id": "patchReceivablesId",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "description": "Una llave nueva por intento; repítela solo al reintentar el mismo."
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/receivables/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "receivables",
                ":id"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "{{receivableId}}"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"concept\": \"Cuota de noviembre (corregida)\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Registrar un pago recibido por fuera de Winora",
          "_postman_id": "postReceivablesIdPayments",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "description": "Una llave nueva por intento; repítela solo al reintentar el mismo."
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/receivables/:id/payments",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "receivables",
                ":id",
                "payments"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "{{receivableId}}"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"amount\": 50000,\n  \"method\": \"cash\",\n  \"paidOn\": \"2026-11-05\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Anular una deuda pendiente (el link deja de cobrar)",
          "_postman_id": "postReceivablesIdVoid",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "description": "Una llave nueva por intento; repítela solo al reintentar el mismo."
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/receivables/:id/void",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "receivables",
                ":id",
                "void"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "{{receivableId}}"
                }
              ]
            }
          }
        },
        {
          "name": "Crear varias deudas (hasta 200); el resultado dice cuál quedó",
          "_postman_id": "postReceivablesBatch",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "description": "Una llave nueva por intento; repítela solo al reintentar el mismo."
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/receivables/batch",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "receivables",
                "batch"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"items\": [\n    {\n      \"debtor\": {\n        \"fullName\": \"Ana Pérez\"\n      },\n      \"concept\": \"Cuota de noviembre\",\n      \"amount\": 50000,\n      \"dueDate\": \"2030-12-31\"\n    }\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        }
      ]
    },
    {
      "name": "Suscripciones",
      "description": "Planes y suscripciones con cobro recurrente (requiere el módulo activo).",
      "item": [
        {
          "name": "Listar planes del comercio",
          "_postman_id": "getSubscriptionPlans",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/subscription-plans",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "subscription-plans"
              ],
              "query": [
                {
                  "key": "includeInactive",
                  "value": "true",
                  "disabled": true
                }
              ]
            }
          }
        },
        {
          "name": "Crear plan de suscripción",
          "_postman_id": "postSubscriptionPlans",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "description": "Una llave nueva por intento; repítela solo al reintentar el mismo."
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/subscription-plans",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "subscription-plans"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Plan mensual\",\n  \"amountMinor\": 49900,\n  \"interval\": \"month\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Detalle de plan",
          "_postman_id": "getSubscriptionPlansPlanId",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/subscription-plans/:planId",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "subscription-plans",
                ":planId"
              ],
              "variable": [
                {
                  "key": "planId",
                  "value": "{{planId}}"
                }
              ]
            }
          }
        },
        {
          "name": "Listar suscripciones del comercio",
          "_postman_id": "getSubscriptions",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/subscriptions",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "subscriptions"
              ],
              "query": [
                {
                  "key": "planId",
                  "value": "00000000-0000-4000-8000-000000000000",
                  "disabled": true
                },
                {
                  "key": "status",
                  "value": "active",
                  "disabled": true
                }
              ]
            }
          }
        },
        {
          "name": "Crear una suscripción con una tarjeta ya guardada",
          "_postman_id": "postSubscriptions",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "description": "Una llave nueva por intento; repítela solo al reintentar el mismo."
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/subscriptions",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "subscriptions"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"planId\": \"00000000-0000-4000-8000-000000000000\",\n  \"customerEmail\": \"comprador@ejemplo.test\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Detalle de suscripción",
          "_postman_id": "getSubscriptionsSubId",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/subscriptions/:subId",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "subscriptions",
                ":subId"
              ],
              "variable": [
                {
                  "key": "subId",
                  "value": "{{subId}}"
                }
              ]
            }
          }
        },
        {
          "name": "Cancelar suscripción",
          "_postman_id": "postSubscriptionsSubIdCancel",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "description": "Una llave nueva por intento; repítela solo al reintentar el mismo."
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/subscriptions/:subId/cancel",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "subscriptions",
                ":subId",
                "cancel"
              ],
              "variable": [
                {
                  "key": "subId",
                  "value": "{{subId}}"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Cambiar plan (aplica al próximo período)",
          "_postman_id": "postSubscriptionsSubIdChangePlan",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "description": "Una llave nueva por intento; repítela solo al reintentar el mismo."
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/subscriptions/:subId/change-plan",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "subscriptions",
                ":subId",
                "change-plan"
              ],
              "variable": [
                {
                  "key": "subId",
                  "value": "{{subId}}"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"newPlanId\": \"00000000-0000-4000-8000-000000000000\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Historial de cobros de la suscripción",
          "_postman_id": "getSubscriptionsSubIdInvoices",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/subscriptions/:subId/invoices",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "subscriptions",
                ":subId",
                "invoices"
              ],
              "variable": [
                {
                  "key": "subId",
                  "value": "{{subId}}"
                }
              ]
            }
          }
        },
        {
          "name": "Pausar suscripción",
          "_postman_id": "postSubscriptionsSubIdPause",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "description": "Una llave nueva por intento; repítela solo al reintentar el mismo."
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/subscriptions/:subId/pause",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "subscriptions",
                ":subId",
                "pause"
              ],
              "variable": [
                {
                  "key": "subId",
                  "value": "{{subId}}"
                }
              ]
            }
          }
        },
        {
          "name": "Reanudar suscripción",
          "_postman_id": "postSubscriptionsSubIdResume",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "description": "Una llave nueva por intento; repítela solo al reintentar el mismo."
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/subscriptions/:subId/resume",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "subscriptions",
                ":subId",
                "resume"
              ],
              "variable": [
                {
                  "key": "subId",
                  "value": "{{subId}}"
                }
              ]
            }
          }
        }
      ]
    }
  ]
}
