createExchangeRate
post
/ccadmin/v1/exchangerates
Create Exchange rate. Endpoint for creating Exchange rate
Request
Supported Media Types
- application/json
Body Parameter
Root Schema : createExchangeRate_request
{
"targetCurrency":"POINTS",
"exchangeRate":5,
"sourceCurrency":"USD"
}
- exchangeRate
-
Type:
numberRequired:trueMultiplying factor to convert source currency value to target currency value - sourceCurrency
-
Type:
stringRequired:trueThe source currency code - targetCurrency
-
Type:
stringRequired:trueThe target currency code
Response
Supported Media Types
- application/json
200 Response
Following model is returned when operation succeeds.
Body
Root Schema : createExchangeRate_response
- exchangeRate
-
Type:
numberMultiplying factor to convert source currency value to target currency value - id
-
Type:
stringTHe id of exchange rate. - sourceCurrency
-
Type:
stringThe source currency code - targetCurrency
-
Type:
stringThe target currency code
Example application/json
{
"targetCurrency":"POINTS",
"exchangeRate":"5",
"sourceCurrency":"USD",
"id":"10001"
}
Default Response
The error response.
The following are the internal error codes thrown by this API when the request processing fails in Oracle Commerce Cloud:
|Error Code|Description|
|------------------|------------------|
|80205|The required attribute {0} is missing|
|180003|The request to create the currency exchange rate could not be performed.|
|180006|Currency exchange rate with source currency {0} and target currency {1} already exists.|
|80206|Format for {0} is incorrect. Please check the API documentation for more details.|
Body
Root Schema : errorModel
Type:
object- devMessage
-
Type:
stringAn optional non-localized message containing technical information for developers - errorCode
-
Type:
stringThe numerical code identifying the error - errors
-
Type:
arrayerrorsAdditional Properties Allowed:An optional list of errors if multiple errors were encountered - message
-
Type:
stringThe localized message describing the error - moreInfo
-
Type:
stringAn optional non-localized message with more information - o:errorPath
-
Type:
stringAn optional machine readable description of where the error occurred - status
-
Type:
stringThe HTTP status code - type
-
Type:
stringThe URI to the HTTP state code definition
Nested Schema : errors
Nested Schema : items
Type:
object- devMessage
-
Type:
stringAn optional non-localized message containing technical information for developers - errorCode
-
Type:
stringThe numerical code identifying the error - message
-
Type:
stringThe localized message describing the error - moreInfo
-
Type:
stringAn optional non-localized message with more information - o:errorPath
-
Type:
stringAn optional machine readable description of where the error occurred - status
-
Type:
stringThe HTTP status code
Examples
Sample Request:
{
"targetCurrency": "POINTS",
"exchangeRate": 5,
"sourceCurrency": "USD"
}
Sample Response Payload returned by endpoint:
{
"targetCurrency": "POINTS",
"exchangeRate": "5",
"sourceCurrency": "USD",
"id": "10001"
}