Contact - Default Currency - xero-api

In xero-java-sdk: The contact object has 'DefaultCurrency' field.
While retrieving the Contacts using the sdk, the DefaultCurrency is set as null.
What is the idea of this field? What is the currency of a Contact in xero?

In Xero's UI a business owner can set the "Default Currency" for a Contact.
Via Xero's API you can retrieve the Contact details including (if they have a default currency). You mention that it's null on the contact you are looking at. That would indicate no default currency is set.
Once you've retrieved the default currency from the Contact, you could use it to set the currency on an Invoice you are creating for that contact via the API.
Note, this does not happen automatically. Xero won't detect a default currency on a Contact and automatically set it on an invoice for you. You need to make that decision.

Related

Enable customer address override checkbox via api

We are using an iPaaS platform named Celigo to sync orders from our ecom platform into Netsuite. Our question is we want to override the default ship to address on a customers account with a new address from a new order that would be sync'ed into Netsuite.
However we are not able to find what field name is used to enable the Override checkbox on a customers default shipto address. Any suggestions?
Set the destination record field as 'shipoverride'. Data type = boolean, Hard-coded, use custom value, enter default value as F. Setting in Celigo Image

Customer VAT ID / Number property

I found some resources online indicating that ORO has/had VAT ID / Number property on the Customer. Searching through the codebase I couldn't find any traces of VAT ID / Number. Is this still a case in the latest 4.* version? Also, does the Customer has properties such Company Registration Number?
As last one, what would be the best approach of extending the Customer entity and adding this fields?
The vat ID field is available in the german version of OroCommerce application:
https://github.com/oroinc/orocommerce-application-de.
For existing OroCommerce instances you can install this bundle https://github.com/oroinc/german-localization
that provides an integration with wirecard, infinitepay and dpd.
The vat Id field is available there, but it is implemented as a part of infinitepay integration
https://github.com/oroinc/OroInfinitePayBundle. You can install it separately as well.
If you are not using infinitepay, to add a vat id field, you can copy the code from there to your customization,
https://github.com/oroinc/OroInfinitePayBundle/blob/master/Form/Type/VatIdType.php
https://github.com/oroinc/OroInfinitePayBundle/blob/master/Form/Extension/CustomerVatIdExtension.php
https://github.com/oroinc/OroInfinitePayBundle/blob/master/Validator/Constraints/CustomerRequireVatId.php
https://github.com/oroinc/OroInfinitePayBundle/blob/master/Validator/Constraints/CustomerRequireVatIdValidator.php

Prestashop 1.7.3.3 Edit Registration Form

I use prestashop 1.7.3.3 e-commerce system.
I need to get a phone number from the customer.
Phone field looks optional. I want to make it mandatory.
How can i do that?
enter image description here
You can set that field as mandatory in the BO > Customers > Addresses.

Currency conversion based on location and Paypal payments

In a Prestashop 1.6 based store I want to accept payments via Paypal in only one currency (Euros). However, I want to show prices in other currencies based on the location of the customer (probably using it's IP address?). How can I do that?
In Modules and services > payment you have a tab CURRENCY RESTRICTIONS, you can check in which currency you would like Paypal to be available
For currecy selection by IP:
First, you should get the user IP after, you should set the curency of the Prestashop context
$this->context->currency->id = $id_currency
To get $id_currency, follow this steps
You should get the country of the the user IP with this script
Then get the currency code by country code (you can get if from a csv file or you you should use an API or database)
The free IP Find service provides currency information in the response for any given IP Address.
Eg. http://ipfind.co?ip=8.8.8.8
Will return (among other things)
currency: USD

eBay API change currency of returned price

Is there a way to get an item in another currency using the eBay API?
Very simple. All you have to do is change the site ID parameter. Since you didn't specify a language, I'm going to assume you're doing this HTTP-GET and just parsing the XML. The same principles will apply regardless of how you do it, programatically or not.
For a URL:
"http://open.api.ebay.com/shopping"
?callname=GetSingleItem
&responseencoding=XML
&appid=[APPID]
&siteid=2 <------------This, for example, is Canada's siteid. 0 is US. This will change the currency returned under < ConvertedCurrentPrice>
&version=839
&ItemID=181195344321
Put it all together and you get this copy/paste-friendly "http://open.api.ebay.com/shopping?callname=GetSingleItem&responseencoding=XML&appid=[APPID]&siteid=2&version=839&ItemID=181195344321"
Make sure to use your app ID as the parameter.
You can use this call for currency change:
Currency type can be changed in Ebay while listing an item using Add Item call in Ebay's trading API.
http://developer.ebay.com/devzone/xml/docs/Reference/eBay/extra/additms.rqst.additmrqstcntnr.itm.crrncy.html
Thanks CedCommerce
You can and it's actually very simple. You can use the Shopping API GetSingleItem.
Depending on what currency you are interested in, all you have to do is change the SiteID on which you are making the call. For example, if you want to get the price in EUR, you can set the SiteID to 3(UK), or 77(Germany). You will also have to set the IncludeSelector to "Details". This way, you will get a response that will contain the following fields.
<ConvertedCurrentPrice currencyID="GBP">68.55</ConvertedCurrentPrice>
<CurrentPrice currencyID="USD">92.9</CurrentPrice>
where the CurrentPrice is the original price of the listing, on the ebay site the listing was made, and the ConvertedCurrentPrice is the price of the listing on the site that corresponds to the SiteID you supplied.
You can see a full list of SiteIDs with the currencies they are using here