IPP QBD CustomTxnDetail not returning Inventory or COGS - intuit-partner-platform

In Quickbooks desktop version, when I run a transaction detail report for transaction type of Invoice, I have 5 accounts displayed: Accounts Receivable, Inventory Asset, Sales Tax Payable, Sales and Cost of Goods Sold.
However, when I run this via .NET IPP DevKit v2, I only see 3 of these accounts: Accounts Receivable, Sales Tax Payable and Sales. So, the Inventory and Cost of Goods Sold are missing.
Code:
CustomTxnDetail detail = new CustomTxnDetail();
detail.OfferingId = offeringId.ipp;
detail.OfferingIdSpecified = true;
detail.ReportBasis = ReportBasisEnum.Accrual;
detail.ReportBasisSpecified = true;
detail.ItemsElementName = new ItemsChoiceType6[] {
ItemsChoiceType6.StartTransactionDate,
ItemsChoiceType6.EndTransactionDate,
};
detail.Items = new object[] {
new DateTime(2013, 1, 1),
new DateTime(2013, 12, 31),
};
detail.Columns = new[] {
DetailColumnsEnum.AccountId,
DetailColumnsEnum.AccountName,
DetailColumnsEnum.Amount,
DetailColumnsEnum.DocNum,
DetailColumnsEnum.ItemId,
DetailColumnsEnum.ItemName,
DetailColumnsEnum.ItemType,
DetailColumnsEnum.TxnDate,
DetailColumnsEnum.TxnId,
DetailColumnsEnum.TxnLineId,
DetailColumnsEnum.TxnType,
DetailColumnsEnum.UnitPrice,
};
detail.TxnType = new[] {
TxnTypeEnum.Invoice,
};
ReportingServices rptSvc = new ReportingServices(context);
Report rpt = rptSvc.CustomTxnDetailsReport(detail);
Request:
<?xml version="1.0" encoding="utf-8"?>
<AdvancedReportQuery xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.intuit.com/sb/cdm/v2">
<CustomTxnDetail>
<OfferingId>ipp</OfferingId>
<StartTransactionDate>2013-01-01T00:00:00</StartTransactionDate>
<EndTransactionDate>2013-12-31T00:00:00</EndTransactionDate>
<TxnType>Invoice</TxnType>
<ReportBasis>Accrual</ReportBasis>
<Columns>AccountId</Columns>
<Columns>AccountName</Columns>
<Columns>Amount</Columns>
<Columns>DocNum</Columns>
<Columns>ItemId</Columns>
<Columns>ItemName</Columns>
<Columns>ItemType</Columns>
<Columns>TxnDate</Columns>
<Columns>TxnId</Columns>
<Columns>TxnLineId</Columns>
<Columns>TxnType</Columns>
<Columns>UnitPrice</Columns>
</CustomTxnDetail>
</AdvancedReportQuery>
Response:
<?xml version="1.0" encoding="UTF-8"?>
<!--XML GENERATED by IntuitDataSyncEngine (IDS) using \\SBDomainServices\CDM\branches\3.9.0-rel-1-->
<RestResponse xmlns="http://www.intuit.com/sb/cdm/v2"
xmlns:xdb ="http://xmlns.oracle.com/xdb"
xmlns:xsi ="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation ="http://www.intuit.com/sb/cdm/v2 RestDataFilter.xsd">
<Report name="CustomerTxnDetail">
<ColDesc>
<ColTitle>AccountId</ColTitle>
<ColType>ids_IdType</ColType>
</ColDesc>
<ColDesc>
<ColTitle>AccountName</ColTitle>
<ColType>ids_String</ColType>
</ColDesc>
<ColDesc>
<ColTitle>Amount</ColTitle>
<ColType>ids_Amount</ColType>
</ColDesc>
<ColDesc>
<ColTitle>DocNum</ColTitle>
<ColType>ids_String</ColType>
</ColDesc>
<ColDesc>
<ColTitle>ItemId</ColTitle>
<ColType>ids_IdType</ColType>
</ColDesc>
<ColDesc>
<ColTitle>ItemName</ColTitle>
<ColType>ids_String</ColType>
</ColDesc>
<ColDesc>
<ColTitle>ItemType</ColTitle>
<ColType>ids_String</ColType>
</ColDesc>
<ColDesc>
<ColTitle>TxnDate</ColTitle>
<ColType>ids_Date</ColType>
</ColDesc>
<ColDesc>
<ColTitle>TxnId</ColTitle>
<ColType>ids_IdType</ColType>
</ColDesc>
<ColDesc>
<ColTitle>TxnLineId</ColTitle>
<ColType>ids_IdType</ColType>
</ColDesc>
<ColDesc>
<ColTitle>TxnType</ColTitle>
<ColType>ids_String</ColType>
</ColDesc>
<ColDesc>
<ColTitle>UnitPriceQnty</ColTitle>
<ColType>ids_Amount</ColType>
</ColDesc>
<Data>
<DataRow>
<ColData>6</ColData>
<ColData>Sales</ColData>
<ColData>-524.85</ColData>
<ColData/>
<ColData>39</ColData>
<ColData>201</ColData>
<ColData>Inventory</ColData>
<ColData>2013-09-18</ColData>
<ColData/>
<ColData/>
<ColData>Invoice</ColData>
<ColData>34.99</ColData>
</DataRow>
<DataRow>
<ColData>6</ColData>
<ColData>Sales</ColData>
<ColData>-174.95</ColData>
<ColData/>
<ColData>40</ColData>
<ColData>200</ColData>
<ColData>Inventory</ColData>
<ColData>2013-09-18</ColData>
<ColData/>
<ColData/>
<ColData>Invoice</ColData>
<ColData>34.99</ColData>
</DataRow>
<DataRow>
<ColData>6</ColData>
<ColData>Sales</ColData>
<ColData>-209.94</ColData>
<ColData/>
<ColData>37</ColData>
<ColData>203</ColData>
<ColData>Inventory</ColData>
<ColData>2013-09-18</ColData>
<ColData/>
<ColData/>
<ColData>Invoice</ColData>
<ColData>34.99</ColData>
</DataRow>
<DataRow>
<ColData>32</ColData>
<ColData>Sales Tax Payable</ColData>
<ColData>0</ColData>
<ColData/>
<ColData>1</ColData>
<ColData>Out of State</ColData>
<ColData>Sales Tax Item</ColData>
<ColData>2013-09-18</ColData>
<ColData/>
<ColData/>
<ColData>Invoice</ColData>
<ColData/>
</DataRow>
<DataRow>
<ColData>32</ColData>
<ColData>Sales Tax Payable</ColData>
<ColData>0</ColData>
<ColData/>
<ColData>1</ColData>
<ColData>Out of State</ColData>
<ColData>Sales Tax Item</ColData>
<ColData>2013-09-18</ColData>
<ColData/>
<ColData/>
<ColData>Invoice</ColData>
<ColData/>
</DataRow>
<DataRow>
<ColData>35</ColData>
<ColData>Accounts Receivable</ColData>
<ColData>734.79</ColData>
<ColData/>
<ColData/>
<ColData/>
<ColData/>
<ColData>2013-09-18</ColData>
<ColData/>
<ColData/>
<ColData>Invoice</ColData>
<ColData/>
</DataRow>
<DataRow>
<ColData>35</ColData>
<ColData>Accounts Receivable</ColData>
<ColData>174.95</ColData>
<ColData/>
<ColData/>
<ColData/>
<ColData/>
<ColData>2013-09-18</ColData>
<ColData/>
<ColData/>
<ColData>Invoice</ColData>
<ColData/>
</DataRow>
</Data>
</Report>
</RestResponse>
Any thoughts? I'm totally stuck :(

Can you check if those missing accounts( Inventory and Cost of Goods Sold ) are in errored state.
You can check by executing a query and setting ErroredObjectsOnly=true.
http://docs.developer.intuit.com/0025_Intuit_Anywhere/0050_Data_Services/v2/0500_QuickBooks_Windows/0100_Calling_Data_Services/0015_Retrieving_Objects#Objects_in_Error_State
If the entity is in error state, you can query for the specific reason using the SyncStatus API:
http://docs.developer.intuit.com/0025_Intuit_Anywhere/0050_Data_Services/v2/0500_QuickBooks_Windows/0600_Object_Reference/SyncStatus
From there, you will need to delete or revert the object in error state, depending on if a sync has occurred.
ApiExplorer - https://developer.intuit.com/apiexplorer?apiname=V2QBD
Thanks

Please query on DetailColumnsEnum.AccountType. It should have the COGS account. Inventory should come under Fixed Asset
Refer:
https://developer.intuit.com/docs/0025_quickbooksapi/0050_data_services/v2/0500_quickbooks_windows/064_reports/customtxndetail
Only the following account sub types are supported by the SDK-
Enumeration of Account sub-types used to categorize accounts in QuickBooks. Values: Bank, Accounts Receivable, Other Current Asset, Fixed Asset, Other Asset, Accounts Payable, Credit Card, Other Current Liability, Long Term Liability, Equity, Income, Cost of Goods Sold, Expense, Other Income, Other Expense, Non-Posting
For description of all account sub types refer:
https://developer.intuit.com/docs/0025_quickbooksapi/0050_data_services/v2/0500_quickbooks_windows/0600_object_reference/account

It turns out that this is a known bug in the Quickbooks API. I opened a ticket with Intuit. They were extremely helpful and one of their developers was able to reproduce this problem.
However, there is no workaround for this right now. And, I was left with the impression that it won't be fixed anytime soon.
QBD V2: Intuit acknowledges this is a bug. (CustomTxnDetail does not return COGS transactions)
QBD V3: As of this posting, there are no ReportingServices available in V3
If anyone else finds a workaround for retrieving actual cost transactions that can be tracked back to an invoice/sales receipt, I would greatly appreciate hearing about how you did it.

Related

How does Exchange (how can I) know that there is still a reminder pending for the last occurrence of a recurring event?

I noticed the following behavior for recurring events with reminders:
If a reminder for an occurrence is dismissed the ReminderIsSet property remains true and the ReminderDueBy property is set to the date/time of the next occurrence
When the last occurrence reminder has been dismissed ReminderIsSet still remains true and the ReminderDueBy property keeps the date/time of the last occurrence
If the last occurrence reminder is not dismissed the same happens
In that last case, in a user interface like Outlook Web Access (OWA), there is an indicator of a pending reminder:
How does Exchange, and how can I, distinguish the last two cases? How can I know that the reminder for that last occurrence was not dismissed yet?
Below is the SOAP testdata that I see querying Exchange Web Services (EWS) for two recurring appointments. They have subjects App A and App B, both were set to repeat 7 and 8 March at 12:20-12:50 CET with a 10 minute reminder:
On 8 March (=last occurrence), I dismissed the reminder for App A at 12:12, but did nothing with the reminder for App B.
If I then do GetItem calls (with BaseShape AllProperties) for both occurrences I see differences in the lines marked * at the start below. I have no idea how to conclude from this that App B still has a pending reminder. What am I missing?
Appointment A
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<h:ServerVersionInfo MajorVersion="15" MinorVersion="0" MajorBuildNumber="1104" MinorBuildNumber="3" Version="V2_22" xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types" xmlns="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 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<m:GetItemResponse xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
<m:ResponseMessages>
<m:GetItemResponseMessage ResponseClass="Success">
<m:ResponseCode>NoError</m:ResponseCode>
<m:Items>
<t:CalendarItem>
*ChangeKey <t:ItemId Id="AAMkAG[snip]AAAEA==" ChangeKey="DwAAABYAAACuuv05CWNWTKnqziXALsXrAACJ2zpT"/>
<t:ParentFolderId Id="AQMkA[snip]AAAA=" ChangeKey="AQAAAA=="/>
<t:ItemClass>IPM.Appointment.Occurrence</t:ItemClass>
* <t:Subject>App A</t:Subject>
<t:Sensitivity>Normal</t:Sensitivity>
<t:Body BodyType="Text"/>
* <t:DateTimeReceived>2016-03-08T11:06:34Z</t:DateTimeReceived>
* <t:Size>5243</t:Size>
<t:Importance>Normal</t:Importance>
<t:IsSubmitted>false</t:IsSubmitted>
<t:IsDraft>false</t:IsDraft>
<t:IsFromMe>false</t:IsFromMe>
<t:IsResend>false</t:IsResend>
<t:IsUnmodified>false</t:IsUnmodified>
* <t:DateTimeSent>2016-03-08T11:06:34Z</t:DateTimeSent>
* <t:DateTimeCreated>2016-03-08T11:06:33Z</t:DateTimeCreated>
<t:ResponseObjects>
<t:ForwardItem/>
</t:ResponseObjects>
<t:ReminderDueBy>2016-03-08T11:20:00Z</t:ReminderDueBy>
<t:ReminderIsSet>true</t:ReminderIsSet>
<t:ReminderMinutesBeforeStart>10</t:ReminderMinutesBeforeStart>
<t:DisplayCc/>
<t:DisplayTo/>
<t:HasAttachments>false</t:HasAttachments>
<t:Culture>nl-NL</t:Culture>
<t:EffectiveRights>
<t:CreateAssociated>false</t:CreateAssociated>
<t:CreateContents>false</t:CreateContents>
<t:CreateHierarchy>false</t:CreateHierarchy>
<t:Delete>true</t:Delete>
<t:Modify>true</t:Modify>
<t:Read>true</t:Read>
</t:EffectiveRights>
<t:LastModifiedName>Wendy Bakkertje</t:LastModifiedName>
* <t:LastModifiedTime>2016-03-08T11:11:56Z</t:LastModifiedTime>
<t:UID>040000[snip]CAFE1</t:UID>
<t:RecurrenceId>2016-03-08T11:20:00Z</t:RecurrenceId>
* <t:DateTimeStamp>2016-03-08T11:11:56Z</t:DateTimeStamp>
<t:Start>2016-03-08T11:20:00Z</t:Start>
<t:End>2016-03-08T11:50:00Z</t:End>
<t:OriginalStart>2016-03-08T11:20:00Z</t:OriginalStart>
<t:IsAllDayEvent>false</t:IsAllDayEvent>
<t:LegacyFreeBusyStatus>Busy</t:LegacyFreeBusyStatus>
<t:Location/>
<t:IsMeeting>false</t:IsMeeting>
<t:IsCancelled>false</t:IsCancelled>
<t:IsRecurring>true</t:IsRecurring>
<t:MeetingRequestWasSent>false</t:MeetingRequestWasSent>
<t:IsResponseRequested>true</t:IsResponseRequested>
<t:CalendarItemType>Occurrence</t:CalendarItemType>
<t:MyResponseType>Organizer</t:MyResponseType>
<t:Organizer>
<t:Mailbox>
<t:Name>Wendy Bakkertje</t:Name>
<t:EmailAddress>Wendy#tttest.nl</t:EmailAddress>
<t:RoutingType>SMTP</t:RoutingType>
</t:Mailbox>
</t:Organizer>
<t:Duration>PT30M</t:Duration>
<t:TimeZone>(UTC+01:00) Amsterdam, Berlijn, Bern, Rome, Stockholm, Wenen</t:TimeZone>
<t:AppointmentSequenceNumber>0</t:AppointmentSequenceNumber>
<t:AppointmentState>0</t:AppointmentState>
</t:CalendarItem>
</m:Items>
</m:GetItemResponseMessage>
</m:ResponseMessages>
</m:GetItemResponse>
</s:Body>
</s:Envelope>
Appointment B
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<h:ServerVersionInfo MajorVersion="15" MinorVersion="0" MajorBuildNumber="1104" MinorBuildNumber="3" Version="V2_22" xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types" xmlns="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 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<m:GetItemResponse xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
<m:ResponseMessages>
<m:GetItemResponseMessage ResponseClass="Success">
<m:ResponseCode>NoError</m:ResponseCode>
<m:Items>
<t:CalendarItem>
*ChangeKey <t:ItemId Id="AAMkAG[snip]t6QAAEA==" ChangeKey="DwAAABYAAACuuv05CWNWTKnqziXALsXrAACJ2zpS"/>
<t:ParentFolderId Id="AQMkAG[snip]AAAA=" ChangeKey="AQAAAA=="/>
<t:ItemClass>IPM.Appointment.Occurrence</t:ItemClass>
* <t:Subject>App B</t:Subject>
<t:Sensitivity>Normal</t:Sensitivity>
<t:Body BodyType="Text"/>
* <t:DateTimeReceived>2016-03-08T11:07:08Z</t:DateTimeReceived>
* <t:Size>5469</t:Size>
<t:Importance>Normal</t:Importance>
<t:IsSubmitted>false</t:IsSubmitted>
<t:IsDraft>false</t:IsDraft>
<t:IsFromMe>false</t:IsFromMe>
<t:IsResend>false</t:IsResend>
<t:IsUnmodified>false</t:IsUnmodified>
* <t:DateTimeSent>2016-03-08T11:07:08Z</t:DateTimeSent>
* <t:DateTimeCreated>2016-03-08T11:07:08Z</t:DateTimeCreated>
<t:ResponseObjects>
<t:ForwardItem/>
</t:ResponseObjects>
<t:ReminderDueBy>2016-03-08T11:20:00Z</t:ReminderDueBy>
<t:ReminderIsSet>true</t:ReminderIsSet>
<t:ReminderMinutesBeforeStart>10</t:ReminderMinutesBeforeStart>
<t:DisplayCc/>
<t:DisplayTo/>
<t:HasAttachments>false</t:HasAttachments>
<t:Culture>nl-NL</t:Culture>
<t:EffectiveRights>
<t:CreateAssociated>false</t:CreateAssociated>
<t:CreateContents>false</t:CreateContents>
<t:CreateHierarchy>false</t:CreateHierarchy>
<t:Delete>true</t:Delete>
<t:Modify>true</t:Modify>
<t:Read>true</t:Read>
</t:EffectiveRights>
<t:LastModifiedName>Wendy Bakkertje</t:LastModifiedName>
* <t:LastModifiedTime>2016-03-08T11:07:08Z</t:LastModifiedTime>
* <t:UID>040000[snip]463B</t:UID>
<t:RecurrenceId>2016-03-08T11:20:00Z</t:RecurrenceId>
* <t:DateTimeStamp>2016-03-08T11:07:08Z</t:DateTimeStamp>
<t:Start>2016-03-08T11:20:00Z</t:Start>
<t:End>2016-03-08T11:50:00Z</t:End>
<t:OriginalStart>2016-03-08T11:20:00Z</t:OriginalStart>
<t:IsAllDayEvent>false</t:IsAllDayEvent>
<t:LegacyFreeBusyStatus>Busy</t:LegacyFreeBusyStatus>
<t:Location/>
<t:IsMeeting>false</t:IsMeeting>
<t:IsCancelled>false</t:IsCancelled>
<t:IsRecurring>true</t:IsRecurring>
<t:MeetingRequestWasSent>false</t:MeetingRequestWasSent>
<t:IsResponseRequested>true</t:IsResponseRequested>
<t:CalendarItemType>Occurrence</t:CalendarItemType>
<t:MyResponseType>Organizer</t:MyResponseType>
<t:Organizer>
<t:Mailbox>
<t:Name>Wendy Bakkertje</t:Name>
<t:EmailAddress>Wendy#tttest.nl</t:EmailAddress>
<t:RoutingType>SMTP</t:RoutingType>
</t:Mailbox>
</t:Organizer>
<t:Duration>PT30M</t:Duration>
<t:TimeZone>(UTC+01:00) Amsterdam, Berlijn, Bern, Rome, Stockholm, Wenen</t:TimeZone>
<t:AppointmentSequenceNumber>0</t:AppointmentSequenceNumber>
<t:AppointmentState>0</t:AppointmentState>
</t:CalendarItem>
</m:Items>
</m:GetItemResponseMessage>
</m:ResponseMessages>
</m:GetItemResponse>
</s:Body>
</s:Envelope>
The Logic that is used for reminders is documented in https://msdn.microsoft.com/en-us/library/ee219839(v=exchg.80).aspx its relative complex and you'll need to use the extended properties to implement it fully. The other thing you can use in 2013 and up is EWS has a reminders operation https://msdn.microsoft.com/en-us/library/office/dn720424(v=exchg.150).aspx but Mapi clients like Outlook use the Reminders Search Folder in the Non_IPM_Subtree
Cheers
Glen

Finding a CID reference for attachments in Exchange Contacts

I'm crafting a powershell program using EWS that:
Recover some data from a backup contact folder (telephone, url, notes field,...)
Set back those values in default contact folder in the new contact
Everything does work except, of course, attachents that were added to notes fields, still i'm able to download them.
foreach ($attch in $Item.Attachments)
{
$downloadDirectory = ".\attachments"
$attch.Load()
$fiFile = new-object System.IO.FileStream(($downloadDirectory + “\” + $attch.Name.ToString()), [System.IO.FileMode]::Create)
$fiFile.Write($attch.Content, 0, $attch.Content.Length)
$fiFile.Close()
write-host "Downloaded Attachment : " + (($downloadDirectory + “\” + $attch.Name.ToString()))
}
Or upload them. (it's static here for test purpose)
$att = $item.Attachments.AddFileAttachment("C:\Scripts\myscript\attachments\PowerShell_transcript.20140506143510.txt")
$att.ContentId = 'test'
$att.IsInline=$false
Ideally, i was looking for matching CID references and uplading back attachments using the same one.
<div><font face="Calibri" size="2"><span style="font-size:11pt;">
<img src="cid:0DF540471453B832E300400FF03B0900CFEC1201#1">
SomeDoc.docx
</span></font></div>
Of course, when the object retrieved from exchange, it doesn't have a contentid (I would have guess it should be CID value).
<Objs Version="1.1.0.1" xmlns="http://schemas.microsoft.com/powershell/2004/04">
<Obj RefId="0">
<TN RefId="0">
<T>Microsoft.Exchange.WebServices.Data.FileAttachment</T>
<T>Microsoft.Exchange.WebServices.Data.Attachment</T>
<T>Microsoft.Exchange.WebServices.Data.ComplexProperty</T>
<T>System.Object</T>
</TN>
<ToString>Microsoft.Exchange.WebServices.Data.FileAttachment</ToString>
<Props>
<Nil N="FileName" />
<BA N="Content"></BA>
<B N="IsContactPhoto">false</B>
<S N="Id">AAMkADdmMDBkOTk4LTNlYzMtNDk1MS05ZTdhLWJmOGE.....</S>
<S N="Name">SomeDoc.docx</S>
<S N="ContentType">application/vnd.openxmlformats-officedocument.wordprocessingml.document</S>
<Nil N="ContentId" /> <=== WHERE IS MY VALUE :'(
<Nil N="ContentLocation" />
<I32 N="Size">1764632</I32>
<DT N="LastModifiedTime">2016-01-26T15:08:03+00:00</DT>
<B N="IsInline">false</B>
</Props>
</Obj>
</Objs>
Does someone know a way to retrieve that value ?
Server/mailbox: Exchange 2013 SP1
Thank you !
it doesn't have a contentid (I would have guess it should be CID value).
An Attachment would only have cid if it was on Inline Attachment in a Mime Message https://www.ietf.org/rfc/rfc2111.txt in a contact it would never be valid (eg even the contact picture doesn't have a cid) as your dealing with Exchange Data Type.
Cheers
Glen

How to 'set' read-only calendar appointment properties (related to meetings)?

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>

Quickbooks IPP v3 sales tax issue

We are building an application using IPP v3 that will sync invoices from our SaaS app to QBOE (and hopefully QBD). The problem are are encountering is with replicating the sales on our invoices with the invoices created in quickbooks.
Specifically, our invoices can have line items which are not taxable (each state is different in terms of which items are taxed and at what rate). Also there are many times both state, city and county taxes, some of which apply to some line items and not to others.
It appears for the IPP v3 US version, taxes must be global to the invoice?
I think that all of this could be solved if we could just override the total tax amount for the invoice. Documentations seems to indicate that API supports that. However, all my attempts were ignored. It's either no Tax or default tax rate (in percentage). That means that we can't override totals or enter fixed taxes.
Another option would be to add an extra line to the invoice named "Tax Name" and the value. The invoice total would be correct but Tax Reports on quickbooks wouldn't?
I would really like a straight answer like "tax amount cannot be overridden through the API" just to be sure.
I would also like to know if Intuit plans to support that feature in a near future?
There are fields in the API like "PercentBased" (which can be set to true or false) that seem to indicate that fixed amounts can be set. But these fields are completely ignored when I try to use them.
Any help or future guidance on this would be greatly appreciate as it pertains to IPP v3 for QBOE / QBD.
Here's our XML request
<?xml version='1.0' encoding='utf-8'?>
<IntuitBatchRequest xmlns:ns2="http://www.intuit.com/sb/cdm/qbo"
xmlns="http://schema.intuit.com/finance/v3">
<BatchItemRequest bId="bid1" operation="create">
<Invoice>
<DocNumber>2459999</DocNumber>
<TxnDate>2012-12-10</TxnDate>
<GlobalTaxCalculation>TaxIncluded</GlobalTaxCalculation>
<Line>
<DetailType>SalesItemLineDetail</DetailType>
<Amount>200</Amount>
<SalesItemLineDetail>
<TaxCodeRef>TAX</TaxCodeRef>
<ServiceDate>2012-12-10</ServiceDate>
</SalesItemLineDetail>
<Description>Test</Description>
<ItemRef>1</ItemRef>
</Line>
<CustomerRef>66</CustomerRef>
<TxnTaxDetail>
<TaxLine>
<DetailType>TaxLineDetail</DetailType>
<Amount>13.00</Amount>
<TaxLineDetail>
<NetAmountTaxable>200.00</NetAmountTaxable>
<TaxPercent>6.50</TaxPercent>
<TaxRateRef>1</TaxRateRef>
<PercentBased>true</PercentBased>
</TaxLineDetail>
</TaxLine>
</TxnTaxDetail>
</Invoice>
</BatchItemRequest>
</IntuitBatchRequest>
You can override the tax amount in the Taxline in TxnTaxDetail-
Eg:
Includes tax # 20% on 16.67 = 3.33. we would expect the request to include following tax details
"TxnTaxDetail": {
"TotalTax":3.33,
"TaxLine":[
{
"Amount":3.33,
"DetailType": "TaxLineDetail",
"TaxLineDetail": {
"TaxRateRef": {
"value":"4"
},
"PercentBased":true,
"TaxPercent": 20,
"NetAmountTaxable": 16.67
"GlobalTaxCalculation": "TaxIncludes",...
Please refer-
https://developer.intuit.com/docs/0025_quickbooksapi/0050_data_services/v3/020_key_concepts/0700_other_topics#TxnTaxDetail
EDIT:
Adding the sample request and response xml. Just set the following tags.
<TxnTaxDetail>
<TxnTaxCodeRef>
<TotalTax>
</TxnTaxDetail>
Do not set the Taxline as QBO recalculates the tax based on the details sent in the request. So in response you’ll get the recalculated amount based in the TaxPercent specified.
Request sample-
<?xml version="1.0"?>
<Invoice xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schema.intuit.com/finance/v3">
<TxnDate>2013-10-11+05:30</TxnDate>
<PrivateNote>This is a private note</PrivateNote>
<Line>
<Description>Invoice line description.</Description>
<Amount>900</Amount>
<DetailType>SalesItemLineDetail</DetailType>
<SalesItemLineDetail>
<ItemRef name="Bat">2</ItemRef>
<UnitPrice>90</UnitPrice>
<Qty>10</Qty>
<TaxCodeRef>TAX</TaxCodeRef>
<ServiceDate>2013-10-11+05:30</ServiceDate>
</SalesItemLineDetail>
</Line>
<TxnTaxDetail>
<TxnTaxCodeRef name="StateSalesTax">8</TxnTaxCodeRef>
<TotalTax>450</TotalTax>
</TxnTaxDetail>
<AutoDocNumber>true</AutoDocNumber>
<CustomerRef name="5748584cc7d64bb18a0e">23</CustomerRef>
<BillAddr>
<Line1>123 Main St.</Line1>
<Line2>Unit 506</Line2>
<City>Brockton</City>
<Country>United States</Country>
<CountrySubDivisionCode>MA</CountrySubDivisionCode>
<PostalCode>02301</PostalCode>
<Note>Billing Address Note</Note>
</BillAddr>
<ShipAddr>
<Line1>100 Fifth Ave.</Line1>
<City>Waltham</City>
<Country>United States</Country>
<CountrySubDivisionCode>MA</CountrySubDivisionCode>
<PostalCode>02452</PostalCode>
<Note>Shipping Address Note</Note>
</ShipAddr>
<SalesTermRef name="Due on receipt">1</SalesTermRef>
<DueDate>2013-11-10+05:30</DueDate>
<GlobalTaxCalculation>TaxInclusive</GlobalTaxCalculation>
<ARAccountRef name="Accounts Receivable (A/R)">32</ARAccountRef>
</Invoice>
Response sample-
<IntuitResponse xmlns="http://schema.intuit.com/finance/v3" time="2013-10-18T01:50:19.576-07:00">
<Invoice domain="QBO" sparse="false">
<Id>50</Id>
<SyncToken>0</SyncToken>
<MetaData>
<CreateTime>2013-10-18T01:50:20-07:00</CreateTime>
<LastUpdatedTime>2013-10-18T01:50:20-07:00</LastUpdatedTime>
</MetaData>
<DocNumber>1037</DocNumber>
<TxnDate>2013-10-11</TxnDate>
<PrivateNote>This is a private note</PrivateNote>
<Line>
<Id>1</Id>
<LineNum>1</LineNum>
<Description>Invoice line test</Description>
<Amount>900.00</Amount>
<DetailType>SalesItemLineDetail</DetailType>
<SalesItemLineDetail>
<ItemRef name="Bat">2</ItemRef>
<UnitPrice>90</UnitPrice>
<Qty>10</Qty>
<TaxCodeRef>TAX</TaxCodeRef>
<ServiceDate>2013-10-11</ServiceDate>
</SalesItemLineDetail>
</Line>
<Line>
<Amount>900.00</Amount>
<DetailType>SubTotalLineDetail</DetailType>
<SubTotalLineDetail />
</Line>
<TxnTaxDetail>
<TxnTaxCodeRef>8</TxnTaxCodeRef>
<TotalTax>450.00</TotalTax>
<TaxLine>
<Amount>450.00</Amount>
<DetailType>TaxLineDetail</DetailType>
<TaxLineDetail>
<TaxRateRef>18</TaxRateRef>
<PercentBased>true</PercentBased>
<TaxPercent>2.5</TaxPercent>
<NetAmountTaxable>900.00</NetAmountTaxable>
</TaxLineDetail>
</TaxLine>
</TxnTaxDetail>
<CustomerRef name="5748584cc7d64bb18a0e">23</CustomerRef>
<BillAddr>
<Id>78</Id>
<Line1>123 Main St.</Line1>
<Line2>Unit 506</Line2>
<City>Brockton</City>
<Country>United States</Country>
<CountrySubDivisionCode>MA</CountrySubDivisionCode>
<PostalCode>02301</PostalCode>
<Lat>42.0829092</Lat>
<Long>-71.01995200000002</Long>
</BillAddr>
<ShipAddr>
<Id>79</Id>
<Line1>100 Fifth Ave.</Line1>
<City>Waltham</City>
<Country>United States</Country>
<CountrySubDivisionCode>MA</CountrySubDivisionCode>
<PostalCode>02452</PostalCode>
<Lat>42.3933303</Lat>
<Long>-71.256777</Long>
</ShipAddr>
<SalesTermRef>1</SalesTermRef>
<DueDate>2013-11-10</DueDate>
<TotalAmt>1350.00</TotalAmt>
<ApplyTaxAfterDiscount>false</ApplyTaxAfterDiscount>
<PrintStatus>NeedToPrint</PrintStatus>
<EmailStatus>NotSet</EmailStatus>
<Balance>1350.00</Balance>
<Deposit>0</Deposit>
<AllowIPNPayment>false</AllowIPNPayment>
<AllowOnlinePayment>false</AllowOnlinePayment>
</Invoice>
</IntuitResponse>
EDIT for Global-
Ok, I retested this fr Global.
I can override amounts for individual taxlines and then final taxamount-
here is an invoice update request -
I changed the following tags-
<TxnTaxDetail>
<TotalTax>2.90</TotalTax>
and then in one of the taxlines
<TaxLine>
<Amount>0.70</Amount>
and then in the final invoice amounts
<TotalAmt>79.90</TotalAmt>
<Balance>79.90</Balance>
<Invoice xmlns="http://schema.intuit.com/finance/v3" domain="QBO" sparse="false">
<Id>1</Id>
<SyncToken>0</SyncToken>
<MetaData>
<CreateTime>2015-01-30T09:32:06-08:00</CreateTime>
<LastUpdatedTime>2015-01-30T09:32:06-08:00</LastUpdatedTime>
</MetaData>
<DocNumber>1001</DocNumber>
<TxnDate>2015-01-30</TxnDate>
<CurrencyRef name="Canadian Dollar">CAD</CurrencyRef>
<Line>
<Id>1</Id>
<LineNum>1</LineNum>
<Amount>33.00</Amount>
<DetailType>SalesItemLineDetail</DetailType>
<SalesItemLineDetail>
<ItemRef name="Hours">2</ItemRef>
<UnitPrice>33</UnitPrice>
<Qty>1</Qty>
<TaxCodeRef>7</TaxCodeRef>
</SalesItemLineDetail>
</Line>
<Line>
<Id>2</Id>
<LineNum>2</LineNum>
<Amount>44.00</Amount>
<DetailType>SalesItemLineDetail</DetailType>
<SalesItemLineDetail>
<ItemRef name="Sales">1</ItemRef>
<UnitPrice>44</UnitPrice>
<Qty>1</Qty>
<TaxCodeRef>5</TaxCodeRef>
</SalesItemLineDetail>
</Line>
<Line>
<Amount>77.00</Amount>
<DetailType>SubTotalLineDetail</DetailType>
<SubTotalLineDetail />
</Line>
<TxnTaxDetail>
<TotalTax>2.90</TotalTax>
<TaxLine>
<Amount>2.20</Amount>
<DetailType>TaxLineDetail</DetailType>
<TaxLineDetail>
<TaxRateRef>6</TaxRateRef>
<PercentBased>true</PercentBased>
<TaxPercent>5</TaxPercent>
<NetAmountTaxable>44.00</NetAmountTaxable>
</TaxLineDetail>
</TaxLine>
<TaxLine>
<Amount>0.70</Amount>
<DetailType>TaxLineDetail</DetailType>
<TaxLineDetail>
<TaxRateRef>15</TaxRateRef>
<PercentBased>true</PercentBased>
<TaxPercent>2</TaxPercent>
<NetAmountTaxable>33.00</NetAmountTaxable>
</TaxLineDetail>
</TaxLine>
</TxnTaxDetail>
<CustomerRef name="dd">1</CustomerRef>
<SalesTermRef>3</SalesTermRef>
<DueDate>2015-03-01</DueDate>
<GlobalTaxCalculation>TaxExcluded</GlobalTaxCalculation>
<TotalAmt>79.90</TotalAmt>
<PrintStatus>NotSet</PrintStatus>
<EmailStatus>NotSet</EmailStatus>
<Balance>79.90</Balance>
<Deposit>0</Deposit>
<AllowIPNPayment>false</AllowIPNPayment>
<AllowOnlinePayment>false</AllowOnlinePayment>
<AllowOnlineCreditCardPayment>false</AllowOnlineCreditCardPayment>
<AllowOnlineACHPayment>false</AllowOnlineACHPayment>

Customer attributes not saving on Add

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.