Getting ItemCode in invoice request using XERO API - rest

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.

Related

Magento 2 rest order API show duplicate sku in order item if product is configurable

I am getting Magento 2 order details by rest order API but the result is showing the same SKU in configured product order item that is creating an issue in SAP integration.
Anyone let me know how can we overwrite Magento 2 rest API code?
You should not need to “overwrite magento 2 rest API code” because what you described is perfectly normal and expected.
In Magento orders, each configurable product creates two sales order line items due to the way that configurable product data is structured in the catalog. One line corresponds to the “parent” catalog product, and one corresponds to the specific variant “child” (simple) product. Both records contain the same SKU value but their product IDs are different.
In order to get all information about the ordered item both of those records could be important, however if you can get by with just the data from the simple product then you could filter your REST request like below:
GET <host>/rest/V1/orders/items?
searchCriteria[filter_groups][0][filters][0][field]=order_id&
searchCriteria[filter_groups][0][filters][0][value]=1&
searchCriteria[filter_groups][1][filters][0][field]=product_type&
searchCriteria[filter_groups][1][filters][0][value]=simple

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

woocommerce customer Fetch with time filter

I am requesting customer data using Rest Api of woocommerce. Woocommerce api documentation says
"All endpoints (except for customer orders) support date filtering via created_at_min and created_at_max as ?filter[] parameters. e.g. ?filter[created_at_min]=2013-12-01".
However, when I am giving date filter in request URL it results in blank response!!
My question is,can the customer data be fetched via date filter in woocommerce.
Thanks.
You can pass Filter with time in REST API of WooCommerce.
Just pass the filter in H:i:s format.
Note : while trying to generate the signature, I found, the URL encoding needs to be done twice because of extra space between DateTime filter criteria. Just encode the clean text once to get RFC3986 encoding, and do it again to generate the signature. Pass the first encoded string and append the generated signature. I saw the filter to be working.

Regarding line item display at PayPal site

We are currently looking at displaying the order level line items – Order Total, Item Total, Total Shipping, Total Tax (which are still passed as part of PaymentDetails).
For the above requirement we are passing all the required details in the SetExpressCheckoutReq.
Please let me know how can we achieve it.
As part of SetExpressCheckoutReq we are passing:
<ebl:PaymentDetails>
<ebl:OrderTotal currencyID="USD">359.94</ebl:OrderTotal>
<ebl:ItemTotal currencyID="USD">309.99</ebl:ItemTotal>
<ebl:ShippingTotal currencyID="USD">49.95</ebl:ShippingTotal>
<ebl:TaxTotal currencyID="USD">0.0</ebl:TaxTotal>
<ebl:OrderDescription>Order Total: 359.94</ebl:OrderDescription>
<ebl:PaymentAction>Order</ebl:PaymentAction>
</ebl:PaymentDetails>
2014-08-05T18:04:20Z
Success
aab008f9d690d
98.0
12194268
EC-4KY406765L816782W
You need to include the node, one for each item. Inside that are child elements for the item details like name, price, qty, etc. which you'll find in the PaymentDetailsItem Type Fields section of the SetExpressCheckout API reference.
Also, keep in mind that you'll need to include the same details in your DoExpressCheckoutPayment request in order for the line item details to show up in the final transaction details at PayPal.

Getting multiple invoices from intuit anywhere api at once

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>