Skip to main content

Errors

Two formats​

Plugin errors. Returned by the resource itself: nonexistent product, invalid data, conflict…

{
"success": false,
"error": {
"code": "notiwoo_extra_not_found",
"message": "Extra not found.",
"details": {}
}
}

details can contain additional data, for example the field or index that failed. It can also be empty ({} or []).

WordPress errors. Raised before the request reaches the resource: missing authentication or permissions, missing or invalid required parameters, nonexistent routes.

{
"code": "rest_missing_callback_param",
"message": "Missing parameter(s): entity, operation, target, request_id",
"data": { "status": 400, "params": ["entity", "operation", "target", "request_id"] }
}

Your client must handle both. A simple way:

const body = await response.json();
const code = body.error?.code ?? body.code; // plugin or WordPress
const message = body.error?.message ?? body.message;

Always decide based on code and the HTTP status, never on message: the text changes with the site language.

Common codes​

CodeHTTPMeaningWhat to do
notiwoo_unauthorized401Authentication is missing or the token is not valid.Request a new token.
notiwoo_forbidden403The user does not have permission.Use an administrator or shop manager account.
rest_forbidden401/403Same as above, on the per-mode shutdown route.Same as above.
notiwoo_invalid_credentials401Wrong username or password when requesting the token.Check the credentials.
rest_missing_callback_param400A required parameter is missing.Check data.params.
rest_invalid_param400A parameter has an invalid type or value.Check data.params.
rest_no_route404The route or method does not exist.Check the route and the HTTP method.
notiwoo_not_found404Product or category does not exist or is not published.—
notiwoo_woocommerce_missing500WooCommerce is not active.Activate WooCommerce.
notiwoo_cutover_pending409Coexistence mode: the store does not accept orders through the API.Finish the migration.
notiwoo_deprecated_route308Old woofood/* route.Use the route in details.redirect_to.

Conflicts (409)​

A 409 means the operation conflicts with the current state. For example:

  • notiwoo_bulk_busy: a bulk change is already in progress.
  • table_busy or table_occupied: the table is occupied or locked.
  • loyalty_unavailable: the program is disabled, the account is locked by another operation, or WhatsApp is not configured.
  • notiwoo_product_changed: the product changed while the order was being created.

Read the resource again, fix the problem and retry. If the operation uses an idempotency key, retry with the same key.

Errors inside a successful response​

Some validations respond 200 and return problems as data, so you can show them to the customer:

  • POST /cart/validate: data.valid and data.errors[].
  • POST /delivery/check-address: data.deliverable and data.reason.
  • POST /users/me/addresses: data.deliverable: false if there is no coverage.

Each resource page lists its specific codes.