How do I create a receipt?

You can create a receipt to automatically be sent to customers after a successful payment. This guide explains how to set this up.

The receipt is sent out by a webhook (you can read more about webhooks here). Log in to your Mondido account. Then follow the steps below to create the webhook:

1. In the menu to the left, go to "Webhooks":

2. Under "Create webhook", click "Choose type" and select "Receipt" from the drop-down list:

3. In the next menu, choose "After successful payment":

4. Sender is the email address which the customer will receive the receipt email from:

You can add emails to choose from under Integration → Apps → Email addresses.

5. Write code to fetch the customer's email address from the transaction object:

What you should write here depends on how the metadata for your transactions is structured. Some examples:
- If you use Shopify: {{ transaction.metadata['order']['customer']['email'] }}
- If you use WooCommerce: {{ transaction.metadata['customer']['email'] }}
- If you use API, you're structuring the metadata yourself.
If you're unsure, use: {{ transaction.payment_details.email }}

Here's a guide on how to fetch data from the transaction object

6. "Subject" is the title of the email the customer will receive. For example, "Your payment":

7. "Email body" is the text in the mail which is sent to customers who have made a successful payment. This is the receipt.

You can edit the code if you want to change the layout and content of the receipt.

Here are some examples of data which can be useful:

- Amount {{ transaction.amount }}
- VAT {{ transaction.vat_amount }}
- Currency {{ transaction.currency }}
- Card number {{ transaction.card_number }} (is masked)
- Name {{ transaction.metadata['customer']['name' ] }} (requires metadata in matching format)
- E-mail: {{ transaction.metadata['customer']['email'] }} (requires metadata in matching format)
- Product {{ transaction.metadata['products']['0']['description'] }} (requires metadata in matching format)

If you have questions or need help with showing the right data in the receipt, please contact us at help@mondido.com. We are happy to create the receipt just like you want it.

The finished mail/receipt code might look something like this:

<h1>Hi {{ transaction.metadata['customer']['name'] }}!</h1>
<p>
Thank you for your purchase of the product {{ transaction.metadata['product']['name'] }}. We have charged your card {{ transaction.card_number }} with {{ transaction.amount }} {{ transaction.currency }} (of which {{ transaction.vat_amount }} is VAT)
</p>
<p>
  Yours faithfully,</br>
  TheShop.com<br>
</p>

8. Confirm with the button "Create webhook template":

Testing your receipt

To test your receipt email, go to Payment Form and do a test transaction:

You should recieve an email with the receipt.