Promociones
Crear o editar una promoción
Crea una nueva promoción o actualiza una existente según la presencia del campo _id en el body.
- Sin _id: Se crea una nueva promoción asociada al negocio del usuario autenticado.
- Con _id: Se actualiza la promoción existente (nombre, tipo, dateSettings, data, isActive).
Tras guardar, se emite un evento de socket connected con productsUpdated: true a todos los clientes conectados al negocio.
Permiso requerido: PM_POST (Crear/Editar)
Autenticación requerida: Bearer Token obtenido del campo tokenCurrent en el servicio de login.
Authorization: Bearer {tokenCurrent}
post/promos
Request
- Base URLhttps://api.pirpos.com
- URLhttps://api.pirpos.com/promos
- AuthHTTP bearer
Request body
Example request
{
"_id": "507f1f77bcf86cd799439021",
"business": "507f1f77bcf86cd799439012",
"name": "2x1 en bebidas",
"description": "Lleva 2 bebidas y paga solo 1",
"type": "Porcentaje",
"dateSettings": {
"date": {
"start": "2025-01-01T00:00:00.000Z",
"final": "2025-12-31T23:59:59.000Z"
},
"days": [
"L",
"M",
"X",
"J",
"V"
],
"happyHours": {
"hours": {
"hourStart": {
"hour": 18
},
"hourEnd": {
"hour": 20
}
}
}
},
"data": {
"typePorcentaje": {
"value": 15
},
"typePorcentajeCantidad": {
"values": [
{
"qtyMin": 1,
"qtyMax": 5,
"value": 10
}
]
},
"typeCantidad": {
"takeAmount": 3,
"payAmount": 2
}
},
"isActive": true,
"createdOn": "2025-01-15T08:30:00.000Z",
"modifiedOn": "2025-06-10T14:00:00.000Z"
}Response
Promoción creada o actualizada exitosamente
Example response
{
"_id": "507f1f77bcf86cd799439021",
"business": "507f1f77bcf86cd799439012",
"name": "2x1 en bebidas",
"description": "Lleva 2 bebidas y paga solo 1",
"type": "Porcentaje",
"dateSettings": {
"date": {
"start": "2025-01-01T00:00:00.000Z",
"final": "2025-12-31T23:59:59.000Z"
},
"days": [
"L",
"M",
"X",
"J",
"V"
],
"happyHours": {
"hours": {
"hourStart": {
"hour": 18
},
"hourEnd": {
"hour": 20
}
}
}
},
"data": {
"typePorcentaje": {
"value": 15
},
"typePorcentajeCantidad": {
"values": [
{
"qtyMin": 1,
"qtyMax": 5,
"value": 10
}
]
},
"typeCantidad": {
"takeAmount": 3,
"payAmount": 2
}
},
"isActive": true,
"createdOn": "2025-01-15T08:30:00.000Z",
"modifiedOn": "2025-06-10T14:00:00.000Z"
}Changes
No recorded changes to this operation across all 1 revision of this API.