=== Parcel Pilot – Australia Post Labels for WooCommerce ===
Tags: australia post, shipping labels, mypost business, eparcel, woocommerce shipping
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
Requires Plugins: woocommerce
WC requires at least: 7.1
WC tested up to: 11.1
Stable tag: 1.5.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Ship WooCommerce orders with Australia Post: one MyPost Business import file for all your orders, or labels straight from an eParcel contract.

== Description ==

Get Australia Post shipments out of WooCommerce without retyping a single address. Everything in the plugin is free, with no limits or sign-up. Choose how you pay for postage:

* **MyPost Business, pay per label.** Tick your orders, choose "Parcel Pilot: export to MyPost Business", and download one file in Australia Post's own import format. Upload it in MyPost Business (Orders > Bulk import), pay for and print the labels there, then paste the tracking numbers back into Parcel Pilot: your customers are emailed their tracking link and the orders are completed. No keys and no extra accounts.
* **eParcel contract, billed to your account.** Labels are created and printed right inside WooCommerce, postage is billed to your Australia Post account when you lodge, and tracking is checked every hour.

Set up in about five minutes with the guided setup, and show customers live Australia Post prices at checkout.

= Checkout rates =

* Live Parcel Post and Express Post prices at checkout, from Australia Post's free postage calculator (any store can get a key).
* Worked out from your box size, your products' weights and your Ship-from postcode; heavy orders are split into parcels under 22 kg.
* Uses Australia Post's size-based price when your box fits one of its size bands (up to 5 kg), and its satchel price when your box is an Australia Post satchel, so customers aren't overcharged.
* Rename each service, adjust prices by a percentage (to pass on your MyPost Business discount), add a handling fee, and set a flat fallback price in case Australia Post can't be reached.
* The Express Post a customer picks at checkout becomes an Express Post label.

= Shipments =

* One click on an order, or the button on the Orders list, sets up the shipment with the right service, box and weight.
* Or let it happen on its own: shipments created as soon as an order is paid (optional).
* Bulk: tick orders and choose the Parcel Pilot bulk action. MyPost Business gets one import file for every ticked order; eParcel gets one PDF with every label.
* Partial and split shipments: choose which items and how many go in each shipment, with up to 20 parcels in one shipment.
* Packaging presets (box sizes and empty weight), including Australia Post satchels and boxes for MyPost Business and flat-rate product codes for eParcel.
* Parcel Post and Express Post, picked automatically from the customer's shipping method.
* Signature on delivery and extra cover; authority to leave and delivery instructions for eParcel.
* Address check against Australia Post's rules before anything is sent.
* Several Ship-from locations.

= MyPost Business import file =

* Every column in Australia Post's domestic import template, one row per parcel.
* "Order 1234" printed on each label so parcels are easy to match up.
* Checks MyPost Business's limits first (weights, sizes, extra cover), so the file imports cleanly.
* Shipments already in a file are never put in a new one by accident, so nothing is paid for twice.
* A Waiting for tracking screen: paste each tracking number and save, one at a time or a whole day's at once.
* Optional: connect a Byteyard account (free for 30 labels a month) to buy MyPost Business labels as you create shipments, with tracking numbers added for you and no import file. See "External services".

= eParcel contract =

* Thermal (4x6 / A6) or office-printer (A4) labels, branded or for pre-printed stationery.
* "Print new labels" in one click: one PDF with every label not printed yet.
* Hands-off mode (optional): automatic daily lodgement at a set time.
* End-of-day lodgement (Australia Post order / manifest) with the order summary PDF.
* Hourly tracking checks and an optional "Delivered" order status.

= Fulfilment and tracking =

* Packing slips and pick lists (single orders or bulk).
* Tracking in the customer's account, in the Completed email, and in the "Order shipped" email for partial shipments.
* Search orders by tracking number.
* A tracking page on your own site: add [parcel_pilot_tracking] to any page and customers look up their parcels with their order number and email.

= Try it first =

Demo mode works without any keys. With MyPost Business the file is real, but adding tracking numbers never completes orders or emails customers. With eParcel, labels are samples stamped NOT VALID FOR POSTAGE.

Works with both WooCommerce order storage types (HPOS and legacy). Australian addresses only: overseas orders are not supported.

== What you need ==

= MyPost Business (pay per label) =

A MyPost Business account with a card saved. It's free from Australia Post. Nothing else: Parcel Pilot makes the import file and you upload it yourself.

= eParcel contract =

Australia Post only gives Shipping & Tracking API keys to businesses with an eParcel or StarTrack contract (aimed at 2,000+ parcels a year, with a business credit account). Register interest at developers.auspost.com.au. They issue Testbed keys first.

== Installation ==

1. Plugins > Add New > Upload Plugin, choose parcel-pilot.zip, then Activate. WooCommerce must be active.
2. Click "Set up labels" in the notice. The guided setup asks how you pay, where you post from, your usual box and (optionally) your postage calculator key for checkout rates. Leave Mode on Demo to try it.
3. MyPost Business (the default): nothing to choose. For your own boxes, set a length, width and height on each one under Packaging; MyPost Business needs them.
   eParcel: under How you pay choose "eParcel contract", Mode Testbed, enter the API key, password and account number, Save, then Test connection. Pick your services. Australia Post reviews your test labels before approving Live.
4. Switch to Live.

= Daily use with MyPost Business =

1. Orders: tick orders > Bulk actions > "Parcel Pilot: export to MyPost Business" > Apply, then click "Download MyPost Business file".
2. In MyPost Business: Orders > Bulk import > choose the file > Import orders. Pay for and print the labels.
3. WooCommerce > Parcel Pilot > Waiting for tracking: paste each tracking number and click "Save tracking numbers".

= Daily use with eParcel =

1. Orders: tick orders > Bulk actions > "Parcel Pilot: create & print labels" > Apply.
2. Print the labels, packing slips and pick list from the results screen.
3. WooCommerce > Parcel Pilot > Lodge parcels > "Lodge ticked shipments" when the parcels go out.

== Frequently Asked Questions ==

= Do I need an eParcel contract? =

No. With MyPost Business you pay for each label in your own MyPost Business account. An eParcel contract is only needed if you want postage billed to an Australia Post credit account.

= Is it really free? =

Yes. Everything in this plugin is free, with no label limits and nothing to unlock. You only pay Australia Post for postage, as you would anyway.

The only paid part is optional and outside the plugin: a Byteyard account, which buys MyPost Business labels for you. Its free account covers 30 labels a month; Pro and Business plans are on byteyard.com.au/pricing. You never need it to use the plugin.

= Why do I upload a file instead of Parcel Pilot buying the labels for me? =

Australia Post only lets its approved eCommerce partners buy MyPost Business labels from other software. The import file is Australia Post's own supported way to bring orders into MyPost Business, so you keep paying per label on your own account.

If you'd rather skip the file, connect a Byteyard account under Settings > How you pay: Byteyard holds the partner connection and buys each label on your own MyPost Business account as you create the shipment.

= What is Byteyard? =

Byteyard makes Parcel Pilot. Its service holds the Australia Post partner connection that buying MyPost Business labels from WooCommerce needs. Connecting is optional, and nothing is sent to Byteyard until you click Connect to Byteyard. In Demo mode Byteyard only makes samples: nothing is bought or counted.

= Can I send overseas? =

Not yet. The plugin creates domestic Australian shipments only and refuses orders with an overseas shipping address.

= How do I cancel a shipment? =

On the order, click Cancel on the shipment. If it was already imported into MyPost Business, delete it there too; a label you've paid for can be refunded in MyPost Business. eParcel shipments can be cancelled until they are lodged.

= Does it slow down my store? =

No. It only runs on the order screens, its own pages and (for eParcel) an hourly background tracking check. On the shop front it adds the tracking block in the customer's account and, if you use checkout rates, one price lookup per cart and postcode, kept for 6 hours.

= Is customer data kept in the debug log? =

The debug log is off by default. When it's on, customer names, street addresses, emails and phone numbers are masked before anything is written.

= What happens to my data if I delete the plugin? =

Settings are always removed. Shipment records, tracking numbers and saved label PDFs are kept unless you tick "When deleted" under Settings > Troubleshooting.

== Screenshots ==

1. Bulk export: a day's orders in one MyPost Business import file, with packing slips and a pick list.
2. Waiting for tracking: paste the tracking numbers from MyPost Business and customers are emailed their link.
3. The Orders list shows what's exported, what's paid for, and every tracking number.
4. The Australia Post panel on an order: one shipment paid for in MyPost Business, with the rest of the order ready to send.
5. Settings: choose MyPost Business (pay per label) or an eParcel contract, and try everything in demo mode first.

== External services ==

With MyPost Business, Parcel Pilot makes no outside requests for labels unless you connect Byteyard: you download the import file and upload it to MyPost Business yourself.

= Byteyard (optional, MyPost Business labels bought in WooCommerce) =

Byteyard is the service from Parcel Pilot's makers that buys MyPost Business labels through Australia Post's partner connection. Only used after a store manager clicks "Connect to Byteyard" under Settings > How you pay and approves the store on byteyard.com.au.
Sent when connecting: the store's home address (URL) and name. After that, with the store's Byteyard token: a check of the plan and MyPost Business connection when Parcel Pilot or order screens are opened or a shipment is created (at most every ten minutes), and, for each label bought, the order number, service, parcel sizes and weights, signature and extra cover, and the recipient's name, business name, delivery address, email and phone, which Byteyard passes to Australia Post. In Demo mode no customer details are sent. Printing or cancelling a label sends only its Byteyard label number.
Host: byteyard.com.au
Terms: https://byteyard.com.au/terms
Privacy: https://byteyard.com.au/privacy

= Australia Post Postage Assessment Calculator (checkout rates only) =

Used to look up Parcel Post and Express Post prices at checkout. Only after the store owner adds a postage calculator key and adds "Australia Post (Parcel Pilot)" to a shipping zone.
Sent when a customer's cart and postcode need a shipping price (answers are kept for 6 hours): the store's postage calculator key, the store's Ship-from postcode, the customer's delivery postcode, and the parcel's size and weight. No names, addresses or order details.
Host: digitalapi.auspost.com.au
Terms: https://auspost.com.au/terms-conditions
Privacy: https://auspost.com.au/privacy

= Australia Post Shipping & Tracking API (eParcel only) =

Used to check addresses, create, price and cancel shipments, download labels, lodge orders (manifests) and check delivery status. Only after the store owner chooses "eParcel contract" and switches Mode to Testbed or Live.
Sent when a label is created, cancelled or lodged, when "Test connection" is clicked, and during the hourly tracking check: the store's API key and account number, the sender address, and the order's recipient name, business name, delivery address, email, phone, delivery instructions, parcel sizes and weights, item descriptions and values.
Hosts: digitalapi.auspost.com.au (and an OAuth token URL if the store owner enters one).
Terms: https://auspost.com.au/terms-conditions
Privacy: https://auspost.com.au/privacy

= Australia Post tracking page =

Tracking numbers in emails and the customer's account link to auspost.com.au/mypost/track. Nothing is sent until the customer clicks the link.

== Privacy ==

The plugin adds suggested text to Settings > Privacy > Policy guide, describing which delivery details go to Australia Post (and to Byteyard, if you connect it). Review it and add it to your privacy policy.

== Changelog ==

= 1.5.0 =
* New: Connect to Byteyard (optional), under Settings > How you pay. Sign in or create a free account on byteyard.com.au and the store is connected with no keys to copy. Then connect your MyPost Business account, and labels are bought as you create shipments, with tracking numbers added and customers emailed straight away. Free account: 30 labels a month.
* New: the How you pay box shows your Byteyard plan, labels used this month and the MyPost Business connection, with an option to go back to the import file at any time.
* Note: Byteyard isn't an approved Australia Post eCommerce Partner yet. Until it is, its labels are samples you can try in Demo mode, and Live shipments keep using the import file.
* New: when the month's Byteyard labels are used up, new shipments go in the import file until the 1st, with a note on the order.
* New: Help covers Byteyard. Sample labels show "Sample label made, nothing bought" on the order, with no price.
* Changed: suggested privacy policy text covers Byteyard.

= 1.4.0 =
* Changed: everything is free, with no plans or limits. Every store can choose MyPost Business or an eParcel contract, use automation and eParcel tracking checks, and the Plans tab is gone. Stores on 1.2's Free plan carry on with the import file, with automation off until they turn it on.
* New: tracking page. Add [parcel_pilot_tracking] to any page and customers can check their delivery with their order number and email.
* New: checkout rates. Live Parcel Post and Express Post prices from Australia Post's postage calculator, as a shipping method for your shipping zones, with price adjustment, handling fee and a fallback price.
* New: guided setup (Get started): how you pay, Ship-from address, your usual box and checkout rates, one screen each. It can add Australia Post prices to your Australia shipping zone for you.
* New: hooks for add-ons (Parcel Pilot tabs, payment options, and buying MyPost Business labels as shipments are created). Labels bought this way are never put in an import file.
* Changed: the plugin lists Byteyard as its author.

= 1.2.0 =
* New: Plans tab. Free covers the MyPost Business import file; Pro adds automatic shipments and the eParcel contract (labels, lodgement and hourly tracking). Switch at any time; settings, shipments and tracking numbers are kept.
* Changed: fresh installs start on the Free plan with MyPost Business. Stores already set up for eParcel move to Pro automatically.

= 1.1.0 =
* New: MyPost Business import file. Export one order or a whole day's orders in Australia Post's import format, pay for and print the labels in MyPost Business, then add the tracking numbers on the new Waiting for tracking screen.
* New: "Set up labels" notice after a fresh install.
* New: suggested privacy policy text.
* New: option to delete shipment records and saved labels when the plugin is deleted.
* Changed: renamed from "AusPost Label Maker" to Parcel Pilot. Plugin folder, main file and text domain are now parcel-pilot; the menu is WooCommerce > Parcel Pilot.
* Changed: the debug log masks customer names, street addresses, emails and phone numbers.
* Changed: a .pot template is in the languages folder.
* Changed: passes the WordPress.org Plugin Check (including experimental checks) with no errors or warnings.
* Changed: declares WooCommerce as a required plugin, tested with WordPress 7.1 and WooCommerce 11.1.
* Changed: MyPost Business works with no third-party account.
* Changed: the MyPost Business file is written the way MyPost Business's importer expects (tested with a real account), and sender phone numbers are converted to the 10 digits it requires.
* Changed: customers see plain delivery statuses ("On its way", "Delivered") in emails and their account.
* Changed: with MyPost Business, settings only show what applies to it, and Waiting for tracking works on phones.

= 1.0.0 =
* First release.

== Upgrade Notice ==

= 1.5.0 =
Optional: connect a Byteyard account to buy MyPost Business labels without the import file. Nothing changes unless you connect.

= 1.4.0 =
Everything is now free, with no plans: eParcel, automation and a new tracking page for every store, plus live Australia Post prices at checkout and a guided setup.

= 1.2.0 =
Adds Free and Pro plans. Your setup carries over: MyPost Business stores start on Free, eParcel stores on Pro.

= 1.1.0 =
MyPost Business now works through Australia Post's own import file, with no extra account. Recommended for all stores.
