Guides
Show prices in EGP in your shop
Convert your product prices to Egyptian pounds at one bank's rate, refreshed every hour on your server.
GET /v1/convert turns an amount into pounds at the Central Bank rate or at one bank. Selling foreign currency uses the bank's buy price, buying it uses the sell price.
Get the rate once an hour
JavaScript
// On your server, once an hour: the bank's rate for your store's currency.
const res = await fetch("https://api.geneh.app/v1/convert?amount=1&from=usd&to=egp&bank=nbe", {
headers: { Authorization: `Bearer ${process.env.GENEH_KEY}` },
});
const { result: egpPerUsd, updated_at } = await res.json();
// Then for each product:
const priceEgp = Math.ceil(product.priceUsd * egpPerUsd);The same call in other languages:
Request
curl "https://api.geneh.app/v1/convert?amount=100&from=usd&bank=nbe" \
-H "Authorization: Bearer $GENEH_KEY"Good to know
- Round up to whole pounds, so you never charge less than the rate.
- Show the update time at checkout.
- One call an hour is 24 a day, far inside the Free plan.
On Shopify or WooCommerce? The website widget can show prices in pounds with no code.
Convert an amount