Hi if i wanna set a custom price for a product through a third party api, how can i achieve this?
The flow should be as below:
Hi @cuowee ,
There is no way to set a custom price for a product that will only be present for that one customer's checkout. If you update the price of a product, all customers on your store will now see that new price of the product.
You would probably need to utilize Product Variants here (https://shopify.dev/docs/admin-api/rest/reference/products/product-variant). One solution would be that when the customer enters the height and width, your app can create a brand new product variant for that customer (POST {store-name}.myshopify.com/admin/api/2020-04/products/{product-id}/variants.json) with the appropriate price. Now that the new product variant has been created with the right price, you can add it to the customer's cart so they can purchase it.
Alternatively, you can create all the Product Variants for every combination of product, length, height, and price ahead of time. That way when the customer enters these details, instead of creating a new Product Variant on the fly you can simply retrieve the appropriate already created variant.
Hassain | Developer Support Specialist @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Click Accept as Solution
@hassain I have a merchant who does flash sales. Have you seen any solutions that work under high loads (so not hitting admin API limits and no product variant limit). Thanks in advance. Regards.
Hey !
Just saw this post - we had the same exact issue so we built an app that does this for you - Custom Price Calculator. You can learn more about it here: https://apps.shopify.com/custom-price-calculator
We allow you to built any calculator allowing your customers to insert inputs and you can calculate the price dynamically.
Please feel free to reach out to us at support@apippa.com if you have any questions!
Thanks
User | Count |
---|---|
13 | |
12 | |
10 | |
8 | |
7 |