Use webhooks to be notified automatically and in real-time about events in your 2Checkout account.
What is IPN?
Instant Payment Notification (IPN) works as a message service generating automatic order/transaction notifications for your 2Checkout account. Use the notifications to process order data into your own management systems by synchronizing it with 2Checkout account events.
2Checkout’s webhooks (IPN and LCN) operate asynchronously.
How can I use IPN?
Use IPN to automate back-end functions, including but not limited to:
- Creating end user accounts
- Providing access to acquired services
- Fulfilling purchases
- Tracking orders and customers
- Engaging customers
How does IPN work?
- Create one or multiple IPN listener pages on your website. 2Checkout sends IPNs to publicly accessible servers.
- Configure the IPN settings of your 2Checkout account to point to the URLs of your default/preferred listener pages. Our system performs a GET request against the URL you fill in, and expects a HTTP 200 code as response. Make sure that your URL can be queried via a GET request from our webserver IPs.
- Set up multiple URLs if you require more listener pages, such as in testing scenarios in which you don’t want to use your default IPN listener.
- 2Checkout sends order notifications to the endpoints you defined when shoppers acquire products/services from your online store. 2Checkout packages the payment information and sends it using secure (HTTPS) POST, according to your IPN settings.
- 2Checkout sends the IPN parameters according to your setup from IPN Settings.To include additional information in the notifications, enable new parameters in the IPN settings page. Learn more about IPN parameters here.
- 2Checkout uses a HMAC_MD5 signature to validate the HTTPS POST. Calculate the signature using data sent and your 2Checkout account’s secret key, following the instructions included in this article.
- Your custom IPN listener scripts consume the notifications and process the info received.
- Configure your IPN listeners to output a read receipt confirmation in the listener page after receiving a valid IPN message. Guidance on how to generate the confirmation can be found here.
- In the absence of a confirmation from one of your IPN listeners, 2Checkout continues to send notifications to that endpoint, according to the failure retry process, until you provide a valid response.
- In the eventuality that 2Checkout fails to send IPNs or doesn’t receive a confirmation from your IPN listener, it displays an error in your Control Panel, on the Dashboard.
Set up the default IPN URL
- Login into your 2Checkout account.
- Navigate to IPN settings under System settings.
- Enter the URL corresponding to your default IPN listener in the IPN URL field.
- Check the Allow concurrent requests (faster notifications) option. If checked, 2Checkout sends multiple notifications concurrently to your IPN URL. Note: This may cause concurrency problems, but will greatly improve the notification time.
- Save your settings.
- 2Checkout checks the validity of the URLs in terms of access to ensure that notifications reach your IPN listener without issues.
Set up multiple IPN URLs
You can set up multiple endpoints for your IPN notifications, for scenarios in which you have multiple Internal System that require to receive this information. You can set up to 3 URLs for your notifications.
To add multiple endpoints, navigate to the IPN settings tab and click New IPN configuration.
Set up additional IPN URLs
To view or debug IPN notifications during the integration phase, place TEST orders.
Alternatively, search for specific orders in the "Orders & Reports" area. When you access the order details page you get the option to resend notifications. You can also see how many IPN notifications have been sent so far for an order. Opt to reissue the IPN for debug and 2Checkout re-generates and re-sends the IPN, but also displays a copy of the content sent in the control panel.
Secure your IPN script
For security reasons, 2Checkout recommends that you restrict access to the IPN script.