I am fairly new to the shopify experience, so bare with me if this question is stupid. Basically, my company is looking to adopt shopify for its ecommerce platform and I have been doing an investigation of it's processes. So far, so good. There is one aspect I have not been able to figure out however:
I am creating an order object, and saving an existing customer to it:
# query the customer customer = ShopifyAPI::Customer.search(query: "email:firstname.lastname@example.org").first # Find product product = ShopifyAPI::Product.where(title: 'cool title').first # Create new order order = ShopifyAPI::Order.new( :line_items => [ ShopifyAPI::LineItem.new( :quantity => 1, :variant_id => product.variants.first.id ) ], :customer => customer )
The order object is created successfully, webhooks working correctly indicating the order is placed. I receive the email saying the order has been placed - BUT i haven't entered any credit card/payment information. The order is marked as 'unfulfilled' in the admin dashboard. I had assumed the email I received would ask me to enter payment information, but it didn't.
Where/how does that happen?
Solved! Go to the solution
This is an accepted solution.
Creating an order is exactly as it reads, simply creating the order vs. a checkout. If you are using Shopify online store channel you would have the orders created automatically for you into the admin. If you needed to upload historical orders for example, you can use the Order API to do so.
If you are looking to build a headless website or process payments through the API you need to look at our Storefront APIs: https://shopify.dev/docs/storefront-api
This is also noted at the top of the Order API docs for reference:
Vix | Developer Support @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Click Accept as Solution