Order
Representa a una orden o pedido de un cliente.
Los pedidos finalizados son archivados al final del día (12am) del horario local. El valor
deleted_at
es actualizado con la fecha de archivado.
-
- status: BitMask de Estado de la Orden.
0x001
: FLAG_TYPE_SERVICES La Orden es de tipo servicio.
0x002
: FLAG_MODE_CUSTOM_PICKUP La Orden posee dirección de recogida antes de iniciar.
0x008
: FLAG_HAS_DELIVERY La Orden debe ser completada por Providers.
0x0000010
: FLAG_WAITING_CLIENT Existen Bids en espera del Cliente.
0x0000020
: FLAG_WAITING_ADMIN Existen Bids en espera de Admins.
0x0000040
: FLAG_WAITING_PROVIDER Existen Bids en espera de Providers.
0x0000080
: FLAG_ASAP La Orden es ASAP (No está programada para alguna fecha).
0x0000100
: FLAG_UNCONFIRMED La Orden requiere confirmación del Admin.
0x0000200
: FLAG_WAITING_PAYMENT Existen Pagos por confirmar.
0x0000400
: FLAG_PAID El pago de la Orden ha sido confirmado.
0x0000800
: FLAG_ASSIGNED Todos los ítems de la Orden están asignados a Providers.
0x0001000
: FLAG_RUNNING Algún Provider inició la Orden.
0x0002000
: FLAG_ARRIVED El Provider está en la dirección de destino.
0x0004000
: FLAG_WORKING Algún Servicio está siendo procesado.
0x0008000
: FLAG_COMPLETED La Orden ha terminado. No se pueden ejecutar más acciones.
0x0018000
: FLAG_CANCELLED Orden Finalizada: Fallida.
0x0028000
: FLAG_COMPLETED_OK Orden Finalizada: Completa.
0x0048000
: FLAG_REFUND_APPLIED Orden Finalizada: Se ejecutó un Refund.
0x0088000
: FLAG_REFUND_PENDING Orden Finalizada: Requiere Refund.
0x0100000
: FLAG_POST_PAYMENT Se ha solicitado saltar el pago.
0x0200000
: FLAG_BEING_PREPARED La orden de productos con delivery está siendo preparada
0x0400000
: FLAG_PREPARED La orden de productos con delivery está lista para ser despachada.
0x0800000
: FLAG_READY_TO_COLLECT El provider ha llegado al destino para retirar la orden de productos con delivery.
0x1000000
: FLAG_COLLECTED El provider ha recolectado la orden de productos con delivery.
0x2000000
: FLAG_EXPIRED La orden ha expirado.
0x4000000
: FLAG_SHOPPING_MODE La orden requiere un Shopper.
0x8000000
: FLAG_SHOPPER_ASSIGNED La orden está asignada a un Shopper.
- 2020-03-25: Agregado regalos (compra para otra persona). Columnas
receiver_name
,
receiver_phone
y is_gift
.
- 2020-04-04: Cambios en los estados: El estado FLAG_WAITING_PAYMENT cambió de 0x010 a 0x200 y
FLAG_WAITING_CLIENT de 0x600 a 0x010
- 2020-05-21: Se agregaron los estados FLAG_BEING_PREPARED, FLAG_PREPARED, FLAG_READY_TO_COLLECT, FLAG_COLLECTED
- 2020-07-29: Se agregaron los estados FLAG_SHOPPING_MODE, FLAG_SHOPPER_ASSIGNED
Modelo Order
{
"id": 1461,
"number": 1250,
"status": 1152,
"subtotal_e2": 1500000,
"total_e2": 1500000,
"tax_e2": 0,
"notes": null,
"scheduled_at": null,
"client_latitude_e6": 0,
"client_longitude_e6": 0,
"client_address_data": {
"type": "legacy",
"address": null
},
"pickup_latitude_e6": 0,
"pickup_longitude_e6": 0,
"pickup_address": null,
"completed_at": null,
"deleted_at": null,
"created_at": "2020-02-26 19:29:08",
"updated_at": "2020-03-05 18:55:38",
"client_id": 5,
"creator_id": null,
"branch_id": 2,
"uid": "001-0001250",
"receiver_name": "Daniel Azuaje",
"receiver_phone": "00000000000",
"is_gift": false,
"shopper_id": null,
"currency_iso": "VES",
"branch_group_id": 2,
"subtotal_original_e2": 1500000,
"branch_rating_id": null,
"ordered_goods": [
{
"id": 1647,
"quantity": 1,
"name": "Galletas de chocolate",
"base_price_e2": 1500000,
"total_price_e2": 1500000,
"provider_fee_e2": 0,
"short_details": "n/a",
"details": "Riquísimas galletas de chocolate ZEN Crujientes por fuera, y con un exquisito corazón de chocolate oscuro derretido.",
"notes": null,
"picture_urls": [
"https://ondemand-api.manzanares.com.ve/storage/companies/46/good/good_3_0_1564151649.jpg"
],
"good_stock": 46,
"order_id": 1461,
"good_id": 3,
"client_id": 5,
"good": {
"id": 3,
"sku": null,
"type": 0,
"name": "Galletas de chocolate",
"price_e2": 1500000,
"quantity": 45,
"available": true,
"provider_fee_e2": 0,
"provider_fee_prc": 0,
"rating_count": 0,
"rating_e2": 0,
"rating_sum": 0,
"details": "Riquísimas galletas de chocolate ZEN Crujientes por fuera, y con un exquisito corazón de chocolate oscuro derretido.",
"short_details": "n/a",
"picture_urls": [
"https://ondemand-api.manzanares.com.ve/storage/companies/46/good/good_3_0_1564151649.jpg"
],
"eta": "25",
"created_at": "2019-02-13 15:52:03",
"updated_at": "2020-02-26 19:29:08",
"deleted_at": null,
"type_info": {
"is_service": false,
"is_custom_pickup": false
},
"good_properties": [
{
"id": 29,
"good_id": 3,
"property_id": 9,
"display_name": "Bandejas",
"options": 515,
"disabled": false,
"in_order": 0,
"created_at": "2019-04-24 20:53:52",
"updated_at": "2019-04-24 20:53:52",
"property": {
"id": 9,
"type": 512,
"name": "Bandejas Plasticas",
"disabled": false,
"created_at": "2019-04-23 20:32:56",
"updated_at": "2019-11-29 14:55:42",
"property_options": [],
"property_range": {
"id": 84,
"min": 1,
"max": 5,
"step": 1,
"default": 1,
"decimates": 0,
"unit": null,
"quantity": 47,
"base_price_e2": 1700,
"step_price_e2": 1700,
"created_at": "2020-01-27 13:04:30",
"updated_at": "2020-02-18 19:59:31",
"property_id": 9
},
"property_text": null
}
}
]
},
"properties": []
}
],
"client_rating_e2": 0,
"currency_snapshot": {
"id": 27,
"enabled": true,
"iso": "VES",
"symbol": "Bs.S",
"conversion_factor": 1,
"related_iso": "VES",
"decimals_count": 2,
"format": "$ 0.00",
"decimal_point": ".",
"use_thousands_separator": true,
"thousands_separator": ",",
"is_local": true,
"is_international": false,
"created_at": "2020-08-06 02:58:46",
"updated_at": "2020-08-06 02:58:46",
"company_id": 3,
"is_custom": false,
"branch_id": 2,
"use_conversion": false,
"available": true
},
"status_data": {
"is_service": false,
"is_asap": true,
"is_pickup_enabled": false,
"is_provider_required": false,
"is_for_shipping": false,
"is_archived": false,
"provider_assigned": false,
"provider_started": false,
"provider_arrived": false,
"provider_collected": false,
"provider_working": false,
"payment_later": false,
"payment_waiting_confirmation": false,
"payment_confirmed": true,
"bid_waiting_client": false,
"bid_waiting_provider": false,
"bid_waiting_admin": false,
"order_is_confirmed": true,
"order_being_prepared": false,
"order_prepared": false,
"order_arrived": false,
"order_finished": false,
"order_canceled": false,
"order_expired": false,
"order_refund_pending": false,
"order_refund_applied": false,
"pool_is_private": false
},
"client_address": null,
"currency_amounts": {
"subtotal_e2": 1500000,
"subtotal_original_e2": 1500000,
"total_e2": 1500000,
"tax_e2": 0
}
}
Insertar Order
Insertar Order de Client
Store a newly created resource in storage.
Método |
URI |
Cabeceras |
POST |
/companies/{companyId}/branches/{branchId}/clients/{clientId}/orders |
Authorization |
{
"receiver_name": "string|max:64",
"receiver_phone": "string|max:32",
"client_dni": "string|max:32",
"is_gift": "boolean",
"client_latitude_e6": "required_without:client_address_id|integer",
"client_longitude_e6": "required_with:client_latitude_e6||integer",
"client_address": "string|max:512",
"client_address_id": "integer",
"pickup_latitude_e6": "integer",
"pickup_longitude_e6": "integer",
"pickup_address": "string|max:512",
"provider_id": "integer",
"scheduled_at": "date",
"notes": "string|max:255",
"goods": [
{
"good_id": "required|integer|exists:goods,id",
"quantity": "required|integer|min:1",
"provider_id": "integer",
"notes": "string|max:255",
"properties": [
{
"property_id": "required|integer",
"value": "required|string"
}
]
}
],
"subtotal_e2": "integer|min:0",
"currency_iso": "string|max:3",
"use_balance": "boolean",
"coupon_code": "string|min:5|max:20",
"cart_identifier": "integer|min:0",
"all_errors": "",
"simulate": "",
"force_scheduling": "boolean",
"force_providers": [
"integer"
]
}
Listar Order
{info} Soporta:
Paginación
Filters
Carga dinámica
Display a listing of Orders.
Método |
URI |
Cabeceras |
GET |
/companies/{companyId}/orders |
Authorization |
{info} Soporta:
Paginación
Filters
Carga dinámica
Método |
URI |
Cabeceras |
GET |
/companies/{companyId}/branch-groups/{branchGroupId}/orders |
Authorization |
Listar Order de Branch
{info} Soporta:
Paginación
Filters
Carga dinámica
Método |
URI |
Cabeceras |
GET |
/companies/{companyId}/branches/{branchId}/orders |
Authorization |
Listar Order de Client
{info} Soporta:
Paginación
Filters
Carga dinámica
Display a listing of the resource.
Método |
URI |
Cabeceras |
GET |
/companies/{companyId}/clients/{clientId}/orders |
Authorization |
Listar Client Active
{info} Soporta:
Filters
Display a listing of the resource.
Método |
URI |
Cabeceras |
GET |
/companies/{companyId}/clients/{clientId}/orders/active |
Authorization |
Listar Provider Available
Display a listing of the Orders that a Provider can be assigned to.
Método |
URI |
Cabeceras |
GET |
/companies/{companyId}/providers/{providerId}/orders/available |
Authorization |
Listar Order de Admin
{info} Soporta:
Paginación
Display a listing of the resource.
Método |
URI |
Cabeceras |
GET |
/companies/{companyId}/admins/{adminId}/orders |
Authorization |
Listar OrderHistory
Display the order histories
Método |
URI |
Cabeceras |
GET |
/companies/{companyId}/orders/{orderId}/order-histories |
Authorization |
Mostrar Order
{info} Soporta:
Carga dinámica
Display the specified Order.
Método |
URI |
Cabeceras |
GET |
/companies/{companyId}/orders/{orderId} |
Authorization |
Acciones de Order
Batch
Método |
URI |
Cabeceras |
POST |
/companies/{companyId}/orders/batch-action/{action} |
Authorization |
{
"ids": [
"integer|min:1"
],
"payload": ""
}
Set Confirmed
Confirms an Order and puts an Order's number
Método |
URI |
Cabeceras |
POST |
/companies/{companyId}/orders/{orderId}/set-confirmed |
Authorization |
Set Paid
Marks the order as paid
Método |
URI |
Cabeceras |
POST |
/companies/{companyId}/orders/{orderId}/set-paid |
Authorization |
{
"type": "string|in:gateway",
"name": "string",
"ref": "string"
}
Begin
Begins an Order (changes status to: running).
Método |
URI |
Cabeceras |
POST |
/companies/{companyId}/orders/{orderId}/set-running |
Authorization |
Set Ready
Marks an Order as completed. This only works if the order is not suitable for deliveries.
Método |
URI |
Cabeceras |
POST |
/companies/{companyId}/orders/{orderId}/set-ready |
Authorization |
Complete
Marks an Order as completed. This only works if the order is not suitable for deliveries.
Método |
URI |
Cabeceras |
POST |
/companies/{companyId}/orders/{orderId}/set-completed |
Authorization |
Cancel
Método |
URI |
Cabeceras |
POST |
/companies/{companyId}/orders/{orderId}/set-canceled |
Authorization |
{
"reason": "required|string|max:64"
}
Post Pay
Marks an Order for Post Payment (Pay in store or pay to provider)
Método |
URI |
Cabeceras |
POST |
/companies/{companyId}/orders/{orderId}/set-post-payment |
Authorization |
Set Being Prepared
Método |
URI |
Cabeceras |
POST |
/companies/{companyId}/orders/{orderId}/set-being-prepared |
Authorization |
Set Prepared
Método |
URI |
Cabeceras |
POST |
/companies/{companyId}/orders/{orderId}/set-prepared |
Authorization |
Change Pool
Método |
URI |
Cabeceras |
POST |
/companies/{companyId}/orders/{orderId}/set-private-pool |
Authorization |
Change Pool
Método |
URI |
Cabeceras |
POST |
/companies/{companyId}/orders/{orderId}/set-public-pool |
Authorization |
Assign
Método |
URI |
Cabeceras |
PUT |
/companies/{companyId}/orders/{orderId}/shoppers/{providerId} |
Authorization |
Unassign
Método |
URI |
Cabeceras |
DELETE |
/companies/{companyId}/orders/{orderId}/shoppers/{providerId} |
Authorization |
Enlaces de Order