Usage-based App Charging Currency

Solved
New Member
3 0 0

HI all,

Is looks like it is only possible to create usage charges though the Useage Charge API in USD. Is this correct? My app adds a product to the the merchants, which they sell in their base currency as normal. I would like to charge them in this currency rather than try to convert to USD. Is this doable? If not, what am I missing? Is this really the best way to do this?

 

Thanks in advance!,

Paul

0 Likes

Success.

Shopify Partner
124 6 17

Unfortunately, all of Shopify's app billing is handled in USD so you would need to convert the value from the base currency to USD before applying the usage charge.

 

You could hook into a free currency conversion API prior to applying the usage charge to Shopify's billing.  I would recommend caching the conversion rate with a 6-hour expiry to save on server overhead.

 

Regards,

Joel.

Co-Founder / CTO @ Intuitive Shipping
Intuitive Shipping | Automate Shipping Profiles
0 Likes
New Member
3 0 0

Thanks for the answer.

So, theres no API or way to find out Shopify's own exchange rate? Just thinking about a scenario where a store's base currency is USD and we charge them a different amount to what they received from the customer for the product the onsold for us - this would be problematic.

0 Likes
Shopify Partner
124 6 17

What if you ran a GraphQL call on the order information, and compared the presentmentMoney > amount with the shopMoney > amount? 

{
  order(id: "") {
    totalPriceSet {
      presentmentMoney {
        amount
      }
      shopMoney {
        amount
      }
    }
  }
}

This should give you the exchange rate using something like this:

$exchange_rate = $response['order']['totalPriceSet']['presentmentMoney']['amount'] / $response['order']['totalPriceSet']['shopMoney']['amount']

This would require the shop base currency to be USD.

 

 

Regards,

Joel.

Co-Founder / CTO @ Intuitive Shipping
Intuitive Shipping | Automate Shipping Profiles
0 Likes