Skip to main content

How can I have my invoice corrections created automatically?

Similar to your invoices, you can also have your invoice corrections created automatically using the Flow Builder. In this article, we explain how this works. You can find general information and tips on the Flow Builder here.

Adding automatic invoice correction creation to a Flow

Among the Pickware-specific triggers in the Flow Builder, two triggers are relevant for us in this case:

  • Pickware → Return → Fully returned

  • Pickware → Return → Partially returned

Since it is not possible to combine both triggers in one flow, you need two separate flows here, which are otherwise identical apart from the trigger. Create the flows as follows:

  1. Go to Settings → Shop → Flow Builder and click Add flow at the top.

  2. Enter a name and, optionally, a description. Activate the flow using the checkbox below.

  3. Next, switch to the Flow tab and select the trigger Fully returned or Partially returned.

  4. Add a new action below. You can find the desired action under General → Create document. Then select Invoice correction as the document type to create, as well as the warehouse the document should refer to. Click Add action.

    FlowBuilder_Rechnungskorrekturen.png

  5. Save the flow using the button at the top right.

  6. Now repeat the steps above to create the second flow. Select the other trigger, and adjust the name and description of the flow for better clarity.

Sending invoice corrections to your customers by email

Similar to sending invoices by email, you can also automatically send your invoice corrections to your customers by email by customizing the corresponding email template. The invoice correction can then be downloaded via a button within the email.

To customize the template, navigate to Settings → Notifications → Customer notifications → Order exceptions in your Shopify Admin. Click the entry Order refund and then click Edit code at the top right.

Search for the following spot in the code. It should be located relatively far down in the email template.

Now insert the following code at the spot marked with the red line:

{% if metafields.pickware.pickware_invoice_correction_urls %}
<table>
{% for url in metafields.pickware.pickware_invoice_correction_urls -%}
<tr>
<td class="actions__cell">
<table class="button main-action-cell" style="width: 100%; margin-top: 12px;">
<tbody>
<tr>
<td class="button__cell">
<a href="{{ url }}" class="button__text">
{{ forloop.index }}. Rechnungskorrektur herunterladen
</a>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
{% endfor %}
</table>
{% endif %}

Now save your change using the button at the top.

This change to the template ensures that, for returns with an invoice correction, a button is displayed in the email leading to the corresponding invoice correction. If no invoice correction exists, the button is not displayed. For this reason, the preview function within the template settings also does not show the button. To see an actual preview, you need to create a test order, send it, and then return it.

Rechnungskorrektur_Mail.png
Did this answer your question?