curl --request GET \
--url https://api.myidvirtual.com/transactions \
--header 'Authorization: <authorization>'{
"transactions": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"amount": 29.90,
"type": "RECHARGE",
"status": "COMPLETED",
"payment_method": "PIX",
"description": "Recarga de créditos - Plano Básico",
"external_id": "mp_12345678",
"gateway": "MERCADOPAGO",
"credits": 100,
"user": {
"id": "user_id_123",
"email": "[email protected]",
"name": "João Silva"
},
"metadata": {
"plan": "basic",
"promotion_code": "PROMO2024"
},
"createdAt": "2024-01-15T10:30:00.000Z",
"updatedAt": "2024-01-15T10:32:00.000Z",
"completedAt": "2024-01-15T10:32:00.000Z"
},
{
"id": "987e6543-e21b-43d2-b654-321987654000",
"amount": 49.90,
"type": "SUBSCRIPTION",
"status": "COMPLETED",
"payment_method": "CREDIT_CARD",
"description": "Assinatura mensal - Plano Premium",
"external_id": "stripe_inv_abc123",
"gateway": "STRIPE",
"credits": 0,
"subscription_id": "sub_premium_monthly",
"user": {
"id": "user_id_123",
"email": "[email protected]",
"name": "João Silva"
},
"metadata": {
"plan": "premium",
"billing_cycle": "monthly"
},
"createdAt": "2024-01-10T15:20:00.000Z",
"updatedAt": "2024-01-10T15:21:00.000Z",
"completedAt": "2024-01-10T15:21:00.000Z"
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 45,
"totalPages": 3,
"hasNext": true,
"hasPrev": false
},
"summary": {
"totalAmount": 1247.50,
"totalTransactions": 45,
"totalCredits": 8950,
"statusBreakdown": {
"COMPLETED": 38,
"PENDING": 3,
"FAILED": 2,
"CANCELLED": 1,
"REFUNDED": 1
}
}
}
Lista todas as transações do usuário autenticado
curl --request GET \
--url https://api.myidvirtual.com/transactions \
--header 'Authorization: <authorization>'{
"transactions": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"amount": 29.90,
"type": "RECHARGE",
"status": "COMPLETED",
"payment_method": "PIX",
"description": "Recarga de créditos - Plano Básico",
"external_id": "mp_12345678",
"gateway": "MERCADOPAGO",
"credits": 100,
"user": {
"id": "user_id_123",
"email": "[email protected]",
"name": "João Silva"
},
"metadata": {
"plan": "basic",
"promotion_code": "PROMO2024"
},
"createdAt": "2024-01-15T10:30:00.000Z",
"updatedAt": "2024-01-15T10:32:00.000Z",
"completedAt": "2024-01-15T10:32:00.000Z"
},
{
"id": "987e6543-e21b-43d2-b654-321987654000",
"amount": 49.90,
"type": "SUBSCRIPTION",
"status": "COMPLETED",
"payment_method": "CREDIT_CARD",
"description": "Assinatura mensal - Plano Premium",
"external_id": "stripe_inv_abc123",
"gateway": "STRIPE",
"credits": 0,
"subscription_id": "sub_premium_monthly",
"user": {
"id": "user_id_123",
"email": "[email protected]",
"name": "João Silva"
},
"metadata": {
"plan": "premium",
"billing_cycle": "monthly"
},
"createdAt": "2024-01-10T15:20:00.000Z",
"updatedAt": "2024-01-10T15:21:00.000Z",
"completedAt": "2024-01-10T15:21:00.000Z"
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 45,
"totalPages": 3,
"hasNext": true,
"hasPrev": false
},
"summary": {
"totalAmount": 1247.50,
"totalTransactions": 45,
"totalCredits": 8950,
"statusBreakdown": {
"COMPLETED": 38,
"PENDING": 3,
"FAILED": 2,
"CANCELLED": 1,
"REFUNDED": 1
}
}
}
{
"transactions": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"amount": 29.90,
"type": "RECHARGE",
"status": "COMPLETED",
"payment_method": "PIX",
"description": "Recarga de créditos - Plano Básico",
"external_id": "mp_12345678",
"gateway": "MERCADOPAGO",
"credits": 100,
"user": {
"id": "user_id_123",
"email": "[email protected]",
"name": "João Silva"
},
"metadata": {
"plan": "basic",
"promotion_code": "PROMO2024"
},
"createdAt": "2024-01-15T10:30:00.000Z",
"updatedAt": "2024-01-15T10:32:00.000Z",
"completedAt": "2024-01-15T10:32:00.000Z"
},
{
"id": "987e6543-e21b-43d2-b654-321987654000",
"amount": 49.90,
"type": "SUBSCRIPTION",
"status": "COMPLETED",
"payment_method": "CREDIT_CARD",
"description": "Assinatura mensal - Plano Premium",
"external_id": "stripe_inv_abc123",
"gateway": "STRIPE",
"credits": 0,
"subscription_id": "sub_premium_monthly",
"user": {
"id": "user_id_123",
"email": "[email protected]",
"name": "João Silva"
},
"metadata": {
"plan": "premium",
"billing_cycle": "monthly"
},
"createdAt": "2024-01-10T15:20:00.000Z",
"updatedAt": "2024-01-10T15:21:00.000Z",
"completedAt": "2024-01-10T15:21:00.000Z"
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 45,
"totalPages": 3,
"hasNext": true,
"hasPrev": false
},
"summary": {
"totalAmount": 1247.50,
"totalTransactions": 45,
"totalCredits": 8950,
"statusBreakdown": {
"COMPLETED": 38,
"PENDING": 3,
"FAILED": 2,
"CANCELLED": 1,
"REFUNDED": 1
}
}
}
# Listar todas as transações
curl --location --request GET 'http://localhost:3333/transactions' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...'
# Com filtros
curl --location --request GET 'http://localhost:3333/transactions?status=COMPLETED&type=RECHARGE&page=1&limit=10' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...'
# Filtro por período
curl --location --request GET 'http://localhost:3333/transactions?date_from=2024-01-01&date_to=2024-01-31&sort=amount&order=DESC' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...'