API for the Settlement Currency Rate converter icon

API for the Settlement Currency Rate converter

This API provides a range of functions to get back currency conversion rates and amounts based on current Mastercard currency conversion values

COMMUNITYNO AUTH0 INSTALLS
OpenAPI Specificationv3.0
{
  "swagger": "2.0",
  "host": "api.mastercard.com",
  "basePath": "/mcapi/settlement/currencyrate",
  "info": {
    "description": "This API provides a range of functions to get back currency conversion rates and amounts based on current Mastercard currency conversion values.",
    "title": "API for the Settlement Currency Rate converter",
    "version": "1.0.0",
    "x-artifactId": "currency-conversion",
    "x-origin": [
      {
        "format": "swagger",
        "url": "https://developer.mastercard.com/devzone/api/portal/swagger/currency-conversion-calculator",
        "version": "2.0"
      }
    ],
    "x-providerName": "mastercard.com",
    "x-serviceName": "CurrencyConversionCalculator",
    "x-test-on-environment": {
      "environment": "SANDBOX_MTF"
    },
    "x-logo": {
      "url": "https://api.apis.guru/v2/cache/logo/https_apis.guru_assets_images_no-logo.svg"
    }
  },
  "produces": [
    "application/json"
  ],
  "tags": [
    {
      "description": "Conversion Rate",
      "name": "Conversion Rate"
    },
    {
      "description": "Rate Issued",
      "name": "Rate Issued"
    },
    {
      "description": "Currencies",
      "name": "Currencies"
    }
  ],
  "paths": {
    "/conversion-rate": {
      "get": {
        "consumes": [
          "application/json"
        ],
        "description": "Get the currency conversion rate details.",
        "operationId": "getConversionDetailUsingGET",
        "parameters": [
          {
            "description": "Date of the requested FX rates.",
            "in": "query",
            "name": "fxDate",
            "required": true,
            "type": "string"
          },
          {
            "description": "Currency of the transaction.",
            "in": "query",
            "name": "transCurr",
            "required": true,
            "type": "string"
          },
          {
            "description": "Cardholder billing currency.",
            "in": "query",
            "name": "crdhldBillCurr",
            "required": true,
            "type": "string"
          },
          {
            "description": "Additional fees imposed by the bank.",
            "format": "double",
            "in": "query",
            "name": "bankFee",
            "required": false,
            "type": "number"
          },
          {
            "description": "Amount in the transaction currency.",
            "format": "double",
            "in": "query",
            "name": "transAmt",
            "required": true,
            "type": "number"
          }
        ],
        "produces": [
          "application/json;charset=UTF-8"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/ConversionRateRequest"
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "summary": "Get the currency conversion rate details.",
        "tags": [
          "Conversion Rate"
        ],
        "x-samples": [
          {
            "name": "documentation_conversion_rate_request",
            "populateDefaults": {
              "application/json": "{\n  \"fxDate\":\"true\",\n  \"transCurr\":\"true\",\n  \"crdhldBillCurr\":\"true\",\n  \"bankFee\":\"true\",\n  \"transAmt\":\"true\"\n} "
            },
            "request": {
              "application/json": "{\n  \"fxDate\":\"2019-09-30\",\n  \"transCurr\":\"ALL\",\n  \"crdhldBillCurr\":\"DZD\",\n  \"bankFee\":\"5\",\n  \"transAmt\":\"23\"\n}   "
            },
            "type": "documentation"
          },
          {
            "ignoreAsserts": [
              "date",
              "data.conversionRate",
              "data.crdhldBillAmt"
            ],
            "name": "example_conversion_rate_request",
            "request": {
              "application/json": "{\n  \"fxDate\":\"2019-09-30\",\n  \"transCurr\":\"ALL\",\n  \"crdhldBillCurr\":\"DZD\",\n  \"bankFee\":\"5\",\n  \"transAmt\":\"23\"\n}   "
            },
            "response": {
              "application/json": "{\n   \"name\":\"settlement-conversion-rate\",\n   \"description\":\"Settlement conversion rate and billing amount\",\n   \"date\":\"2017-11-03 03:59:50\",\n   \"data\":{\n      \"conversionRate\":0.57,\n      \"crdhldBillAmt\":13.11,\n      \"fxDate\":\"2019-09-30\",\n      \"transCurr\":\"ALL\",\n      \"crdhldBillCurr\":\"DZD\",\n      \"transAmt\":23,\n      \"bankFee\":5\n   }\n}"
            }
          },
          {
            "name": "example_unavailable_rate_request",
            "request": {
              "application/json": "{\n  \"fxDate\":\"2019-08-08\",\n  \"transCurr\":\"INR\",\n  \"crdhldBillCurr\":\"USD\",\n  \"bankFee\":\"5\",\n  \"transAmt\":\"345\"\n}"
            },
            "response": {
              "application/json": "{  \n  \"name\":\"settlement-conversion-rate\",\n  \"description\":\"An error occurred during the request\",\n  \"date\":\"2019-08-08 16:34:34\",\n  \"type\":\"error\",\n  \"data\":{  \n      \"errorCode\":\"104\",\n      \"errorMessage\":\"Not Found , The calculated cross rates for the selected date is not available.\"\n  }\n}"
            },
            "type": "sample"
          }
        ]
      }
    },
    "/conversion-rate-issued": {
      "get": {
        "consumes": [
          "application/json"
        ],
        "description": "Determine if the settlement rate has been issued.",
        "operationId": "isRateIssuedUsingGET",
        "parameters": [
          {
            "description": "The date by which the rate would have been issued.",
            "in": "query",
            "name": "date",
            "required": false,
            "type": "string"
          }
        ],
        "produces": [
          "application/json;charset=UTF-8"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/SettlementRateIssuedRequest"
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "summary": "Determine if the settlement rate has been issued.",
        "tags": [
          "Rate Issued"
        ],
        "x-samples": [
          {
            "name": "documentation_rate_issued_request",
            "populateDefaults": {
              "application/json": "{\n  \"date\":\"true\"\n}  "
            },
            "request": {
              "application/json": "{\n  \"date\":\"2019-08-08\"\n}  "
            },
            "type": "documentation"
          },
          {
            "ignoreAsserts": [
              "date"
            ],
            "name": "example_rate_issued_request",
            "request": {
              "application/json": "{\n  \"date\":\"2019-08-08\"\n}   "
            },
            "response": {
              "application/json": "{\n   \"name\":\"settlement-conversion-rate-issued\",\n   \"description\":\"Is settlement conversion rate issued\",\n   \"date\":\"2017-11-03 04:07:18\",\n   \"data\":{\n      \"rateIssued\":\"Yes\"\n   }\n}"
            }
          }
        ]
      }
    },
    "/settlement-currencies": {
      "get": {
        "consumes": [
          "application/json"
        ],
        "description": "List of supported currencies.",
        "operationId": "getCurrencyRateDataUsingGET",
        "produces": [
          "application/json;charset=UTF-8"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/SettlementCurrencyRequest"
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "summary": "getCurrencyRateData",
        "tags": [
          "Currencies"
        ],
        "x-samples": [
          {
            "ignoreAsserts": [
              "date"
            ],
            "name": "example_settlement_currencies_request",
            "request": {
              "application/json": "{\n  \n}   "
            },
            "response": {
              "application/json": "{\n    \"name\": \"settlement-currency\", \n    \"description\": \"A list of settlement active currencies\", \n    \"date\": \"11-2017-03 03:54:47\", \n    \"data\": {\n        \"currencies\": [\n            {\n                \"alphaCd\": \"AFN\", \n                \"currNam\": \"AFGHANISTAN AFGHANI\"\n            }, \n            {\n                \"alphaCd\": \"ALL\", \n                \"currNam\": \"ALBANIAN LEK\"\n            }\n        ]\n    }\n}"
            }
          }
        ]
      }
    }
  },
  "definitions": {
    "Conversion": {
      "properties": {
        "bankFee": {
          "description": "Additional fees imposed by the bank.",
          "example": 5,
          "format": "double",
          "type": "number"
        },
        "conversionRate": {
          "description": "Rate applied to the transaction to convert from Transaction Currency to Cardholder Billing Currency.",
          "example": 0.943078,
          "format": "double",
          "type": "number"
        },
        "crdhldBillAmt": {
          "description": "Amount in the cardholder billing currency.",
          "example": 21.690798,
          "format": "double",
          "type": "number"
        },
        "crdhldBillCurr": {
          "description": "Cardholder billing currency.",
          "example": "DZD",
          "type": "string"
        },
        "errorCode": {
          "description": "The error code associated with the error being returned.",
          "example": 104,
          "type": "string"
        },
        "errorMessage": {
          "description": "The reason for the error.",
          "example": "Not Found , The calculated cross rates for the selected date is not available.",
          "type": "string"
        },
        "fxDate": {
          "description": "Date of the requested FX rates.",
          "example": "2016-09-30",
          "type": "string"
        },
        "transAmt": {
          "description": "Amount in the transaction currency.",
          "example": 23,
          "format": "double",
          "type": "number"
        },
        "transCurr": {
          "description": "Currency of the transaction.",
          "example": "ALL",
          "type": "string"
        }
      }
    },
    "ConversionRateRequest": {
      "properties": {
        "data": {
          "$ref": "#/definitions/Conversion"
        },
        "date": {
          "description": "The date and time the API is being called in GMT.",
          "example": "2019-08-08 16:43:27",
          "type": "string"
        },
        "description": {
          "description": "The description of the API being called.",
          "example": "Settlement conversion rate and billing amount",
          "type": "string"
        },
        "name": {
          "description": "The name of the service being requested.",
          "example": "settlement-conversion-rate",
          "type": "string"
        },
        "type": {
          "description": "The type of response being returned by the API.",
          "example": "error",
          "type": "string"
        }
      }
    },
    "Currency": {
      "properties": {
        "alphaCd": {
          "description": "The Alpha code for the currency.",
          "example": "AOA",
          "type": "string"
        },
        "currNam": {
          "description": "The full name of the currency.",
          "example": "ANGOLAN KWANZA",
          "type": "string"
        }
      }
    },
    "SettlementCurrency": {
      "properties": {
        "currencies": {
          "items": {
            "$ref": "#/definitions/Currency"
          },
          "type": "array"
        }
      }
    },
    "SettlementCurrencyRequest": {
      "properties": {
        "data": {
          "$ref": "#/definitions/SettlementCurrency"
        },
        "date": {
          "description": "The date and time the API is being called in GMT.",
          "example": "2019-08-08 16:22:31",
          "type": "string"
        },
        "description": {
          "description": "The description of the API being called.",
          "example": "A list of settlement active currencies",
          "type": "string"
        },
        "name": {
          "description": "The name of the service being requested.",
          "example": "settlement-currency",
          "type": "string"
        }
      }
    },
    "SettlementRateIssued": {
      "properties": {
        "rateIssued": {
          "description": "The requested foreign exchange rate.",
          "example": "NO",
          "type": "string"
        }
      }
    },
    "SettlementRateIssuedRequest": {
      "properties": {
        "data": {
          "$ref": "#/definitions/SettlementRateIssued"
        },
        "date": {
          "description": "The date and time the API is being called in GMT.",
          "example": "2019-08-08 16:22:31",
          "type": "string"
        },
        "description": {
          "description": "The description of the API being called.",
          "example": "Is settlement conversion rate issued",
          "type": "string"
        },
        "name": {
          "description": "The name of the service being requested.",
          "example": "settlement-conversion-rate-issued",
          "type": "string"
        }
      }
    }
  }
}