I am using the following SOAP request to upsert a customer into NetSuite.
It is retuning the following: ERROR USER_ERROR Please enter value(s) for: Primary Subsidiary
I've tried to add the subsidiary field and a few others but nothing seems to be working.
Does anyone know how to assign a Primary Subsidiary on customer upsert?
Thank you!
<soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="urn:messages_2019_1.platform.webservices.netsuite.com"
xmlns:ns2="urn:relationships_2019_1.lists.webservices.netsuite.com"
xmlns:ns4="urn:relationships.lists.webservices.netsuite.com"
xmlns:ns3="urn:core_2019_1.platform.webservices.netsuite.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soap-env:Header>
<tokenPassport>
<account>%v</account>
<consumerKey>%v</consumerKey>
<token>%v</token>
<nonce>%v</nonce>
<timestamp>%v</timestamp>
<signature algorithm="HMAC-SHA256">%v</signature>
</tokenPassport>
<preferences>
</preferences>
</soap-env:Header>
<soap-env:Body>
<ns1:upsert>
<ns2:record xsi:type="ns2:Customer" externalId="10">
<ns2:entityId>%v</ns2:entityId>
<ns2:companyName>%v</ns2:companyName>
<ns2:email>%v</ns2:email>
<ns3:customField xsi:type="ns3:RecordRef" scriptId="custbody_inv_worksheet_currency">
<ns3:value internalId="10">
<ns3:name>EUR</ns3:name>
</ns3:value>
</ns3:customField>
<ns2:customFieldList>
<ns3:customField xsi:type="ns3:SelectCustomFieldRef" scriptId="custentity_vies_check_customer">
<ns3:value internalId="2">
<ns3:name>Approved</ns3:name>
</ns3:value>
</ns3:customField>
<ns3:customField xsi:type="ns3:SelectCustomFieldRef" scriptId="custentity_sales_type">
<ns3:value internalId="2">
<ns3:name>B2B</ns3:name>
</ns3:value>
</ns3:customField>
<ns3:customField xsi:type="ns3:SelectCustomFieldRef" scriptId="custentity_kyc_status">
<ns3:value internalId="2">
<ns3:name>Approved</ns3:name>
</ns3:value>
</ns3:customField>
<ns3:customField xsi:type="ns3:SelectCustomFieldRef" scriptId="custbody_inv_worksheet_currency">
<ns3:value internalId="10">
<ns3:name>EUR</ns3:name>
</ns3:value>
</ns3:customField>
</ns2:customFieldList>
</ns2:record>
</ns1:upsert>
</soap-env:Body>
</soap-env:Envelope>
If you check out the NetSuite Schema Browser (https://www.netsuite.com/help/helpcenter/en_US/srbrowser/Browser2021_2/schema/record/customer.html), you'll see that the subsidiary field is named "subsidiary" and is a RecordRef type, so that in your code you will need to (assuming C#) use "new RecordRef { internalid = XX } to create the RecordRef for the subsidiary and assign that to the field in your Customer object.
Related
I tried to call EnhancedVehBookRQ API with CERT ENV
This is my request and response
REQUEST:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sec="http://schemas.xmlsoap.org/ws/2002/12/secext" >
<soapenv:Header>
<Security xmlns="http://schemas.xmlsoap.org/ws/2002/12/secext">
<BinarySecurityToken>
token
</BinarySecurityToken>
</Security>
<MessageHeader xmlns="http://www.ebxml.org/namespaces/messageHeader">
<From>
<PartyId type="urn:x12.org:IO5:01">from</PartyId>
</From>
<To>
<PartyId type="urn:x12.org:IO5:01">to</PartyId>
</To>
<CPAId>hiddendata
</CPAId>
<ConversationId>hiddendata</ConversationId>
<Action>EnhancedVehBookRQ</Action>
<MessageData>
<MessageId>1001</MessageId>
<Timestamp>2021-08-18T10:00:01</Timestamp>
<!--Optional:-->
<TimeToLive>2021-08-19T10:00:01</TimeToLive>
<!--Optional:-->
<Timeout>0</Timeout>
</MessageData>
</MessageHeader>
</soapenv:Header>
<soapenv:Body>
<EnhancedVehBookRQ xmlns="http://services.sabre.com/sp/enhanced/veh/book/v1" version="1.0.0">
<VehBook>
<BookingInfo >
<BookingKey>23accd05-4770-4d1c-a286-ab0e6f360fc5
</BookingKey>
</BookingInfo>
<Customer NameNumber="1.1">
<Address>
<CityName>DALLAS</CityName>
<CountryCode>US</CountryCode>
<PostalCode>12345</PostalCode>
<StateCountyProv StateCode="TX" />
<StreetNmbr>1234 TEST ADDRESS</StreetNmbr>
</Address>
</Customer>
<RentalPaymentPrefs>
<GuaranteePrepaid Type="GUARANTEE">
<PaymentCard>
<CardCode>DC</CardCode>
<CardNumber>311234567685619</CardNumber>
<ExpiryMonth>12</ExpiryMonth>
<ExpiryYear>2022</ExpiryYear>
<FullCardHolderName>
<LastName>Monster</LastName>
</FullCardHolderName>
</PaymentCard>
</GuaranteePrepaid>
</RentalPaymentPrefs>
<VehRentalCore Quantity="1" />
</VehBook>
</EnhancedVehBookRQ>
</soapenv:Body>
</soapenv:Envelope>
I could not move ahead with car booking, getting errors like this
<Message code="ERR.SP.INTERNAL_ERROR">TravelItineraryReadRQ: After maximum retry count it was not possible to successfully execute target service</Message>
Can anybody please confirm whether SOAP requst is proper or not or I am missing something from my side
Yes, before running EnhancedVehBookRQ API you need to run PassengerDetailsRQ with TravelIntinerary details in it. On the success of this API use the response details for the request of this API and then run it
I am developing API to update passenger detail like name and DOB in PNR.
I followed this http://files.developer.sabre.com/doc/providerdoc/pnrservices/UpdateReservationRQ_1_15_0_User_Guide.pdf
Request xml
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sec="http://schemas.xmlsoap.org/ws/2002/12/secext" xmlns:eb="http://www.ebxml.org/namespaces/messageHeader" xmlns:v1="http://webservices.sabre.com/pnrbuilder/v1_15" xmlns:v11="http://services.sabre.com/res/or/v1_8">
<soapenv:Header>
<sec:Security xmlns:sec="http://schemas.xmlsoap.org/ws/2002/12/secext">
<sec:BinarySecurityToken valueType="String" EncodingType="sec:Base64Binary">${#Project#sessionid}</sec:BinarySecurityToken>
</sec:Security>
<eb:MessageHeader eb:version="2.0">
<eb:From>
<eb:PartyId type="urn:x12.org:IO5:01">999999</eb:PartyId>
</eb:From>
<eb:To>
<eb:PartyId type="urn:x12.org:IO5:01">343434</eb:PartyId>
</eb:To>
<eb:CPAId>AB</eb:CPAId>
<eb:ConversationId>test123</eb:ConversationId>
<eb:Service eb:type="OTA">UpdateReservationRQ</eb:Service>
<eb:Action>UpdateReservationRQ</eb:Action>
<eb:MessageData>
<eb:MessageId>1001</eb:MessageId>
<eb:Timestamp>2017-01-10T10:00:00</eb:Timestamp>
<eb:TimeToLive>2017-01-16T23:59:59</eb:TimeToLive>
</eb:MessageData>
</eb:MessageHeader>
</soapenv:Header>
<soapenv:Body>
<v1:UpdateReservationRQ Version="1.15.0">
<v1:RequestType>Stateless</v1:RequestType>
<v1:ReturnOptions IncludeUpdateDetails="true" RetrievePNR="true" />
<v1:ReservationUpdateList>
<v1:Locator>${#Project#pnr}</v1:Locator>
<v1:ReservationUpdateItem>
<!--Optional:-->
<v1:PassengerNameUpdate op="U">
<!--Optional:-->
<v1:TravelerName type="ADT">
<!--Optional:-->
<v1:Given>Ramesh</v1:Given>
<v1:Surname>Tiwari</v1:Surname>
</v1:TravelerName>
<!--Optional:-->
<v1:NameAssociationTag>
<v1:LastName>Praveen</v1:LastName>
<v1:FirstName>Deshmukh</v1:FirstName>
<v1:NameRefNumber>01.01</v1:NameRefNumber>
</v1:NameAssociationTag>
</v1:PassengerNameUpdate>
<!--Optional:-->
</v1:ReservationUpdateItem>
<v1:ReceivedFrom>
<v1:AgentName>AESWSSELL1AEBG</v1:AgentName>
</v1:ReceivedFrom>
</v1:ReservationUpdateList>
</v1:UpdateReservationRQ>
</soapenv:Body>
</soapenv:Envelope>
But continually getting below error.
<soap-env:Body>
<stl15:UpdateReservationRS xmlns:stl15="http://webservices.sabre.com/pnrbuilder/v1_15" xmlns:ns6="http://services.sabre.com/res/orr/v0" xmlns:raw="http://tds.sabre.com/itinerary" xmlns:or18="http://services.sabre.com/res/or/v1_8" xmlns:ns4="http://webservices.sabre.com/pnrconn/ReaccSearch">
<stl15:Success>FALSE</stl15:Success>
<stl15:Warnings>
<stl15:Warning>
<stl15:Message>PARTIAL ERROR</stl15:Message>
</stl15:Warning>
</stl15:Warnings>
<stl15:Errors>
<stl15:Error UpdateId="">
<stl15:Code>500601</stl15:Code>
<stl15:Message>UNABLE TO PROCESS</stl15:Message>
</stl15:Error>
</stl15:Errors>
<stl15:Results/>
</stl15:UpdateReservationRS>
</soap-env:Body>
Please help me to find out what change in require in the request.
Hard to tell without knowing the carrier, but many airlines will not allow a name change once the PNR has been "ended" and a locator has been returned.
It is possible to update passenger detail in created PNR.
In above request require PNR created date to compete this process.
<stl1:Locator>XPKCGL</stl1:Locator>
<stl1:CreateDate>2017-05-23</stl1:CreateDate>
Below is complete request.
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:eb="http://www.ebxml.org/namespaces/messageHeader" xmlns:ns1="http://webservices.sabre.com/pnrbuilder/getres" xmlns:ns12="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns13="http://www.w3.org/1999/xlink" xmlns:ns14="http://www.w3.org/2000/09/xmldsig#" xmlns:or="http://services.sabre.com/res/or/v1_8" xmlns:ota="http://webservices.sabre.com/sabreXML/2003/07" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:stl1="http://webservices.sabre.com/pnrbuilder/v1_15" xmlns:stl2="http://services.sabre.com/STL/v01" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/12/secext" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xml="http://www.w3.org/XML/1998/namespace">
<SOAP-ENV:Header>
<sec:Security xmlns:sec="http://schemas.xmlsoap.org/ws/2002/12/secext">
<sec:BinarySecurityToken valueType="String" EncodingType="sec:Base64Binary">${#Project#sectoken}</sec:BinarySecurityToken>
</sec:Security>
<MessageHeader xmlns="http://www.ebxml.org/namespaces/messageHeader" version="1.0">
<eb:From>
<eb:PartyId type="urn:x12.org:IO5:01">99935345999</eb:PartyId>
</eb:From>
<eb:To>
<eb:PartyId type="urn:x12.org:IO5:01">344535</eb:PartyId>
</eb:To>
<eb:CPAId>AB</eb:CPAId>
<eb:ConversationId>cpm23432</eb:ConversationId>
<eb:Service type="OTA">UpdateReservationOperation</eb:Service>
<eb:Action>UpdateReservationRQ</eb:Action>
<eb:MessageData>
<eb:MessageId>608926</eb:MessageId>
<eb:Timestamp>2017-05-22T15:49:07Z</eb:Timestamp>
</eb:MessageData>
</MessageHeader>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<stl1:UpdateReservationRQ xmlns="http://webservices.sabre.com/pnrbuilder/v1_15" Version="1.15.0">
<stl1:RequestType>Stateless</stl1:RequestType>
<stl1:ReturnOptions IncludeUpdateDetails="true" RetrievePNR="true" />
<stl1:ReservationUpdateList>
<stl1:Locator>XPKCGL</stl1:Locator>
<stl1:CreateDate>2017-05-23</stl1:CreateDate>
<stl1:ReservationUpdateItem UpdateId="ID-1">
<stl1:PassengerNameUpdate op="U">
<stl1:TravelerName type="ADT" referenceId="1">
<stl1:Given>RamRaj</stl1:Given>
<stl1:Surname>Des</stl1:Surname>
</stl1:TravelerName>
<stl1:NameAssociationTag>
<stl1:LastName>DESHMUKH</stl1:LastName>
<stl1:FirstName>PRAVEEN</stl1:FirstName>
<stl1:NameRefNumber>01.01</stl1:NameRefNumber>
</stl1:NameAssociationTag>
</stl1:PassengerNameUpdate>
</stl1:ReservationUpdateItem>
<stl1:ReceivedFrom>
<stl1:AgentName>CPM MBE</stl1:AgentName>
</stl1:ReceivedFrom>
</stl1:ReservationUpdateList>
</stl1:UpdateReservationRQ>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Why doesn't this soap call work for this URL ?
http://services.aonaware.com/DictService/DictService.asmx?op=Define
<v:Envelope xmlns:i="http://www.w3.org/1999/XMLSchema-instance" xmlns:d="http://www.w3.org/1999/XMLSchema" xmlns:c="http://schemas.xmlsoap.org/soap/encoding/" xmlns:v="http://schemas.xmlsoap.org/soap/envelope/">
<v:Header />
<v:Body>
<Define xmlns="http://tempuri.org/" id="o0" c:root="1">
<word i:type="d:string">Name</word>
</Define>
</v:Body>
</v:Envelope>
But this one does
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://services.aonaware.com/webservices/">
<soapenv:Header/>
<soapenv:Body>
<web:Define>
<!--Optional:-->
<web:word>Test</web:word>
</web:Define>
</soapenv:Body>
</soapenv:Envelope>
Because they are different: not only in content but also in namespace definition, to correct the first one you've to atleast use the correct namespace so use http://services.aonaware.com/webservices/ for your <Define> element as you do in the second one:
<v:Envelope xmlns:i="http://www.w3.org/1999/XMLSchema-instance" xmlns:d="http://www.w3.org/1999/XMLSchema" xmlns:c="http://schemas.xmlsoap.org/soap/encoding/" xmlns:v="http://schemas.xmlsoap.org/soap/envelope/">
<v:Header />
<v:Body>
<Define xmlns="http://services.aonaware.com/webservices/" id="o0" c:root="1">
<word i:type="d:string">Name</word>
</Define>
</v:Body>
</v:Envelope>
Then make sure also that id an c:root are valid attributes in your xsd for <Definition> and i:type it's a correct one for <word>.
EDIT
I invoke http://services.aonaware.com/DictService/DictService.asmx with SOAPUI using my corrected request and it response correctly:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<DefineResponse xmlns="http://services.aonaware.com/webservices/">
<DefineResult>
<Word>Name</Word>
<Definitions>
<Definition>
<Word>Name</Word>
<Dictionary>
<Id>gcide</Id>
<Name>The Collaborative International Dictionary of English v.0.44</Name>
</Dictionary>
<WordDefinition>Name \Name\ (n[=a]m), n. [AS. nama; akin to D. naam, OS. & OHG.
...
[1913 Webster]</WordDefinition>
</Definition>
<Definition>
<Word>Name</Word>
<Dictionary>
<Id>gcide</Id>
<Name>The Collaborative International Dictionary of English v.0.44</Name>
</Dictionary>
<WordDefinition>Name \Name\ (n[=a]m), v. t. [imp. & p. p. {Named} (n[=a]md); p.
...
</WordDefinition>
</Definition>
</Definitions>
</DefineResult>
</DefineResponse>
</soap:Body>
</soap:Envelope>
Hope this helps,
I'm recreating calendar meeting events in a sychronization tool (using CreateItem), basically preserving some properties for meetings and writing them back.
However, there are some properties that are read-only, and I see no way to preserve their state:
IsMeeting
IsCancelled
MeetingRequestWasSent
IsOnlineMeeting
Some of these boolean values are stored in property AppointmentState, but that is read-only too:
Name Bit Description
None 0x0000 No flags have been set. This is only used for an appointment that does not include attendees.
Meeting 0x0001 This appointment is a meeting.
Received 0x0002 This appointment has been received.
Canceled 0x0004 This appointment has been canceled.
Is IsMeeting maybe automatically set if I set other meeting-properties, like e.g. OptionalAttendees or RequiredAttendees? That would help with one of the four, if I knew which properties trigger the setting of IsMeeting.
(Yes, this is a follow-up to Meeting request properties not settable in EWS SOAP calls?).
You should be able to use MAPI Extended Properties:
Appointment state is
Named Prop Name: id: 0x8217=33303 = PidLidAppointmentStateFlags, dispidApptStateFlags
Named Prop Guid: {00062002-0000-0000-C000-000000000046} = PSETID_Appointment
So SOAP that should be something like
<t:ExtendedProperty>
<t:ExtendedFieldURI DistinguishedPropertySetId="Appointment" PropertyId="33303" PropertyType="Integer" />
<t:Value>1</t:Value>
</t:ExtendedProperty>
(I use the managed API for that, and got that XML from the trace-log, hope that is something you can use)
[Edited by the OP] This is the complete call that does the job:
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:typ="http://schemas.microsoft.com/exchange/services/2006/types"
xmlns:mes="http://schemas.microsoft.com/exchange/services/2006/messages">
<soapenv:Header>
<typ:RequestServerVersion Version="Exchange2007_SP1"/>
<typ:MailboxCulture>en-US</typ:MailboxCulture>
<typ:TimeZoneContext>
<typ:TimeZoneDefinition Id="W. Europe Standard Time"/>
</typ:TimeZoneContext>
</soapenv:Header>
<soapenv:Body>
<mes:UpdateItem ConflictResolution="AutoResolve" SendMeetingInvitationsOrCancellations="SendOnlyToChanged">
<mes:ItemChanges>
<typ:ItemChange>
<typ:ItemId <t:ItemId Id="AAMkA[snip]xAAA=" ChangeKey="Dw[snip]Mar"/>
<typ:Updates>
<typ:SetItemField>
<typ:ExtendedFieldURI DistinguishedPropertySetId="Appointment" PropertyId="33303" PropertyType="Integer"/>
<typ:CalendarItem>
<typ:ExtendedProperty>
<typ:ExtendedFieldURI DistinguishedPropertySetId="Appointment" PropertyId="33303" PropertyType="Integer"/>
<typ:Value>5</typ:Value>
</typ:ExtendedProperty>
</typ:CalendarItem>
</typ:SetItemField>
</typ:Updates>
</typ:ItemChange>
</mes:ItemChanges>
</mes:UpdateItem>
</soapenv:Body>
</soapenv:Envelope>
Strangely, the result says "Success", but reports a (one) conflict. I have no idea which one:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<h:ServerVersionInfo MajorVersion="15" MinorVersion="1" MajorBuildNumber="225" MinorBuildNumber="19" Version="V2_48" xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
</s:Header>
<s:Body>
<m:UpdateItemResponse xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
<m:ResponseMessages>
<m:UpdateItemResponseMessage ResponseClass="Success">
<m:ResponseCode>NoError</m:ResponseCode>
<m:Items>
<t:CalendarItem>
<t:ItemId Id="AAMk[snip]xAAA=" ChangeKey="DwA[snip]aMat"/>
</t:CalendarItem>
</m:Items>
<m:ConflictResults>
<t:Count>1</t:Count>
</m:ConflictResults>
</m:UpdateItemResponseMessage>
</m:ResponseMessages>
</m:UpdateItemResponse>
</s:Body>
</s:Envelope>
So I've been experimenting with adding customers to QuickBooks Online from a local database instance at our business. I want to keep track of our internal customer reference numbers in QBO, so have tried to save those to several different attributes like AcctNum, ExternalKey, ExternalId, AlternateId, or even directly to the Id attribute. After attempting to save to these fields, the return result looks good.
var qbCustomer = new Customer
{
AcctNum = customer.CustRef.ToString(CultureInfo.InvariantCulture),
ExternalKey = new IdType {idDomain = idDomainEnum.NG, Value = customer.CustRef.ToString(CultureInfo.InvariantCulture)},
Id = new IdType {idDomain = idDomainEnum.NG, Value = customer.CustRef.ToString(CultureInfo.InvariantCulture)},
Name = customer.CustName1,
FamilyName = customer.CustRef.ToString(CultureInfo.InvariantCulture),
};
Customer resultCustomer = dataServices.Add(qbCustomer);
But the next time I retrieve those customers, all of those fields are just null. Why are these fields not saving? Is there another more appropriate field to use to store an external ID besides just using one of the plain text fields (Name, Address, etc.)?
UPDATE:
Here's the raw XML exchange.
What I sent when adding a new customer:
<?xml version="1.0" encoding="utf-8"?>
<q1:Customer xmlns="http://www.intuit.com/sb/cdm/qbo" xmlns:q1="http://www.intuit.com/sb/cdm/v2">
<q1:Id>7</q1:Id>
<q1:ExternalKey>7</q1:ExternalKey>
<q1:TypeOf>Person</q1:TypeOf>
<q1:Name>Customer Name</q1:Name>
<q1:FamilyName>7</q1:FamilyName>
<q1:AcctNum>7</q1:AcctNum>
</q1:Customer>
Intuit's response:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Customer xmlns="http://www.intuit.com/sb/cdm/v2" xmlns:qbp="http://www.intuit.com/sb/cdm/qbopayroll/v1" xmlns:qbo="http://www.intuit.com/sb/cdm/qbo">
<Id idDomain="QBO">12</Id>
<SyncToken>0</SyncToken>
<MetaData><CreateTime>2013-07-25T13:51:43-07:00</CreateTime><LastUpdatedTime>2013-07-25T13:51:43-07:00</LastUpdatedTime></MetaData>
<Name>Customer Name</Name>
<WebSite/>
<Email/>
<FamilyName>7</FamilyName>
<CustomField xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="StringTypeCustomField"><DefinitionId>Preferred Delivery Method</DefinitionId><Value>DONT</Value></CustomField>
<CustomField xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="StringTypeCustomField"><DefinitionId>Resale Number</DefinitionId></CustomField>
<CustomField xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="BooleanTypeCustomField"><DefinitionId>Bill With Parent</DefinitionId><Value>false</Value></CustomField>
<ShowAs>Erik Kunze/Magdalena Guarda Munoz</ShowAs>
<OpenBalance><Amount>0</Amount></OpenBalance>
</Customer>
My retrieval later:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<qbo:SearchResults xmlns="http://www.intuit.com/sb/cdm/v2" xmlns:qbp="http://www.intuit.com/sb/cdm/qbopayroll/v1" xmlns:qbo="http://www.intuit.com/sb/cdm/qbo">
<qbo:CdmCollections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="Customers">
<Customer>
<Id idDomain="QBO">12</Id>
<SyncToken>0</SyncToken>
<MetaData><CreateTime>2013-07-25T13:51:43-07:00</CreateTime><LastUpdatedTime>2013-07-25T13:51:43-07:00</LastUpdatedTime></MetaData>
<Name>Customer Name</Name>
<WebSite/>
<Email/>
<FamilyName>7</FamilyName>
<CustomField xsi:type="BooleanTypeCustomField"><DefinitionId>Bill With Parent</DefinitionId><Value>false</Value></CustomField>
<CustomField xsi:type="StringTypeCustomField"><DefinitionId>Preferred Delivery Method</DefinitionId><Value>DONT</Value></CustomField>
<ShowAs>Erik Kunze/Magdalena Guarda Munoz</ShowAs>
<OpenBalance><Amount>0</Amount></OpenBalance>
</Customer>
</qbo:CdmCollections>
<qbo:Count>1</qbo:Count>
<qbo:CurrentPage>1</qbo:CurrentPage>
</qbo:SearchResults>
There's no AcctNum in the raw XML anywhere.
You are referring QBD's customer endpoint in apiexplorer.
Correct QBO link - https://developer.intuit.com/apiexplorer?apiname=V2QBO#Customer
Api Docs & Sample Create request - https://developer.intuit.com/docs/0025_quickbooksapi/0050_data_services/v2/0400_quickbooks_online/customer#Sample_Create_Request_XML
Simplest request body to create QBO customer -
<Customer xmlns:ns2="http://www.intuit.com/sb/cdm/qbo" xmlns="http://www.intuit.com/sb/cdm/v2" xmlns:ns3="http://www.intuit.com/sb/cdm/baseexceptionmodel/xsd">
<TypeOf>Person</TypeOf>
<Name>TestQBCustomer12345</Name>
</Customer>
Simplest Response
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Customer xmlns="http://www.intuit.com/sb/cdm/v2" xmlns:qbp="http://www.intuit.com/sb/cdm/qbopayroll/v1" xmlns:qbo="http://www.intuit.com/sb/cdm/qbo">
<Id idDomain="QBO">14</Id>
<SyncToken>0</SyncToken>
<MetaData>
<CreateTime>2013-07-25T14:08:49-07:00</CreateTime>
<LastUpdatedTime>2013-07-25T14:08:49-07:00</LastUpdatedTime>
</MetaData>
<Name>TestQBCustomer12345</Name>
<WebSite/>
<Email/>
<CustomField xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="StringTypeCustomField">
<DefinitionId>Preferred Delivery Method</DefinitionId>
<Value>DONT</Value>
</CustomField>
<CustomField xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="StringTypeCustomField">
<DefinitionId>Resale Number</DefinitionId>
</CustomField>
<CustomField xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="BooleanTypeCustomField">
<DefinitionId>Bill With Parent</DefinitionId>
<Value>false</Value>
</CustomField>
<ShowAs>TestQBCustomer12345</ShowAs>
<OpenBalance>
<Amount>0</Amount>
</OpenBalance>
</Customer>
You can test it first using apiexplorer then use the proper setters to do the same in your code.
Please let me know how it goes.
Thanks
Refer to the documentation:
https://developer.intuit.com/docs/0025_quickbooksapi/0050_data_services/v2/0500_quickbooks_windows/0600_object_reference/customer
You'll note that:
Id is an internal key generated by IPP/IDS - it's NOT something you can set yourself.
ExternalKey is the same situation - it's generated by IPP/IDS, not set-able by you.
ExternalId is marked "UNSUPPORTED FIELD."
AlternateId is marked "NOT SUPPORTED."
The only one of these fields that should work is:
AcctNum
If you're still having problems with that field, the way to troubleshoot is to get the raw XML outgoing request from Intuit, the raw XML that you get back (showing success) and then the raw response that you get back when you query it, showing that it's NULL.