Detect if the user is a new customer or an old one in shopify additional scripts - shopify

I am developing an affiliate pixel script to put in the additional scripts sections of a Shopify shop.
I should calculate the commission to be given to the affiliate based on the state of the customer. I will give the affiliate different commission if the customer is new or old.
Is that a way to detect if the customer is a new or an old one in the additional scripts sections of Shopify even if the customer is not signed in?

Related

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.

Copy shopify products, customers and orders using api

I have to clone shopify products, customers and orders from one store to another using API. I am able to do this successfully for products and customers. For creating relationship between source and destinatio store products I have used handlers.
Customers are linked based on customer email.
But order feed has customer and product Id of source store. My new store has own product Id and i don't know how to relate new products. Also I need to check if this order has been imported or not. I am not able to find anything with which I can work.
Because token, cart token, checkout token and order number changed for each store. Can someone help me in resolving this.
Thanks

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

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.

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.

Can shopify ScriptTag do that?

I considering integrating Shopify platform with third party loyalty/rewards provider.
For that I need to be able to allow customer to redeem his points at the moment of purchase.
This will involve adding extra control to Shopping cart, such as button [Redeem your points]
Can I use ScriptTag injection to:
Access information about currently logged on customer (customer email) ?
Modify current shopping cart total and have customer to pay less than total (let him apply loyalty points)?
Arbitrarily modifying the cost of a cart/order is not possible. Based on this restriction, I do not recommend trying to integrate/implement points card functionality.