{"_id":"59b6b1eebc195b003ca7a9b0","category":{"_id":"59b6b1ecbc195b003ca7a98a","version":"59b6b1ecbc195b003ca7a981","project":"57336fd5a6a9c40e00e13a0b","__v":0,"sync":{"url":"","isSync":false},"reference":true,"createdAt":"2016-05-17T12:18:56.501Z","from_sync":false,"order":8,"slug":"convert-currency","title":"Convert Currency"},"user":"560d5913af97231900938124","parentDoc":null,"project":"57336fd5a6a9c40e00e13a0b","version":{"_id":"59b6b1ecbc195b003ca7a981","project":"57336fd5a6a9c40e00e13a0b","__v":1,"createdAt":"2017-09-11T15:55:24.925Z","releaseDate":"2017-09-11T15:55:24.925Z","categories":["59b6b1ecbc195b003ca7a982","59b6b1ecbc195b003ca7a983","59b6b1ecbc195b003ca7a984","59b6b1ecbc195b003ca7a985","59b6b1ecbc195b003ca7a986","59b6b1ecbc195b003ca7a987","59b6b1ecbc195b003ca7a988","59b6b1ecbc195b003ca7a989","59b6b1ecbc195b003ca7a98a","59b6b1ecbc195b003ca7a98b"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":false,"codename":"3.22.2 Release","version_clean":"8976.0.0-Tools","version":"8976-Tools"},"__v":0,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-06-22T18:19:18.352Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[]},"method":"get","results":{"codes":[{"language":"text","code":""}]},"settings":"","auth":"optional","params":[],"url":""},"isReference":true,"order":40,"body":"##Definition\nhttps<span>://sandbox.bluesnap.com/services/2/tools/merchant-currency-convertor?{parameters}</span>\n\n<hr>\n\n##Documentation\nThe Convert Price service enables you to convert amounts from a source currency to a target currency.\n\n###Request Content\nEnter the following parameters into the web service URL in the format:\n`/services/2/tools/merchant-currency-convertor?from={currency_code}&to={currency_code}&amount={amount}`\n\n  * **from**: 3-letter code of the currency to convert from\n  * **to**: 3-letter code of the currency to convert to\n  * **amount**: Amount to convert\n\nFor example:\n`https://sandbox.bluesnap.com/services/2/tools/merchant-currency-convertor?from=USD&to=EUR&amount=100`\n\n###Response Details\nIf successful, the response HTTP status code is 200 OK.\nThe response body contains the converted price.\n\n<hr>\n\n##Examples\n\n###Request Example\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl -v -X GET https://sandbox.bluesnap.com/services/2/tools/merchant-currency-convertor?from=USD&to=EUR&amount=100 \\\\\\n-H 'Content-Type: application/xml' \\\\\\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ='\",\n      \"language\": \"curl\",\n      \"name\": \"Convert Price Request: from USD to EUR\"\n    }\n  ]\n}\n[/block]\n###Response Example\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"HTTP/ 1.1 200 OK\\n\\n<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n<price xmlns=\\\"http://ws.plimus.com\\\">\\n  <value>72.72</value>\\n  <currency>EUR</currency>\\n  <formatted-price>\\n    <iso>EUR 72.72</iso>\\n    <symbol>€72.72</symbol>\\n  </formatted-price>\\n</price>\",\n      \"language\": \"xml\",\n      \"name\": \"Convert Price Response: 200 OK\"\n    }\n  ]\n}\n[/block]\n<a class=\"btn btn-primary\" href=\"#\" role=\"button\">Back to Top</a>","excerpt":"","slug":"convert-currency","type":"get","title":"Convert Price"}

Definition

https://sandbox.bluesnap.com/services/2/tools/merchant-currency-convertor?{parameters}


Documentation

The Convert Price service enables you to convert amounts from a source currency to a target currency.

Request Content

Enter the following parameters into the web service URL in the format:
/services/2/tools/merchant-currency-convertor?from={currency_code}&to={currency_code}&amount={amount}

  • from: 3-letter code of the currency to convert from
  • to: 3-letter code of the currency to convert to
  • amount: Amount to convert

For example:
https://sandbox.bluesnap.com/services/2/tools/merchant-currency-convertor?from=USD&to=EUR&amount=100

Response Details

If successful, the response HTTP status code is 200 OK.
The response body contains the converted price.


Examples

Request Example

curl -v -X GET https://sandbox.bluesnap.com/services/2/tools/merchant-currency-convertor?from=USD&to=EUR&amount=100 \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ='

Response Example

HTTP/ 1.1 200 OK

<?xml version="1.0" encoding="UTF-8"?>
<price xmlns="http://ws.plimus.com">
  <value>72.72</value>
  <currency>EUR</currency>
  <formatted-price>
    <iso>EUR 72.72</iso>
    <symbol>€72.72</symbol>
  </formatted-price>
</price>