使用信用额度管理后付费余额

您正在查看的是 Apigee Edge 文档。
转到 Apigee X 文档
信息

简介

为组织添加支持的货币时,您可以为后付费开发者设置信用额度,如添加支持的货币中所述。此信用额度适用于组织中的所有后付费开发者。此外,您还可以为单个后付费开发者设置信用额度,如以下部分所述。在这种情况下,信用额度会覆盖为指定开发者设置的币种的任何限额。

使用 API 设置信用额度

如需为单个开发者设置信用额度,请向 /organizations/{org_name}/developers/{developer_id}/developer-credit-limit 发出 POST 请求,其中 {developer_id} 是开发者的电子邮件地址。在发出请求时,您需要将赠金金额和用于赠金的币种指定为查询参数。例如,以下请求为开发者设置了 1, 000 美元的信用额度:

$ curl -H "Content-Type:application/json" -X POST \
"https://api.enterprise.apigee.com/v1/mint/organizations/{org_name}/developers/dev7@myorg/developer-credit-limit?amount=1000&supportedCurrencyId=usd" \
-u email:password

使用 API 检索信用额度

如需检索后付费开发者的信用额度,请向 /organizations/{org_name}/developers/{developer_id}/developer-credit-limit 发出 GET 请求,其中 {developer_id} 是开发者的电子邮件地址。例如:

$ curl -H "Accept:application/json" -X GET \
"https://api.enterprise.apigee.com/v1/mint/organizations/{org_name}/developers/dev7@myorg/developer-credit-limit" \
-u email:password

响应应类似如下所示(仅显示部分响应):

{
  "developerBalance" : [ {
    "amount" : 1000.0000,
    "id" : "ddd98cd5-06bc-481b-ae42-76a7345933a9",
    "supportedCurrency" : {
      "description" : "United States Dollar",
      "displayName" : "United States Dollar",
      "id" : "usd",
      "name" : "USD",
      "organization" : {
        ...
      },
      "status" : "ACTIVE",
      "virtualCurrency" : false
    },
    "usage" : 76.6052
  } ],
  "totalRecords" : 1
}

后续步骤

您可以使用创收功能发布退款(仅适用于购买交易)。请参阅发布退款了解详情。