{"_id":"5b197473be7bb50003d5dbab","category":{"_id":"5b197473be7bb50003d5dba5","version":"5b197473be7bb50003d5dbd6","project":"57336fd5a6a9c40e00e13a0b","__v":0,"sync":{"url":"","isSync":false},"reference":true,"createdAt":"2016-05-17T12:18:56.501Z","from_sync":false,"order":4,"slug":"convert-currency","title":"Convert Currency"},"user":"560d5913af97231900938124","project":"57336fd5a6a9c40e00e13a0b","parentDoc":null,"version":{"_id":"5b197473be7bb50003d5dbd6","project":"57336fd5a6a9c40e00e13a0b","__v":2,"forked_from":"5addf90f94fe9d0003cd9d29","createdAt":"2018-04-23T15:17:35.680Z","releaseDate":"2018-04-23T15:17:35.680Z","categories":["5b197473be7bb50003d5db9c","5b197473be7bb50003d5db9d","5b197473be7bb50003d5db9e","5b197473be7bb50003d5db9f","5b197473be7bb50003d5dba0","5b197473be7bb50003d5dba1","5b197473be7bb50003d5dba2","5b197473be7bb50003d5dba3","5b197473be7bb50003d5dba4","5b197473be7bb50003d5dba5","5b197473be7bb50003d5dba6","5b27bded4799c70003f36389","5b34c737e0dca2000311de6a"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":false,"codename":"3.26 Release","version_clean":"8976.0.0-Tools","version":"8976-Tools"},"githubsync":"","__v":0,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-07-26T18:22:38.041Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"settings":"","examples":{"codes":[]},"method":"get","results":{"codes":[{"code":"","language":"text"}]},"auth":"optional","params":[],"url":""},"isReference":true,"order":1,"body":"##Definition\nhttps<span>://sandbox.bluesnap.com/services/2/tools/currency-rates?base-currency={currency code}&quote-currency={currency code}</span>\n\n<hr>\n\n##Documentation\nThe Get Conversion Rates service enables you to obtain currency conversion rates. You can get all conversion rates with USD as the base currency, or specify a base currency and/or quote currency.\n\nWhen using this tool, it is recommended to set the base currency to the base currency of your store in BlueSnap.\n[block:html]\n{\n  \"html\": \"<ul class=\\\"nav nav-pills nav-justified\\\">\\n  <li class=\\\"active\\\"><a data-toggle=\\\"pill\\\" href=\\\"#menujson\\\">JSON</a></li>\\n  <li><a data-toggle=\\\"tab\\\" href=\\\"#menuxml\\\">XML</a></li>\\n</ul>\\n<div class=\\\"tab-content\\\">\\n  <div id=\\\"menujson\\\" class=\\\"tab-pane fade in active\\\">\"\n}\n[/block]\n### JSON Request Content\nEnter the `base-currency` and/or `quote-currency` parameters into the web service URL.\n\nFor example:\n`/services/2/tools/currency-rates?base-currency=EUR&quote-currency=JPY`\n\n### JSON Response Details\nIf successful, the response HTTP status code is 200 OK.\nThe response body contains the conversion rates from the base currency to the quote currency.\n\nIf the request contained an invalid currency code, the PRICING_CURRENCY_NOT_FOUND (13001) error is returned.\n\n<hr>\n\n## JSON Examples\n\n###Request Examples\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl -v -X GET https://sandbox.bluesnap.com/services/2/tools/currency-rates?base-currency=EUR&quote-currency=JPY  \\\\\\n-H 'Accept: application/json' \\\\ \\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ='\",\n      \"language\": \"curl\",\n      \"name\": \"Get Conversion Rates Request: from EUR to JPY\"\n    },\n    {\n      \"code\": \"curl -v -X GET https://sandbox.bluesnap.com/services/2/tools/currency-rates \\\\\\n-H 'Accept: application/json' \\\\ \\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ='\",\n      \"language\": \"curl\",\n      \"name\": \"get all conversion rates\"\n    }\n  ]\n}\n[/block]\n###Response Examples\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"baseCurrency\\\": \\\"EUR\\\",\\n  \\\"currencyRate\\\": [\\n    {\\n      \\\"quoteCurrency\\\": \\\"JPY\\\",\\n      \\\"conversionRate\\\": 155.454939\\n    }\\n  ]\\n}\",\n      \"language\": \"json\",\n      \"name\": \"Get Conversion Rates Response: 200 OK - from EUR to JPY\"\n    },\n    {\n      \"code\": \"{\\n  \\\"baseCurrency\\\": \\\"USD\\\",\\n  \\\"currencyRate\\\": [\\n    {\\n      \\\"quoteCurrency\\\": \\\"EUR\\\",\\n      \\\"conversionRate\\\": 0.776349\\n    },\\n    {\\n      \\\"quoteCurrency\\\": \\\"GBP\\\",\\n      \\\"conversionRate\\\": 0.628543\\n    },\\n    {\\n      \\\"quoteCurrency\\\": \\\"CAD\\\",\\n      \\\"conversionRate\\\": 1.1531\\n    },\\n    ...\\n  ]\\n}\",\n      \"language\": \"json\",\n      \"name\": \"200 OK - all conversion rates\"\n    }\n  ]\n}\n[/block]\n\n[block:html]\n{\n  \"html\": \" </div>\\n <div id=\\\"menuxml\\\" class=\\\"tab-pane fade\\\">\"\n}\n[/block]\n### XML Request Content\nEnter the `base-currency` and/or `quote-currency` parameters into the web service URL.\n\nFor example:\n`/services/2/tools/currency-rates?base-currency=EUR&quote-currency=JPY`\n\n### XML Response Details\nIf successful, the response HTTP status code is 200 OK.\nThe response body contains the conversion rates from the base currency to the quote currency.\n\nIf the request contained an invalid currency code, the PRICING_CURRENCY_NOT_FOUND (13001) error is returned.\n\n<hr>\n\n## XML Examples\n\n###Request Examples\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl -v -X GET https://sandbox.bluesnap.com/services/2/tools/currency-rates?base-currency=EUR&quote-currency=JPY  \\\\\\n-H 'Accept: application/xml' \\\\\\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ='\",\n      \"language\": \"curl\",\n      \"name\": \"Get Conversion Rates Request: from EUR to JPY\"\n    },\n    {\n      \"code\": \"curl -v -X GET https://sandbox.bluesnap.com/services/2/tools/currency-rates \\\\\\n-H 'Accept: application/xml' \\\\\\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ='\",\n      \"language\": \"curl\",\n      \"name\": \"get all conversion rates\"\n    }\n  ]\n}\n[/block]\n###Response Examples\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"yes\\\"?>\\n<currency-rates \\n    xmlns=\\\"http://ws.plimus.com\\\">\\n    <base-currency>EUR</base-currency>\\n    <currency-rate>\\n        <quote-currency>JPY</quote-currency>\\n        <conversion-rate>141.357520</conversion-rate>\\n    </currency-rate>\\n</currency-rates>\",\n      \"language\": \"xml\",\n      \"name\": \"Get Conversion Rates Response: 200 OK - from EUR to JPY\"\n    },\n    {\n      \"code\": \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"yes\\\"?>\\n<currency-rates xmlns=\\\"http://ws.plimus.com\\\">\\n    <base-currency>USD</base-currency>\\n    <currency-rate>\\n        <quote-currency>EUR</quote-currency>\\n        <conversion-rate>0.727209</conversion-rate>\\n    </currency-rate>\\n    <currency-rate>\\n        <quote-currency>GBP</quote-currency>\\n        <conversion-rate>0.639039</conversion-rate>\\n    </currency-rate>\\n    <currency-rate>\\n        <quote-currency>CAD</quote-currency>\\n        <conversion-rate>1.14171</conversion-rate>\\n    </currency-rate>\\n   ...\\n</currency-rates>\\n\",\n      \"language\": \"xml\",\n      \"name\": \"200 OK - all conversion rates\"\n    }\n  ]\n}\n[/block]\n\n[block:html]\n{\n  \"html\": \"\\t</div>\\n</div>\"\n}\n[/block]\n<a class=\"btn btn-primary\" href=\"#\" role=\"button\">Back to Top</a>","excerpt":"","slug":"get-conversion-rates","type":"endpoint","title":"Get Conversion Rates"}

getGet Conversion Rates


Definition

https://sandbox.bluesnap.com/services/2/tools/currency-rates?base-currency={currency code}&quote-currency={currency code}


Documentation

The Get Conversion Rates service enables you to obtain currency conversion rates. You can get all conversion rates with USD as the base currency, or specify a base currency and/or quote currency.

When using this tool, it is recommended to set the base currency to the base currency of your store in BlueSnap.