API to create invoice

API to create invoice

Harshita
Tourist
7 0 1

Hello All,

As I go through the Documentation of Orders API, on that I only found the API for invoice in Draft Order.

But I want the API which create invoice for the customer from orders not from the Draft order. Is there any way to create invoice of customers order without including any draft order process.

Any suggestion regarding this is very helpful.

Thank You

Replies 5 (5)

Josh
Shopify Staff
1134 84 234

Hi Harshita, 

The intent of Draft Orders is ultimately to send an invoice/order to a customer that turns into a real order after payment is made. That isn't normally what the Order API is used for. 

If you wanted to use the Order API for invoicing, you'd have to send your own invoice to a customer outside of Shopify, and then once they've accepted it you could use the Order API to create your own order after the fact.

If you want Shopify to be handling your invoicing process for you though, you'd want to use the Draft Order API.

Josh | Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

Harshita
Tourist
7 0 1

Thanks for response,

I want to integrate the API related to order processing for which I have the  done the following :-

1)Integrate the API for new order which is process.

/admin/orders.json?financial_status=pending&fulfillment_status=null

2)Integrate the API related to payment of that new order for that we use Transaction API

POST /admin/orders/#{order_id}/transactions.json

3)For generating the invoice of particular order we use API of invoice from Draft order.

POST /admin/draft_orders/#{draft_order_id}/send_invoice.json[Here for generate the api for invoice, first we have to create a draft order for that? Because in API of send invoice the draft_oreder_id must be needed and it should me come when new draft order created

4)For fulfillment of particular order 

/admin/orders/#{order_id}/fulfillments/#{fulfillment_id}/complete.json

Here, what is the difference between create a fulfillment and complete a fulfillment API.

5)When order has been fulfilled and paid then the last process is to archive the order for that API should be:-

POST /admin/orders/#{order_id}/close.json

a)For generate the shipping label and manifest I don't found any type of API.

b)The API which I define above according to the Order Processing, correct me if I am wrong and give me suggestions with the correct API.

c)And also if I miss any of the process between the above mention process, please let me know the process.

d)And also clear my doubt as you define in your last reply that "The intent of Draft Orders is ultimately to send an invoice/order to a customer that turns into a real order after payment is made" that means for generate an invoice its not compulsory to create a draft order. only with the help of draft order we create invoice of that particular order.

Please give the suggestion for all a, b, c, d. Any suggestion regarding this is very helpful. 🙂

Thank you 

Harshita

 

 

garyrgilbert
Shopify Partner
414 41 170

Hi There,

 

I know this question is old and you have probably moved on by now. But I had a similar requirement and found the solution in the current graphql api.

use the following mutation to send the order invoice to the customer.

mutation OrderInvoiceSend($orderId: ID!, $email: EmailInput) {
  orderInvoiceSend(id: $orderId, email: $email) {
    order {
      id
    }
    userErrors {
      message
    }
  }
}

 

{
  "orderId": "gid://shopify/Order/[orderid]",
  "email": {
    "from": "[valid shop email address]",
    "to":"[order email address]"
  }
}

 

This will send the default order invoice email defined in the settings>notifications>order invoice

 

Cheers,

 

Gary 

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

Harshita
Tourist
7 0 1

Please anybody give response on my post.

Robert20
Tourist
25 0 1

Hi there,

I think we can help you solve this problem.

We are running the Printout Designer app that allows you to create and design custom invoice, packing slip and label templates using our simple Drag & Drop Interface.
With Printout Designer it is also possible to e-mail and print the receipts automatically when the order is placed in Shopify.

The app of course has many other perks as well. You can check it out here: https://apps.shopify.com/printout-designer


If you have any questions please let me know

Hope it helps,
Robert from Printout Designer