How to Set Up Ifthenpay on Moloni ON
What is Ifthenpay and what is it used for?
IFTHENPAY is a Portuguese Payment Institution, founded 19 years ago, authorised to operate within the European Economic Area (EEA) and directly supervised by the Banco de Portugal. As one of the first national Fintechs, it specialises in developing and integrating digital payment solutions for businesses.
Ifthenpay helps companies receive payments securely and automatically, 24 hours a day. Its main purpose is to allow any business (B2C or B2B) to integrate the most widely used payment methods in Portugal-such as Multibanco Reference, MB WAY, Credit Cards, and PAYSHOP-into their invoices, accounting documents, or e-commerce platforms.
Through this integration with Moloni ON, your business gains the ability to automatically issue references and payment links (PaybyLink) directly within the documents sent to customers. It also provides real-time communication whenever a payment is made.
Follow these steps:
1. Access Settings on the left menu of Moloni ON, click Other settings, and select Payment platforms.

2. Review the available options on the page and, if you do not have an account or contract yet, access the registration form via the "click here" link inside your desired method.

3. Fill in the mandatory fields on the official form (Name, Email, Mobile, Company, and URL) and click Send. Once your details are submitted, the process with Ifthenpay will begin. As soon as it is complete, you will receive an email with the login details for the contracted services.

4. Return to Moloni ON and click the Activate button.

5. In the Title field, enter an identifying name for this configuration (e.g., "Ifthenpay Multibanco").

6. Insert the service key provided by Ifthenpay in the email into the MB key/gatewayKey field.

7. Enable the Default option if you want this to be the standard payment method suggested on your Moloni ON documents.

8. Click the Save button (in the top or bottom right corner) to get your anti-phishing key and activate the automatic Callback for real-time payment recording.

How to generate receipts automatically in Moloni ON
For Moloni ON to generate receipts 100% automatically, you must connect Ifthenpay's real-time communication mechanism (called Callback). Whenever a customer pays an invoice, Ifthenpay instantly notifies Moloni ON via this link, closing the invoice and issuing the receipt without manual intervention.
Follow these steps:
1. Access Settings on the left menu of Moloni ON, click Other settings, and select Payment platforms.

2. Click Consult on the block of the Ifthenpay method you wish to configure (e.g., Ifthenpay: PaybyLink or Multibanco).

3. Copy the link that appears in the Callback field and also save your Anti-phishing key generated by the system.

4. Access your Ifthenpay customer portal. In the left side menu, click Administration and select Contract/Accounts.

5. Identify the relevant account in the table and, in the Options column, click the link/chain icon (Callback Activation).

6. Paste the link you copied from Moloni ON into the Callback URL field.

7. Enter your security key into the Anti-phishing Key field.

8. Fill in the Backoffice Key field with the key provided directly by Ifthenpay, and click Apply to save the connection.

9. Return to the method configuration page in Moloni ON and select the Optional settings tab at the top.

10. Enable the Generate receipts automatically option.

11. In the Document series field, select the billing series from the drop-down menu where you want your receipts to be issued.

12. In the Payment method field, select your preferred payment method.

13. Click the Save button in the bottom right corner to complete the process.

How to add payment details to a document
To simplify the collection process and automate financial management, Moloni ON allows you to integrate payment platforms directly into your documents. When you activate this option, the system automatically generates a payment link associated with your configured financial entity, allowing your customer to pay with total convenience.
However, there are specific rules regarding where and when you can use this feature in Moloni ON. Make sure you meet the following requirements:
- Eligible documents: Payment details can only be added to Invoices and Regular/Recurring Invoices. They are not available for other document types.
- AT Communication: the document must have active real-time communication with the Tax Authority (AT) for the process to run smoothly.
- Workflow Flexibility: You can include the payment details right at the time of issuance or add them later to a document that has already been closed.
During the creation of a document
If you are issuing a new invoice or regular invoice and want the customer to receive the payment link straight away, follow these steps:
1. After filling in the Commercial information and Products, go to the Generate payment data section and select your desired payment platform.

2. In the Value field, enter the exact amount to be charged through the platform.

3. Click Save and finalise in the bottom right corner. Moloni ON will issue the document and immediately create the link in the Payments tab with a Pending status.

On an already issued document
If the document has already been generated without payment details and you want to add the link now, follow these steps:
1. Open the desired invoice or regular invoice and click the Payments tab.

2. Click the Generate payment button in the top right corner.

3. In the Generate payment data section, select your desired payment platform.

4. The system will automatically pull the total outstanding amount from the document. Validate the details and click the Generate payment button to create the corresponding link.

Status automation
As soon as the document is paid by the customer via the link, the status in the Payments tab will automatically change from Pending to Paid.