Many business buyers can’t pay a supplier without a purchase order (PO) number. Their accounts team matches each invoice to an approved PO before it’s paid, and an invoice without one often waits until someone asks for it. WooCommerce has no PO field at checkout, so the number ends up in the order notes, in a separate email, or nowhere at all.
This guide shows you how to add a purchase order number field to an invoice payment method with WooCommerce Custom Payment Gateway Pro, make it required, and get the number to the people who need it. If you haven’t set up invoice payments yet, read how to add a pay by invoice payment method to WooCommerce first. This post is about the PO number.
Why B2B buyers need a PO number
- It proves the purchase was approved. In many companies, schools and public bodies, a buyer can’t order without a PO from their purchasing team.
- Their accounts team pays against it. Your invoice is matched to the PO before payment is released.
- It saves you a chase. If you collect the PO at checkout, you can quote it on your invoice straight away instead of emailing the buyer later.
A PO number only matters when the buyer pays on account. Card buyers don’t need it. That’s why it works best as a field on the payment method itself: in Custom Payment Gateway Pro, a payment method’s fields appear at checkout only when the customer selects that method.
Step 1: Create an invoice payment method
Go to WooCommerce → Settings → Custom Payment Gateways. Under Create gateway, choose the Pay by Invoice template, give the method a name and create it. Then click Configure.

The template sets the order status to On hold and adds four checkout fields: Company name, VAT / Tax ID, Purchase order number and Billing contact email. New methods start switched off, so tick Enable Custom Payment when you’re ready. Every other invoice setting is covered in how to create a pay by invoice payment method.
You don’t have to use the template. You can add a PO field to any method you’ve made with the plugin, such as a bank transfer method, in the same field builder.
Step 2: Set up the PO number field
On the method’s settings page, scroll to Custom Form. The field builder has three panels: the field palette, a checkout preview and the field settings. Click the Purchase order number field in the preview, or add a new Text field if your method doesn’t have one.

Then set:
- Field label: use the words your buyers use, such as “PO number” or “Purchase order number”.
- Required: the template sets it to No, because not every buyer uses POs. Set it to Yes if you can’t invoice without one. Checkout then stops and asks for the number when the field is empty.
- Help text: a short hint shown with the field, for example “The PO number for this order, from your purchasing team”.
- API parameter: only needed if you send the PO number to another system (see below).
Save the field builder, then save the page.
One thing to know: for logged-in customers, text fields are filled in with the value they entered last time. That’s handy for the company name and VAT ID. A PO number changes with every order, so since version 4.0.3 fields named like a purchase order number or a payment reference are left empty. Keep “PO” or “purchase order” in the field’s label, and buyers enter a fresh PO each time.
Collect the PO document too
Some buyers send a signed PO as a PDF. Add a File Upload field next to the PO number. By default it accepts jpg, jpeg, png, webp and pdf files up to 5 MB, and you can choose whether the file link shows on the order screen and in emails. Uploaded files are stored in the WordPress media library. See custom payment fields for WooCommerce for the other field types.
Optional: check the PO format
The text field accepts any text. There’s no format setting. If your buyers’ POs follow a pattern, a developer can check it with the plugin’s custom_payment_gateways_validate_field filter. Return true to accept the value, or an error message to stop checkout:
add_filter( 'custom_payment_gateways_validate_field', function ( $valid, $field_name, $value ) {
if ( 'Purchase order number' !== $field_name || ! is_string( $value ) ) {
return $valid;
}
$value = trim( $value );
if ( '' === $value || '-' === $value ) {
return $valid; // Empty values are handled by the Required setting.
}
if ( ! preg_match( '/^PO-d{4,}$/', $value ) ) {
return 'Please enter your PO number in the format PO-12345.';
}
return $valid;
}, 10, 3 );
The field name is the label you gave the field, so change it in the code if you renamed the field.
Step 3: Keep the order on hold until you’re paid
Leave Order Status After The Checkout on On hold. The order stays open while you send the invoice and wait for payment. When the money arrives, move it to Processing or Completed.
The template also gives you Invoice Instructions, Payment Terms (for example “Net 30 days from invoice date”) and an Invoice Contact Email. They’re shown to the buyer as payment details at checkout and on the thank-you page. A Customer Note appears on the thank-you page and is added to the order as a note to the customer.
Where the PO number shows up
- The order edit screen. A Payment Information box lists every value the buyer submitted, including the PO number. This needs the global setting Store Payment Information in the Database, which is on by default.
- Order emails. Turn on Add payment info to emails under WooCommerce → Settings → Custom Payment Gateways. It’s off by default. When it’s on, a “Submitted Payment Information” table is added to WooCommerce order emails, so both your team and the buyer see the PO number.
- PDF invoices, if you use PDF Invoices & Packing Slips for WooCommerce. With the email setting on, the plugin adds the same table to the documents that plugin creates. Custom Payment Gateway Pro doesn’t create invoices itself.
- Your invoicing or ERP system. Give the field an API parameter and the method can send the order data to an external API after checkout, as JSON or form data.

The PO number isn’t shown in the customer’s My Account order view or on the thank-you page, and it isn’t added to the order notes. If buyers need a copy, turn on the email setting.
Show the method only to approved customers
Paying by invoice means giving credit, so you’ll usually want the method only for accounts you’ve approved. Each method in Custom Payment Gateway Pro has conditional display rules. You can show it by user role, logged-in status, cart total or subtotal, country, currency, products, product categories, coupons or shipping method. A common setup is one rule: User role is Wholesale. All the conditions you add must match.

While you test, turn on Enable Debug Mode on the method. Only administrators can use it until you turn it off.
If you approve accounts one by one, or need “this OR that” logic, use Restricted Shipping and Payment Pro alongside it. Its payment conditions work with any WooCommerce payment method, including the ones you make with Custom Payment Gateway Pro. It adds a Customer rule that matches a customer’s email, a Previous Orders rule that counts their processing and completed orders, and rule groups you can combine with AND or OR. For example: show Pay by Invoice only when the customer is logged in AND their email is one of your approved accounts. Keep the logged-in rule: for guests, the email checked is the billing email they type at checkout.
Frequently asked questions
Can I require a PO number from some customers only?
Required applies to everyone who chooses that method. Pro lets you create as many methods as you need, so make two invoice methods, one with the PO field required and one without, and use display rules to show each one to the right customers.
Does it work with the block checkout?
Yes. The PO field and the other custom fields work on the WooCommerce block checkout and the classic checkout.
Will the PO number appear on my invoices?
Only if your invoices come from PDF Invoices & Packing Slips for WooCommerce, with Add payment info to emails on, or from a system you send the order data to by API. If you write invoices by hand in your accounting software, copy the number from the order screen.
Can I add a PO field with the free plugin?
Partly. The free Custom Payment Gateway for WooCommerce adds one payment method with one text box, which you can make required. The value is saved as an order note. You can’t add more fields, upload a PO document, show it in emails or limit who sees the method.
Collect PO numbers with WooCommerce Custom Payment Gateway Pro
WooCommerce Custom Payment Gateway Pro lets B2B buyers enter their purchase order number when they choose to pay by invoice. The order waits on hold, the PO number is on the order screen and, if you choose, in your order emails. Display rules keep the method for the customers you’ve approved. Start from the Pay by Invoice template and the PO field is already in place.