Have your say in Community Polls: What was/is your greatest motivation to start your own business?
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Order API - Confirmation Email

Order API - Confirmation Email

jtharris-dev
Shopify Partner
3 0 0

Is there a way to determine if a confirmation email has been sent, and if not, send the order confirmation? We are using an app which creates draft orders. Unfortunately some of the confirmation emails are not being sent. Shopify is working with the app developer to help correct the issue, but in the meantime, I would love to build a process that looks to see if an order confirmation has not been sent, and if not, send the order confirmation. I don't see anything in the Order API that would allow me to see if an order confirmation has been sent, nor do I see anything that would allow me to send an order confirmation, but I may have missed it... Is this possible via API? Thanks!

Reply 1 (1)

Luke_K
Shopify Staff
402 66 102

Hey @jtharris-dev 

Thanks for getting in touch! In REST API There's the boolean send_receipt that can be specified in the body of the request when creating an order. If set true, an order confirmation will be sent to the customer (send_receipt docs). You may wish to check out notify_customer on the fulfillments endpoint too in REST(docs). Yet I don't see a way to Read these values in REST for what it's worth and I don't see them present in the corresponding orders/create and fulfillment/create hooks.

That said, CanNotifyCustomer is present on Order object in the GQL Admin API here and it can be read. 

You may wish to use REST Admin API to set the send_receipt value and use the GraphQL Admin API to read via CanNotifyCustomer as testing this today,  when setting send_receipt === true in REST, it means  CanNotifyCustomer === true in GraphQL. Hope that helps!

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