Skip to content

// e-commerce and billing

Via API

WooCommerce email verification with pingutil

WooCommerce guest checkout takes whatever address the buyer types, and a typo means the order confirmation, download link or invoice goes nowhere. Hooking the order-processed action lets you queue a pingutil check in the background and write the result to the order as a note and meta field, so checkout stays fast and your team sees the bad addresses.

Where it connects: WooCommerce PHP actions woocommerce_checkout_order_processed (classic checkout) and woocommerce_store_api_checkout_order_processed (Checkout block), with Action Scheduler

What goes wrong without it

  • Guest buyers mistype their email, the downloadable product link never arrives and we find out from a chargeback.
  • Coupon hunters create a fresh temp-mail account for every "10% off your first order" code.
  • Half our failed-delivery notices from WordPress mail are for addresses that never existed.

What you can do with WooCommerce and pingutil

  • Add a verification note to every order

    After checkout, queue a /v1/verify call and add a private order note like "pingutil: invalid (mailbox_not_found)". Shop managers see it on the order screen.

  • Hold digital orders with an unreachable address

    For downloadable products, move orders with an invalid address to on-hold so someone confirms the address before the license or file goes out.

  • Catch coupon abuse from throwaway inboxes

    Store the pingutil category on the order. Orders that used a first-order coupon with category "disposable" are easy to filter and review.

  • Suggest a fix at checkout

    If you control the checkout template, a small frontend call to your own endpoint can show the did_you_mean suggestion before the buyer submits, which prevents the problem instead of flagging it.

Set it up

  1. 1

    Create an API key in the pingutil dashboard and define PINGUTIL_KEY in wp-config.php.

  2. 2

    Add the snippet to a small custom plugin (or a code snippets plugin) on the store.

  3. 3

    Hook woocommerce_checkout_order_processed for classic checkout and woocommerce_store_api_checkout_order_processed for the Checkout block.

  4. 4

    Inside the hook, enqueue an async Action Scheduler job with as_enqueue_async_action so the HTTP call never runs during checkout.

  5. 5

    In the job, call /v1/verify, save the status as order meta and add an order note.

  6. 6

    Check WooCommerce > Status > Scheduled Actions to confirm the jobs run.

Custom plugin: verify the order email after checkout
<?php
/**
 * Plugin Name: pingutil order email check
 */

// Classic checkout and Checkout block both queue the same background job.
add_action( 'woocommerce_checkout_order_processed', function ( $order_id ) {
    as_enqueue_async_action( 'pingutil_verify_order', array( $order_id ), 'pingutil' );
}, 10, 1 );

add_action( 'woocommerce_store_api_checkout_order_processed', function ( $order ) {
    as_enqueue_async_action( 'pingutil_verify_order', array( $order->get_id() ), 'pingutil' );
} );

add_action( 'pingutil_verify_order', function ( $order_id ) {
    $order = wc_get_order( $order_id );
    if ( ! $order || ! $order->get_billing_email() ) {
        return;
    }

    $response = wp_remote_post( 'https://pingutil.com/v1/verify', array(
        'timeout' => 30,
        'headers' => array(
            'Authorization' => 'Bearer ' . PINGUTIL_KEY,
            'Content-Type'  => 'application/json',
        ),
        'body'    => wp_json_encode( array( 'email' => $order->get_billing_email() ) ),
    ) );

    // Fail open: network errors, 429 quota_exceeded or 5xx leave the order untouched.
    if ( is_wp_error( $response ) || 200 !== wp_remote_retrieve_response_code( $response ) ) {
        return;
    }

    $result = json_decode( wp_remote_retrieve_body( $response ), true );
    $order->update_meta_data( '_pingutil_status', $result['status'] );
    $order->update_meta_data( '_pingutil_disposable', $result['checks']['disposable'] ? 'yes' : 'no' );

    $note = sprintf( 'pingutil: %s (%s)', $result['status'], $result['reason'] );
    if ( ! empty( $result['did_you_mean'] ) ) {
        $note .= ' Did the buyer mean ' . $result['did_you_mean'] . '?';
    }
    $order->add_order_note( $note );

    if ( 'invalid' === $result['status'] && 'processing' === $order->get_status() ) {
        $order->update_status( 'on-hold', 'Email address is unreachable, confirm before fulfilling.' );
    }
    $order->save();
} );

What to do with each result

pingutil resultAction in WooCommerce
status: "valid"Store the meta, add a note, fulfil as normal.
status: "invalid"Move a processing order to on-hold and contact the buyer by phone from the billing details.
did_you_mean is setInclude the suggestion in the order note so support can correct the billing email.
checks.disposable: trueSave as meta and review coupon use on that order.
status: "risky" or "unknown"Note only. Catch-all company domains and greylisting are normal for real buyers.

Limits to plan for

  • woocommerce_checkout_order_processed does not fire on the Checkout block, and the block hook does not fire on classic checkout, so register both.
  • The job runs after checkout, so it flags orders rather than preventing them. Preventing typos needs a frontend call to your own endpoint before submit.
  • Action Scheduler runs on WP-Cron, so on low-traffic stores jobs can wait until the next page load. pingutil also caps verification at 300 addresses a day (3,000 a month) per account. Those are Free plan limits; Enterprise has custom limits.

WooCommerce documentation

WooCommerce is a trademark of its owner. This integration uses WooCommerce's documented extension points; it is not an official WooCommerce app.

Common questions

Why not verify inside woocommerce_after_checkout_validation?
You can, but a mailbox check can take seconds on slow mail servers, and that time lands on the buyer. If you want a check before the order exists, call /v1/lookup with skip_enrichment for a millisecond disposable check and keep the full verification in the background.
Does this work with HPOS?
Yes. The snippet uses the WC_Order methods (update_meta_data, add_order_note, save) rather than post meta, which is what WooCommerce recommends for High-Performance Order Storage.
Is there a pingutil WooCommerce plugin?
No. The snippet above is a small custom plugin you own and can change.

Stop bad addresses in WooCommerce today

Sign in with your email, create an API key and paste it into the step above. Test on a few real addresses first: the live demo shows exactly what your WooCommerce setup will receive.