---
swagger: "2.0"
info:
title: Foreign Exchange Rate Microservice
description: ' API for Foreign Exchange Rate Microservice'
version: "2.0"
x-ibm-name: foreign-exchange-rate-microservice
name: ""
host: 127.0.0.1
schemes:
- https
basePath: /api
produces:
- application/json
paths:
/v1/consumer-services/foreign-exchange/rate/{currencyCode}:
get:
summary: Retrieve Foreign Exchange Rate
description: This API is used to get the Foreign Exchange Rate. The scope of
the API is public, pre-login and entry-point
tags:
- foreignExchange
parameters:
- name: client_id
in: header
description: Client ID generated during application registration
required: true
type: string
- name: Authorization
in: header
description: The most recent Authorization token
type: string
required: true
- name: Accept
in: header
description: 'Content-Types that are acceptable for the response '
required: true
type: string
- name: 'uuid '
in: header
description: 'Random 128 bit UUID generated uniquely for every request from
the Customer, which will represent transaction unique identifier '
required: true
type: string
- name: Accept-Language
in: header
description: List of acceptable human languages for response
required: false
type: string
- name: countryCode
in: header
description: Country code in 2 character ISO 3166 format
required: true
type: string
- name: businessCode
in: header
description: Business code identified during application registration
required: true
type: string
- name: ChannelID
in: header
description: Channel Id identifies the consumer from where the request comes
required: true
type: string
- name: currencyCode
in: path
description: currency which has to be exchanged. It includes a value of ALL
for the details about all the currencies
required: true
type: string
responses:
200:
description: Successful operation.
schema:
$ref: '#/definitions/RetrieveCurrencyRatesResponse'
400:
description:
Type | Code | Details |
error | invalidCard | Card
not found or invalid |
invalid | invalidRequest | Missing
or invalid Parameters |
schema:
$ref: '#/definitions/ErrorResponse'
401:
description: Type | Code | Details |
error | unAuthorized
| Authorization credentials are missing or invalid |
schema:
$ref: '#/definitions/ErrorResponse'
403:
description: Type | Code | Details | More
Info |
error | accessNotConfigured | The request
operation is not configured to access this resource | Channel/Country/Business
provided in the request is not supported currently |
schema:
$ref: '#/definitions/ErrorResponse'
404:
description: Type | Code | Details | More
Info |
error | resourceNotFound | The requested
resource was not found | Empty resource/resource not found |
schema:
$ref: '#/definitions/ErrorResponse'
500:
description: Type | Code | Details |
fatal | serverUnavailable | The
request failed due to an internal error |
schema:
$ref: '#/definitions/ErrorResponse'
/v1/consumer-services/foreign-exchange/updateinfo:
get:
summary: retrieve number of records and date of modification
description: This API is used to retrieve the number of records and the date
of modification. The scope of the API is public, pre-login and entry-point
tags:
- retrieveRateUpdateInfo
parameters:
- name: client_id
in: header
description: Client ID generated during application registration
required: true
type: string
- name: Authorization
in: header
description: The most recent Authorization token
type: string
required: true
- name: Accept
in: header
description: 'Content-Types that are acceptable for the response '
required: true
type: string
- name: 'uuid '
in: header
description: 'Random 128 bit UUID generated uniquely for every request from
the Customer, which will represent transaction unique identifier '
required: true
type: string
- name: Accept-Language
in: header
description: List of acceptable human languages for response
required: false
type: string
- name: countryCode
in: header
description: Country code in 2 character ISO 3166 format
required: true
type: string
- name: businessCode
in: header
description: Business code identified during application registration
required: true
type: string
- name: ChannelID
in: header
description: Channel Id identifies the consumer from where the request comes
required: true
type: string
responses:
200:
description: Successful operation.
schema:
$ref: '#/definitions/ExchangeRateUpdateInfoResponse'
400:
description: Type | Code | Details |
error | invalidCard | Card
not found or invalid |
invalid | invalidRequest | Missing
or invalid Parameters |
schema:
$ref: '#/definitions/ErrorResponse'
401:
description: Type | Code | Details |
error | unAuthorized
| Authorization credentials are missing or invalid |
schema:
$ref: '#/definitions/ErrorResponse'
403:
description: Type | Code | Details | More
Info |
error | accessNotConfigured | The request
operation is not configured to access this resource | Channel/Country/Business
provided in the request is not supported currently |
schema:
$ref: '#/definitions/ErrorResponse'
404:
description: Type | Code | Details | More
Info |
error | resourceNotFound | The requested
resource was not found | Empty resource/resource not found |
schema:
$ref: '#/definitions/ErrorResponse'
500:
description: Type | Code | Details |
fatal | serverUnavailable | The
request failed due to an internal error |
schema:
$ref: '#/definitions/ErrorResponse'
definitions:
RetrieveCurrencyRatesResponse:
type: array
description: Response for retrieving foreign currency exchange
items:
$ref: '#/definitions/ForeignExchange'
ExchangeRateUpdateInfoResponse:
type: object
description: Response object for retrieveRateUpdateInfo API
properties:
recordCount:
description: number of exchange rate records
type: integer
example: 20
lastUpdatedDate:
description: date when the data was updated
type: string
format: date-time
example: "2017-01-19T16:39:57-06:00"
ForeignExchange:
properties:
buyingRate:
description: Buying price of the currency
type: number
format: double
example: 60.010000
sellingRate:
description: Selling price of the currency
type: number
format: double
example: 60.020000
currencyCode:
description: code of currency to be exchanged
type: string
example: USD
maximumSellingAmount:
description: Maximum amount of currency to be sold by the bank
type: number
format: double
example: 100000.030000
maximumBuyingAmount:
description: Maximum amount of currency to be bought by the bank
type: number
format: double
example: 100000.600000
required:
- buyingRate
- sellingRate
- currencyCode
ErrorResponse:
properties:
type:
type: string
description: Invalid - Request did not confirm to the specification and was
unprocessed and rejected. Please fix the value and try again
enum:
- error
- warn
- invalid
- fatal
code:
description: Error code which qualifies the error
type: string
details:
description: Human readable explanation specific to the occurrence of the
problem
type: string
location:
description: The name of the field that resulted in the error
type: string
moreInfo:
description: URI to human readable documentation or detailed description of
the error
type: string
required:
- type
- code
x-ibm-configuration:
enforced: true
testable: true
phase: realized
securityDefinitions:
OAuth2 Application Flow:
type: oauth2
description: ""
flow: application
tokenUrl: https://api.banamex.com/mx-gcgapi/api/v1/oauth/token
scopes:
/api/v1: ""
Client ID:
type: apiKey
description: ""
in: header
name: X-IBM-Client-Id
security:
- OAuth2 Application Flow:
- /api/v1
Client ID: []
x-ibm-endpoints:
- endpointUrl: https://api.banamex.com/mx-gcgapi
type:
- production
- development
...