Solved

ShopifyAPI: How to add a customer id while creating an order through admin api?

mukeshgmon
Tourist
6 0 1

I found that you can create an order through admin api but I couldn't find how we can add a customer in the api parameters. 

Accepted Solution (1)

Shabalinski___A
Shopify Partner
21 4 2

This is an accepted solution.

Hi, @mukeshgmon!

See the examples section here: Shopify AdminAPI docs
Check this 2 points:

  • Create a pending order with an existing customer
  • Create a partially paid order with a new customer and addresses (here you can pass 'financial_status': pending)

 

If you have an existing Customer, just pass their 'id' in the order creation parameters.

If not, you first need to create a new Customer, get a response from AdminAPI with that Customer's data, and then create an order with that data.

I hope my explanations will help you, if not, please describe the problem in more detail, with code examples.

Have a nice day! 😉

 

 

Frontend (Shopify) Engineer at SpiralScout

  • - Was my reply helpful? Click Like to let me know!
  • - Was your question answered? Mark it as an Accepted Solution!

View solution in original post

Replies 2 (2)

Shabalinski___A
Shopify Partner
21 4 2

This is an accepted solution.

Hi, @mukeshgmon!

See the examples section here: Shopify AdminAPI docs
Check this 2 points:

  • Create a pending order with an existing customer
  • Create a partially paid order with a new customer and addresses (here you can pass 'financial_status': pending)

 

If you have an existing Customer, just pass their 'id' in the order creation parameters.

If not, you first need to create a new Customer, get a response from AdminAPI with that Customer's data, and then create an order with that data.

I hope my explanations will help you, if not, please describe the problem in more detail, with code examples.

Have a nice day! 😉

 

 

Frontend (Shopify) Engineer at SpiralScout

  • - Was my reply helpful? Click Like to let me know!
  • - Was your question answered? Mark it as an Accepted Solution!
mukeshgmon
Tourist
6 0 1

this worked beautifully. Thank you!