When you create a site that supports loyalty points, you must create an exchange rate. You can create multiple exchange rates, but the site will determine which configuration to use when converting currency.
To create an exchange rate between currency and loyalty points, issue a POST request to the /ccadmin/v1/exchangerates
endpoint on the administration server. Specify the values of the currency properties as a JSON map in the body of the request.
The following table describes properties in the body of the request.
Property | Description |
---|---|
| A string that specifies the ID for the Exchange Rate. |
| A string that specifies the custom currency code that you use to indicates loyalty points. The |
| A string that specifies the monetary currency code to which the loyalty points should be converted. |
| A number that indicates the exchange rate. This rate is multiplied by the |
The following example shows a sample request for creating an exchange rate between a monetary currency and the loyalty program’s currency that you created in the Implement loyalty points section:
POST /ccadmin/v1/exchangerates HTTP/1.1
Content-Type: application/json
Authorization: Bearer <access_token>
{
"sourceCurrency": "USD",
"targetCurrency": "PTS",
"exchangeRate": 5
}
If the exchange rate is created successfully, the response body returned includes the ID for the new currency and a link to the URL used in the request. The following is a sample response.
{ "sourceCurrency": "USD", "targetCurrency": "PTS", "exchangeRate": 5, "id": "10001" }