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

数据

数据 API 允许您查看所有类型的可用数据。

列出所有数据

此 API 允许您检索并查看一个简单的可用数据端点列表。

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

数据属性

属性类型描述
slug字符串数据资源 ID。只读
description字符串数据资源描述。只读

查看所有大洲

这个 API 可以帮助您查看所有的大洲。

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

Continents properties

AttributeTypeDescription
codestring2 character continent code. READ-ONLY
namestringFull name of continent. READ-ONLY
countriesarrayList of countries on this continent. See Continents - Countries properties READ-ONLY
Continents - Countries properties
AttributeTypeDescription
codestringISO3166 alpha-2 country code. READ-ONLY
currency_codestringDefault ISO4127 alpha-3 currency code for the country. READ-ONLY
currency_posstringCurrency symbol position for this country. READ-ONLY
decimal_sepstringDecimal separator for displayed prices for this country. READ-ONLY
dimension_unitstringThe unit lengths are defined in for this country. READ-ONLY
namestringFull name of country. READ-ONLY
num_decimalsintegerNumber of decimal points shown in displayed prices for this country. READ-ONLY
statesarrayList of states in this country. See Continents - Countries - States properties READ-ONLY
thousand_sepstringThousands separator for displayed prices in this country. READ-ONLY
weight_unitstringThe unit weights are defined in for this country. READ-ONLY
Continents - Countries - States properties
AttributeTypeDescription
codestringState code. READ-ONLY
namestringFull name of state. READ-ONLY

获取大陆数据

此 API 允许您检索和查看大陆数据。

GET /wp-json/wc/v3/data/continents/<location>
curl https://example.com/wp-json/wc/v3/data/continents/eu \
-u consumer_key:consumer_secret

大陆属性

参见 大陆属性列表

列出所有国家

此 API 可以帮助您查看所有国家。

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

国家属性

属性类型描述
code字符串ISO3166 alpha-2 国家代码。只读
name字符串国家的全名。只读
states列表此国家的所有州列表。请查看 国家 - 州属性 只读
国家 - 州属性
属性类型描述
code字符串州代码。只读
name字符串州的完整名称。只读

获取国家数据

此 API 允许您检索和查看国家数据。

GET /wp-json/wc/v3/data/countries/<location>
curl https://example.com/wp-json/wc/v3/data/countries/br \
-u consumer_key:consumer_secret

国家属性

参见 国家属性列表

查看所有货币

此 API 可以帮助您查看所有货币。

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

货币属性

属性类型描述
code字符串ISO4217 货币代码。只读
name字符串货币的全名。只读
symbol字符串货币符号。只读

获取货币数据

这个 API 允许您获取和查看货币数据。

GET /wp-json/wc/v3/data/currencies/<currency>
curl https://example.com/wp-json/wc/v3/data/currencies/brl \
-u consumer_key:consumer_secret

货币属性

参见 货币属性列表

获取当前货币

此 API 允许您检索和查看商店的当前货币数据。

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

货币属性

参见货币属性列表