Automate Invoice Generation via Flow

Modified on Tue, 8 Jul at 6:57 PM



CONTENT


Automatically Generate Invoices


Automatically send the invoice via email


Accessing the Invoice in Shopify


How to save the invoice to the customer Account?





Automatically Generate Invoices


How does it work?


When a new order is placed, the configured flow is triggered automatically, and an invoice is generated through the billing integration.


xConnector Settings


  • In xConnector > Profile > Preferences > Automation > Default billing connector, select the default connector you want to use for automatic invoice generation


Example: 





If you have activated—or want to activate—the company details lookup feature for billing (B2B - using the company billing details for the invoice), configure the following settings:


  • xConnector > Profile > Preferences > Content helpers: enable Search for company details
  • xConnector > Profile > Preferences > Default values > check the option Use the billing address for invoice
  • xConnector > Profile > Preferences > Default values > check the option Don't create invoice if company not found




As a result:


  • B2C* - The invoice will be issued to an individual by default 


  • B2B**- If a valid VAT ID (CUI) is entered in the Company Name field during checkout, xConnector will recognize the company’s details based on the VAT ID, and the invoice will be issued to the legal entity 


  • B2B** - If an invalid VAT ID is entered in the Company Name field, xConnector will not recognize the company’s details, and the invoice will not be issued at all (you will need to verify the entered information) 





*   B2C - business to consumer (PF, persoana fizica)
** B2B-  business to business (PJ, persoana juridica) it works only  for the registry of legal entities in Romania





Shopify Settings



Case 1: Generate invoice for all incoming orders


Import and enable the attached workflow to automatically generate an invoice when an order is placed.

➡️ Click here to download the flow





Test the flow


Place a test order on your website, wait 3 minutes and than verify in xConnector platform if the invoice is generated. 




Case 2: Generate invoice just for the digital products

coming soon



Automatically send the invoice via email


How does it work?

There are two ways to send the invoice via email, depending on whether a shipping label is generated:



A. If a shipping label is generated through xConnector


The invoice can be sent through Shopify as part of the Shipping confirmation email, which already contains the tracking number. In this case, a download link for the invoice can be added, allowing the customer to receive both the tracking information and the invoice link in the same email.



B. If no shipping label is generated through xConnector


The invoice can be sent directly via the billing service used to issue the invoice.



See the settings for each case below:



Settings


A. If a shipping label is generated through xConnectorhow to email the invoice when you generate also shipping labels through xConnector


Go to xConnector > Profile > Preferences > Default values > check the option Send Shopify notification 


Test the invoice sending process for method A

- the flow automatically generates the invoice after 3 min
- generate a shipping label after the invoice is generated
- you will receive an email with the tracking number and the invoice



B. If no shipping label is generated through xConnector: settings to email the invoice


  • Configure an email server in your invoice platform per their specifications (Contact their support if you need help.)
  • Go to xConnector > Profile > Preferences > Default values:
    • Check Send invoice by email.
    • Save the Email subject that customers will receive.




Test the invoice sending process for method B


Place a test order using your email address, wait 3 minutes after the invoice is generated and  check the email to see if you did receive the invoice.





Accessing the Invoice in Shopify



In Shopify, click on the Order Number, and go to the Additional Details section.

Here you can find the invoice short url saved by default. 








How to save the invoice to the customer Account?



Customers can access and download their invoices directly from their account in Shopify. This gives them the convenience of retrieving invoices anytime, reducing support requests and making the process more efficient for both parties.



You can edit your website theme to customize the customer account page and add new columns for the Invoice, Delivery Status, and Payment Status etc



Here is the code for adding the Invoice column into the customer account:




{% if order.metafields.external.invoices != nil %}
  <p>One or more invoices available</p>
  <ul>
  {% assign invoices = order.metafields.external.invoices | parse_json %}
  {% for invoice in invoices %}
    <li><a href="{{ invoice.link }}">Invoice serial {{ invoice.serial }}, number {{ invoice.number }} </a></li>
  {% endfor %}
  </ul>
{% else %}
  {% for attribute in order.attributes %}
  {% if attribute.first == 'xconnector-invoice-short-url' %}
    <p>Download your <a href="{{ attribute.last }}">invoice</a> .</p>
  {% endif %}
  {% endfor %}
{% endif %}




As a result:
Customers have access to their order history, where they can see:

  • Payment status

  • Delivery status

  • Total amount

  • Download link for the invoice









Note:

Customizing the customer account page depends greatly on your site’s theme, how the data is already presented, and how you want to display the invoice link on this screen. We provide a script that retrieves the invoice download link, but please note that technical knowledge is required to add a new column for the invoice and populate it with the corresponding link.
















This module is available in Advanced subscription plan.


Feel free to contact us if you need any further information:


Chat: click on the blue chat icon (bottom-right)
E-mail: support@xconnector.app
Phone: +4 0373 747 991






Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons

Feedback sent

We appreciate your effort and will try to fix the article