QBO API 3에서 고객을 업데이트하십시오
-
21-12-2019 - |
문제
나는 이것을 시도했다. 그러나 나는 나쁜 요청을 받고있다.
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;
}
. 해결책
현재 잘못된 네임 스페이스가 오류 요청을 유발하는 고객 업데이트를 위해 DotNet SDK의 버그가 있습니다. 우리는 그 일을하고 있습니다. 이 해결 방법을 확인하십시오.
새 고객 객체를 만들고 결과를 할당합니다.그런 다음 고객 업데이트 작업을 호출하십시오. 예 :
Customer found = GetQboCustomer();
Customer customerToUpdate = new Customer();
customerToUpdate.Id = found.Id;
customerToUpdate.SyncToken = found.SyncToken;
//Set Other Properties
//Perform Sparse Update
. 다른 팁
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;
}
. 이 업데이트 API 호출과 관련된 원시 요청 및 응답 XML을 캡처하려고 할 수 있습니다. ref - https://developer.intuit.com/docs./0025_quickbooksapi/0055_devkits/0150_ipp_.net_devkit_3.0/logging#request_and_response_log
또한 고객 업데이트 페이로드를 만들고 APIExplorer를 사용하여 업데이트 호출을 시도 할 수 있습니다. https://developer.intuit.com/apiexplorer?apiname=v3qbo#customer
감사합니다
제휴하지 않습니다 StackOverflow