Gareth Wilson Gareth Wilson

Guide to 2Checkout Webhooks: Features and Best Practices

Published


2Checkout (now part of Verifone) is a global monetization platform that handles payments, subscriptions, and digital commerce for software and SaaS businesses worldwide. Beyond processing transactions, 2Checkout's webhook system enables merchants to automate backend operations in real-time, from provisioning customer accounts to managing subscription lifecycles.

This guide covers everything you need to know about 2Checkout webhooks: their features, how to configure them, best practices for production deployments, and the common pain points developers face along with solutions to address them.

What are 2Checkout webhooks?

2Checkout webhooks are HTTP notifications that deliver real-time event data to your server whenever something happens in your 2Checkout account. When a payment is authorized, a subscription renews, a refund is processed, or a chargeback is opened, 2Checkout sends a payload containing the event details to URLs you configure.

2Checkout provides two primary webhook systems:

  • Instant Payment Notification (IPN) — Covers purchase and transaction events such as authorized payments, completed orders, refunds, and chargebacks. Delivered via HTTPS POST.
  • License Change Notification (LCN) — Covers subscription lifecycle events such as renewals, expirations, upgrades, and end-user info updates. Delivered via HTTPS GET or POST.

Both systems operate asynchronously and independently, meaning you can configure each to point at different endpoints and trigger on different events.

2Checkout webhook features

FeatureDetails
Webhook typesIPN (transactions) and LCN (subscriptions)
Webhook configurationMerchant Control Panel UI
Hashing algorithmHMAC-SHA256 or HMAC-SHA3-256
Delivery methodIPN: HTTPS POST; LCN: HTTPS GET or POST
Retry logicStaged retry over ~2 days (immediate — 5 min — 15 min — hourly)
Manual retryYes, per-order resend from Control Panel
Multiple endpointsUp to 8 URLs per webhook type
Concurrent deliveryOptional, configurable per IPN URL
Browsable logAPI and webhooks log monitor in Control Panel
Failing webhook alertsConfigurable email alerts with frequency and threshold settings
Payload customizationSelectable parameters (Response Tags) per endpoint
Test modeTest orders generate IPN/LCN notifications for debugging

IPN event types

IPN notifications are triggered for transaction-level events. The MESSAGE_TYPE parameter indicates which event fired:

MESSAGE_TYPEDescription
PENDINGOrder placed, awaiting bank authorization
PROCESSINGOrder waiting to be processed by 2Checkout
APPROVEDAuthorized and approved (sent before electronic delivery)
AUTHAuthorized and approved (sent after electronic delivery)
APPROVED_DELIVERYOrder approved for delivery
COMPLETEOrder completed
ORDER_UNDER_REVIEWOrder under 2Checkout fraud review
SHOPPER_INVOICEInvoice generated
SUSPECTFlagged as potential fraud
CANCELEDOrder canceled
CHARGEBACK_OPENChargeback dispute opened
CHARGEBACK_CLOSEDChargeback dispute resolved
REFUNDReversed or refunded order
PURCHASE_PENDINGPurchase order approved, awaiting payment
PURCHASE_REJECTED_BY_VENDORPurchase order rejected
PURCHASE_COMPLETEPurchase order completed
PURCHASE_EXPIRED_NOT_PAIDPurchase order expired without payment
PURCHASE_CANCELED_TIMEOUTPurchase order canceled due to timeout
PENDING_APPROVAL_ORDER_FOR_PARTNERPartner order pending approval
VENDOR_APPROVEDPartner order approved
DELIVERED_ORDER_FOR_PARTNERPartner order delivered

The ORDERSTATUS parameter provides the current order state (e.g., PAYMENT_RECEIVED, COMPLETE, REFUND, REVERSED, CHARGEBACK), and its behavior can vary by payment method. For example, SEPA Direct Debit orders return MESSAGE_TYPE: PROCESSING where credit card orders return MESSAGE_TYPE: APPROVED.

LCN event types

LCN notifications cover subscription lifecycle events. The DISPATCH_REASON parameter indicates the trigger:

Dispatch ReasonSubscription StatusTrigger
LICENCE_CHANGEActiveExpiration date updated, recurring toggled, end-user details changed, subscription imported
LICENCE_GP_CHANGEActiveGrace period changed
LICENCE_PENDING_ACTIVATIONPending ActivationSubscription awaiting activation
LICENCE_EXPIRATIONExpiredSubscription expired
LICENCE_PASTDUEPast DueSubscription past due
LICENCE_CPC_ACCEPTEDActiveChurn prevention campaign discount accepted
SCHEDULED_FOR_CANCELATION_ON_DEMANDActiveScheduled cancellation registered (German billing addresses)
REVERT_CANCELATION_ON_DEMANDActiveScheduled cancellation reverted
CANCELATION_ON_DEMANDDisabledScheduled cancellation executed

LCN notifications are also triggered by API calls including convertTrial, enableSubscription, disableSubscription, renewSubscription, setSubscriptionUpgrade, extendSubscription, and updateSubscriptionEndUser.

IPN payload structure

IPN payloads are delivered as HTTPS POST requests with form-encoded parameters. The payload is extensive, covering order details, customer billing and delivery information, product arrays, subscription data, and validation fields. Here are the key parameter groups:

Order information: REFNO (2Checkout order reference), REFNOEXT (your external reference), ORDERNO, ORDERSTATUS, MESSAGE_TYPE, SALEDATE, PAYMENTDATE, COMPLETE_DATE, PAYMETHOD, PAYMETHOD_CODE, CURRENCY, TEST_ORDER

Product arrays: IPN_PID[], IPN_PNAME[], IPN_PCODE[], IPN_QTY[], IPN_PRICE[], IPN_VAT[], IPN_TOTAL[], IPN_TOTALGENERAL

Subscription data: IPN_LICENSE_PROD[], IPN_LICENSE_TYPE[] (REGULAR, RENEWAL, UPGRADE, TRIAL), IPN_LICENSE_REF[], IPN_LICENSE_EXP[], IPN_LICENSE_LIFETIME[]

Customer information: FIRSTNAME, LASTNAME, COMPANY, ADDRESS1, CITY, STATE, ZIPCODE, COUNTRY, CUSTOMEREMAIL, IPADDRESS

Chargeback data: CHARGEBACK_RESOLUTION (OPEN, WON, LOST, ACCEPTED, NONE), CHARGEBACK_REASON_CODE

Refund data: REFUND_REASON, REFUND_TYPE (TOTAL, PARTIAL)

Validation: SIGNATURE_SHA2_256, SIGNATURE_SHA3_256, IPN_DATE

2Checkout continues to add new IPN parameters on an ongoing basis. Parameters are opt-in — you enable them individually via the Response Tags section in your IPN settings.

Security with HMAC signatures

2Checkout uses HMAC signatures to ensure webhook authenticity. Both IPN and LCN support SHA-256 and SHA3-256 algorithms.

Verifying the IPN signature

The signature is calculated over the IPN payload fields using your account's secret key. When calculating the hash, 2Checkout constructs an HMAC source string by concatenating the byte-length of each field value followed by the value itself.

Depending on your shoppers' location, addresses and billing names may contain special characters. For UTF-8 characters, the byte length can differ from the character length. Always use byte-length functions (e.g., PHP's strlen(), not mb_strlen()) when building the HMAC source string.

Sending the read receipt response

After verifying an IPN, your listener must return a read receipt in the response body to acknowledge successful processing. The format is:

<sig algo="sha256" date="YmdHis">HMAC_HASH</sig>

The hash is calculated over four fields in order: IPN_PID[0], IPN_PNAME[0], IPN_DATE, and the current datetime stamp, using the same HMAC-SHA method and your secret key.

If 2Checkout does not receive a valid read receipt, it continues retrying per the failure recovery schedule.

Setting up 2Checkout webhooks

Setting up IPN

  1. Log into your 2Checkout Merchant Control Panel
  2. Navigate to Dashboard — Integrations — Webhooks and API
  3. Click the IPN Settings tab
  4. Click Edit to modify an existing URL, or Add IPN URL to create a new endpoint
  5. Enter your publicly accessible HTTPS endpoint URL
  6. Under Triggers, select the events that should generate notifications (e.g., completed orders, chargebacks, refunds)
  7. Under Response Tags, select the parameters to include in the payload
  8. Optionally check Allow concurrent requests for faster delivery (with the caveat that this may cause concurrency issues)
  9. Save your settings

2Checkout validates your URL by performing a GET request and expecting an HTTP 200 response.

Setting up LCN

  1. In the same Webhooks and API section, click the LCN Settings tab
  2. Click Add LCN URL to create an endpoint
  3. Under Triggers, select the subscription events you want to receive (license changes, expirations, past-due notifications, etc.)
  4. Select the Response Tags to include in LCN payloads
  5. Save your settings

Both IPN and LCN support up to eight (8) endpoint URLs, allowing you to route notifications to multiple internal systems simultaneously.

Configuring failing webhook alerts

  1. Navigate to Webhooks & API and scroll to the Notifications section
  2. Check Failing webhooks alerts
  3. Set the alert frequency (e.g., every 4 hours) and the failure threshold (e.g., 25% of IPNs failing)
  4. Ensure the Technical notifications email is configured under Account settings — Account information

IPN retry schedule

When 2Checkout does not receive a valid read receipt, it follows a staged retry process:

StageBehaviorAttempts
Stage 1Initial IPN sent immediately when the event occurs1
Stage 2If the initial notification fails, two retries are sent 5 minutes apart2
Stage 3If failures continue, four retries are sent 15 minutes apart4
Stage 4Hourly retries for up to 2 days after the initial notification~48

After approximately two days of failed retries, 2Checkout stops attempting delivery. There is no dead letter queue — unacknowledged notifications are lost after the retry window closes.

Best practices when working with 2Checkout webhooks

Always return the read receipt immediately

Your IPN listener should calculate and return the HMAC read receipt as quickly as possible. Perform any heavy processing (database writes, API calls, provisioning) asynchronously after sending the response. If your listener takes too long, 2Checkout will consider the delivery failed and begin retrying.

Implement idempotent processing

Because 2Checkout retries failed notifications and supports concurrent delivery to multiple endpoints, your listener may receive the same event multiple times. Use the REFNO (order reference) combined with MESSAGE_TYPE as an idempotency key to avoid processing duplicate events.

async function handleIPN(params) {
  const idempotencyKey = `${params.REFNO}-${params.MESSAGE_TYPE}`;

  const alreadyProcessed = await db.get(`ipn:${idempotencyKey}`);
  if (alreadyProcessed) {
    console.log(`IPN ${idempotencyKey} already processed, skipping`);
    return generateReadReceipt(params);
  }

  await processOrder(params);
  await db.set(`ipn:${idempotencyKey}`, Date.now());

  return generateReadReceipt(params);
}

Handle multibyte characters carefully in signature verification

This is one of the most common sources of IPN integration failures. When shoppers have names or addresses with special characters (accented characters, CJK characters, etc.), the byte length differs from the string length. Always use byte-length functions when building the HMAC source string.

Use the TEST_ORDER parameter to filter test data

By default, 2Checkout includes test order data in IPN notifications alongside real orders. Always check the TEST_ORDER parameter (1 for test, 0 for real) and route test notifications to a separate processing path or ignore them in production.

Be cautious with concurrent requests

The "Allow concurrent requests" option improves notification speed but can cause race conditions if your listener isn't designed for concurrent access. If you enable this feature, ensure your endpoint handles parallel writes safely (e.g., using database-level locking or idempotency checks).

Restrict access to your IPN script

2Checkout recommends restricting access to your IPN listener endpoint. Consider allowlisting 2Checkout's webserver IP addresses and rejecting requests from unknown sources.

2Checkout webhook limitations and pain points

Complex read receipt requirement

The Problem: Unlike most webhook providers that simply expect an HTTP 2xx status code to acknowledge delivery, 2Checkout requires a cryptographic read receipt in the response body. Your listener must calculate an HMAC-SHA hash over specific payload fields and return it in a <sig> XML tag. A plain 200 OK response is not sufficient — 2Checkout will continue retrying.

Why It Happens: 2Checkout uses the read receipt as a two-way verification mechanism, confirming not only that your server received the notification but that it was able to parse the payload and possesses the correct secret key.

Workarounds:

  • Use the official 2Checkout PHP SDK's IpnSignatureHandler class, which provides a generateTag() method that handles the receipt calculation
  • Build a lightweight middleware layer that handles receipt generation before passing events to your business logic

How Hookdeck Can Help: Hookdeck can sit between 2Checkout and your endpoint, handling the read receipt response automatically while forwarding the event payload to your actual processing infrastructure. This decouples the receipt requirement from your business logic entirely.

HMAC signature verification failures with special characters

The Problem: Hash validation frequently fails when processing orders from shoppers whose names or addresses contain multibyte UTF-8 characters (accented letters, CJK characters, Cyrillic, etc.). This is one of the most commonly reported developer pain points.

Why It Happens: The HMAC source string is built by prefixing each field value with its byte length (not character count). If you use a character-counting function instead of a byte-counting function, the lengths will be wrong for any multibyte characters, causing the computed hash to differ from 2Checkout's.

Workarounds:

  • In PHP, always use strlen() (byte length) instead of mb_strlen() (character count)
  • In other languages, ensure you're measuring byte length of the UTF-8 encoded string, not codepoint count
  • Test your signature verification with international characters before going to production

How Hookdeck Can Help: By receiving and validating webhooks on your behalf, Hookdeck handles the signature verification complexity at the infrastructure level, including the multibyte edge cases, before forwarding verified events to your endpoint.

No dead letter queue after retry exhaustion

The Problem: After 2Checkout exhausts its retry schedule (~2 days of staged retries), unacknowledged notifications are permanently lost. There is no built-in mechanism to retrieve, inspect, or replay failed webhook deliveries after the retry window closes.

Why It Happens: 2Checkout's retry system is designed as a best-effort delivery mechanism. Once the retry stages are exhausted, the system moves on without persisting the failed event for later recovery.

Workarounds:

  • Monitor the failing webhooks dashboard alerts closely and resolve endpoint issues within the 2-day retry window
  • Use the manual resend option in the Order Details page for individual orders you know were missed
  • Build your own reconciliation process that periodically queries the 2Checkout API to detect missed events

How Hookdeck Can Help: Hookdeck automatically stores all webhook events (including those that fail delivery) in a persistent log. Failed events can be inspected, debugged, and replayed at any time through the Hookdeck dashboard, eliminating the risk of permanent data loss.

Difficulty distinguishing test from live notifications

The Problem: By default, 2Checkout sends test order data through the same IPN endpoints as real orders, with both appearing in the same notification stream. Developers who aren't aware of this behavior may accidentally process test transactions as real orders.

Why It Happens: 2Checkout's test ordering system is designed to simulate real transactions as closely as possible, including triggering the same webhook flows. The TEST_ORDER parameter differentiates them, but it's not immediately obvious if you're not looking for it.

Workarounds:

  • Always check the TEST_ORDER parameter in your IPN listener and route accordingly
  • Note that 2Checkout removed PROCESSING and TEST as ORDERSTATUS values for test orders — you must use TEST_ORDER instead of relying on ORDERSTATUS to filter
  • Consider using separate IPN URLs for development and production environments

How Hookdeck Can Help: Hookdeck's filtering and routing rules can automatically separate test webhook traffic from production traffic based on payload content, routing test events to a different destination or discarding them entirely.

Limited payload customization

The Problem: While you can select which parameters (Response Tags) to include in IPN notifications, you cannot transform the payload structure itself. The payload is always delivered as form-encoded POST data with 2Checkout's predefined parameter names, including deeply nested product arrays like IPN_BUNDLE_DETAILS_1234_PID[].

Why It Happens: 2Checkout's IPN system predates modern webhook conventions. The payload format is designed around their internal data model rather than being optimized for developer ergonomics.

Workarounds:

  • Build a transformation layer between 2Checkout and your application that converts the form-encoded data into a cleaner JSON structure
  • Use the 2Checkout REST API (v6.0) alongside webhooks for cases where you need data in a different format
  • Map 2Checkout's parameter naming conventions to your internal models in a dedicated parsing module

How Hookdeck Can Help: Hookdeck's transformation feature can reshape 2Checkout's form-encoded payloads into clean JSON before forwarding to your endpoint, converting nested array parameters into properly structured objects that match your application's expectations.

Concurrency issues with parallel delivery

The Problem: Enabling the "Allow concurrent requests" option significantly improves notification speed, but can cause race conditions, duplicate processing, and data integrity issues when multiple notifications for related events arrive simultaneously at your endpoint.

Why It Happens: With concurrent requests enabled, 2Checkout sends multiple notifications in parallel without any ordering guarantees. Two events for the same order (e.g., APPROVED and COMPLETE) may arrive out of order or be processed simultaneously.

Workarounds:

  • Implement database-level locking or optimistic concurrency control in your listener
  • Use a message queue to serialize processing of events for the same order
  • Disable concurrent requests if ordering matters more than speed for your use case

How Hookdeck Can Help: Hookdeck provides built-in event ordering and concurrency controls, ensuring that events for the same order are delivered sequentially to your endpoint even when 2Checkout sends them in parallel. This gives you the speed benefits of concurrent delivery without the race condition risks.

Split webhook systems for transactions and subscriptions

The Problem: Having two separate webhook systems (IPN for transactions, LCN for subscriptions) means developers must build and maintain two different listener implementations with different payload formats, different signature verification methods, and different retry behaviors.

Why It Happens: IPN and LCN were developed as independent systems to address different aspects of the commerce lifecycle. IPN handles the payment flow while LCN handles post-purchase subscription management.

Workarounds:

  • Build a unified webhook handler that normalizes both IPN and LCN payloads into a common internal event format
  • Use the 2Checkout REST API to supplement webhook data when you need a complete picture of both transaction and subscription state
  • Consider using a single URL for both IPN and LCN and differentiating by request method (POST for IPN, GET for LCN) or payload content

How Hookdeck Can Help: Hookdeck can receive both IPN and LCN webhooks as separate sources and route them through transformations that normalize the data into a consistent format before delivering to your application, giving you a single, unified event stream.

Testing 2Checkout webhooks

Use the test ordering system

2Checkout provides a test ordering system that generates real webhook notifications for test transactions. Place test orders through your configured checkout flow and verify that your IPN/LCN listeners receive and correctly process the notifications. Remember to check the TEST_ORDER parameter to confirm you're handling test events appropriately.

Resend notifications from the Control Panel

For debugging, navigate to Orders & Reports, find the specific order, and use the resend option on the order details page. 2Checkout regenerates and resends the IPN, and also displays a copy of the notification content in the Control Panel for inspection.

Use a request inspector

Before building your handler, inspect real 2Checkout payloads using a tool like Hookdeck Console:

  1. Create a temporary Hookdeck URL
  2. Configure it as an IPN endpoint in your 2Checkout settings
  3. Place a test order
  4. Inspect the full payload structure, parameters, and headers in the Hookdeck dashboard

This is especially useful for understanding the form-encoded parameter structure and nested product arrays before writing parsing logic.

Validate in staging

Test your webhook integration with realistic scenarios:

  • Single product purchase and completion flow
  • Multi-product orders with bundles
  • Subscription renewals and expirations (via LCN)
  • Refund and chargeback notifications
  • Orders with international (multibyte) customer data
  • Concurrent notifications for the same order

Conclusion

2Checkout's webhook system provides comprehensive coverage of the commerce lifecycle through its IPN and LCN notification services, enabling merchants to automate everything from order provisioning to subscription management. The extensive parameter set, configurable triggers, and staged retry mechanism offer a solid foundation for real-time integrations.

However, the system's complexity, particularly around the cryptographic read receipt requirement, multibyte signature verification, split IPN/LCN architecture, and the lack of a dead letter queue, means production deployments require careful implementation. Investing in proper signature verification, idempotent processing, and robust error handling will prevent most common issues.

For merchants with straightforward payment flows and reliable endpoint infrastructure, 2Checkout's built-in webhook capabilities combined with the practices outlined in this guide will serve well. For high-volume commerce operations, multi-system integrations, or scenarios where delivery guarantees and event replay are critical, webhook infrastructure like Hookdeck can address 2Checkout's limitations by providing automatic receipt handling, payload transformation, persistent event storage, and delivery monitoring without modifying your 2Checkout configuration.


Gareth Wilson

Gareth Wilson

Product Marketing

Multi-time founding marketer, Gareth is PMM at Hookdeck and author of the newsletter, Community Inc.