Shopify - inventory_quantity deprecation notification - shopify

I am using Shopify Admin REST API for item and inventory sync and I am not sending inventory_quantity field in variants API, but I received following email from Shopify few days ago. I am also sending correct location_id when creating fulfillment and it is created successfully in Shopify.
The location_id field is now required when creating fulfillment and
refund requests.
Inventory_quantity and inventory_quantity_adjustment
can no longer be set on the product variant.
Deprecated in 2019-10 and support will be removed on July 1, 2020
I wanted to know if the email above is a generic email sent by Shopify to all developers? or am I doing something wrong here?

Ignore it if you're sure that you don't use these deprecated attributes anymore. I think they recently introduced this notification system which sends warnings to developers if they detected any deprecated calls in the past. They just alert you, they don't scan your app code so they don't know whether you fixed the issue or not. I was getting similar warnings despite that I was sure that the issue had been fixed earlier.
Anyway, to get peace of mind, go to the Apps area in your Shopify Partners account. The table that lists all your apps has now the API health column showing the status of your apps in terms of deprecated calls. You will see a warning (orange dot) if they detected any deprecated calls in the past 30 days. The warning is provided with some additional information like the last time the issue was detected and the deadline to fix it to, example. You can get more details about the deprecation by clicking on to the warning.
If it's a private app, just check your code again for using the deprecated attributes mentioned in the email.

You will want to check the new Inventory Level and Inventory Item endpoints in the Rest API. With a variant's inventory_item_id and a location ID, you can update inventory.
Clearly you can no longer just set a variant's inventory level. That went the way of the DODO this year.

Related

Payments through PayPal with ASP.NET CORE 3

I am trying to run payments through PayPal in sandbox mode with my .NET CORE 3 project.
The idea is to give the customer ability to choose whether to pay using his/her PayPal account or Credit Card.
I am using the PayPal-NET-SDK v2.0.0-rc2
I am trying to understand whether this is the right order to run things:
Create Payment using PaymentCreateRequest
At this point, I get the approval_url. I redirect the customer and approve the payment/order using Credit Card
Execute payment using PaymentExecuteRequest, using the PAYID and PAYERID I get from the redirect URL. Here I get an order object
Authorize order using OrderAuthorizeRequest with the order id (setting body to a PayPal.v1.Orders.Capture object)
Capture order using OrderCaptureRequest with the order id (setting body to a
PayPal.v1.Payments.Capture object)
Is that a correct execution order?
Rather than the old v1/payments, you should use v2/orders; the v2 SDK can be downloaded here
Rather than an old-style full page redirect to an approval_url , it's much nicer to use the new checkout's in-context UI that keeps your site loaded in the background. Here is a demo pattern. Another benefit is that it gives an embedded/in-line credit card form.
As a finishing touch once you have everything working, don't neglect to
gracefully handle/propagate funding failures back from your server,
so the buyer can choose something else when declined.
If you start out with intent=capture(v2) or sale(v1), the capture(v2)/execution(v1) call will be final and complete the transaction, there will be no authorize step, so (4) on your list is skipable. (You should only bother with implementing something other than intent=capture/sale if you find you have a specific business need for delaying captures, as it adds complexity)
More general information on implementing the server-side portion of the integration: https://developer.paypal.com/docs/checkout/reference/server-integration/set-up-transaction/

How do I access Shopify data without advanced account?

All I'm wanting to do is track sales of certain products from a certain date. My company is wanting to add a banner to track sales goals for raising money for charities. So basically, we'd tag a few products as being part of that goal, set a goal, and then need to update the goal progress by a certain amount every time a sale is made on one of those products. As far as I can tell, without access to Shopify's analytics API, this is not possible. How can I do this?
What you want to build is perfectly possible. However, you need to generate Private App Credentials, so you can use Shopify API. It doesn't matter if you have an account by yourself, someone else can follow these steps and send you the credentials your way.
If you don't actually need to modify anything through the API, you could have them set a webhook (Settings -> Notifications -> Webhook) on Order Creation (or similar) that posts to your server and you can check what product got sold and see if it has got the tag.
The "easy" way to do this is to create an app that receives order webhooks and can check on tagged products and keep a sum of target items sold.
Then the app should have use a script tag to insert a simple script with the current value into the web page at a configured place by css selector
OR the app could update one or more snippet files that you could include until the promo is done.
I'd tend to go with the script tag option since that's a bit more flexible and you should be able to change your theme when the promo is over to report results without having to touch the app again.

Purchase simulation dialog does not show up (CurrentAppSimulator.RequestProductPurchaseAsync)

I was developing an app for Windows 8. After a while I updated the project to Windows 8.1 and I got a warning, that the method CurrentAppSimulator.RequestProductPurchaseAsync(String, Boolean) from the CurrentAppSimulator class is deprecated. So I started using CurrentAppSimulator.RequestProductPurchaseAsync(String) version of it, and for some reason the purchase simulation dialog does not show up at all. Here is a dialog I was getting using deprecated version of the method.
I never needed the WindowsStoreProxy.xml before, but just in case I checked it and set the IsTrial property to false - however, the dialog does not show up, and the answer of the new method CurrentAppSimulator.RequestProductPurchaseAsync(String) always returns ProductPurchaseStatus::NotPurchased.
Maybe someone knows where is the problem?
The NotPurchased is returned, because the file WindowsStoreProxy.xml that is used by CurrentAppSimulator does not contain the requested product. You need to fill WindowsStoreProxy.xml with all the products you are providing to the app user. Here are some examples, written by Microsoft.
WindowsStoreProxy.xml is created on the first launch of the app in this location:
C:\Users\<username>\AppData\Local\Packages\<app package folder>\LocalState\Microsoft\Windows Store\ApiData\WindowsStoreProxy.xml
Also, after every CurrentAppSimulator.RequestProductPurchaseAsync(String) call, when result is ProductPurchaseStatus.Succeeded you need to do two things:
Grant user the product (e.g. purchased item)
Inform Store, that the product fulfillment is completed successfuly - using method CurrentApp.ReportConsumableFulfillmentAsync(String, Guid). Make sure, that the FulfillmentResult that is returned afterwards is FulfillmentResult::Succeeded
After these steps your item should be successfully purchased and fulfilled.
Check out detailed explanation: Enable consumable in-app product purchases.
And if you need more clarification of what each FulfillmentResult means for the purchase, you can look up a really good explanation in the book "Universal Windows Apps with XAML and C# Unleashed" by Adam Nathan, that I found while googling these things.

Test multiple-product purchase with sandbox PayPal

I have a webshop and im almost there, but I have a number of items for purchase which are downloadable content. I fixed so when a user has paid they are redirected to my pdt.php where they get a receipt, Now I written code for also displaying content if the item-id are == something. Now I wanna make a sandbox/test-purchase of all products that are downloadable ontent which are 28. I can create 28 buttons and have the id 1-28 but that seems stupid. How can I do this easier?
Check out the cart upload command method of sending transaction data to PayPal. It's similar to standard buttons except that you'll include all items in a single form.
Alternatively, if you're familiar with web service API's I'd recommend using the Express Checkout API. This gives you more freedom over your checkout and provides more advanced features as well.

Easiest way to sell stuff and track inventory

on my website I sell unique items. I have programmed it so that on the selling page, users can select any amount of these items, and it calculates the cost. The key is that I only have 1 of each of these items. So I need the shopping cart system to not allow the payment to go through unless it is available.
I've been searching for a good quick/easy/cheap solution and can't find one. I don't expect this site to make a lot of money (the transactions are a few bucks), so I didn't want to need a ssl certificate.
The only way I know of not needing an ssl certificate would be to use paypal or google checkout. However, I do not think there is a way of using these services and making paypal's server run a script to check how many are available on the site. Any solution?
Thanks
I was thinking about it more, and I think the problem is that once the user gets to the paypal payment screen, I have no control. I guess I could do something like they click the buy it now link, a php script updates it to sold, then they go to the paypal screen, but then they might not continue the purchase...
If you use PayPal Website Payments Standard (using a cart rather than 'Buy Now' Buttons) then you could use IPN or PDT (see the paypal docs here) to get PayPal to call back to you with the status of the payment.
The work flow would then be to set status to reserved when the item is added to the cart, and then wait for the IPN/PDT call to come back with the payment status, and mark the item as sold.
You would still need to check and reset to available any item that had been reserved for longer than say 2 Hours. (You could do this before serving a page to a user so that they have the latest availability and you don't need a cron job or long running process)
If you could provide a little more information about how you have implemented ur shopping card, it would have been more easier for other to assist! If you are using any ecommerce solution then it should be there already in the track inventory section. But Provided that you have implemented d shopping cart manually, why don't you add little bit of codes that checks the inventory status first before letting your customers check out?