{"id":2594,"date":"2022-03-07T16:55:33","date_gmt":"2022-03-07T16:55:33","guid":{"rendered":"https:\/\/www.reloadly.com\/blog\/?p=2594"},"modified":"2022-03-07T09:55:54","modified_gmt":"2022-03-07T09:55:54","slug":"specify-non-usd-sending-top-ups","status":"publish","type":"post","link":"https:\/\/www.reloadly.com\/blog\/specify-non-usd-sending-top-ups\/","title":{"rendered":"How to specify a Non-USD currency when sending top-ups"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Your wallet contents are expressed in your local currency and, unless you specify differently, the quantity you specify for the topup will be used directly to deduct from your balance.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For topups where both the sender and recipient use the same currency (Local topups being the most obvious case) this is fine but, in general, when sending international TopUps a currency conversion will need to take place.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Don&#8217;t worry, Reloadly has you covered.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How does currency conversion work in Reloadly&#8217;s TopUps<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">In case your balance is expressed in a currency different to the one of the receiving party you have the option of asking Reloadly to make the conversion.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For this Reloadly will use an exchange rate specific to the operator you&#8217;re sending credit to.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Specifiying the currency when sending a request<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Let&#8217;s say you live in the US and you want to make a topup for a phone in Colombia and you want to use Colombian Peso to express the amount to be sent to the recipient.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Let me illustrate this with an example to make things clearer.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You want to make a COP 20,000 topup for <code>+57 301 4264205<\/code>. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The sequence would be:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li><a rel=\"noreferrer noopener\" href=\"https:\/\/docs.reloadly.com\/airtime\/quickstart#get-your-access-token\" target=\"_blank\">Get an authentication token<\/a><\/li><li><a rel=\"noreferrer noopener\" href=\"https:\/\/www.reloadly.com\/blog\/how-to-reloadly-automatically-detect-operator-id\/\" target=\"_blank\">Get the operator Id<\/a><\/li><li><a rel=\"noreferrer noopener\" href=\"https:\/\/docs.reloadly.com\/airtime\/top-ups\/top-up\" target=\"_blank\">Make the topup request<\/a><\/li><\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">I&#8217;ll assume you know how to perform steps 1 and 2 (If not, just follow the appropriate links) and show you the details of step 3.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Since you prefer the recipient to be credited a specific number in their own currency, you have to inform Reloadly about that by slightly changing the request you&#8217;d usually send.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Simply use the <code>useLocalAmount<\/code> parameter. Like this:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">curl --location --request POST https:\/\/topups.reloadly.com\/topups --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' --header 'Accept: application\/com.reloadly.topups-v1+json' --header 'Content-Type: application\/json' --data-raw '{\n                \"operatorId\":\"92\",\n                \"amount\":\"20000\",\n\t\t    \"useLocalAmount\": true,\n                \"recipientPhone\": {\n                        \"countryCode\": \"CO\",\n                        \"number\": \"573014264205\"\n                }\n        }<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Which will produce an output similar to:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"json\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">{\n  \"transactionId\": 27879,\n  \"status\": \"SUCCESSFUL\",\n  \"operatorTransactionId\": null,\n  \"customIdentifier\": null,\n  \"recipientPhone\": \"573014264205\",\n  \"recipientEmail\": null,\n  \"senderPhone\": null,\n  \"countryCode\": \"CO\",\n  \"operatorId\": 92,\n  \"operatorName\": \"Tigo Colombia\",\n  \"discount\": 0,\n  \"discountCurrencyCode\": \"EUR\",\n  \"requestedAmount\": 20000,\n  \"requestedAmountCurrencyCode\": \"COP\",\n  \"deliveredAmount\": 20000,\n  \"deliveredAmountCurrencyCode\": \"COP\",\n  \"transactionDate\": \"2022-03-02 11:06:23\",\n  \"pinDetail\": null,\n  \"balanceInfo\": {\n    \"oldBalance\": 766.814,\n    \"newBalance\": 755.85748,\n    \"currencyCode\": \"USD\",\n    \"currencyName\": \"US Dollar\",\n    \"updatedAt\": \"2022-03-02 16:06:23\"\n  }\n}<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If you look at the bottom (<code>balanceInfo<\/code>) you&#8217;ll notice how the balance got affected after this transaction:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Before sending the top-up it was USD 766.814 and after it is USD 755.85748.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This means that the exchange rate for this particular operator is 1 USD = COP 1,825.38 (10.95652 USD = 20,000 COP). <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><em><span style=\"text-decoration: underline;\">Note<\/span>: bear in mind that exchange rates are fluctuant so the exact<\/em> <em>numbers you&#8217;ll get when running this example might not be a perfect match for what you&#8217;re reading here but doesn&#8217;t mean you&#8217;re doing anything wrong<\/em>. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">There are times where you may want to know how many pesos the recipient will get for every USD deducted from your wallet before carrying the operation out.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To find that out you can use the <a href=\"https:\/\/docs.reloadly.com\/airtime\/fx-rates\/fetch-fx-rate-by-operator-id\" target=\"_blank\" rel=\"noreferrer noopener\">Fetch FX Rate by Operator Id endpoint<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Getting the exchange rate applicable to a mobile Operator<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">What you&#8217;ll want to do is issue a request such as:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">curl --location --request POST https:\/\/topups.reloadly.com\/operators\/fx-rate --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' --header 'Accept: application\/com.reloadly.topups-v1+json' --header 'Content-Type: application\/json' --data-raw '{\n        \"operatorId\":\"92\",\n                \"amount\":\"10\"\n        }'<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Which will produce an output similar to:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"json\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">{\n  \"id\": 92,\n  \"name\": \"Tigo Colombia\",\n  \"fxRate\": 18,2533.8,\n  \"currencyCode\": \"COP\"\n}<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Which means when you send 10 USD to a phone operated by Tigo Colombia (Operator with ID 92), the recipient&#8217;s phone will be credited with 18,2533.8 Colombian Pesos.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When you need to send topups internationally, a currency exchange need to be performed. Reloadly can do it for you&#8230;<\/p>\n","protected":false},"author":22,"featured_media":2599,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"_monsterinsights_skip_tracking":false,"footnotes":""},"categories":[274],"tags":[346,347,14],"ppma_author":[361],"class_list":["post-2594","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-developers","tag-exchange-rate","tag-local-currency","tag-top-up-api"],"authors":[{"term_id":361,"user_id":22,"is_guest":0,"slug":"mauro-chojrin","display_name":"Mauro Chojrin","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/7ebf4f71751034b32e4747bbc3b7e42723e1320b8c45cda722eb794bb356890d?s=96&d=mm&r=g","author_category":"","first_name":"Mauro","last_name":"Chojrin","user_url":"","job_title":"","description":""}],"jetpack_featured_media_url":"https:\/\/www.reloadly.com\/blog\/wp-content\/uploads\/2022\/03\/blog_image45-01.png","_links":{"self":[{"href":"https:\/\/www.reloadly.com\/blog\/wp-json\/wp\/v2\/posts\/2594","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.reloadly.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.reloadly.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.reloadly.com\/blog\/wp-json\/wp\/v2\/users\/22"}],"replies":[{"embeddable":true,"href":"https:\/\/www.reloadly.com\/blog\/wp-json\/wp\/v2\/comments?post=2594"}],"version-history":[{"count":4,"href":"https:\/\/www.reloadly.com\/blog\/wp-json\/wp\/v2\/posts\/2594\/revisions"}],"predecessor-version":[{"id":2600,"href":"https:\/\/www.reloadly.com\/blog\/wp-json\/wp\/v2\/posts\/2594\/revisions\/2600"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.reloadly.com\/blog\/wp-json\/wp\/v2\/media\/2599"}],"wp:attachment":[{"href":"https:\/\/www.reloadly.com\/blog\/wp-json\/wp\/v2\/media?parent=2594"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.reloadly.com\/blog\/wp-json\/wp\/v2\/categories?post=2594"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.reloadly.com\/blog\/wp-json\/wp\/v2\/tags?post=2594"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.reloadly.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=2594"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}