How do I use shopify to sell third party product which need to be shown in the customers account page - shopify

Some of the products we sell in our Shopify shop are third party downloads, which we resell.
So when a customer buys such a product in our shop, it activate a webhook once the order is paid. This webhook then order the product from the third party. This third party gives us a download link which we then email to the customer.
This works fine, but we would also like to show the download link at the customers account page, so they can log in, and then re-download any file they have previously bought. And here is the problem: How do we store the download links for each product, in a way we can show at the users account page?
The obvious solution would be to store the unique download link in the orders line_item but that is not supported by shopify(How do I update properties on a shopify line_item).

I'd use a meta field on the order. You could create a set of metafields from the order webhook to handle all the download links and then modify your theme to show them.

Related

How to redirect user back to the Sales Channel once the Shopify Payment is completed?

I have build a Sales Channel for my e-commerce website. The Sales Channel loads shopify products from Shopify stores to my e-commerce website.
Now I want to implement the Buy functionality: the user selects a product in my e-commerce website. I would create a DraftOrder and send the draft order to Shopify, shopify would respond with am invoice-url.
Now I can redirect the user to this invoice-url to make the payment directly through Shopify... but I want to redirect the user back to my e-commerce website, once the payment is completed.
Is it possible to implement this redirect functionality?
Note: I had asked a similar question trying to achieve the same goal using Checkout API.
You cannot do too much on the order status page - the page customer gets in once an order is placed and paid. You can add custom scripts on the shop's checkout settings page: Add Additional Scripts. For example, you can show a message with a link back to your sales channel.
If you're on Shopify Plus you can customize checkout.liquid directly.

How to create an order from sales channel and redirect the user to Shopify store for payment?

I am working on an e-commerce website similar to E-bay or Amazon, where sellers can list their products.
I have also created a Shopify Sales Channel for my e-commerce website, which can import products from Shopify. A Shopify store installs the Sales Channel App and their products will be imported to my e-commerce website.
All of this is working fine... now I want to build the last step, which is buy the product. A buyer comes to my e-commerce website and wants to buy a product which has been imported from certain Shopify store. I want to enable the buyer to create an order from my e-commerce website.
According to Shopify documentation:
By default, your app can provide checkout links to Shopify's web
checkout for each product. This lets your platform use Shopify's web
checkout instead of building your own native checkout form. You can
direct customers to a checkout link by using the web_url parameter of
the Checkout API.
This is what I want... I want to allow a buyer in my e-commerce website to create an order and redirect him to Shopify for payment... buy how can I actually implement this? Would I be able to implement this using Order API? And how could I redirect the user to Shopify store for payment?
If redirecting user to Shopify store for payment is not an option, then do I need to implement the payment process within my e-commerce using the Checkout API? Would anyone be able to give some details about this?
Use DraftOrder API to create an order. Once created it has the invoice_url attribute which can be used to pay and complete that order.

How to verify that guest email is already exist as customer in system on checkout page in Shopify

We need to add feature in Shopify that guest/customer can't purchase the product more then limit defined in product meta field in CMS.
Basically, we have limited edition of product so want that single person [email verification] can purchase 1-2 quantity in life time.
For this we tried following ways:
Webhook: But not able to find solution to show error on checkout page and stop order if we found such condition.
Custom code on template itself: But we are not able to verify email from CMS that its already attached to a customer otherwise we will get all orders of that customers and then products and matched with current cart product and show error message
Don't allow guest checkouts. Force your customers to login with an email. Them you can be certain of not allowing them to checkout with more than the one or two of these products in their lifetime. Otherwise, accept their order and simply cancel/refund the cheaters.

Post an order to Shopify for unknown user

Is there a way to post an order, including payment information and shipping information, to Shopify for a new user?
For example, user ABC wants to purchase a product through my website (that is not a shopify website), and I gather all of the information required to make the purchase, including shipping address, credit card, etc. User ABC is not known to Spotify. Is there a way for me to use the Shopify API to process this transaction, including payment processing and everything else?
Shopify has a sales channel called Buy Button. You can use that for your purpose.
Buy Button
Creating a Buy Botton
Adding a Buy Button

Shopify API - Payments

I have been reviewing the API documentation for Shopify and am trying to figure out if the cost of an item selected from the 'Store' can be passed in a Get command back to a different website so a different website can charge for the Item along with other charges from a website ...and then once the payment goes through on the website, send a POST to shopify that the sale was complete and proceed with fulfilling the order?
Our software is newspaper software so we provide newspapers with subscriber web portals were customers can sign up and pay for a newspaper subscription.
We would like to offer the ability to add Single Sales items to what a customer purchases and we want to be able to do it in one payment transaction
I have reviewed the various Shopify API documentation but it is not clear if the API supports getting cost info and posting a successful charge back to Shopify to complete the fulfillment step. We are looking to be able to GET the cost for a selected single sale item passed to us from the Shopify API so that we can add it to the Amount we pass to the Payment Gateway we integrate with and when the payment goes through, send Shopify a success on the payment.
The ultimate goal is to have a customer make one payment that can include single sales items as well as a newspaper subscription or day pass.
You should do a POST and create an Order using the Shopify API once (at your side) are sure the payment has gone through.