管理支持的货币

您正在查看 Apigee Edge 文档。
前往 Apigee X 文档。
信息

简介

在首次设置 Monetization 时,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(代表美元)。

不适用 是
组织

支持的币种对应的组织。

不适用 是
状态

支持的币种的状态。有效值包括:

  • 有效:支持的币种可供使用。
  • INACTIVE:不支持的币种,无法使用。
不适用 是
virtualCurrency

指示所支持的币种是否为虚拟币种。有效值包括:

  • true:支持的币种为虚拟币。
  • false:支持的币种不是虚拟币。
不适用 是