订单列表

  • 接口说明: 订单列表
  • 接口地址: /orders
  • 请求方式: GET

请求参数

字段名变量名必填类型描述
排序参数sortstring可选值:created_at、updated_at。
筛选参数filter[status]int筛选订单付款状态,可选值:0 待付款,1 已付款,3 支付失败,4 订单已过期
筛选参数filter[user]int传递 user_id,筛选某用户数据
筛选参数filter[order_sn]string按订单号筛选
筛选参数filter[username]string按订单创建人筛选
筛选参数filter[payee_username]string按收款人用户名筛选
筛选参数filter[product]string按商品名筛选(帖子内容)
筛选参数filter[start_time]datetime按订单创建时间范围筛选:开始时间
筛选参数filter[end_time]datetime按订单创建时间范围筛选:最后时间
关联参数includestring关联数据(包含 user,thread,thread.firstPost,group)

返回说明

  • 返回当前创建成功数据, http 状态码: 200

返回结果

字段名变量名必填类型描述
linksobjectobject接口链接
data.attributesobjectobject数据属性
订单编号attribute.order_snstring订单唯一编号
订单金额attribute.amountfloat订单付款金额
付款状态attributes.statusint付款状态,0 待付款,1 已付款 ,2 取消订单,3 支付失败,4 订单已过期
订单类型attributes.typeint1:注册,2:打赏,3:付费主题,4:付费用户组,5:问答提问支付,6:问答围观付费, 7: 付费主题
主题 IDattributes.thread_idint打赏的主题
用户组 IDattributes.group_idint付费用户组 id
订单标题attributes.titlestring主题不为空时,标题不为空
更新时间attributes.updated_atdatetime更新时间
创建时间attributes.created_atdatetime创建时间
data.relationshipsobjectobject关联关系
includedobjectobject关联数据

返回示例

  1. {
  2. "links": {
  3. "first": "http://discuz.test/api/order?page%5Blimit%5D=1&include=user%2Cthread",
  4. "next": "http://discuz.test/api/order?page%5Blimit%5D=1&page%5Boffset%5D=1&include=user%2Cthread",
  5. "last": "http://discuz.test/api/order?page%5Blimit%5D=1&page%5Boffset%5D=8&include=user%2Cthread"
  6. },
  7. "data": [
  8. {
  9. "type": "orders",
  10. "id": "9",
  11. "attributes": {
  12. "order_sn": "2019112210453097539952",
  13. "amount": "2.50",
  14. "status": 0,
  15. "type": 2,
  16. "title": "title",
  17. "thread_id": 2,
  18. "updated_at": "2019-11-22T10:45:30+08:00",
  19. "created_at": "2019-11-22T10:45:30+08:00"
  20. },
  21. "relationships": {
  22. "user": {
  23. "data": {
  24. "type": "users",
  25. "id": "1"
  26. }
  27. },
  28. "thread": {
  29. "data": {
  30. "type": "threads",
  31. "id": "2"
  32. }
  33. }
  34. }
  35. }
  36. ],
  37. "included": [
  38. {
  39. "type": "users",
  40. "id": "1",
  41. "attributes": {
  42. "username": "username",
  43. "mobile": "mobile",
  44. "lastLoginIp": "",
  45. "createdAt": "2019-11-16T12:47:45+08:00",
  46. "updatedAt": "2019-11-16T12:47:45+08:00"
  47. }
  48. },
  49. {
  50. "type": "threads",
  51. "id": "2",
  52. "attributes": {
  53. "title": "test",
  54. "price": "0.50",
  55. "viewCount": 0,
  56. "postCount": 0,
  57. "likeCount": 0,
  58. "createdAt": null,
  59. "updatedAt": null,
  60. "isApproved": true,
  61. "isSticky": false,
  62. "isEssence": false,
  63. "canApprove": false,
  64. "canSticky": false,
  65. "canEssence": false,
  66. "canDelete": false
  67. }
  68. }
  69. ]
  70. }