Sending an order into Quickbooks via IPP doesn't work when transaction date is in the past - quickbooks

I've edited the question to make it more clean and focused now that I've investigated more.
Syncing orders are working for today's date and future dates, but not for dates in the past. I'm testing now directly in the API explorer.
Here is the add order request and response:
<!--Add order request-->
<Add xmlns="http://www.intuit.com/sb/cdm/v2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
RequestId="ecc53f53d70f0a52de4c88021721ba32"
xsi:schemaLocation="http://www.intuit.com/sb/cdm/v2 ./RestDataFilter.xsd ">
<OfferingId>ipp</OfferingId>
<ExternalRealmId>688875295</ExternalRealmId>
<Object xsi:type="SalesOrder">
<Header>
<DocNumber>6</DocNumber>
<TxnDate>2010-12-25</TxnDate>
<CustomerId idDomain="QB">4</CustomerId>
<SalesRepId idDomain="QB">1</SalesRepId>
</Header>
<Line>
<ItemId idDomain="QB">1</ItemId>
<Qty>6</Qty>
</Line>
</Object>
</Add>
<!--Add order response-->
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<RestResponse xmlns="http://www.intuit.com/sb/cdm/v2">
<Success RequestId="ecc53f53d70f0a52de4c88021721ba32">
<ObjectRef>
<Id idDomain="NG">802721</Id>
<SyncToken>1</SyncToken>
<LastUpdatedTime>2013-04-29T15:26:53Z</LastUpdatedTime>
</ObjectRef>
<RequestName>SalesOrderAdd</RequestName>
<ProcessedTime>2013-04-29T15:26:53Z</ProcessedTime>
</Success>
</RestResponse>
Here is the sync status and sync activity. There was only one entity with SalesOrder, but the times don't match up, so I don't believe its referencing the same order that I added via API explorer. Also, the order that I added did not appear in Quickbooks also.
<SyncStatusResponse>
<NgIdSet>
<NgId>802721</NgId>
<NgObjectType>SalesOrder</NgObjectType>
</NgIdSet>
<RequestId>DB7F4BF877006079E040900A0F1B14C1</RequestId>
<StateCode>8</StateCode>
<StateDesc>Record netted with QB</StateDesc>
<MessageCode>70</MessageCode>
<MessageDesc>MBL Netter success using QB SDK ext_ack_id</MessageDesc>
<ResponseLogTMS>2013-04-29T15:38:02.0Z</ResponseLogTMS>
</SyncStatusResponse>
<SyncActivityResponse>
<SyncType>Writeback</SyncType>
<StartSyncTMS>2013-04-10T12:42:21.0</StartSyncTMS>
<EndSyncTMS>2013-04-29T08:38:02.0</EndSyncTMS>
<EntityName>SalesOrder</EntityName>
<EntityRowCount>20</EntityRowCount>
</SyncActivityResponse>
From the sync status response, state code 8 means
Record netted. Synchronized. Object created in Data Services. Sync Manager has acknowledged synchronizing the object and mapped its NG ID to a QB ID in QuickBooks. Equivalent to StateCode 1 (for object created in QuickBooks).
Message code 70 seems to be ok base on its description, but it wasn't listed in the documentation.

In Quickbooks Destop, by default only the current Fiscal year transactions are displayed. Could you try changing the Date filter to "All", to see if the Sales Order made it ?

So your Request is succeeding but you are not seeing it in QuicKBooks after sync is run.
Check the sync status of the object, or you can see all the sync activity by calling these APIS
http://docs.developer.intuit.com/0025_Intuit_Anywhere/0050_Data_Services/v2/0500_QuickBooks_Windows/0600_Object_Reference/SyncActivity
http://docs.developer.intuit.com/0025_Intuit_Anywhere/0050_Data_Services/v2/0500_QuickBooks_Windows/0600_Object_Reference/SyncStatus
Even though your request succeeded, before it can by synced to QuickBooks it must pass the business rules to be created/updated on the desktop.
If your object encountered an error (lets say it was a duplicate) then you can add an errored object filter on your query to query for it as well.
regards
Jarred

Related

In some cases, Graph API's "ical_uid" value differs from EWS "UID" for the same CalendarItem/event

We use EWS to bi-directionally synchronize Exchange events with our application, and we are in the process of migrating to Graph API.
When creating reservations in Exchange through EWS using CreateItem, we set the uid using a self-generated UUID like this (look at the "UID" field) :
<?xml version=\'1.0\' encoding=\'utf-8\'?>\n
<s:Envelope
xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages"
xmlns:t="http://schemas.microsoft. com/exchange/services/2006/types">
<s:Header>
<t:RequestServerVersion Version="Exchange2016"/>
<t:TimeZoneContext>
<t:TimeZoneDefinition Id="Romance Standard Time"/>
</t:TimeZoneContext>
</s: Header>
<s:Body>
<m:CreateItem MessageDisposition="SaveOnly" SendMeetingInvitations="SendToAllAndSaveCopy">
<m:SavedItemFolderId>
<t:DistinguishedFolderId Id="calendar">
<t:Mailbox>
<t: EmailAddress>email#email.com
</t:EmailAddress>
<t:RoutingType>SMTP</t:RoutingType>
<t:MailboxType>Mailbox</t:MailboxType>
</t:Mailbox>
</t:DistinguishedFolderId>
</m:SavedItemFolderId>
<m: Items>
<t:CalendarItem>
<t:Subject>subject</t:Subject>
<t:Sensitivity>Normal</t:Sensitivity>
<t:Body BodyType="HTML"></t:Body>
<t:Importance>Normal</t:Importance>
<t:ReminderIsSet>0
</t: ReminderIsSet>
<t:ReminderMinutesBeforeStart>0</t:ReminderMinutesBeforeStart>
--> <t:UID>81d5f321-af6c-45ae-9cac-ef096ef32069</t:UID>
<t:Start>2022-07-28T17:00:00+02:00</t:Start>
<t: End>2022-07-28T17:30:00+02:00
</t:End>
<t:IsAllDayEvent>0</t:IsAllDayEvent>
<t:LegacyFreeBusyStatus>Busy</t:LegacyFreeBusyStatus>
<t:Location></t:Location>
<t:Resources>
<t:Waitee>
<t:Mailbox>
<t: EmailAddress>resource_email#email.com
</t:EmailAddress>
<t:RoutingType>SMTP</t:RoutingType>
<t:MailboxType>Mailbox</t:MailboxType>
</t:Mailbox>
<t:ResponseType>Accept</t:ResponseType>
</t: Attendee>
</t:Resources>
<t:StartTimeZone Id="Romance Standard Time" Name=""/>
<t:EndTimeZone Id="Romance Standard Time" Name=""/>
</t:CalendarItem>
</m:Items>
</m:CreateItem>
</s:Body>
</s:Envelope>
This identifier seems to be fully supported by Exchange:
When this event comes back to our application as a result of a "GetItem" SOAP request, it has the same identifier 81d5f321-af6c-45ae-9cac-ef096ef32069
When I look at the MAPI properties of the event using the OutlookSpy tool, I find our UUID in the "GlobalObjectId" and "CleanGlobalObjectId" fields
However, when we synchronize this same event using Graph API, the ical_uid field is totally different, which generates synchronization problems in our application following the EWS->Graph API migration.
To add some information:
Using the beta version of Graph API, we get a "uid" field that contains our UUID.
When the event is created on Outlook, it is a UID generated by EWS and not by our application, there is no such problem
How can I make sure I get the same UID as with EWS and avoid synchronization problems?

How to retrieve archived messages in the reverse order with XMPPFramework?

I'm implementing retrieving XMPP chat history with XEP-0313 Message Archive Management using XMPPFramework for iOS. I receive messages page by page using XMPPFramework's class XMPPMessageArchiveManagement. I'm able to receive the pages in the reverse order providing the message before which the next page should be.
let resultSet = XMPPResultSet(max: 50, before: theIdOfTheOldestReceivedMessage ?? "")
self.xmppMAM?.retrieveMessageArchive(at: to,
withFields: [field],
with: resultSet)
But I also would like to receive the messages on each page in the reverse order from the last one to the first one. According to the documentation I should provide the element in the query:
A client wishing for a reversed page should include the <flip-page/> element in its query, like so:
<iq type='set' id='q29309'>
<query xmlns='urn:xmpp:mam:2'>
<x xmlns='jabber:x:data' type='submit'>
<field var='FORM_TYPE' type='hidden'><value>urn:xmpp:mam:2</value></field>
<field var='start'>\<value>2010-08-07T00:00:00Z\</value>\</field>
</x>
<set xmlns='http://jabber.org/protocol/rsm'>
<max>10</max>
<after>09af3-cc343-b409f\</after>
</set>
<flip-page/>
</query>
</iq>
The source: https://xmpp.org/extensions/xep-0313.html#query-paging-flip.
The problem is that I don't populate the query myself: XMPPFramework is responsible for that. The framework generates the final XML and I'm only able to provide fields and a result set. The provided fields will be inside the x element, the provided result set will be a separate element of the queue. But how to provide the <flip-page/> element to the queue with XMPPMessageArchiveManagement by XMPPFramework?

Stream send create new blasts returns (422) unprocessable entity

I am trying to schedule a new blast to send emails. I am calling the below URL
https://app.streamsend.com/audiences/1/blasts.xml
posting the below xml to the service
<blast>
<from>
<name>Customer Service</name>
<email-address>xxx#example.com</email-address>
</from>
<to>
<audience-id>1</audience-id>
<filter-id></filter-id>
<include-lists>5</include-lists>
<exclude-lists>7</exclude-lists>
</to>
<subject>My First Blast</subject>
<body>
<email-id>9</email-id>
</body>
<options>
<track-views>true</track-views>
<track-clicks>true</track-clicks>
<include-social-bar>false</include-social-bar>
</options>
<scheduled-for>2015-02-17T20:00:00Z</scheduled-for>
</blast>
I am getting WebException showing error 422 unprocessable entity. Please help me in resolving this issue.
Before scheduling a blast we must first verify the email mentioned in the email-address tag(xxx#example.com). This is to ensure compliance with the U.S. Can-Spam Law.
<blast>
<from>
<name>Customer Service</name>
<email-address>xxx#example.com</email-address>
</from>
<to>
<audience-id>1</audience-id>
<filter-id></filter-id>
<include-lists>5</include-lists>
<exclude-lists>7</exclude-lists>
</to>
<subject>My First Blast</subject>
<body>
<email-id>9</email-id>
</body>
<options>
<track-views>true</track-views>
<track-clicks>true</track-clicks>
<include-social-bar>false</include-social-bar>
</options>
<scheduled-for>2015-02-17T20:00:00Z</scheduled-for>
</blast>
To verify the email address, Login to stream send web portal and try to set up a blast. Steps to set up a blast
Step 1: Mention the sender email address information
Step 2: Activation link is sent to the email mentioned in step 1. Once the user activates the link, the sender account is verified successfully.
We will be able to schedule the blasts after verification without any issues.
Note: In stream send one audience Id is created per account, usually the value is 1, sometimes it may have a value other than 1. While scheduling a blast it is better to check for the audience id by calling the API rather than hard coding the value.

Quickbooks API and detecting deleted items

I'm using the Quickbooks XML API to import salesorders, items, and customers. Everything works great, however I haven't figured out how to handle things that are deleted in Quickbooks. Querying the imported data in my system is not an option because I have 20,000+ salesorders. My question is, does Quickbooks have a query for deleted items?
QuickBooks for Windows:
If you're using QuickBooks for Windows, then you can do a TxnDeletedQueryRq request to get a list of recently deleted transactions.
Example:
<?xml version="1.0" encoding="utf-8"?>
<?qbxml version="9.0"?>
<QBXML>
<QBXMLMsgsRq onError="stopOnError">
<TxnDeletedQueryRq>
<!-- TxnDelType may have one of the following values: ARRefundCreditCard, Bill, BillPaymentCheck, BillPaymentCreditCard, BuildAssembly, Charge, Check, CreditCardCharge, CreditCardCredit, CreditMemo, Deposit, Estimate, InventoryAdjustment, Invoice, ItemReceipt, JournalEntry, PayrollLiabilityAdjustment [PRIVATE], PayrollPriorPayment [PRIVATE], PayrollYearToDateAdjustment [PRIVATE], PurchaseOrder, ReceivePayment, SalesOrder, SalesReceipt, SalesTaxPaymentCheck, TimeTracking, TransferInventory, VehicleMileage, VendorCredit -->
<TxnDelType>Invoice</TxnDelType>
<TxnDelType>ReceivePayment</TxnDelType>
</TxnDeletedQueryRq>
</QBXMLMsgsRq>
</QBXML>
Example from here:
http://www.consolibyte.com/docs/index.php/QbXML_for_Querying_for_Deleted_Objects
http://www.consolibyte.com/docs/index.php/Example_qbXML_Requests
The full syntax with all options/flags you can set can be found in the QuickBooks OSR:
https://developer-static.intuit.com/qbSDK-current/Common/newOSR/index.html
QuickBooks Online:
If you're using QuickBooks Online, then you can use the CDC requests to poll for recently changed data, including things that have been deleted.
https://quickbooks.api.intuit.com/v3/company/1234/cdc?entities=Class,Item,Invoice&changedSince=2012-07-20T22:25:51-07:00
Will return something like:
<IntuitResponse xmlns="http://schema.intuit.com/finance/v3" time="2013-04-03T10:36:19.393Z">
<CDCResponse>
<QueryResponse>
<Customer>...
</Customer>
...
Some of which may have a status="Deleted" attribute to let you know it's been deleted.

yahoo finance api returns empty response

My application showing stock market data. I am using YQL for fetching stock data.
http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.quotes%20where%20symbol%20in%20(%22SBIN.NS%22)&env=store://datatables.org/alltableswithkeys&diagnostics=true&format=xml
Lats two days, When I am fetching morning or before (1.00 pm India time) then yql query returns empty response.
But right now it show exact problem
The query result is "yahoo.finance.quotes' has been blocked.
Response is
<query xmlns:yahoo="http://www.yahooapis.com/v1/base.rng" yahoo:count="0" yahoo:created="2012-09-26T11:24:22Z" yahoo:lang="en-US">
<diagnostics>
<publiclyCallable>true</publiclyCallable>
<url execution-start-time="20" execution-stop-time="23" execution-time="3" proxy="DEFAULT">
<![CDATA[
http://www.datatables.org/yahoo/finance/yahoo.finance.quotes.xml
]]>
</url>
<cache execution-start-time="25" execution-stop-time="26" execution-time="1" method="GET" type="MEMCACHED">
<![CDATA[ 13c4f8eac77ad886bade5a711c8c1ef5 ]]>
</cache>
<javascript name="yahoo.finance.quotes" verb="select">
<![CDATA[
com.yahoo.platforms.pipes.model.ModuleException: Error Codes: js.blocked.execute.request Message: "The current table 'yahoo.finance.quotes' has been blocked. It exceeded the allotted quotas of either time or instructions"
]]>
</javascript>
<user-time>26</user-time>
<service-time>4</service-time>
<build-version>30549</build-version>
</diagnostics>
<results/>
</query>
I am not exceed request limit 1000\hours. Just try in day 50 times.
"This is a community contributed table and used by multiple people. We mark a table as abusive if it seems to be hogging our resources, or consistently taking more than 30s to execute (this could also be due to a slow downstream source). This particular table seems to be getting marked as abusive more times than others. We also remove our blocks after a while, hence the sporadic working of the table. I would advise that you wait for official tables from Yahoo! Finance if your application needs a stabler data source."
http://developer.yahoo.com/forum/YQL/YQL-The-current-table-39-yahoo-finance-quotes-39-has/1332611837865-68d31e89-80e4-4691-91e6-86f687302ff4

Resources