Skip to main content

Orders

Routes​

MethodRoutePermissionSince
GET/ordersManagement or store1.3.0
POST/ordersSigned in1.10.0
GET/orders/{id}/statusOrder owner or management1.10.0
PUT, PATCH/orders/{id}Order owner or management1.10.0
DELETE/orders/{id}Management or store1.11.0
POST/orders/{id}/minutesManagement or store1.11.0
GET/orders/reportsManagement or store1.11.0
GET/order-statusesSigned in1.11.0

There is no GET /orders/{id} in notiwoo/v1. To read a full order, use the WooCommerce API (/wp-json/wc/v3/orders/{id}). To check only its status, use /orders/{id}/status.

List orders​

GET /orders

ParameterDefaultNotes
page, per_page1, 20Maximum 100 per page.
search—A number with fewer than 10 digits searches by exact ID. Any other text searches name, city, address, postcode, phone and service mode.
statusprocessing,acceptingOne or more comma-separated statuses.
orderbydatedate, id or delivery_time.
orderdescasc or desc.

multistore_user users only see orders from their own store.

Each order has the WooCommerce structure, with these additions:

FieldContent
total, subtotal, discount_totalCurrency-formatted text, for example "$ 25.000".
line_items[]Items with formatted prices and the chosen extras.
fee_lines[]Fees and delivery charges: {name, total, total_without_tax, tax}.
order_type_slug, order_typeService mode (delivery, pickup) and its name.
status_niceStatus in the site language.
billing_formatted, shipping_formattedAddresses in HTML.
date_to_deliver, time_to_deliverDay and time requested by the customer.
printedWhether the order has already been printed.
service_modedine_in (at a table), takeaway or empty.
table{id, label, zone, released_at} if the order is at a table.

meta includes pagination and statuses, the store's full status map.

Create an order​

POST /orders creates an order on behalf of the authenticated user. The server recalculates everything: prices, extras, delivery fee, hours and minimum. Any prices, totals, distances or shipping costs sent by the client are ignored.

FieldRequiredNotes
line_items[]Yesproduct_id, variation_id, quantity, extra_selections[{category_id, extra_ids[]}] and additional_comments.
payment_methodYesMust be an active offline payment method in the store (cod, bacs or cheque). Gateway payments go through the store checkout.
order_typeRecommendeddelivery or pickup.
fulfillment_dateDepends on settingsYYYY-MM-DD.
fulfillment_timeDepends on settingsHH:MM, now or asap.
billing, shippingNoAddresses with WooCommerce keys. Coverage is checked with shipping, then billing, then address.
addressNoFree-text address.
doorbellNoApartment, doorbell, directions.
curl -X POST https://tienda.example.test/wp-json/notiwoo/v1/orders \
-H "Authorization: Bearer <token>" -H "Content-Type: application/json" \
-d '{
"order_type": "delivery",
"payment_method": "cod",
"fulfillment_time": "asap",
"shipping": { "address_1": "Calle 10 # 20-30", "city": "Bogotá", "country": "CO" },
"line_items": [
{ "product_id": 120, "quantity": 2,
"extra_selections": [ { "category_id": 18, "extra_ids": [91] } ],
"additional_comments": "Sin cebolla" }
]
}'
{
"success": true,
"data": { "id": 1234, "status": "processing", "message": "Your Order has been accepted", "minutes": "30", "total": "33000.00" }
}

Before creating the order, validate the cart with POST /cart/validate to show errors to the customer.

ErrorHTTPCause
notiwoo_cutover_pending409Coexistence mode.
notiwoo_empty_cart422No items.
notiwoo_payment_method_required422payment_method is missing.
notiwoo_payment_requires_checkout422The method requires an online gateway.
notiwoo_payment_method_unavailable422The method is not active.
notiwoo_transaction_id_required422The transaction ID of a confirmed payment is missing.
notiwoo_cart_invalid422Validation failed; details are in details.validation.
notiwoo_product_changed409A product changed while the order was being created. Validate again.
notiwoo_order_create_failed500WooCommerce could not create the order.

Check the status​

GET /orders/{id}/status responds { id, status, message, minutes }. minutes is the estimated time. Use it so the customer can poll the status of their order.

Errors: 404 notiwoo_order_not_found, 403 notiwoo_order_forbidden (the order belongs to another user).

Update an order​

PUT /orders/{id}

FieldCustomer (owner)Management
statusOnly cancelled, and only if the order is not cancelled, completed or refunded.Any status.
minutes—Estimated time.
printed—Printed flag.
deliveryboy—Courier ID.
transaction_id—Transaction ID.

Responds { id, status, message, updated }. If the customer sends a change that is not allowed, it is ignored and updated is false.

To follow the app's status flow, see order statuses.

Change the estimated time​

POST /orders/{id}/minutes with minutes (required) and notify (true by default). With notify, the customer receives an email with the new time. Responds { id, minutes, message }.

Delete an order​

DELETE /orders/{id} deletes the order permanently, without going to the trash. To void a sale, change the status to cancelled.

Sales report​

GET /orders/reports counts completed orders in a range:

ParameterRequiredNotes
date_from, date_toYesDates; / is accepted as a separator.
deliveryboyNoCourier ID or all.
payment_methodNoMethod ID or all.

Responds { date_from, date_to, delivery_name, count, total, total_html }. If the dates are not valid, it responds 422 notiwoo_invalid_dates.

Available statuses​

GET /order-statuses responds { all, custom }:

  • all: all store statuses.
  • custom: statuses added by Notiwoo and other plugins (wc-accepted, wc-shipped, wc-finalized…).

See WooCommerce integration.