---
title: How to Create a Pay by Invoice Payment Method
description: "This guide walks you through setting up a **Pay by Invoice** gateway so B2B customers can place orders now and pay later by invoice. Table of Contents [Toggle](#) - [Before you start](#Before_you_start) - [Step 1: Create the gateway](#Step_1_Create_the_gateway) - [Step 2: Enable…"
url: "https://wpruby.com/knowledgebase/how-to-create-a-pay-by-invoice-payment-method/"
updated: "2026-07-07"
category: WooCommerce Custom Payment Gateway Pro
---

# How to Create a Pay by Invoice Payment Method

This guide walks you through setting up a **Pay by Invoice** gateway so B2B customers can place orders now and pay later by invoice.

Table of Contents

 [Toggle](#)

- [Before you start](#Before_you_start)
- [Step 1: Create the gateway](#Step_1_Create_the_gateway)
- [Step 2: Enable the gateway](#Step_2_Enable_the_gateway)
- [Step 3: Set the Method Title](#Step_3_Set_the_Method_Title)
- [Step 4: Add a customer message](#Step_4_Add_a_customer_message)
- [Step 5: Add invoice instructions](#Step_5_Add_invoice_instructions)
- [Step 6: Add payment terms](#Step_6_Add_payment_terms)
- [Step 7: Add invoice contact email](#Step_7_Add_invoice_contact_email)
- [Step 8: Set order status to On hold](#Step_8_Set_order_status_to_On_hold)
- [Step 9: Add recommended checkout fields](#Step_9_Add_recommended_checkout_fields)
  - [Example help text](#Example_help_text)
- [Step 10: Add a customer note (optional)](#Step_10_Add_a_customer_note_optional)
- [Step 11: Optional conditional rule](#Step_11_Optional_conditional_rule)
- [Step 12: Test as an administrator](#Step_12_Test_as_an_administrator)
- [Copy-paste example text](#Copy-paste_example_text)

## Before you start

[https://github.com/wsenjer/woocommerce-custom-payment-gateway/blob/docs-cursor/docs/pay-by-invoice-setup.md#before-you-start](https://github.com/wsenjer/woocommerce-custom-payment-gateway/blob/docs-cursor/docs/pay-by-invoice-setup.md#before-you-start)

- WooCommerce Custom Payment Gateway Pro is installed and licensed.
- You know your invoice process: who sends invoices, payment terms, and contact details.

The fastest way to start is the **Pay by Invoice** template. You can also configure a gateway manually.

---

## Step 1: Create the gateway

[https://github.com/wsenjer/woocommerce-custom-payment-gateway/blob/docs-cursor/docs/pay-by-invoice-setup.md#step-1-create-the-gateway](https://github.com/wsenjer/woocommerce-custom-payment-gateway/blob/docs-cursor/docs/pay-by-invoice-setup.md#step-1-create-the-gateway)

1. Go to **WooCommerce → Settings → Custom Payment Gateways**.
2. Under **Create gateway**, select the **Pay by Invoice** template.
3. Enter a gateway name (for example, `Pay by Invoice`).
4. Click create.
5. Click **Configure** (or go to **WooCommerce → Settings → Payments** and click **Manage**).

---

## Step 2: Enable the gateway

[https://github.com/wsenjer/woocommerce-custom-payment-gateway/blob/docs-cursor/docs/pay-by-invoice-setup.md#step-2-enable-the-gateway](https://github.com/wsenjer/woocommerce-custom-payment-gateway/blob/docs-cursor/docs/pay-by-invoice-setup.md#step-2-enable-the-gateway)

On the gateway settings page:

1. Check **Enable Custom Payment**.
2. Leave **Enable Debug Mode** checked for now (admin-only testing).

---

## Step 3: Set the Method Title

[https://github.com/wsenjer/woocommerce-custom-payment-gateway/blob/docs-cursor/docs/pay-by-invoice-setup.md#step-3-set-the-method-title](https://github.com/wsenjer/woocommerce-custom-payment-gateway/blob/docs-cursor/docs/pay-by-invoice-setup.md#step-3-set-the-method-title)

**Method Title:** `Pay by Invoice`

This is the name customers see at checkout.

---

## Step 4: Add a customer message

[https://github.com/wsenjer/woocommerce-custom-payment-gateway/blob/docs-cursor/docs/pay-by-invoice-setup.md#step-4-add-a-customer-message](https://github.com/wsenjer/woocommerce-custom-payment-gateway/blob/docs-cursor/docs/pay-by-invoice-setup.md#step-4-add-a-customer-message)

In **Customer Message**, add text that explains the process:

```php
Place your order now and pay later by invoice. We will send the invoice and payment instructions after reviewing your order.
```

---

## Step 5: Add invoice instructions

[https://github.com/wsenjer/woocommerce-custom-payment-gateway/blob/docs-cursor/docs/pay-by-invoice-setup.md#step-5-add-invoice-instructions](https://github.com/wsenjer/woocommerce-custom-payment-gateway/blob/docs-cursor/docs/pay-by-invoice-setup.md#step-5-add-invoice-instructions)

In **Invoice Instructions** (template field), add details shown in the **Payment details** section:

```php
After your order is approved, we will email a PDF invoice to your billing contact. Please reference your order number on all payments and correspondence.
```

---

## Step 6: Add payment terms

[https://github.com/wsenjer/woocommerce-custom-payment-gateway/blob/docs-cursor/docs/pay-by-invoice-setup.md#step-6-add-payment-terms](https://github.com/wsenjer/woocommerce-custom-payment-gateway/blob/docs-cursor/docs/pay-by-invoice-setup.md#step-6-add-payment-terms)

In **Payment Terms**:

```php
Net 30 days from invoice date
```

Adjust to match your business (Net 15, Net 45, Due on receipt, and so on).

---

## Step 7: Add invoice contact email

[https://github.com/wsenjer/woocommerce-custom-payment-gateway/blob/docs-cursor/docs/pay-by-invoice-setup.md#step-7-add-invoice-contact-email](https://github.com/wsenjer/woocommerce-custom-payment-gateway/blob/docs-cursor/docs/pay-by-invoice-setup.md#step-7-add-invoice-contact-email)

In **Invoice Contact Email**:

```php
accounts@yourstore.com
```

Replace with your accounts or finance email address.

---

## Step 8: Set order status to On hold

[https://github.com/wsenjer/woocommerce-custom-payment-gateway/blob/docs-cursor/docs/pay-by-invoice-setup.md#step-8-set-order-status-to-on-hold](https://github.com/wsenjer/woocommerce-custom-payment-gateway/blob/docs-cursor/docs/pay-by-invoice-setup.md#step-8-set-order-status-to-on-hold)

**Order Status After The Checkout:** `On hold`

This keeps orders open until you review them and receive payment.

---

## Step 9: Add recommended checkout fields

[https://github.com/wsenjer/woocommerce-custom-payment-gateway/blob/docs-cursor/docs/pay-by-invoice-setup.md#step-9-add-recommended-checkout-fields](https://github.com/wsenjer/woocommerce-custom-payment-gateway/blob/docs-cursor/docs/pay-by-invoice-setup.md#step-9-add-recommended-checkout-fields)

Scroll to **Custom Form**. The Pay by Invoice template includes these fields by default. Confirm or add them:

| Field type | Field label | Required |
| --- | --- | --- |
| Text | Company name | No |
| Text | VAT / Tax ID | No |
| Text | Purchase order number | No |
| Email | Billing contact email | Yes |

### Example help text

[https://github.com/wsenjer/woocommerce-custom-payment-gateway/blob/docs-cursor/docs/pay-by-invoice-setup.md#example-help-text](https://github.com/wsenjer/woocommerce-custom-payment-gateway/blob/docs-cursor/docs/pay-by-invoice-setup.md#example-help-text)

- **Company name:** `Enter your registered company name`
- **VAT / Tax ID:** `Your tax or VAT registration number`
- **Purchase order number:** `Your internal PO reference`
- **Billing contact email:** `We will send the invoice to this address`

Click **Save changes** in the field builder.

---

## Step 10: Add a customer note (optional)

[https://github.com/wsenjer/woocommerce-custom-payment-gateway/blob/docs-cursor/docs/pay-by-invoice-setup.md#step-10-add-a-customer-note-optional](https://github.com/wsenjer/woocommerce-custom-payment-gateway/blob/docs-cursor/docs/pay-by-invoice-setup.md#step-10-add-a-customer-note-optional)

In **Customer Note**, add post-checkout text:

```php
Thank you for your order. Our accounts team will review your order and send an invoice within 2 business days. If you have questions, contact accounts@yourstore.com.
```

---

## Step 11: Optional conditional rule

[https://github.com/wsenjer/woocommerce-custom-payment-gateway/blob/docs-cursor/docs/pay-by-invoice-setup.md#step-11-optional-conditional-rule](https://github.com/wsenjer/woocommerce-custom-payment-gateway/blob/docs-cursor/docs/pay-by-invoice-setup.md#step-11-optional-conditional-rule)

Show Pay by Invoice only to logged-in wholesale customers:

1. Under **Conditional Display Rules**, check **Enable conditional display rules**.
2. Add condition:
   - **Condition type:** User role
   - **Operator:** is
   - **Value:** Your wholesale role
3. Save changes.

See [Conditional Display Rules](https://wpruby.com/knowledgebase/conditional-display-rules/) for more examples.

---

## Step 12: Test as an administrator

[https://github.com/wsenjer/woocommerce-custom-payment-gateway/blob/docs-cursor/docs/pay-by-invoice-setup.md#step-12-test-as-an-administrator](https://github.com/wsenjer/woocommerce-custom-payment-gateway/blob/docs-cursor/docs/pay-by-invoice-setup.md#step-12-test-as-an-administrator)

1. Confirm **Enable Debug Mode** is on.
2. Log in as an administrator.
3. Add a product to the cart and go to checkout.
4. Select **Pay by Invoice**.
5. Confirm:
   - Customer message and payment details appear
   - Checkout fields work and required fields block submission when empty
   - Order status is **On hold** after checkout
   - Submitted data appears on the order in admin
   - Customer note appears on the thank-you page
6. When everything looks correct, turn off **Enable Debug Mode** and save.

---

## Copy-paste example text

[https://github.com/wsenjer/woocommerce-custom-payment-gateway/blob/docs-cursor/docs/pay-by-invoice-setup.md#copy-paste-example-text](https://github.com/wsenjer/woocommerce-custom-payment-gateway/blob/docs-cursor/docs/pay-by-invoice-setup.md#copy-paste-example-text)

Use and adapt these blocks:

**Customer Message**

```php
Place your order now and pay later by invoice. We will send the invoice and payment instructions after reviewing your order.
```

**Invoice Instructions**

```php
We will email your invoice after order review. Include your order number on all payments.
```

**Payment Terms**

```php
Net 30 days from invoice date
```

**Customer Note**

```php
Thank you for your order. Your invoice will be sent shortly. Payment is due within 30 days of the invoice date.
```

---
