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.
Montos de una Orden
subtotal_original_e2: Monto total de productos de la orden (sin aplicar descuentos todavía).
subtotal_e2: Monto total de productos tras aplicar descuentos de precio base al subtotal_original_e2.
tax_e2: Monto de la orden adicional a los productos ordenados, por ejemplo, delivery, servicio o descuentos.
total_e2: Monto final de la orden. Equivale a subtotal_e2 + tax_e2
branch_subtotal_e2: Monto final de vista al comercio. Equivale a subtotal_original_e2 - branch_discounts_e2 donde
branch_discounts_e2 representa al monto total de descuentos asumidos por el comercio.
En general, la orden se calcula en el siguiente orden:
- Se suma el total de productos solicitados como
subtotal_original_e2.
- Al
subtotal_original_e2 se le aplican los descuentos de base_price y obtenemos subtotal_e2
- Al
subtotal_e2 se calculan los descuentos de subtotal y se registra en la lista de taxes.
- Al
subtotal_e2 después de descuentos, se le calcula el service_fee_e2 (Servicio App) y se registra en la lista de taxes.
- Se calcula el monto de Envío y se registra en la lista de
taxes.
- Se calculan los descuentos del Envío y se registra en la lista de
taxes.
- Se calcula el monto de Shopper y se registra en la lista de
taxes.
- Se calculan los descuentos del Shopper y se registra en la lista de
taxes.
- Se calculan las tarifas adicionales según la configuración global y del comercio y se registra en la lista de
taxes.
- La suma de la lista de taxes genera el monto
tax_e2.
- Se calcula el
total_e2 sumando subtotal_e2 + tax_e2.
- Si el tipo de pago aplica comisiones adicionales, se calculan las comisiones como
payment_fee_e2 y se cobra total_e2 + payment_fee_e2.
(esto no afecta los montos de la orden).
Otros Atributos
number: Representa el número de órden relativo (al Comercio o Company).
uid: Número de identificación de la orden en la Company.
notes: Notas de entrega
scheduled_at: Fecha de entrega solicitada por el cliente para órdenes programadas.
paid_at: Fecha de pago.
being_prepared_at: Fecha de inicio de preparación por el comercio o shopper.
prepared_at: Fecha de fin de preparación por el comercio o shopper.
collected_at: Fecha de recolección del repartidor para iniciar la entrega hacia el cliente.
arrived_at: Fecha de llegada del repartidor al sitio de entrega.
completed_at: Fecha de finalización de la orden (de entrega o cancelación).
receiver_name: Nombre de quien recibe.
receiver_phone: Teléfono de quien recibe.
is_gift: Indica si recibe otra persona (alguien distinto a quien crea la orden)
source: Origen de la orden. null para órdenes nativas. Ejemplo: Ridery para órdenes creadas desde el WebView en Ridery.
device: Información del dispositivo desde el cual se creó la orden.
selected_payment_method: Información de pago cuando se elige pagar al momento de la entrega (POS, Efectivo, etc.).
latest_status: Última acción que generó un cambio de estado.
status_for_clients: Status para mostrar al Cliente.
status_for_shoppers: Status para mostrar al Shopper. N/A si no aplica.
status_for_providers: Status para mostrar al Repartidor o Proveedor. N/A si no aplica.
status_for_company_admins: Status para mostrar a Administradores de Company.
status_for_branch_admins: Status para mostrar a Administradores de Comercio.
status_for_payment: Status de pago.
order_provider_snapshot: Repartidor asignado.
estimated_route: Ruta estimada y tiempo estimado de entrega.
partner_name: Nombre de asociado que atenderá la orden.
partner: Información del asociado asignado a la orden.
partner_validation_url: URL de verificación (QR) para autorizar la preparación de una orden.
partner_pod_pin: Código de entrega entre shopper y repartidor.
service_charge: Información de la flota asociada a la orden para realizar la entrega.
ordered_goods: Lista de productos.
administrator_notes: Notas de administrador en caso de incidencias.
probable_eta: Tiempo estimado de entrega de la orden calculada por el sistema.
locations: Coordenadas (para Entregas de tipo punto A punto B)
payment_types: Tipos de pago realizados.
taxes: Descripción detallada de los tax aplicados a la orden (delivery, descuentos, etc).
Modelo Order
Ver Json
| Atributo |
Tipo |
Descripción |
id |
int |
- |
number |
int\|null |
- |
status |
int |
- |
subtotal_e2 |
int |
- |
total_e2 |
int |
- |
tax_e2 |
int |
- |
client_latitude_e6 |
int |
- |
client_longitude_e6 |
int |
- |
client_address_data |
array\|null |
- |
pickup_latitude_e6 |
int |
- |
pickup_longitude_e6 |
int |
- |
completed_at |
datetime\|null |
- |
deleted_at |
datetime\|null |
- |
created_at |
datetime\|null |
- |
updated_at |
datetime\|null |
- |
company_id |
int |
- |
client_id |
int\|null |
- |
branch_id |
int\|null |
- |
uid |
string\|null |
- |
receiver_name |
string\|null |
- |
receiver_phone |
string\|null |
- |
is_gift |
bool\|null |
- |
currency_iso |
string\|null |
- |
branch_group_id |
int\|null |
- |
subtotal_original_e2 |
int\|null |
- |
city_id |
int\|null |
- |
locations |
array\|null |
- |
ordered_goods |
array\|null |
- |
is_service |
bool |
BitMask (({@link self::status} & 0x1) !== 0) |
is_pickup_enabled |
bool |
BitMask (({@link self::status} & 0x2) !== 0) |
is_type_digital |
bool |
BitMask (({@link self::status} & 0x4) !== 0) |
is_delivery |
bool |
BitMask (({@link self::status} & 0x8) !== 0) |
is_bid_waiting_client |
bool |
BitMask (({@link self::status} & 0x10) !== 0) |
is_bid_waiting_admin |
bool |
BitMask (({@link self::status} & 0x20) !== 0) |
is_bid_waiting_provider |
bool |
BitMask (({@link self::status} & 0x40) !== 0) |
is_asap |
bool |
BitMask (({@link self::status} & 0x80) !== 0) |
is_status_unconfirmed |
bool |
BitMask (({@link self::status} & 0x100) !== 0) |
is_payment_waiting_confirmation |
bool |
BitMask (({@link self::status} & 0x200) !== 0) |
is_payment_confirmed |
bool |
BitMask (({@link self::status} & 0x400) !== 0) |
is_provider_assigned |
bool |
BitMask (({@link self::status} & 0x800) !== 0) |
is_provider_started |
bool |
BitMask (({@link self::status} & 0x1000) !== 0) |
is_status_arrived |
bool |
BitMask (({@link self::status} & 0x2000) !== 0) |
is_provider_working |
bool |
BitMask (({@link self::status} & 0x4000) !== 0) |
is_status_completed |
bool |
BitMask (({@link self::status} & 0x8000) !== 0) |
is_status_canceled |
bool |
BitMask (({@link self::status} & 0x10000) !== 0) |
is_status_completed_ok |
bool |
BitMask (({@link self::status} & 0x20000) !== 0) |
is_refund_applied |
bool |
BitMask (({@link self::status} & 0x40000) !== 0) |
is_refund_pending |
bool |
BitMask (({@link self::status} & 0x80000) !== 0) |
is_payment_later |
bool |
BitMask (({@link self::status} & 0x100000) !== 0) |
is_status_being_prepared |
bool |
BitMask (({@link self::status} & 0x200000) !== 0) |
is_status_prepared |
bool |
BitMask (({@link self::status} & 0x400000) !== 0) |
is_provider_arrived |
bool |
BitMask (({@link self::status} & 0x800000) !== 0) |
is_provider_collected |
bool |
BitMask (({@link self::status} & 0x1000000) !== 0) |
is_status_expired |
bool |
BitMask (({@link self::status} & 0x2000000) !== 0) |
is_shopper_allowed |
bool |
BitMask (({@link self::status} & 0x4000000) !== 0) |
is_shopper_assigned |
bool |
BitMask (({@link self::status} & 0x8000000) !== 0) |
is_pool_private |
bool |
BitMask (({@link self::status} & 0x10000000) !== 0) |
is_invoice_allowed |
bool |
BitMask (({@link self::status} & 0x20000000) !== 0) |
is_for_shipping |
bool |
BitMask (({@link self::status} & 0x40000000) !== 0) |
has_item_updates |
bool |
BitMask (({@link self::status} & 0x80000000) !== 0) |
is_sent_to_pool |
bool |
BitMask (({@link self::status} & 0x100000000) !== 0) |
is_trip |
bool |
BitMask (({@link self::status} & 0x200000000) !== 0) |
is_type_good |
bool |
BitMask (({@link self::status} & 0x1) === 0) |
is_scheduled |
bool |
BitMask (({@link self::status} & 0x80) === 0) |
is_status_confirmed |
bool |
BitMask (({@link self::status} & 0x100) === 0) |
is_no_bid_waiting |
bool |
BitMask ((({@link self::status} & 0x70) >> 4) === 0) |
administrator_notes |
Collection |
- |
branch_subtotal_e2 |
int |
- |
client_rating_e2 |
int |
- |
company_currency_snapshot |
Currency\|null |
- |
currency_snapshot |
Currency\|null |
- |
delivery_fee_to_pay_e2 |
int |
- |
is_provider_chat_allowed |
bool |
- |
is_provider_dial_allowed |
bool |
- |
latest_status |
string |
- |
order_provider_snapshot |
OrderProvider\|null |
- |
payment_types |
array |
- |
probable_eta |
datetime\|null |
- |
shopper_attachments |
Collection |
- |
shopper_notes |
Collection |
- |
status_data |
array |
- |
status_for_branch_admins |
string |
- |
status_for_clients |
string |
- |
status_for_company_admins |
string |
- |
status_for_payment |
string |
- |
status_for_providers |
string |
- |
status_for_shoppers |
string |
- |
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",
"client_phone": "string|max:32",
"client_name": "string|max:128",
"client_email": "string|email:rfc,filter",
"is_gift": "boolean",
"client_latitude_e6": "required_without:client_address_id|integer|between:-90000000,90000000",
"client_longitude_e6": "required_with:client_latitude_e6||integer|between:-180000000,180000000",
"client_address": "string|max:512",
"client_address_id": "integer",
"pickup_latitude_e6": "integer|between:-90000000,90000000",
"pickup_longitude_e6": "integer|between:-180000000,180000000",
"pickup_address": "string|max:512",
"provider_id": "integer",
"scheduled_at": "date",
"use_local_tz": "boolean",
"notes": "string|max:255",
"goods": [
{
"good_id": "required|integer|exists:goods,id",
"quantity": "required|integer|min:1",
"units": "nullable|numeric|min:0.000001",
"provider_id": "integer",
"notes": "string|max:255",
"properties": [
{
"property_id": "required|integer",
"value": "required|string"
}
]
}
],
"subtotal_e2": "integer|min:0",
"service_charge_id": "nullable|integer",
"service_charge": "nullable|array",
"available_delivery_providers": "nullable|array",
"use_balance": "boolean",
"coupon_code": "nullable|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 |
Display a listing of the resource.
{info} Soporta:
Filters
| Método |
URI |
Cabeceras |
| GET |
/companies/{companyId}/clients/{clientId}/orders/active |
Authorization |
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 |
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 |
Actualizar Order
{info} Soporta:
Paginación
Filters
Carga dinámica
| Método |
URI |
Cabeceras |
| PATCH |
/companies/{companyId}/orders/{orderId} |
Authorization |
{
"admin_note_id": "nullable|integer|min:1",
"admin_notes": "nullable|string|max:512"
}
Subir imagen a una nota de administrador
{info} Soporta:
Paginación
Filters
Carga dinámica
Crea una evidencia (imagen) y lo vincula a una nota de administrador de una Orden.
Se puede visualizar por el atributo de Orden: administrator_notes.attachments
| Método |
URI |
Cabeceras |
| POST |
/companies/{companyId}/orders/{orderId}/add-attachment |
Authorization |
{
"admin_note_id": "required|integer|min:1",
"attachment": "required|image|mimes:jpeg,png,bmp|max:8192"
}
Subir notas/adjuntos como Shopper
{info} Soporta:
Paginación
Filters
Carga dinámica
Crea una evidencia (imagen) y una nota (texto) de un shopper y lo vincula a una orden.
Útil para subir facturas o evidencias de la compra.
Se puede visualizar por el atributo de Orden: shopper_notes.
Sólo disponible para el shopper asignado.
| Método |
URI |
Cabeceras |
| POST |
/companies/{companyId}/orders/{orderId}/add-shopper-notes |
Authorization |
{
"shopper_notes": [
{
"text": "nullable|string|max:512",
"attachments": [
"required|image|mimes:jpeg,png,bmp|max:8192"
]
}
]
}
Actualizar UpdateDestinationAddress
{info} Soporta:
Paginación
Filters
Carga dinámica
| Método |
URI |
Cabeceras |
| POST |
/companies/{companyId}/orders/{orderId}/update-destination-address |
Authorization |
{
"client_latitude_e6": "required|integer|between:-90000000,90000000",
"client_longitude_e6": "required|integer|between:-180000000,180000000",
"client_address": "nullable|string|max:512"
}
Acciones de Order
Batch
| Método |
URI |
Cabeceras |
| POST |
/companies/{companyId}/orders/batch-action/{action} |
Authorization |
{
"ids": [
"integer|min:1"
],
"payload": ""
}
Handle
| Método |
URI |
Cabeceras |
| GET |
/companies/{companyId}/orders/branch-heatmap |
Authorization |
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,form,post-payment,balance",
"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 |
{
"id": "nullable|string",
"currency_iso": "required_with:id|string|min:3|max:8"
}
Balance Pay
| Método |
URI |
Cabeceras |
| POST |
/companies/{companyId}/orders/{orderId}/set-balance-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 |
{
"assign_shopper_as_deliverer": "nullable|boolean"
}
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 |
Index Available
| Método |
URI |
Cabeceras |
| GET |
/companies/{companyId}/orders/{orderId}/available-fleets |
Authorization |
Update Fleet
| Método |
URI |
Cabeceras |
| POST |
/companies/{companyId}/orders/{orderId}/set-selected-fleet |
Authorization |
{
"service_charge_id": "required|integer"
}
Send To Pool
Try order assignment
| Método |
URI |
Cabeceras |
| POST |
/companies/{companyId}/orders/{orderId}/send-to-pool |
Authorization |
{
"force": "bool"
}
Set Excluded
| Método |
URI |
Cabeceras |
| POST |
/companies/{companyId}/orders/{orderId}/exclude-invoices |
Authorization |
Set Included
| Método |
URI |
Cabeceras |
| POST |
/companies/{companyId}/orders/{orderId}/include-invoices |
Authorization |
Calculate
{info} Soporta:
Paginación
Filters
Carga dinámica
| Método |
URI |
Cabeceras |
| POST |
/companies/{companyId}/orders/{orderId}/check-destination-address |
Authorization |
{
"client_latitude_e6": "required|integer|between:-90000000,90000000",
"client_longitude_e6": "required|integer|between:-180000000,180000000"
}
Store From Admin
Store a newly created resource in storage.
| Método |
URI |
Cabeceras |
| POST |
/companies/{companyId}/branches/{branchId}/orders |
Authorization |
{
"receiver_name": "string|max:64",
"receiver_phone": "string|max:32",
"client_dni": "string|max:32",
"client_phone": "string|max:32",
"client_name": "string|max:128",
"client_email": "string|email:rfc,filter",
"is_gift": "boolean",
"client_latitude_e6": "required_without:client_address_id|integer|between:-90000000,90000000",
"client_longitude_e6": "required_with:client_latitude_e6||integer|between:-180000000,180000000",
"client_address": "string|max:512",
"client_address_id": "integer",
"pickup_latitude_e6": "integer|between:-90000000,90000000",
"pickup_longitude_e6": "integer|between:-180000000,180000000",
"pickup_address": "string|max:512",
"provider_id": "integer",
"scheduled_at": "date",
"use_local_tz": "boolean",
"notes": "string|max:255",
"goods": [
{
"good_id": "required|integer|exists:goods,id",
"quantity": "required|integer|min:1",
"units": "nullable|numeric|min:0.000001",
"provider_id": "integer",
"notes": "string|max:255",
"properties": [
{
"property_id": "required|integer",
"value": "required|string"
}
]
}
],
"subtotal_e2": "integer|min:0",
"service_charge_id": "nullable|integer",
"service_charge": "nullable|array",
"available_delivery_providers": "nullable|array",
"use_balance": "boolean",
"coupon_code": "nullable|string|min:5|max:20",
"cart_identifier": "integer|min:0",
"all_errors": "",
"simulate": "",
"force_scheduling": "boolean",
"force_providers": [
"integer"
]
}
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 |
Insert
| Método |
URI |
Cabeceras |
| POST |
/companies/{companyId}/orders/{orderId}/adjust |
Authorization |
{
"amount_e2": "required|integer",
"description": "required|string|max:128",
"adjust_client_balance": "required|boolean",
"is_forced": "nullable|boolean"
}
Enlaces de Order