Ventas
Listar ventas
GET /api/v1/transactionsParámetros de query
| Parámetro | Tipo | Descripción |
|---|---|---|
page | número | Página. Por defecto 1. |
limit | número | Por página. Por defecto 20, máximo 100. |
search | texto | Busca por nombre, email o teléfono del cliente. |
type | texto | Filtra por tipo: Purchase o Return. |
Ejemplo
curl "https://api.novity.com.ar/api/v1/transactions?limit=20" \ -H "Authorization: Bearer nv_tu_api_key"Respuesta
{ "data": [ { "id": "txn_abc", "totalAmount": 3500, "type": "Purchase", "source": "Api", "comment": null, "externalId": "pos-0001", "createdAt": "2026-07-08T14:00:00.000Z", "customerId": "cus_abc123", "customerName": "Juan Pérez", "customerPhone": "+5491112345678" } ], "meta": { "currentPage": 1, "total": 128, "hasNextPage": true, "hasPreviousPage": false }}Registrar una venta
Registra una venta. Las ventas de tipo Purchase disparan las reglas
de fidelidad (por ejemplo, sumar puntos automáticamente).
POST /api/v1/transactionsCuerpo
| Campo | Tipo | Descripción |
|---|---|---|
customerId | texto | Obligatorio. ID del cliente. |
totalAmount | número | Obligatorio. Monto total (debe ser mayor a 0). |
type | texto | Purchase (por defecto) o Return. |
items | array | Detalle de ítems: { sku, price, quantity }. |
externalId | texto | ID de la venta en tu sistema (para conciliar). |
comment | texto | Nota interna. |
Ejemplo
curl -X POST https://api.novity.com.ar/api/v1/transactions \ -H "Authorization: Bearer nv_tu_api_key" \ -H "Content-Type: application/json" \ -d '{ "customerId": "cus_abc123", "totalAmount": 3500, "externalId": "pos-0001", "items": [ { "sku": "CAFE-01", "price": 1500, "quantity": 1 }, { "sku": "MEDIALUNA", "price": 1000, "quantity": 2 } ] }'Errores
| Código | Mensaje |
|---|---|
400 | customerId requerido |
400 | totalAmount debe ser mayor a 0 |
404 | Cliente no encontrado |