WooCommerce REST API - GET Orders since Order ID - woocommerce

I'm using the WooCommerce REST API to download Orders into our internal CRM database. We're currently doing this by requesting all Orders between 2 date ranges, e.g.
wp-json/wc/v2/orders?after=2018-05-08T00:00:00Z&before=2018-05-14T23:59:59Z&page=1&orderby=id&order=asc
and this is working well. We were wondering if it's possible to change this to just request all new orders since the last Order ID that we downloaded. For example if the last Order ID we downloaded was 2450 we would like to make a request to get all new Orders after 2450. I've been reading the docs for the parameters to list all Orders but not sure if this is actually possible?

Related

API call is very slow

I have a C# products page which is using Bazaarvoice API for comments, ratings on the Products page. Each product has a comment box and rating which is coming from the API. The Unique memeber ID and the product ID is passed to the API to save the comments. And using the member ID and the product ID to get the result.
The process is working fine but its very slow. For example if i have 200 products and if i open each product detail then a request is made to the bazaarvoice api using Member ID and Product ID and it returns the data which is displayed on the product details page. So for 200 products ,there are 200 api calls are made to the API.
I am thinking to make a single call based on memeberID and product ID and save them somewhere and then each product detail will access the list to get the comments. I am not sure what is the best approach to do it. Should i create a JSON file of all records and then access the relevant record based on the product ID and Memeber ID or should i use the XML to store the data or Cache is an ideal option.
Please any help would be appreaciated.
Thanks

How to retrieve particular product's order using Shopify API

I checked Shopify API(https://docs.shopify.com/api/order#index) but there is no endpoint I found by which we can filter particular product's order list.
Is there anyway to grab specific product's order in Shopify?
Work it the other way around. Download all your orders, then iterate through those looking for the specific product of interest. An Order has many products, and a Product does belong to an Order, but there is no API call that will give you the orders that have any one Product.
You can fetch all orders using the following endpoint :
GET /admin/orders.json
This will return a list of line items with product ids, which should contain the products you are looking for.
One thing to note here is that Shopify might throttle your requests if you keep querying their servers. Make sure you account for that in your code.

How do I link a tracking number to a specific carrier in Bigcommerce?

Through the Bigcommerce API I am trying to upload the carrier along with the tracking number so that the tracking number links to a carriers website. Following the instructions here - Post carrier to Bigcommerce Shipments API - I set the shipping_method to UPS. However, when looking at the shipment information in the Bigcommerce backend, shipping method shows - Other(UPS). Also, the tracking number is not linked to any website.
How do I properly set shipping_method so that it won't be prefixed with Other and the tracking number is linked to that carrier?
This is a limitation of the Shipments API resource. Shipments created via the API always prefix the shipping_methods property with "Other" and do not link the tracking number to the appropriate carrier website. Shipments need to be created via the Control Panel for the tracking number URL to behave as you're describing.
So I did some playing around and it seems that the tracking numbers associated website and the prefix comes from the requested shipping. My first couple of orders were created manually and I did not select a shipping method. However, when I placed an order on the stores frontend and selected a shipping method, shipping_method was then prefixed with the requested carrier. This also happened when I created a manual order in the backend and actually selected a shipping method.
Long story short, it appears to me that the website linked to the tracking number, is associated with the shipping method that the customer selected.

RESTful design - requesting multiple records by passing a list

I am currently writing a RESTful service for a client who wants to pull stock records (free stock quantity) out of there accounts system and display them on the web.
I have the current endpoints :
GET /stockitems - returns free stock for all stock items
GET /stockitems/STOCKCODE - returns a single free stock record for the STOCKCODE
The requirements from the customer states "It will be possible to return the details of specific stock items only by passing in a list of stock codes."
How would I accomplish this in a RESTful way? Is it even possible?
You could call the GET /stockitems and filter accordingly at the consumer.
or
You could call the GET /stockitems/STOCKCODE for each product code.

BigCommerce orders API: paginated retrieval with filtering (modified_date, order status)

Podbox is building a connector using the BigCommerce orders API to synchronize orders from a BigCommerce e-store to cloud CRMs (like vTiger, Salesforce or ZohoCRM). As one of the developers, I found that there are unfortunately a couple of points that prevent the process from being efficient:
it would be great to have a paginated retrieval, with page and limit parameters, as in the customers API. That would reduce the workload for both the BigCommerce server and the client server
both customers and orders API calls return the date modified field and it would be great to use them as filters to retrieve the orders that were updated after a given date. With such criteria, the data returned by the API calls would be small, saving bandwidth and reducing workload for both BigCommerce and client servers too
another optimization would be to use the status id criteria as a filter in order to retrieve only the uncomplete orders, but it seems that this criteria in only usable in the form of "status id equals [value]", I would like to use it in the form "status id differs from 7" (7 being the status id of a complete order) but it does not seem currently feasible to me
Would these feature requests be useful to other developers? Do some BigCommerce developers know whether these feature requests are on the road map? Or if I should propose them somewhere else?
Thanks anyway for your attention!
2 out of 3 request by you has already been implemented by BigCommerce.
page and limit parameters
You can pull modified orders by passing an 'If-Modified-Since' header. This will only return items that have been modified since the provided RFC-2822 date.
No idea about the status code issue, But i found this, I guess setting status_id filter as 0.
Hope this helps.

Resources