更新QBO API 3中的客户

本文关键字:客户 QBO API 更新 | 更新日期: 2023-09-27 18:06:34

我已经尝试过了,但现在我收到了一个错误的请求。

var customers = IntuitServiceConfig.ServiceManager.FindAll<Customer>(new Customer(), 1, 100); 
foreach (Intuit.Ipp.Data.Customer customer in customers)
{
    Customer resultCustomer = IntuitServiceConfig.ServiceManager.FindById(customer) as Customer;
    //Mandatory Fields
    customer.Id = resultCustomer.Id;
    customer.SyncToken = resultCustomer.SyncToken;
    customer.GivenName = "Bob";
    customer.Title = "Mr.";
    customer.MiddleName = "Anto";
    customer.FamilyName = "Bob";
    Customer result = IntuitServiceConfig.ServiceManager.Update(customer) as Customer;
}

更新QBO API 3中的客户

var customers = IntuitServiceConfig.ServiceManager.FindAll<Customer>(new Customer(), 1, 100); 
foreach (Intuit.Ipp.Data.Customer customer in customers)
{
    Customer resultCustomer = IntuitServiceConfig.ServiceManager.FindById(customer) as Customer;
    //Mandatory Fields
    resultCustomer.GivenName = "Bob";
    resultCustomer.Title = "Mr.";
    resultCustomer.MiddleName = "Anto";
    resultCustomer.FamilyName = "Bob";
    Customer result = IntuitServiceConfig.ServiceManager.Update(resultCustomer) as Customer;
}

你正要得到一些客户名单,再次通过id找到,然后更新旧的,这没关系,你可以像上面一样做,或者我认为最好的方式是下面。

var customers = IntuitServiceConfig.ServiceManager.FindAll<Customer>(new Customer(), 1, 100); 
foreach (Intuit.Ipp.Data.Customer customer in customers)
{
    //Mandatory Fields
    customer.GivenName = "Bob";
    customer.Title = "Mr.";
    customer.MiddleName = "Anto";
    customer.FamilyName = "Bob";
    Customer result = IntuitServiceConfig.ServiceManager.Update(customer) as Customer;
}

Dotnet SDK for Customer Update当前存在一个错误,错误的名称空间导致请求出错。我们正在为此努力。检查此解决方法:

创建一个新的Customer对象并将结果分配给它。然后调用Customer更新操作。例如:

Customer found = GetQboCustomer(); 
Customer customerToUpdate = new Customer(); 
customerToUpdate.Id = found.Id; 
customerToUpdate.SyncToken = found.SyncToken; 
//Set Other Properties 
//Perform Sparse Update

您可以尝试捕获与此更新API调用相关的原始请求和响应XML。参考-https://developer.intuit.com/docs/0025_quickbooksapi/0055_devkits/0150_ipp_.net_devkit_3.0/logging#Request_and_Response_Log

您也可以尝试创建客户更新负载,并使用Apisexplorer尝试更新调用。https://developer.intuit.com/apiexplorer?apiname=V3QBO#Customer

感谢