Manage postpaid balances using credit limits

You're viewing Apigee Edge documentation.
Go to the Apigee X documentation.
info

Introduction

When you add a supported currency for an organization, you can set a credit limit for a postpaid developer, as described in Adding supported currencies). The credit limit applies to all postpaid developers in the organization. In addition, you can set the credit limit for an individual postpaid developer, as described in the following sections. In this case, the credit limit overrides any limit set for the currency for the specified developer only.

Setting a credit limit using the API

To set a credit limit for an individual developer, issue a POST request to /organizations/{org_name}/developers/{developer_id}/developer-credit-limit, where {developer_id} is the email address of the developer. When you issue the request, you need to specify as query parameters the amount of the credit and the currency used for the credit. For example, the following request sets a credit limit of $1000 for a developer:

$ 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

Retrieving a credit limit using the API

To retrieve a credit limit for a postpaid developer issue a GET request to /organizations/{org_name}/developers/{developer_id}/developer-credit-limit, where {developer_id} is the email address of the developer. For example:

$ 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

The response should look something like this (only part of the response is shown):

{
  "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
}

Next steps

You can post refunds (for purchase transactions only) using monetization. Learn how in Post refunds.