@lap v0.3
# Machine-readable API spec. Each @endpoint block is one API call.
@api nFusion Solutions Market Data API
@base https://api.nfusionsolutions.biz
@version 1
@auth ApiKey token in query
@endpoints 19
@toc api(19)

@endpoint GET /api/v1/Currencies/rate/supported
@desc Get list of currencies supported by the rate endpoint
@optional {format: str(json/xml)}
@returns(200) OK
@errors {400: Bad Request, 401: Unauthorized}

@endpoint GET /api/v1/Currencies/summary/supported
@desc Get list of currency pairs supported by the Summary endpoint
@optional {format: str(json/xml)}
@returns(200) OK
@errors {400: Bad Request, 401: Unauthorized}

@endpoint GET /api/v1/Currencies/history/supported
@desc Get list of currency pairs supported by the history endpoint
@optional {format: str(json/xml)}
@returns(200) OK
@errors {400: Bad Request, 401: Unauthorized}

@endpoint GET /api/v1/Currencies/rate
@desc Get latest mid rate for requested currency pairs
@required {pairs: str # comma separated list of currency pairs. For example: USD/CAD,USD/EUR,USD/AUD}
@optional {format: str(json/xml) # to override content negotiation specify a value of json or xml}
@returns(200) OK
@errors {400: Bad Request, 401: Unauthorized}

@endpoint GET /api/v1/Currencies/summary
@desc Get latest Summary for requested currency pairs
@required {pairs: str # comma separated list of currency pairs. For example: USD/CAD,USD/EUR,USD/AUD}
@optional {format: str(json/xml) # to override content negotiation specify a value of json or xml}
@returns(200) OK
@errors {400: Bad Request, 401: Unauthorized}

@endpoint GET /api/v1/Currencies/history
@desc Get historical prices for requested currency pairs
@required {pairs: str # comma separated list of currency pairs. For example: USD/CAD,USD/EUR,USD/AUD, start: str(date-time) # start date of time period. format is yyyy-mm-dd}
@optional {end: str(date-time) # end date of time period. format is yyyy-mm-dd. Default is current date., interval: str # aggregation interval. Composed of an optional integer value (which defaults to 1 when not specified),  followed by a type string which must be one of the following values: y=year, m=month, w=week, d=day, h=hour, mi=minute  For example, a yearly interval can be specified as "y" and 6 month interval as "6m".   If not specified the interval parameter default is 1 Day., format: str(json/xml) # to override content negotiation specify a value of json or xml}
@returns(200) OK
@errors {400: Bad Request, 401: Unauthorized}

@endpoint GET /api/v1/Currencies/adjustments
@desc Read the currency adjustments
@returns(200) {enabled: bool, expiresOn: str(date-time)?, adjustments: [map]?} # OK

@endpoint POST /api/v1/Currencies/adjustments
@desc Update the currency adjustments
@optional {token: str, items: [map{enabled!: bool, expiresOn: str(date-time), adjustments: [map]}]}
@returns(200) {enabled: bool, expiresOn: str(date-time)?, adjustments: [map]?} # OK
@errors {400: Bad Request, 500: Internal Server Error}

@endpoint GET /api/v1/Metals/supported/currency
@desc Get list of currencies supported by metals endpoints for currency conversion
@optional {format: str(json/xml)}
@returns(200) OK
@errors {400: Bad Request, 401: Unauthorized}

@endpoint GET /api/v1/Metals/spot/supported
@desc Get list of symbols supported by the spot endpoints
@optional {format: str(json/xml)}
@returns(200) OK
@errors {400: Bad Request, 401: Unauthorized}

@endpoint GET /api/v1/Metals/spot/summary
@desc Get latest Spot Summary for requested metals
@required {metals: str # comma separated list of metals}
@optional {currency: str # comma separated list of conversion currencies, defaults to USD, unitofmeasure: str(mg/g/kg/gr/toz/ct/dwt) # unit of meaure, defaults to troy ounces. allowed values are: mg=milligram g=gram kg=kilogram gr=grain toz=troy ounce ct=carat dwt=pennyweight, format: str(json/xml) # to override content negotiation specify a value of json or xml}
@returns(200) OK
@errors {400: Bad Request, 401: Unauthorized}

@endpoint GET /api/v1/Metals/spot/history
@desc Get historical Spot prices for requested metals
@required {metals: str # comma separated list of metals, start: str(date-time) # start date of time period. format is yyyy-mm-dd}
@optional {end: str(date-time) # end date of time period. format is yyyy-mm-dd. Default is current date., interval: str # aggregation interval. Composed of an optional integer value (which defaults to 1 when not specified),  followed by a type string which must be one of the following values: y=year, m=month, w=week, d=day, h=hour, mi=minute  For example, a yearly interval can be specified as "y" and 6 month interval as "6m".   If not specified the interval parameter default is 1 Day., historicalfx: bool # if true use historical currency rates otherwise current currency rates. Defaults to true., currency: str # comma separated list of conversion currencies, defaults to USD, unitofmeasure: str(mg/g/kg/gr/toz/ct/dwt) # unit of meaure, defaults to troy ounces. allowed values are: mg=milligram g=gram kg=kilogram gr=grain toz=troy ounce ct=carat dwt=pennyweight, format: str(json/xml) # to override content negotiation specify a value of json or xml}
@returns(200) OK
@errors {400: Bad Request, 401: Unauthorized}

@endpoint GET /api/v1/Metals/spot/ratio/summary
@desc Get latest Spot Summary for requested metal ratios
@required {pairs: str # comma separated list of metal pairs. For example: gold/silver,gold/platinum,silver/palladium}
@optional {format: str(json/xml) # to override content negotiation specify a value of json or xml}
@returns(200) OK
@errors {400: Bad Request, 401: Unauthorized}

@endpoint GET /api/v1/Metals/spot/ratio/history
@desc Get historical Spot Ratio prices for requested metals
@required {pairs: str # comma separated list of metals, start: str(date-time) # start date of time period. format is yyyy-mm-dd}
@optional {end: str(date-time) # end date of time period. format is yyyy-mm-dd. Default is current date., interval: str # aggregation interval. Composed of an optional integer value (which defaults to 1 when not specified),  followed by a type string which must be one of the following values: y=year, m=month, w=week, d=day, h=hour, mi=minute  For example, a yearly interval can be specified as "y" and 6 month interval as "6m".   If not specified the interval parameter default is 1 Day., format: str(json/xml) # to override content negotiation specify a value of json or xml}
@returns(200) OK
@errors {400: Bad Request, 401: Unauthorized}

@endpoint GET /api/v1/Metals/benchmark/supported
@desc Get list of symbols supported by the benchmark endpoints
@optional {format: str(json/xml)}
@returns(200) OK
@errors {400: Bad Request, 401: Unauthorized}

@endpoint GET /api/v1/Metals/benchmark/summary
@desc Get latest Benchmark prices for requested metals
@required {metals: str # comma separated list of metals}
@optional {currency: str # comma separated list of conversion currencies, defaults to USD, unitofmeasure: str(mg/g/kg/gr/toz/ct/dwt) # unit of meaure, defaults to troy ounces. allowed values are: mg=milligram g=gram kg=kilogram gr=grain toz=troy ounce ct=carat dwt=pennyweight, format: str(json/xml) # to override content negotiation specify a value of json or xml}
@returns(200) OK
@errors {400: Bad Request, 401: Unauthorized}

@endpoint GET /api/v1/Metals/benchmark/history
@desc Get historical benchmark prices for requested metals
@required {metals: str # comma separated list of metals, start: str(date-time) # start date of time period. format is yyyy-mm-dd}
@optional {end: str(date-time) # end date of time period. format is yyyy-mm-dd. Default is current date., interval: str # aggregation interval. Composed of an optional integer value (which defaults to 1 when not specified),  followed by a type string which must be one of the following values: y=year, m=month, w=week, d=day, h=hour, mi=minute  For example, a yearly interval can be specified as "y" and 6 month interval as "6m".   If not specified the interval parameter default is 1 Day., historicalfx: bool # if true use historical currency rates otherwise current currency rates. Defaults to true., currency: str # comma separated list of conversion currencies, defaults to USD, unitofmeasure: str(mg/g/kg/gr/toz/ct/dwt) # unit of meaure, defaults to troy ounces. allowed values are: mg=milligram g=gram kg=kilogram gr=grain toz=troy ounce ct=carat dwt=pennyweight, format: str(json/xml) # to override content negotiation specify a value of json or xml}
@returns(200) OK
@errors {400: Bad Request, 401: Unauthorized}

@endpoint GET /api/v1/Metals/adjustments
@desc Read the spot adjustments
@returns(200) {enabled: bool, expiresOn: str(date-time)?, adjustments: [map]?} # OK

@endpoint POST /api/v1/Metals/adjustments
@desc Update the spot adjustments
@optional {token: str, items: [map{enabled!: bool, expiresOn: str(date-time), adjustments: [map]}]}
@returns(200) {enabled: bool, expiresOn: str(date-time)?, adjustments: [map]?} # OK
@errors {400: Bad Request, 500: Internal Server Error}

@end
