Callback & Notifications

Overview

Once the order has been placed and payment has been confirmed, you will be notified by ifthenpay via the usual channels, i.e. by push notification, if you have our app installed and have this option activated, by email, or you can check directly in our backoffice.

If you wish to be notified by callback, you must first ask ifthenpay to activate your callback (webhook).

In simpler terms: The callback URL is like a template. When a payment happens, the template is filled in with real information about that payment, and then the information is sent to your website.

ifthenpay offers free technical support to all customers through the following channels:



« go to index

 

Explanation

The following is an explanation of what a callback is and its purpose.

Callback example URL
http://www.yoursite.com/callback.php?key=[ANTI_PHISHING_KEY]&orderId=[ORDER_ID]&amount=[AMOUNT]&requestId=[REQUEST_ID]&payment_datetime=[PAYMENT_DATETIME]

Constraints


URL Breakdown:

The Square Brackets []:

What Happens During a Callback:

  1. Customer Completes Purchase: When a customer finishes buying something on your website, the payment gateway processes the transaction.
  2. Gateway Sends Request: The payment gateway sends a request to the URL you provided.
  3. Placeholders are Replaced: The gateway replaces the placeholders in the URL with the specific details of the transaction.
  4. Your Server Receives Data: Your server receives the request and processes the data, updating your database, sending emails, or performing other actions.

Why use a callback URL?

Common Use Cases:

Response Codes and Retry Policy

Your URL is not required to return any content. The success of our request is determined solely by the HTTP status code returned: if an HTTP 200 status code is received, ifthenpay considers the call successful. If any other status code is returned (HTTP 400, 500, or others), the call is considered unsuccessful and will be retried automatically.

A maximum of 13 attempts will be made: the first 8 at 5-minute intervals, and the remaining attempts at 1-hour intervals. If, after these 13 attempts, a successful response (HTTP 200) is still not obtained, no further retries will be made.

Additionally, if the failure is identified as permanent, the system will stop retrying after the 3rd attempt.

 

Multibanco


Callback example URL
https://www.yoursite.com/callback.php?key=[ANTI_PHISHING_KEY]&orderId=[ORDER_ID]&amount=[AMOUNT]&requestId=[REQUEST_ID]&entity=[entity]&reference=[REFERENCE]&payment_datetime=[PAYMENT_DATETIME]

The description of the replacements is as follows:



Example of a Callback URL triggered after payment confirmation
https://www.yoursite.com/callback.php?key=my_anti_phishing_key&orderId=order-1234&amount=1234.56&requestId=5Qd8gtWLAEUJ6n0lkS5g&entity=99999&reference=123456789&payment_datetime=28-10-2021 10:55:21
 

MB WAY


Callback example URL
https://www.yoursite.com/callback.php?key=[ANTI_PHISHING_KEY]&orderId=[ORDER_ID]&amount=[AMOUNT]&requestId=[REQUEST_ID]&payment_datetime=[PAYMENT_DATETIME]

The description of the replacements is as follows:



Example of a Callback URL triggered after payment confirmation
https://www.yoursite.com/callback.php?key=your_anti_phishing_key&orderId=1887&amount=33.61&requestId=i2szvoUfPYBMWdSxqO3n&payment_datetime=03-01-2024 15:15:16
 

Payshop


Callback example URL
https://www.yoursite.com/callback.php?anti_phishing_key=[ANTI_PHISHING_KEY]&order_id=[ORDER_ID]&reference=[REFERENCE]&amount=[AMOUNT]&payment_datetime=[PAYMENT_DATETIME]

The description of the replacements is as follows:



Example of a Callback URL triggered after payment confirmation
https://www.yoursite.com/callback.php?anti_phishing_key=my_anti_phishing_key&order_id=12345&reference=1021600051424&amount=5.00&payment_datetime=28-10-2021 10:55:21
 

Credit Card


Callback example URL
https://www.yoursite.com/callback.php?key=[ANTI_PHISHING_KEY]&id=[ORDER_ID]&amount=[AMOUNT]&payment_datetime=[PAYMENT_DATETIME]&payment_method=[PAYMENT_METHOD]

The description of the replacements is as follows:



Example of a Callback URL triggered after payment confirmation
https://www.yoursite.com/callback.php?key=my_anti_phishing_key&id=1234&amount=21.50&payment_datetime=28-10-2021 10:55:21&payment_method=CCARD
 

Google Pay


Callback example URL
https://www.yoursite.com/callback.php?key=[ANTI_PHISHING_KEY]&id=[ORDER_ID]&amount=[AMOUNT]&payment_datetime=[PAYMENT_DATETIME]&payment_method=[PAYMENT_METHOD]

The description of the replacements is as follows:



Example of a Callback URL triggered after payment confirmation
https://www.yoursite.com/callback.php?key=my_anti_phishing_key&id=1234&amount=21.50&payment_datetime=28-10-2021 10:55:21&payment_method=GOOGLE
 

Apple Pay


Callback example URL
https://www.yoursite.com/callback.php?key=[ANTI_PHISHING_KEY]&id=[ORDER_ID]&amount=[AMOUNT]&payment_datetime=[PAYMENT_DATETIME]&payment_method=[PAYMENT_METHOD]

The description of the replacements is as follows:



Example of a Callback URL triggered after payment confirmation
https://www.yoursite.com/callback.php?key=my_anti_phishing_key&id=1234&amount=21.50&payment_datetime=28-10-2021 10:55:21&payment_method=GOOGLE
 

Direct Debit


Callback example URL
https://www.yoursite.com/callback.php?anti_phishing_key=[ANTI_PHISHING_KEY]&mandate_id=[ORDER_ID]&transaction_id=[REQUEST_ID]&amount=[AMOUNT]&payment_datetime=[PAYMENT_DATETIME]

The description of the replacements is as follows:



Example of a Callback URL triggered after payment confirmation
https://www.yoursite.com/callback.php?anti_phishing_key=my_anti_phishing_key&mandate_id=12345&reference=1021600051424&transaction_id=00065411-98&amount=5.00&payment_datetime=28-10-2021 10:55:21

In addition to the callback URL, which only confirms when a payment is successfully collected, you can also use the notification URL to receive the status of each individual collection attempt as it is processed.

Notification example URL
https://www.yoursite.com/notification.php
(This URL will be called using the GET method, and parameters will be appended when a payment is confirmed or refused.)

The following parameters are included in the direct debit notification URL when a payment is either confirmed or refused:



Example of a Notification URL triggered after payment confirmation
https://www.yoursite.com/notification.php?mandateId=09039807130&transactionId=KL83NVuf0fy8GYkpohVo&amount=0.01¤cy=EUR&collectionDate=2025-04-17&reference=6CCEA46379&status=PROCESSING&code=0000
 

PIX


Callback example URL
https://www.yoursite.com/callback.php?anti_phishing_key=[ANTI_PHISHING_KEY]&order_id=[ORDER_ID]&amount=[AMOUNT]&payment_datetime=[PAYMENT_DATETIME]

The description of the replacements is as follows:



Example of a Callback URL triggered after payment confirmation
https://www.yoursite.com/callback.php?anti_phishing_key=my_anti_phishing_key&order_id=12345&amount=5.00&payment_datetime=28-10-2021 10:55:21
 

PAY BY LINK & PINPAY


Callback example URL
https://www.yoursite.com/callback.php?key=[ANTI_PHISHING_KEY]&id=[ID]&amount=[AMOUNT]&payment_datetime=[PAYMENT_DATETIME]&payment_method=[PAYMENT_METHOD]

The description of the replacements is as follows:



Example of a Callback URL triggered after payment confirmation
https://www.yoursite.com/callback.php?key=my_anti_phishing_key&id=1234&amount=21.50&payment_datetime=28-10-2021 10:55:21&payment_method=CCARD