ar-agents · fase 1
Hello MP Agent
Vercel AI SDK 6 + Mercado Pago Subscriptions, end-to-end.
Endpoints
- POST
/api/agent— conversar con el agente - POST
/api/webhook/mercadopago— recibir eventos MP - GET
/api/agent— info de uso
Probar el agente vía curl
curl -X POST http://localhost:3000/api/agent \
-H "Content-Type: application/json" \
-d '{"message": "Creá una subscription mensual de $100 ARS para test_user@test.com, motivo: Plan básico"}'Flujo esperado
- Agente crea subscription, devuelve
init_point_url. - Cliente test abre el URL y completa primer pago en MP Sandbox con tarjeta+CVV.
- MP dispara webhook → state actualizado en Upstash con
status: authorized. - Preguntale al agente “qué status tiene la sub X?” y debería confirmarte que está activa.
- MP cobra recurring automático según frecuencia configurada.