cancel
Showing results for 
Search instead for 
Did you mean: 

SOAP API: can't access the data from the field "VAT number".

SOLVED

SOAP API: can't access the data from the field "VAT number".

Dear Customer Service,
 
We are build  a synchronization software for magento trough SOAP.
Here is the WSDL link to the test server: http://dev.mormota.ro/api/v2_soap/?wsdl
 
Our problem is that we can't access the data from the field "VAT number". 
The "VAT number" is located in the admin interface here:
  "Customer Information"/ "Addresses" / "VAT number".
 
We tried to get all the information from the registered customer:
customerCustomerEntity <-SOAP.customerAddressInfo
customerAddressEntityItem <- SOAP.customerCustomerInfo
 
but none of this fields contain the "VAT number".
 
I suppose the data need to be in field "customerCustomerEntity.taxvat".
 
Best Regards,
4 REPLIES

Re: SOAP API: can't access the data from the field &quot;VAT number&quot;.

Hi @lorigergely,

 

Maybe you don't have the taxvat enabled?

(And why SOAP instead of REST?)

--
If you've found one of my answers useful, please give "Kudos" or "Accept as Solution"

Re: SOAP API: can't access the data from the field &quot;VAT number&quot;.

Thank you for your reply. 

 

How we can check if the taxvat field is enabled? or how we can enable?

 

Here's a screenshot about the field we can't find.

magento.jpg

Re: SOAP API: can't access the data from the field &quot;VAT number&quot;.

Hi @lorigergely,

 

I've made a test with a vanilla installation.

Área de trabajo 1_003.pngCustomer without TaxVatAs you can see my customer doesn't have the TaxVat.

I've made a SOAP request and this was the response.

 

Área de trabajo 1_004.pngSOAP API response without taxvat

 Customer without TaxVat.

Then I've edited my customer and I've added some TaxVat value.

 

Área de trabajo 1_005.pngCustomer with TaxVat

 

The new response was:

 

Área de trabajo 1_006.pngSOAP API response with taxvat

Then I've checked addresses.

For example, the default billing address of that customer.

 

Área de trabajo 1_007.pngAddress without TaxVat

 

As you can see, the response came without taxvat (and that was right).

 

Área de trabajo 1_008.pngSOAP API response without taxvat

Then I've edited the  address and I've added some value on the TaxVat attribute.

 

Área de trabajo 1_009.pngAddress with TaxVat

 

And the new api response was correct.

 

Área de trabajo 1_010.pngSOAP API response with taxvat

 

Finally, this is my current Customer configuration. Is default.

 

Área de trabajo 1_011.pngCustomer configuration

 

 

And the code was:

 

<?php
ini_set('max_execution_time','1000');
set_time_limit(0);

$client = new SoapClient("http://www.yourdomain.com/index.php/api/?wsdl");
try {
    
    //Login
    $session = $client->login("username", "password");

    //Listado de países
    //1 is the customer address ID
    $result = $client->call($session, 'customer_address.info', '1');
    
    echo "<pre>";
    print_r($result);
    echo "</pre>";
    
} catch (SoapFault $exception) {
    
    echo "There were an error on your request\n\n";
    echo "Code: " . $exception->faultcode . "\n";
    echo "Message: " . $exception->faultstring . "\n";
    
}

//Logout
$client->endSession($session);

(Of course, this is dummy code just for test)

--
If you've found one of my answers useful, please give "Kudos" or "Accept as Solution"

Re: SOAP API: can't access the data from the field &quot;VAT number&quot;.

Thank you very much for your reply! It helped a lot.