Custom price

cuowee
Shopify Partner
4 0 0

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:

  1. Visit product
  2. Input height
  3. Input length
  4. Query our API with 2,3 and SKU number
  5. API returns the price of the product
  6. Apply the price to the product
  7. Add product to cart with the correct price
  8. Checkout
0 Likes
cuowee
Shopify Partner
4 0 0

Any one that has an idea?

0 Likes
hassain
Shopify Staff (Retired)
Shopify Staff (Retired)
624 103 134

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 

PublicApps
Shopify Partner
75 3 20

@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.

Just trying to help out.
- If my reply was helpful, please Like it or mark it as Accepted Solution to let me know!
- Need store customizations? Then consider Hiring us.
0 Likes
ShaiBracha
Tourist
19 0 2

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