=== CatCode Delivery with Trexity for WooCommerce ===
Contributors: catcodestudio
Tags: trexity, same day delivery, shipping, woocommerce, canada
Requires at least: 6.4
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Trexity same-day and next-day delivery: live rates at the checkout, shipments from the order and a tracking link for the buyer.

== Description ==

Adds [Trexity](https://trexity.com/) local delivery to WooCommerce. The buyer types the address and sees the Trexity rates for it; you create the shipment from the order screen and the buyer gets a link to follow the courier. You use your own Trexity merchant account and API key.

* **Live rates at the checkout** — the "Trexity" shipping method asks Trexity for the rates of the typed address and shows each one with the name and the description that Trexity returns. Works with the classic and the block checkout.
* **Only where Trexity delivers** — the address is checked against the Trexity delivery zones first; outside them the method is not offered.
* **Shipments from the order** — choose the service and the pickup day and press "Create shipment". The parcel carries the buyer's name, address, phone, e-mail, the order number and value, and the delivery note of the buyer.
* **Direct shipments** — created as a draft; "Ready for pickup" sends them to the first available courier.
* **Tracking** — the tracking link is kept on the order, shown on the buyer's order page, added to the order e-mails and, if you wish, e-mailed to the buyer when the shipment is created.
* **Status and cancellation** — "Update status" reads the delivery status from Trexity; "Cancel shipment" cancels it there.
* **Check an address** and **Check connection** on the settings screen.
* Price for the buyer: the Trexity price without taxes (WooCommerce adds its own shipping tax) or with the Trexity taxes included.
* Production and sandbox environments. The API key is stored encrypted. Works with HPOS.
* Translations included: English, French (Canada).

= Pro =

The Pro version is sold on [catcode.com.ua](https://catcode.com.ua/modules/catcode-delivery-with-trexity-for-woocommerce/), with a 7-day trial that never starts by itself:

* **Automatic shipments** — a shipment is created when the order reaches the status you choose, with the pickup day set by your cutoff hour.
* **Bulk creation** — "Create Trexity shipments" in the bulk actions of the order list.
* **Labels** — the parcel label as a PDF from the order screen.
* **Choice of services** — offer only the services you want (Same Day Standard, Next Day, Next Day Express, Direct) and set the pickup time of Direct shipments.
* **Status by webhook** — Trexity reports pickups, deliveries and cancellations to the shop; calls are checked by their signature. The order can move to the status you choose when the parcel is delivered.
* **Delivery photo** — the proof-of-delivery photo from the order screen.
* **Several pickup locations** — a default location of your Trexity account and another one for a single order.
* Updates from catcode.com.ua.

The licence runs for 1-5 years and includes updates and support for that term; a purchased licence keeps its Pro features after the term ends. One key covers two sites: the shop and its test copy.

Trexity is a trademark of its owner. This plugin is an independent integration made by CatCode; it is not an official plugin of Trexity and is not affiliated with or endorsed by it. You need your own Trexity merchant account, and your pickup address has to be in a city that Trexity serves.

== External services ==

The plugin connects to the Trexity Merchant API ([trexity.com](https://trexity.com/), documentation at [developers.trexity.com](https://developers.trexity.com/reference/merchant-api/v1)) at `trexity.app`, or at the Trexity sandbox `trexity-driver-mobile.uc.r.appspot.com` when you choose the sandbox environment. Nothing is sent before you enter your API key. Every request carries the API key.

* When a buyer with a complete address reaches the cart or the checkout: the delivery address, your pickup address, the value of the cart and the delivery requirements you set — to check the delivery zone and to get the rates.
* When you press "Check connection": only the API key, to list the locations of your account.
* When you press "Does Trexity deliver here?": the address you typed and your pickup address.
* When a shipment is created: the pickup address and instructions, the buyer's name, delivery address, phone, e-mail and delivery note, the order number and ID, the description and value of the parcel, the service and the pickup day. After that the parcel ID, to read its tracking number.
* When you press "Update status", "Ready for pickup" or "Cancel shipment": the shipment or parcel ID.
* Label and delivery photo (Pro): the parcel ID.
* "Load locations" (Pro): only the API key. "Connect webhooks" (Pro): the webhook address of your shop; Trexity then calls that address with the shipment and parcel data when a status changes.

The tracking link opens the Trexity tracking page (`tracking.trexity.com`) in the buyer's browser.

[Trexity terms of service](https://trexity.com/terms-of-service/) and [privacy policy](https://trexity.com/privacy-policy/).

== Installation ==

1. Upload the plugin and activate it. WooCommerce must be active.
2. In the Trexity merchant portal open Advanced → API Keys and create a key. In WooCommerce → **Trexity** paste it, press "Check connection" and save.
3. Enter the pickup address, or leave it empty to use the business address of your Trexity account.
4. WooCommerce → Settings → Shipping: add the "Trexity" method to the zone that covers your city.
5. Place a test order to an address in your city, open it and press "Create shipment". Use the sandbox environment and a sandbox key while you test.

== Frequently Asked Questions ==

= Do I need a Trexity account? =

Yes. The plugin works with your own merchant account and the API key you create in the Trexity merchant portal. Deliveries are billed by Trexity.

= Why is Trexity not offered at the checkout? =

The buyer has to type the street, the city and the postal code. The method is not offered when the address is outside the Trexity delivery zones, when Trexity returns no rate for it (for example outside your delivery hours), or when the rate is in another currency than the shop's. The last problem of a rate request is shown at the top of the plugin settings screen.

= Can I rename the rates? =

No. Trexity's usage policy asks to show the rate name without changes, so the plugin shows the name and the description exactly as Trexity returns them.

= What happens to Direct and Classic Same Day shipments? =

They need an exact pickup window, so they are created as drafts. For a Direct shipment press "Ready for pickup"; a Classic Same Day draft is scheduled in the Trexity merchant portal. Trexity retires Classic Same Day on January 4, 2027.

= Is the price at the checkout the price Trexity charges me? =

The checkout shows the rate that Trexity returned for that address at that moment. The shipment is created later with the same service, and Trexity prices it again, so the amounts can differ.

== Changelog ==

= 1.0.0 =
* First release.
