WooCommerce Batch Tracking for Peptides: Lot-Level COAs, Per-Lot PDFs and Order Records
A certificate of analysis only proves something if you can show which lot a customer actually received. That’s what WooCommerce batch tracking for peptides is for: tying every order to a lot, and every lot to its COA.
In our post on peptide COAs and endotoxin testing we covered what a strong peptide COA includes. This post is the build: how to set up lots, per-lot PDFs and order records in WooCommerce.
Why product-level COAs aren’t enough
Most peptide stores upload one COA per product and leave it there. The problem is that stock changes. A new lot arrives, the old PDF stays up, and now the page shows test results for a batch you no longer ship.
If a buyer, processor or regulator asks which lot went into a specific order, a product-level COA can’t answer. A lot-level setup can.
The data model: product, lot, COA, order
Before touching settings, get the relationships clear. There are four pieces:
- Product: what you sell, like a specific compound and size.
- Lot: a batch of that product, with its own lot number, received date and status.
- COA: the PDF for that lot.
- Order line item: what a customer bought, with the lot number recorded at the moment of purchase.
Each product has many lots over time. Each lot has one COA. Each order line item points to exactly one lot.
Setting up WooCommerce batch tracking for peptides
There are batch-tracking plugins for WooCommerce, and some stores start there. On the stores we build, we usually set this up with custom fields so the lot data fits the store’s own templates and reporting. Either way, the steps are the same.
Store lots and their data
Each lot needs, at minimum: lot number, product, received date, status (current, sold out, archived) and the COA file. Custom fields on the product work for a small catalog. A dedicated lot record works better once you have many products and frequent restocks.
Attach a COA PDF to each lot
Upload each COA to the media library and attach it to its lot, not to the product. Name files with the lot number so they’re easy to find later.
Show the current lot and COA on the product page
The product page should show the lot number currently shipping, its test date and a download link for that lot’s COA. When a new lot becomes current, the page updates without anyone editing the product.
Write the lot number to each order line item
This is the step most stores skip, and the one that matters most. When an order is placed, record the current lot number on the line item. Here’s a simplified example of how a developer can do it with a WooCommerce hook, assuming the current lot number is stored on the product as _current_lot_number:
add_action( 'woocommerce_checkout_create_order_line_item', function ( $item, $cart_item_key, $values, $order ) {
$product_id = $item->get_variation_id() ?: $item->get_product_id();
$lot = get_post_meta( $product_id, '_current_lot_number', true );
if ( $lot ) {
$item->add_meta_data( 'Lot number', $lot, true );
}
}, 10, 4 );
Because the meta key doesn’t start with an underscore, WooCommerce shows “Lot number” on the order screen and in order emails automatically. Have your developer adapt it to your setup and test it on staging first.
Include the lot and COA in emails and packing slips
Add the lot number and a COA link to order confirmation emails and packing slips. The customer gets the right document, and you get a paper trail that matches what shipped.
Order records processors and regulators ask for
Lot tracking is also a records question. Processors may ask how you document what shipped, and regulators look at records too.
Lumalex Law’s write-up of the Piper sentencing notes that telling customers to keep product names out of payment notes was cited as evidence the seller knew the business was illegal. Clean, consistent records are the opposite of that. For each order, you should be able to show:
- What was ordered, and which lot shipped.
- The COA for that lot.
- When it shipped and where, with tracking.
- How it was paid for, with a billing descriptor that matches your business.
Common mistakes we see
These come up again and again when we review existing peptide stores:
- COA attached to the product, not the lot. The page looks fine until stock changes.
- Lot number only in a spreadsheet. If it’s not on the order, nobody can tie an order to a lot later.
- Hard-coded lot numbers in product descriptions. Someone forgets to update the text when a new lot arrives.
- Variations sharing one lot. Different sizes often come from different lots, so each variation needs its own.
- Old COAs deleted to save space. Customers with older orders lose the document that matches what they received.
Keep it maintainable
A lot system only helps if it stays accurate:
- Archive, don’t delete. Old lots and COAs stay on file for past orders.
- Make the current lot a deliberate switch. Someone marks a new lot as current when the stock actually changes.
- Test changes on staging. Hooks that touch checkout should never be tested on the live store. Our WordPress DevOps setups give every store a staging environment and deploy pipeline for exactly this.
How we build it
Lot-level COAs are part of the compliance architecture we build into RUO stores, alongside clean product templates and high-risk processor integration. You can see an RUO store refresh with dynamic lab reports in our Arcane Peptides case study, and our WooCommerce peptide store setup guide covers the base configuration this sits on.
WooCommerce for peptides works well once each order points to a lot and each lot points to its COA. Set it up once, and every future question about what shipped has a one-click answer.



