Tarjetas de regalo
POST
Listar gift cards
POST /api/gift-cards/list-gift-cards
Descripción
Listado paginado de las gift cards vendidas por el negocio.
Detalles
Devuelve las gift cards con su saldo disponible, estado, fecha de emisión y vencimiento. Acepta búsqueda por código y filtros por estado y disponibilidad. Incluye totales resumidos.
Permisos requeridos
finance.module
Request
| Nombre | Tipo | Requerido | Reglas |
|---|---|---|---|
| search | string | No |
max:100
|
| status | string | No |
in:active,redeemed,expired,cancelled
|
| isAvailable | bool | No | — |
Paginación
| defaultLimit | 25 |
| maxLimit | 100 |
| defaultDir | desc |
| withTotal | true |
| allowedSorts | [createdAt, currentBalanceCents, code] |
Ejemplo de request
curl -X POST https://app.restofy.co/api/gift-cards/list-gift-cards \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <accessToken>"
Los valores son demo: reemplázalos por datos reales del negocio.
Ejemplo de respuesta
Actualizado: 2026-07-15T13:20:48Z
HTTP 200
Request
[]
Response
{
"success": true,
"message": "Operación realizada correctamente",
"data": {
"giftCards": [
{
"prepaidAccountId": 4,
"prepaidUuid": "95d3de9f-7eb3-11f1-ac02-f2368af4d8ac",
"accountId": 9115,
"code": "GC-EACE2940",
"currentBalanceCents": 10000,
"initialAmountCents": 10000,
"status": "active",
"isAvailable": 1,
"partyId": null,
"partyName": null,
"createdAt": "2026-07-15T13:19:00.000Z",
"expiresAt": null
},
{
"prepaidAccountId": 2,
"prepaidUuid": "95138a63-7eb3-11f1-ac02-f2368af4d8ac",
"accountId": 9113,
"code": "GC-9793CDE8",
"currentBalanceCents": 50000,
"initialAmountCents": 50000,
"status": "active",
"isAvailable": 1,
"partyId": null,
"partyName": null,
"createdAt": "2026-07-15T13:18:59.000Z",
"expiresAt": null
},
{
"prepaidAccountId": 3,
"prepaidUuid": "956f0409-7eb3-11f1-ac02-f2368af4d8ac",
"accountId": 9114,
"code": "GC-B71D2F56",
"currentBalanceCents": 25000,
"initialAmountCents": 25000,
"status": "active",
"isAvailable": 1,
"partyId": null,
"partyName": null,
"createdAt": "2026-07-15T13:18:59.000Z",
"expiresAt": null
},
{
"prepaidAccountId": 1,
"prepaidUuid": "82277cd9-7eb3-11f1-ac02-f2368af4d8ac",
"accountId": 82,
"code": "SEED01",
"currentBalanceCents": 0,
"initialAmountCents": 5000000,
"status": "active",
"isAvailable": 1,
"partyId": null,
"partyName": null,
"createdAt": "2026-07-15T13:18:27.000Z",
"expiresAt": null
}
],
"pagination": {
"page": 1,
"limit": 25,
"total": 4,
"totalPages": 1,
"hasNext": false,
"hasPrev": false
},
"stats": {
"totalCount": 4,
"activeCount": "4",
"outstandingBalanceCents": "85000",
"totalIssuedCents": "5085000"
}
}
}