get pending orders price using Amazon MWS API - api

I am trying to process the orders from certain Amazon store. But was faced with a problem:
I can not get total price (or total amount) for orders with 'Pending' status. This field is empty. This info can not be retrieved even via OrderItems.
Amazon API docs says:
Note: When an order is in the Pending state (the order has been placed but payment has not been authorized), the ListOrderItems operation does not return information about pricing, taxes, shipping charges, gift wrapping, or promotions for the order items in the order. After an order leaves the Pending state (this occurs when payment has been authorized) and enters the Unshipped, Partially Shipped, or Shipped state, the ListOrderItems operation returns information about pricing, taxes, shipping charges, gift wrapping, and promotions for the order items in the order.
But I really need it. In addition I saw some apps, which can 'see' OrderAmount for pending orders.
Maybe anyone have already resolved this question? Any help is highly appreciated.
Thanks.

I use the SellerSKU along with a Amazon price stored in my database to calculate the order value. It is an estimate, though, since the price may have been updated recently (and the order might not reflect the new price) and I cannot calculate the shipping price - neither the price nor the address is known for pending orders.
At least in my usage, I don't see a reason for trying to get the exact amount before the order actually leaves the Pending state. Quantities and SKUs are known, so you can reserve stock accordingly which is the only task I actually need to know pending orders for.

Related

Can we increase shipping rates in shopify using shopify script?

I found similar question in the forum, and from this answer I come to know about Career service. Which looks promising initially, but after reading the doc from here, I found that there is an issue for my use case.
This is my use case:
There will be multiple items in the cart with different delivery dates set(I store delivery dates in the line_item property)
now when user go to checkout the shipping rate has to be calculated based on the delivery dates(which are stored in the line item property for each line item)
shipping price should be calculated like ...... if there is only one delivery day, we need to offer x price, if there are two different delivery dates we need to offer 2x price and so on....
so the issue is, Carrier Service uses Server side cashing and it will only ask for price if any of these(variant IDs, default shipping box weight and dimensions, variant quantities, carrier service ID, origin address, destination address, item weights and signatures) field change. It doesn't include line item properties(where I have stored delivery dates).
I have also checked the shopify scripts from here, but after some mockups I come to know that we can only provide discount to the existing shipping rates and can not add new shipping method, or increase shipping price for existing shipping method.
Please help me to find a solution for this problem.

Shopify API get Total Returns/Refunds

I am trying to get the Net Sales of orders of our Shopify store on daily basis. I can do it with the Orders API, but there seems to be a mismatch for the refunds returned by the API and the refunds/returns that show up in the dashboard.
In fact, the API doesnt show any refunds for the orders at all but there does seem to be some amount deducted from the Total Sales of Orders which make the actual Net Sales for that particular day.
I can retrieve the orders for one day by this example URL. I iterate through all the orders and add up each Order's amount which gives an exact number of Total Sales which match up to the number in the dashboard. But this Total Sales value doesnt take into account the refunds/returns.
/admin/api/2021-07/orders.json?status=any&created_at_min=2021-08-17T00:00:00-04:00&created_at_max=2021-08-18T00:00:00-04:00&limit=250
There is a refunds in the returned json for each order as well in the above call but that is empty for all the objects.
I have explicitly tried to retrieve the refunds as well by following API call but it also returns empty for all the orders.
/admin/api/2021-07/orders/{order_id}/refunds.json
You may have a look at the Dashboard Sales image for one day. Please note in this image, I can get the exact value for Total Orders from the API but can not retrieve a single refund/return for any of the order.
Would you be having an idea what are these Refunds/Returns shown in the Dashboard? If so, is there a way how can I accurately calculate the Refunds/Returns by the API as well, so I can accurately calculate the Total Sales for one day?
You should be working with Transactions. Specifically, the refund transactions. An Order has many transactions. So given some order, you can get at the interesting transactions, and calculate your important values, like Net. I have aced this for many clients, as Shopify does not report this type of value very well. So I generate reports with Net, refunds, taxes, etc, providing much clearer guidance than the standard Shopify reports.

Does transaction locks the row to prevent the data inconsistancy

I am new to MSSQL and creating a website where Customers can place orders.
Each order may have multiple items with any number of quantity.
I am interested in before saving my order to check if the desired quantity is available for each item, if yes then I will place the order and update the items inventory, otherwise I want to rollback.
But at the same time I want that any other order should wait till first transaction is finished. So that up updates don't overwrite the changes and produce inconsistency.
If each order is processed within a transaction, is it enough or do I have to consider something else too?
If you go on any Online retail website, you will notice that you go through the shop, buying stuff (not actually buying but being added to a basket) and once you have completed your shopping you go to Checkout that is, where you are asked to provide payment details etc.
So the idea is, the website shows everything (that has at least 1 stock item) to every customer, At this point no item inventory is being updated or inserted, at the checkout stage a complete order is compiled and submitted to system, (at this stage you will do the actual updates/inserts to item stock inventory) now how you want to handle the orders is entirely up to you.
Do you want to rollback entire order when any one item has less stock than
the quantity ordered?
Do you want to commit all order lines and only rollback those order lines where the items has less stock than quantity ordered?
Or do you want to place a provisional
order regardless of the stock availability and manipulate the delivery date?
Depending on what path you chose to go with (this should be a business decision a developer shouldn't be making these decisions) there is a lot of flexibility, but one thing you never do is as soon as someone has select to buy an item, you update the inventory. All this should be done right in the end of the Purchase process and all should be done at Once.

First Expiry First out in OpenERP

I wanted to bring batch number selection to be in sales module and to enforce any sales done according to the expire date associated to product automatically. The idea is a user select product and quantity to sale, and the system expected to do selection from the right batch, if there is no enough stock available it must does splitting
So far what I managed to do:
Product are sorted by expired date and it automatically selects a product with recent expiry date without any user intervention and notify if not enough stock available
Creates delivery slip to warehouse and sales invoice to finance with that batch number from sales order
However, I am facing these problems
If current stock quantity of specific product in batch is not enough it should go to second batch and creates to sales order line somehow similar to splitting mechanism exist in warehouse.
confirmed sales orders doesn't deduct sold product stock quantity from warehouse

Is it possible to show the number of pre-orders on the product page?

My primary business is pre-orders, and this is how it works:
I list an item for sale.
My customers order the item. Their credit card is authorized but not charged.
Once a minimum number of orders are placed, the customers are charged, and the buy is live.
If, after a specified amount of time, the minimum is not reached, all orders are cancelled.
What i would like to do is this:
Specify the minimum number of orders needed for a particular item in the backend. (not 100% needed, but it would be nice).
Display the total number of pre-orders on the product page, so that my customers know how many are left before the buy is live (it would be great to show it in the following format: 23/50 Ordered).
Does anyone know if this is possible? If so, can you please explain to me what I need to do in order to make this happen?
Thanks!
P.S. - In case it doesn't show up, I'm using Bigcommerce
Store the minimum needed as a custom field & set the initial inventory to that same number. You'll also need to allow inventory to be displayed for pre-orders, though you can hide it from display if you'd like (we only want it present in the DOM).
As the products are pre-ordered, inventory will decrement. Use javascript to subtract the number left in inventory from the original number (the custom field) and display in the ProductDetails.html panel.