Change currency doesn't work on api Rest
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello, i try to use the rest api but i cant change the currency on the api config :
when i try this code, Paypal window open whit currency on USD and print 1.30 USD
if you have a solution , Thanks a lot !
paypal.Buttons({
createOrder: function(data, actions) {
// This function sets up the details of the transaction, including the amount and line item details.
return actions.order.create({
locale: 'fr_FR',
purchase_units: [{
amount: {
value: '1.30',
currency : "EUR",
}
}]
});
},
- Labels:
-
Payments REST APIs
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Change currency : "EUR", to currency_code : "EUR",
does that work?
that's what the documentation says. but it doesn't work for me, because no paypal payment popup opens. if i leave it out, or change it to USD, everything is no problem. where is the error?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The reply by nickbeat above seems correct, to use currency_code
Here is my code ... I've left in lines you don't need like the style, just for interest
paypal.Buttons({
style: {
shape: 'pill',
label: 'checkout',
},
createOrder: function (data, actions) {
return actions.order.create({
purchase_units: [{
amount: {
value: $('#idTotal').text().replace(",", ""),
currency_code: 'AUD'
},
description : 'some text here', // max 127
invoice_id: 'invoice number here' // max 127
}]
});
},
onShippingChange: function (data, actions) {
// etc
.
It all seems to match what the OP and nick said. But I have not tried any currency other than AUD. Note that without that, it defaulted to USD if I recall correctly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Just remembered, there is one other thing you need. I got it from the groups.google.com/g/etsy-api-v2
<script src="https://www.paypal.com/sdk/js?currency=AUD&client-id=<% ShowClientId(); %>"></script>
Note the currency in the script line.
The ShowClientId part is just ASP.Net syntax.

Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
- Issue with Payflow Pro: "Failed to connect to host" Error on Server Deployment in Payflow
- Production account value in Braintree Server-side Integration (PHP, Java, .NET, Ruby, Python, NodeJS SDKs)
- Android WebViews issue when doing seller onboarding in REST APIs
- Using the api to make payments works in Sandbox but not in Live in REST APIs
- Change the button from Sandbox to Production in REST APIs