Developer notes
Technical reference for developers who customize InPost Shipping & Labels.
Add-on identity
Section titled “Add-on identity”| Item | Value |
|---|---|
| Add-on id | kv_inpost |
| Function prefix | fn_kv_inpost_ |
| Language variables | kv_inpost.* |
| CSS scope | .kv-inpost |
| PHP namespace | Tygh\Addons\KvInpost |
| Preset | shipping |
Structure
Section titled “Structure”| Class | Role |
|---|---|
Client\BaseClient |
HTTP (cURL, TLS verification, timeouts), JSON, error mapping, masked logging |
Client\Api |
ShipX calls: organization, create / get / cancel shipment, label (single and bulk), tracking, dispatch order, point by name |
Shipments |
Order to ShipX payload (receiver, parcel template or dimensions, target_point, COD, insurance), asynchronous completion, status mapping, label storage, cancel |
Points, Parcel |
Locker of an order (own table, or the point stored by EU Pickup Points), Geowidget settings, size templates A/B/C, phone / post code / street normalisation |
RateCalculator |
Customer price from the size rates of the settings |
Client |
Client per company, the connection test |
Accounts, Secret |
Credentials (test and live) sealed with AES-256-GCM; one account per store owner or per vendor |
Config, Access |
Settings, owner mode, who may see and manage what |
Queue, Jobs, JobException |
Job queue: back-off 5 min / 15 min / 1 h / 3 h / 12 h, per-job isolation, overlap lock; handlers in Jobs::handle(), recurring work in Jobs::schedule() |
Log |
Event log with masking, filters, CSV, retention |
Webhook |
URL key check (ShipX events are not signed) and event ids; the controller kv_inpost.webhook?c=<account>&k=<key> answers GET with 200 and stores POST events as jobs |
Database tables
Section titled “Database tables”| Table | Purpose |
|---|---|
?:kv_inpost_accounts |
Credentials per company (secrets sealed), last connection check, token cache |
?:kv_inpost_log |
Log |
?:kv_inpost_jobs |
Queue |
?:kv_inpost_shipments |
Shipments, labels (base64) and tracking |
?:kv_inpost_points |
Parcel locker chosen at the checkout, per order |
Hooks used
Section titled “Hooks used”PHP: change_order_status_post (label at a status), get_order_info, place_order, place_suborders, delete_order (locker with the order), template_document_order_context_init (locker text on documents). Template hooks: checkout/shipping_method.post (locker card), index/scripts.post and index/styles.post (checkout only scripts), orders/totals_shipping.post (customer order page), orders/tabs_extra.post (admin tab). Pre-controller checkout.pre refuses a locker order without a locker.
The storefront output is the checkout page (never cached: it depends on the session cart) plus one static stylesheet; nothing per-visitor is printed on cacheable pages, so the add-on is safe with the full page cache of 4.21.
Test the HTTP layer without the provider
Section titled “Test the HTTP layer without the provider”The base URL can be overridden for tests in config.local.php (development only):
$config['kv_inpost_base_url'] = 'http://127.0.0.1:11830';node tests/mock-server/server.js 11830 starts a local stand-in of the ShipX API that follows the official documentation; node tests/e2e/e2e.mjs runs the HTTP end-to-end test against it; php tests/unit.php runs the unit tests.
Template overrides
Section titled “Template overrides”Admin templates live in design/backend/templates/addons/kv_inpost/. Do not edit them in a store; they are replaced on update.