Sitio del comensal
POST
Agregar un producto al pedido
POST /api/site/create-order-item
Descripción
Suma un producto al pedido en curso del cliente, sin iniciar sesión.
Detalles
Agrega un producto al pedido que el cliente arma desde el menú digital, validando que pertenezca al menú, que sus opciones y personalizaciones sean válidas y recalculando el precio con los valores configurados. El producto queda pendiente de envío. Solo se permite mientras el cliente sigue armando su pedido.
Permisos requeridos
public
Request
| Nombre | Tipo | Requerido | Reglas |
|---|---|---|---|
| slug | string | Sí |
min:1
max:63
|
| orderUuid | string | Sí |
min:36
max:36
|
| productId | int | Sí |
min_value:1
|
| menuId | int | Sí |
min_value:1
|
| name | string | Sí |
max:200
|
| unitPriceCents | int | Sí |
min_value:0
|
| qty | int | Sí |
min_value:1
|
| courseId | int | Sí |
min_value:1
|
| note | string | No |
max:500
|
| productPriceId | int | No |
min_value:1
|
| productPriceOptionId | int | No |
min_value:1
|
| modifiers | array | No | — |
| modifiers[].modifierGroupId | int | Sí |
min_value:1
|
| modifiers[].modifierId | int | Sí |
min_value:1
|
| modifiers[].quantity | int | Sí |
min_value:1
|
Ejemplo de request
curl -X POST https://app.restofy.co/api/site/create-order-item \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <accessToken>" \
-d '{
"slug": "string",
"orderUuid": "string",
"productId": 1,
"menuId": 1,
"name": "string",
"unitPriceCents": 1,
"qty": 1,
"courseId": 1
}'
Los valores son demo: reemplázalos por datos reales del negocio.
Ejemplo de respuesta
Actualizado: 2026-07-15T13:20:48Z
HTTP 200
Request
{
"slug": "restofy_test_siteordercarttes_10954_1784121632_tenant",
"orderUuid": "f27aa841-2c25-440b-8d7e-1094af451a38",
"productId": 9,
"menuId": 1,
"name": "Cazuela de Mariscos",
"unitPriceCents": 2300000,
"qty": 1,
"courseId": 2,
"productPriceId": 9
}
Response
{
"success": true,
"message": "Operación realizada correctamente",
"data": {
"orderUuid": "f27aa841-2c25-440b-8d7e-1094af451a38"
}
}