Knowledge Base - 2Checkout - How to pass in a currency
Like

How to pass in a currency

How can I use currency codes?

The currency code parameter can be used in our checkout methods to pass in a specific currency for a sale.
Standard Checkout and Pass through Products use currency_code parameter to get the currency message to our system. This can be added to the coding for any product and allow it to pass in a specific currency type.

 

Parameter

Description

 currency_code 

AFN, ALL, DZD, ARS, AUD, AZN, BSD, BDT, BBD, BZD, BMD, BOB, BWP, BRL, GBP, BND, BGN, CAD, CLP, CNY, COP, CRC, HRK, CZK, DKK, DOP, XCD, EGP, EUR, FJD, GTQ, HKD, HNL, HUF, INR, IDR, ILS, JMD, JPY, KZT, KES, LAK, MMK, LBP, LRD, MOP, MYR, MVR, MRO, MUR, MXN, MAD, NPR, TWD, NZD, NIO, NOK, PKR, PGK, PEN, PHP, PLN, QAR, RON, RUB, WST, SAR, SCR, SGD, SBD, ZAR, KRW, LKR, SEK, CHF, SYP, THB, TOP, TTD, TRY, UAH, AED, USD, VUV, VND, XOF, YER.

 

The currency and listed code are below.

  • Afghan Afghani (AFN)
  • Albanian Lek (ALL)
  • Algerian Dinar (DZD)
  • Argentine Peso (ARS)
  • Australian Dollar (AUD)
  • Azerbaijani Manat (AZN)
  • Bahamian Dollar (BSD)
  • Bangladeshi Taka (BDT)
  • Barbadian Dollar (BBD)
  • Belize Dollar (BZD)
  • Bermudan Dollar (BMD)
  • Bolivian Boliviano (BOB)
  • Botswana Pula (BWP)
  • Brazilian Real (BRL)
  • British Pound (GBP)
  • Brunei Dollar (BND)
  • Bulgarian Lev (BGN)
  • Canadian Dollar (CAD)
  • Chilean Peso (CLP)
  • Chinese Yuan (CNY)
  • Colombian Peso (COP)
  • Costa Rican Colon (CRC)
  • Croatian Kuna (HRK)
  • Czeh Koruna (CZK)
  • Danish Krone (DKK)
  • Dominican Peso (DOP)
  • East Caribbean Dollar (XCD)
  • Egyptian Pound (EGP)
  • Euro (EUR)
  • Fijian Dollar (FJD)
  • Guatemalan Quetzal (GTQ)
  • Hong Kong Dollar (HKD)
  • Honduran Lempira (HNL)
  • Hungarian Forint (HUF)
  • Indian Rupee (INR)
  • Indonesian Rupiah (IDR)
  • Israeli New Shekel (ILS)
  • Jamaican Dollar (JMD)
  • Japanese Yen (JPY)
  • Kazakhstani Tenge (KZT)
  • Kenyan Shilling (KES)
  • Lao Kip, Democratic Rep (LAK)
  • Kyat, Myanmar (MMK)
  • Lebanese Pound (LBP)
  • Liberian Dollar (LRD)
  • Macanese Pataca (MOP)
  • Malaysian Ringgit (MYR)
  • Maldivian Rufiyaa (MVR)
  • Mauritanian Ouguiya (MRO)
  • Mauritian Rupee (MUR)
  • Mexican Peso (MXN)
  • Moroccan Dirham (MAD)
  • Nepalese Rupee (NPR)
  • New Taiwan Dollar (TWD)
  • New Zealand Dollar (NZD)
  • Nicaraguan Cordoba Oro (NIO)
  • Norwegian Krone (NOK)
  • Pakistani Rupee (PKR)
  • Papua New Guinean Kina (PGK)
  • Peruvian Nuevo Sol (PEN)
  • Philippine Peso (PHP)
  • Polish Zloty (PLN)
  • Qatari Riyal (QAR)
  • Romanian Leu (RON)
  • Russian Ruble (RUB)
  • Samoan Tala (WST)
  • Saudi Riyal (SAR)
  • Seychellois Rupee (SCR)
  • Singaporean Dollar (SGD)
  • Solomon Islands Dollar (SBD)
  • South African Rand (ZAR)
  • South Korean Won (KRW)
  • Sri Lankan Rupee (LKR)
  • Swedish Krona (SEK)
  • Swiss Franc (CHF)
  • Syrian Pound (SYP)
  • Thai Baht (THB)
  • Tongan Pa’anga (TOP)
  • Trinidad and Tobago Dollar (TTD)
  • Turkish Lira (TRY)
  • Ukrainian Hryvnia (UAH)
  • United Arab Emirates Dirham (AED)
  • United States Dollar (USD)
  • Vanuatu Vatu (VUV)
  • Vietnamese Dong (VND)
  • West African CFA Franc (XOF)
  • Yemeni Ria (YER)

However the currency_code does different things with the Plug and Play parameter set, and the Pass through Products parameter set.

Plug and Play:

In  Plug and Play the currency_code is used to convert the price set in the Vendor Account to an equivalent price in the new currency with in the 2Checkout system.

<form action='https://sandbox.2checkout.com/checkout/purchase' method='post'>

<input type='hidden' name='sid' value='901249407'>

<input type='hidden' name='quantity' value='1'>

<input type='hidden' name='product_id' value='1'>

<input type='hidden' name='currency_code' value='EUR'>

<input name='submit' type='submit' value='Buy from 2CO' >

</form>

This code will take a $5.00 product that is set up and convert it to the same equivalent amount in Euros. Notice that the new price in the screenshot below has converted the amount to €3.94

User-added image

 

Pass through Products

While Pass through Products use the same currency_code it is interpreted differently by the 2Checkout system. Below is the code for the similar product being sent through the Pass through Products method passed through to our system.

<form action='https://sandbox.2checkout.com/checkout/purchase' method='post'>

<input type='hidden' name='sid' value='901249407' />

<input type='hidden' name='mode' value='2CO' />

<input type='hidden' name='li_0_type' value='product' />

<input type='hidden' name='li_0_name' value='Euro Currency Test' />

<input type='hidden' name='li_0_price' value='5.00' />

<input type='hidden' name='li_0_tangible' value='N' />

<input type='hidden' name='currency_code' value='EUR'>

<input type='hidden' name='quantity' value='1'>

<input name='submit' type='submit' value='Buy Now' >

</form>

This code will take a 5.00 product that is set up to with the pass through method and send it directly to 2Checkout cart system. This does not convert the price to an equilevant amount. This method simply keeps it at the set amount that is also passed into the 2Checkout cart system, notice the price in the screenshot below has not converted the amount and is listed as €5.00

User-added image

 

Payment API

The Payment API systems use currency instead of currency_code. The process is the same as that for Pass through Products method in that it simply sets the currency, and does not convert the amount.

 

Was this article helpful?

Your feedback helps us improve our site.

Feedback

Please tell us how we can make this article more useful.

Characters Remaining: 255