Getting multiple invoices from intuit anywhere api at once - intuit-partner-platform

When I update an invoice in QB (after its been changed in my system), I want to avoid updating anything that the user has modified in QB. My plan was to use the filter API method and filter by Ids to get the list of invoices from QB that my app created. However, it doesn't look like InvoiceFilter accepts ListIdSet. It does have a TransactionIdSet, but I can't find a way to get ahold of that number (i.e., the TransactionId) via Data Services. It's certainly not in the response when invoices are read. So, how do I query for a specific set of invoices via the API?

The transaction id refers to the id of the invoice here.
For eg, the following invoice query will retrieve the invoice with Id 4 -
<InvoiceQuery xmlns="http://www.intuit.com/sb/cdm/v2">
<TransactionIdSet>
<Id idDomain="QB">4</Id>
</TransactionIdSet>
</InvoiceQuery>

Related

Getting ItemCode in invoice request using XERO API

I am targeting the https://api.xero.com/api.xro/2.0/Invoices endpoint, specifying either no invoice or a specific invoice. In both cases I am not receiving the ItemCode, DiscountRate and DiscountAmount components of the LineItems array.
Is there a query string item that will force the missing components to appear? These "Elements for LineItems" components are supposed to be there, assuming I've read the documentation correctly.

Get specific product with id via Rest API Magento 2

I want to get the information from an specific product.
I am using this reference in this moment, and get all the products in given searchCriteria:
http://www.mysite.co/rest/V1/products-render-info?storeId=1&currencyCode=cop
Is there a way I can send the product id in the url and get only all its information?
You can add the filter
http://www.mysite.co/rest/V1/products?searchCriteria[filterGroups][0][filters][0][field]=entity_id&searchCriteria[filterGroups][0][filters][0][value]=1&searchCriteria[filterGroups][0][filters][0][condition_type]=eq
use field entity_id instead of id, value is product id here 1, condition_type is equal to here eq.
You can fetch product info by SKU, not ID.
API endpoint (get method) will pull product info. vendor/magento/module-catalog/etc/webapi.xml
/V1/products/:sku
So, your rest API calling URL should be like this
http://www.mysite.co/rest/V1/products/productsku
Note: If you want to fetch product info by id, you probably need to create a simple rest API. you can check this out.
https://magento.stackexchange.com/questions/282480/i-am-new-here-i-want-to-know-how-can-i-create-my-own-simple-api/282730

why is it that WooCommerce REST API returns total orders 0 for a customer but has 1 order for that customer in order table?

I am working on WooCommerce REST API. I am fetching customers and orders. I want to know how WooCommerce calcluates total number of orders as for some customers it is returning less results than the record found in orders table. Is there any issue with API?
here is the customer table result: Customer Table
here is the order table
Orders Table. Sorry stack overflow only allows me to add links of the images.
BTW you can clearly see that customer has one order but in customer table, it shows 0 orders, this data is returned by woocommerce rest api, so there is no chance of error from me. I can't add full image of DB due to some privacy issue and company rules.

how to get specific property name via rest call in strongloop loopback

I am having students model in loopback which is accessible via rest using this url. /api/students rest call gives all the student data but I want to get only the registration numbers (regno) of students. Like in sql (SELECT regno FROM students). how I should filter the above rest call to get only the registration numbers of students.
?filter={"fields":"regno"}
If you want to get multiple columns
?filter={"fields":["regno","column2","column3",....]}
Use the fields filter.
?filter[fields][regno]=true
https://docs.strongloop.com/display/public/LB/Fields+filter

Need list of cancelled/voided/deleted transactions

I have an ETL set up to pull SalesReceipts, Invoices, and CreditMemos into our own data warehouse. However, if a transaction in the past has been voided/deleted this will cause our numbers to be off. I have not found a way to get a list of invalidated transactions and I'd prefer not to have to pull all transactions for all time for each invocation of the ETL.
More details:
Our data is in QBO and I am using the Java API provided by Intuit.
I have reviewed the API (both the online endpoint API as well as the Java API) and I have not found much to work with.
Here is an example of a query for Invoice data:
<page loop>
{
Invoice invoice = GenerateQuery.createQueryEntity(Invoice.class);
String query = select($(invoice)).skip(page * PAGE_SIZE).take(PAGE_SIZE).generate();
QueryResult result = dataService.executeQuery(query);
for (IEntity entity : result.getEntities())
{
Transaction t = (Transaction) entity;
System.out.println(t.getStatus());
}
}
However I never encounter any of our cancelled/voided/deleted transactions with this query and the transaction status may not be used in the where filter.
EDIT #2
I believe I have found what I need in the Change Data Capture service.
https://developer.intuit.com/docs/0025_quickbooksapi/0050_data_services/020_key_concepts/00600_changedata_operation
Some code:
List<IEntity> entities = new ArrayList();
entities.add(new SalesReceipt());
entities.add(new Invoice());
entities.add(new CreditMemo());
List<CDCQueryResult> cresult = dataService.executeCDCQuery(entities, "2011-12-01T00:00:00Z");
...
This will return all transactions that have changed (modified, added, deleted) since the date specified, though what's VERY odd to me is that if I use the date string "2011-12-01T0:0:0Z" I get only transactions with the DELETED state.
For reference:
"2011-12-01T00:00:00Z": all added, modified, deleted transactions.
"2011-12-01T0:0:0Z": only deleted transactions.
Thanks
Preston,
If you are using QuickBooks Desktop you need to use the QBXML SDK v13 to access transactions, if you are using QuickBooks Online you can use QBO v3 REST API.
QBO:
https://developer.intuit.com/docs/0025_quickbooksapi/0050_data_services
QBD:
https://developer.intuit.com/docs/0250_qb
regards,
Jarred