Manage supported currencies

Introduction

As part of its initial setup of monetization, the Apigee Edge configuration team configures currencies and the default currency supported by your organization.

You can view the currencies that your organization supports, add supported currencies, or delete supported currencies (if the currencies are not used by a developer or a rate plan).

Managing supported currencies using the UI

Manage the supported currencies and set the default currency in the Tax and Currency section of the Organization Profile page. See Managing the organization profile using the UI for details.

Managing supported currencies using the API

Manage supported currencies using the API, as described in the following sections.

Viewing supported currencies using the API

View an individual currency supported by your organization or all the currencies supported by your organization.

To view an individual currency supported by your organization, issue a GET request to /mint/organizations/{org_name}/supported-currencies/{supportedCurrencyId}, where {supportedCurrency_id} is the identification of the supported currency to be viewed. For example:

curl -X GET -H "Accept: application/json"  \
  "https://api.enterprise.apigee.com/v1/mint/organizations/{org_name}/supported-currencies/usd" \
-u email:password

To view all the currencies supported by your organization, issue a GET request to /mint/organizations/{org_name}/supported-currencies. For example:

curl -X GET "https://api.enterprise.apigee.com/v1/mint/organizations/{org_name}/supported-currencies" \
  -H "Accept: application/json"  \
-u email:password

The following provides an example of the response:

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

Adding supported currencies using the API

Add supported currencies by issuing a POST request to /mint//organizations/{org_name}/supported-currencies. For each supported currency you add, you need to specify the following information in the request body:

  • Name of the supported currency. The name is the ISO 4217 code for the currency, such as USD for Unites States dollar.
  • Display name.
  • Description.
  • Whether or not the currency is virtual currency.
  • Status of the currency, that is, whether or not the currency is available for use.
  • Organization for which the supported currency will be added.

Optionally, you can set:

  • Credit limit for a supported currency (postpaid developers only).
  • Minimum top-up for a supported currency (prepaid developers only).

See Supported currency configuration properites for more information.

For example, the following adds a supported currency for an organization:

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

Setting the default currency using the API

Set the default currency for the organization by setting the currency value to a supported ISO 4217 currency code when you edit the organization profile, as described in Managing the organization profile using the API.

Editing a supported currency using the API

Edit a supported currency by issuing a PUT request to /mint/organizations/{org_name}/{supportedCurrencyId}, where {supportedCurrency_id} is the identification of the supported currency to be updated. You need to specify in the request body the updated properties as well as the supported currency ID. For example, the following API call edits the description and display name for a supported currency (the updated properties are highlighted in the example):

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

Deleting a supported currency using the API

Delete a supported currency by issuing a DELETE request to /mint/organizations/{org_name}/supported-currencies/{currency_id}, where {currency_id} is the identification of the supported currency to be deleted. For example:

curl -X DELETE -H "Accept: application/json"  \
  "https://api.enterprise.apigee.com/v1/mint/organizations/{org_name}/supported-currencies/usd" \
  -u email:password

Currency configuration properties for the API

The following table summarizes the configuration properties that can be set using the API.

Name Description Default Required?
creditLimit

This property applies to postpaid developers only. The credit limit for the supported currency.

N/A No
description

A description of the supported currency.

N/A Yes
displayName

The name to display for the supported currency.

N/A Yes
minimumTopupAmount

This property applies to prepaid developers only. Minimum amount that developers can add to their prepaid account balance in the specified currency.

N/A No
name

The ISO 4217 code for the currency, such as USD for United States dollar.

N/A Yes
organization

The organization for the supported currency.

N/A Yes
status

The status of the supported currency. Valid values include:

  • ACTIVE: Supported currency is available for use.
  • INACTIVE: Supported currency is not available for use.
N/A Yes
virtualCurrency

Indicates whether the supported currency is virtual currency. Valid values include:

  • true: Supported currency is virtual currency.
  • false: Supported currency is not virtual currency.
N/A Yes