跳到主要内容
将当前页面内容以 Markdown 格式复制到剪贴板

退款

退款 API 是一个简单、只读的接口,允许您检索与现有订单无关的退款列表。要创建、查看和删除单个退款,请参阅 订单退款 API

退款属性

所有属性与其他在 订单退款接口 中定义的属性相同,但增加了一个额外的属性:

属性类型描述
parent_idinteger与退款关联的订单 ID。

获取退款列表

此 API 允许您从您的商店检索和查看退款,无论它们与哪个订单相关。

GET /wp-json/wc/v3/refunds
curl https://example.com/wp-json/wc/v3/refunds \
-u consumer_key:consumer_secret

Available parameters

ParameterTypeDescription
contextstringScope under which the request is made; determines fields present in response. Options: view and edit. Default is view.
pageintegerCurrent page of the collection. Default is 1.
per_pageintegerMaximum number of items to be returned in result set. Default is 10.
searchstringLimit results to those matching a string.
afterstringLimit response to resources published after a given ISO8601 compliant date.
beforestringLimit response to resources published before a given ISO8601 compliant date.
excludearrayEnsure result set excludes specific IDs.
includearrayLimit result set to specific ids.
offsetintegerOffset the result set by a specific number of items.
orderstringOrder sort attribute ascending or descending. Options: asc and desc. Default is desc.
orderbystringSort collection by object attribute. Options: date, modified, id, include, title and slug. Default is date.
parentarrayLimit result set to those of particular parent IDs.
parent_excludearrayLimit result set to all items except those of a particular parent ID.
dpintegerNumber of decimal points to use in each resource. Default is 2.