Using USD or EUR as currency in creating charges API

Hello,

When I create a checkout, I can enter the price in USD or for instance EUR, and the user has many cryptocurrency payment options available. When I create a charge using the API, I can enter multiple amount and currency records under the local_price section. I saw some examples where currency could be BTC.

Let’s say I would like to sell something for US$15. Would I need to fill in all the separate cryptocurrencies in the create charge request, and the accompanying amount, or would it also be possible to just fill in USD, and 15? And if it is not possible to fill in USD, would I then need to obtain all the current values of the cryptocurrencies, $15 worth, and add that to the create charge request?

It would be nice if I could just fill in US$15, and people would be redirected to a payment page similar as a checkout page.

Kind regards,
Jay

Hello @Jay81! Thank you for your interest in using Coinbase Commerce API. We’re happy to assist you with your concern. However, we’ll need you to provide us the following information:

  • When you create a charge using API, you said that you can enter multiple amounts and currency under local_price object. Can you confirm if you meant that you can enter them all at once?

  • Can you please explain further with what you meant with separate cryptocurrencies when you said “Would I need to fill in all the separate cryptocurrencies in the create charge request, and the accompanying amount”? Sending us a screenshot of it would be great as it will help us understand your concern. Please exclude any sensitive information that may be used to compromise your account.

  • What Coinbase Commerce API endpoint are you trying to use (checkout, charge, invoice, etc.)? We just want to clarify in order to address your issue because you mentioned creating a checkout and creating a charge as well

Once you send us the information requested above, we’ll work right into it to address your concern.

Looking forward to your response. Have a great day!

1 Like

Hi there,

Thanks for the reply, here are some answers to your questions.

Yes that is what I meant.

Well I meant that if I create a charge, would I need to add all the cryptocurrencies in the post, like CURLOPT_POSTFIELDS =>'{"local_price":{"currency":"BTC","amount":"1"}, (in this case it’s a PHP example) but then with multiple cryptocurrencies.

I’m trying to use the charge endpoint. The one on the following page (I am not sure if I am allowed to place links): Create a charge | Coinbase Cloud

So my main question is, is it possible to enter USD or EUR as the currency field, instead of a cryptocurrency?

Kind regards,
Jay

Hi @Jay81! Thank you for replying back to us. To answer your main question, the answer would be YES . We tried creating a charge on our end and we used either USD or EUR in the currency and it worked fine. Please note that in the currency, you should only specify one (1) such as USD, EUR, BTC, etc. Additionally, you may visit this FAQ page for more information about Coinbase Commerce.

We hope we were able to help you with regard to your concern. Please do not hesitate to reply back to this thread if you have any other concerns.

2 Likes

Great! Also thanks for the link to the FAQ, that page is new for me, I will have a look.

1 Like