You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Shopware Admin API请求体传参失败问题咨询

Solution for Shopware Admin API Body Parameters
  • The validation errors occur because POST /api/order is designed for creating new orders, not fetching existing ones. Shopware expects order creation data (like billing address, currency ID) here, hence the missing required fields error.
  • To fetch orders with filter/limit parameters in the request body, use Shopware's dedicated search endpoint: POST /api/search/order
  • Wrap your query parameters inside a criteria object in the request body. Here's a corrected request example:
POST /api/search/order HTTP/1.1
Authorization: Bearer XXXXX
Host: 127.0.0.1:8000
Content-Type: application/json
Content-Length: 35

{
  "criteria": {
    "limit": 2
  }
}
  • You can extend the criteria object with additional parameters like filters, sorting, or associations as needed. For example, to filter orders by status:
{
  "criteria": {
    "limit": 2,
    "filter": [
      {
        "type": "equals",
        "field": "stateMachineState.technicalName",
        "value": "completed"
      }
    ]
  }
}

内容的提问来源于stack exchange,提问作者O'Niel

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.14 05:03:17