您正在查看的是 Apigee Edge 文档。
转到 Apigee X 文档。 信息
简介
在初始获利设置过程中,Apigee Edge 配置团队会配置贵组织支持的默认货币和货币。
您可以查看您的组织支持的货币、添加支持的货币或删除支持的货币(如果开发者或费率方案未使用这些货币)。
使用界面管理支持的货币
在“组织资料”页面的“税费和币种”部分管理支持的币种并设置默认币种。如需了解详情,请参阅使用界面管理组织资料。
使用 API 管理支持的货币
使用 API 管理支持的货币,如以下部分所述。
使用 API 查看支持的货币
查看您的组织支持的各种货币或组织支持的所有货币。
如需查看您的组织支持的各种货币,请向 /mint/organizations/{org_name}/supported-currencies/{supportedCurrencyId}
发出 GET 请求,其中 {supportedCurrency_id}
是要查看的受支持货币的标识。例如:
curl -X GET -H "Accept: application/json" \ "https://api.enterprise.apigee.com/v1/mint/organizations/{org_name}/supported-currencies/usd" \ -u email:password
如需查看您的组织支持的所有货币,请向 /mint/organizations/{org_name}/supported-currencies
发出 GET 请求。例如:
curl -X GET "https://api.enterprise.apigee.com/v1/mint/organizations/{org_name}/supported-currencies" \ -H "Accept: application/json" \ -u email:password
以下提供了一个响应示例:
{ "supportedCurrency" : [ { "description" : "US Dollar", "displayName" : "US Dollar", "id" : "usd", "name" : "USD", "organization" : { ... "status" : "ACTIVE", "virtualCurrency" : false }, { "creditLimit" : 5000.0000, "description" : "Euro", "displayName" : "Euro", "id" : "eur", "name" : "EUR", "organization" : { ... }, "status" : "INACTIVE", "virtualCurrency" : false } ], "totalRecords" : 2 }
使用 API 添加支持的货币
通过向 /mint//organizations/{org_name}/supported-currencies
发出 POST 请求可添加支持的货币。对于您添加的每个受支持的货币,您需要在请求正文中指定以下信息:
- 支持的货币的名称。名称是货币的 ISO 4217 代码,例如 USD(代表美元)。
- 显示名称。
- 说明。
- 货币是否为虚拟货币。
- 货币的状态,即货币是否可供使用。
- 要为其添加所支持币种的组织。
您也可以选择设置:
- 受支持货币的信用额度(仅限后付费开发者)。
- 支持币种的最低充值金额(仅限预付费开发者)。
如需了解详情,请参阅支持的货币配置属性。
例如,以下代码会为组织添加支持的币种:
curl -H "Content-Type: application/json" -X POST -d \ '{ "description": "US Dollar", "displayName": "US Dollar", "virtualCurrency": "false", "name": "USD", "organization": { "id": "{org_name}" }, "status": "ACTIVE" }' \ "https://api.enterprise.apigee.com/v1/mint/organizations/{org_name}/supported-currencies" \ -u email:password
使用 API 设置默认货币
如需设置组织的默认货币,请在修改组织资料时将 currency
值设置为受支持的 ISO 4217 货币代码,如使用 API 管理组织资料中所述。
使用 API 修改支持的货币
通过向 /mint/organizations/{org_name}/{supportedCurrencyId}
发出 PUT 请求来修改支持的货币,其中 {supportedCurrency_id}
是要更新的受支持货币的标识。您需要在请求正文中指定更新后的属性以及支持的货币 ID。例如,以下 API 调用为受支持的货币修改了说明和显示名称(示例中突出显示了更新后的属性):
curl -H "Content-Type: application/json" -X PUT -d \ '{ "description": "United States Dollar", "displayName": "United States Dollar", "id": "usd", "name": "USD", "organization": { "id": "{org_name}" }, "status" : "ACTIVE", "virtualCurrency": "false" }' \ "https://api.enterprise.apigee.com/v1/mint/organization/{org_name}/supported-currencies/usd" -d \ -u email:password
使用 API 删除支持的货币
向 /mint/organizations/{org_name}/supported-currencies/{currency_id}
发出 DELETE 请求,以删除支持的货币,其中 {currency_id}
是要删除的受支持货币的标识。例如:
curl -X DELETE -H "Accept: application/json" \ "https://api.enterprise.apigee.com/v1/mint/organizations/{org_name}/supported-currencies/usd" \ -u email:password
API 的货币配置属性
下表总结了可使用 API 设置的配置属性。
名称 | 说明 | 默认 | 是否必需? |
---|---|---|---|
creditLimit |
此属性仅适用于后付费开发者。支持货币的信用额度。 |
不适用 | 否 |
说明 |
所支持货币的说明。 |
不适用 | 是 |
displayName |
针对支持的货币显示的名称。 |
不适用 | 是 |
minimumTopupAmount |
此媒体资源仅适用于预付费开发者。开发者可充入指定币种的预付款帐号余额的最低金额。 |
不适用 | 否 |
name |
货币的 ISO 4217 代码,例如 USD 代表美元。 |
不适用 | 是 |
组织 |
所支持货币的组织。 |
不适用 | 是 |
资质 |
所支持货币的状态。有效值包括:
|
不适用 | 是 |
virtualCurrency |
指明支持的货币是否为虚拟货币。有效值包括:
|
不适用 | 是 |