Skip to content
2E0JWR
PBNPorkbun for WHMCS

Automatic pricing

Keep WHMCS domain prices in step with Porkbun's costs automatically. The Import Pricing wizard for a one-off, or a nightly sync that applies your markup to current costs.

Keeping your customer-facing domain prices in step with what Porkbun actually charges you, without doing it by hand.

The problem this solves

Porkbun has no reseller tier. The prices it quotes are what your account pays, and everything a customer is charged is that cost plus a margin you choose.

Those costs move. Registries raise prices, promotional first-year rates end, and none of it is announced to you. Meanwhile your WHMCS price list is a set of fixed numbers that are only as current as the last time somebody updated them.

The failure mode is quiet: a TLD’s renewal cost creeps past your retail price, and you find out when you look at the margin on a year’s renewals.

Two ways to price

WHMCS’s Import Pricing wizard (one-off)

Configuration → System Settings → Domain Pricing → Import Pricing, choose Porkbun.

The module hands WHMCS Porkbun’s cost prices and the wizard is where you apply a margin. Good for initial setup and for checking what a TLD costs.

Handshake TLDs are excluded, and prices arrive in the currency set by Pricing currency.

This is a manual job you have to remember to repeat.

The nightly sync (ongoing)

The module applies your markup rules to Porkbun’s current costs and writes finished retail prices straight into Domain Pricing.

This does not make WHMCS pricing dynamic — WHMCS has no such mode. Every price a customer sees is a fixed stored number. What the sync changes is that you are no longer the one keeping those numbers current.

Pick one. Using both means marking up twice.

Setting up the sync

1. Configure the markup

On the registrar config page:

SettingA reasonable starting point
Markup %25
Minimum margin3
Round prices toNext price ending .99
Which TLDs to priceOnly TLDs already assigned to Porkbun

The minimum margin matters more than it looks. Porkbun’s first-year prices are promotional — .xyz registers around $2 and renews around $14 — and a percentage of $2 is pennies.

2. Sort out the currency

Porkbun quotes in USD. Either:

  • Add USD under Configuration → System Settings → Currencies and leave Pricing currency as USD. WHMCS converts into your other currencies.
  • Set Pricing currency to your own (GBP) and the module converts first, using the exchange rates already in WHMCS.
  • If you have no USD currency at all, set your own currency and fill in USD conversion rate manually, because WHMCS has no rate to work from.

3. Save

The save validates your markup rules and currency settings. A malformed rule is rejected here, with the line number, rather than failing silently on the cron at 3am.

4. Preview

This writes nothing:

cd /path-to-whmcs/modules/registrars/porkbun
php pricing.php
Preview (nothing written) — prices in GBP, converted from USD at 0.79
Terms: 1 year only (years 2-10 switched off)

TLD              ACTION     COST (reg/renew/xfer)    RETAIL (reg/renew/xfer)  NOTE
-----------------------------------------------------------------------------------
.com             update     8.75 / 8.75 / 8.75       11.99 / 11.99 / 11.99
.co.uk           update     3.41 / 4.47 / 0.00       5.99 / 6.99 / -
.app             create     6.91 / 11.79 / 11.79     9.99 / 15.99 / 15.99
.net             skip       - / - / -                - / - / -                assigned to the enom registrar in WHMCS

Read the Terms: line as carefully as the prices. Then:

php pricing.php --apply

5. Turn on the nightly run

Tick Sync retail pricing daily and save. It runs on the WHMCS daily cron you already have, logs a summary to the activity log and every row to the module log.

After installing or updating the module, open the registrar config and click Save Changes even if you change nothing. WHMCS only scans for the module’s hooks.php file when the module is activated or saved, and that file is what schedules the nightly run.

What it writes, and what it leaves alone

It writes: register, renew and transfer prices, in your chosen currency. When it introduces a TLD that WHMCS did not have, it also sets the registrar to Porkbun and marks an EPP code as required for transfers.

It leaves alone: ID protection, DNS management, email forwarding, display order, groups. Those are your decisions, and a price sync has no business changing them.

It never takes a TLD from another registrar. A TLD already assigned to eNom or ResellerClub is skipped and reported in the output, whatever scope you chose.

It leaves a 0.00 transfer price alone. Porkbun quotes 0.00 for transfers it does not price — .uk among them, which the API cannot transfer at all. That is not the same as a free transfer, so whatever WHMCS already has is kept rather than publishing a zero.

The one-year question

By default the sync prices year 1 and switches years 2–10 off.

That is not a limitation of the sync; it is the API being honest. Porkbun registers and renews the registry-minimum term per call, so a customer who buys a three-year registration gets one year, and the module writes a note to the module log saying so. Offering terms you cannot deliver turns into a refund conversation.

If you would rather keep your existing multi-year prices and handle the extra years by hand, set Registration terms to leave other terms as they are before you apply. The preview’s Terms: line tells you which of the two you are about to get.

Running it manually

php pricing.php                    preview everything
php pricing.php --apply            write it
php pricing.php --tld=.com,.dev    limit the run
php pricing.php --all              include skipped TLDs in the output

Full detail in the command line reference.