myparcelnl / pdk
MyParcel Plugin Development Kit
Requires
- php: >=7.4.0
- ext-zip: *
- fruitcake/php-cors: ^1.2
- myparcelnl/sdk: ^11.0.0-beta.19@beta
- php-di/php-di: ^6.0.0
- psr/log: ^1.0.0 || ^2.0.0 || ^3.0.0
- symfony/http-foundation: ^2.0.0 || ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0
Requires (Dev)
- behat/behat: ^3.13
- brick/varexporter: ^0.4
- guzzlehttp/guzzle: ^7.5
- league/openapi-psr7-validator: ^0.22
- mockery/mockery: ^1.6
- myparcelnl/devtools: ^1.0.0
- nette/robot-loader: ^3.0.0
- pestphp/pest: ^1.0.0
- phpdocumentor/reflection-docblock: ^5.0.0
- phpstan/phpstan: ^1.0.0
- rector/rector: ^1.0.0
- spatie/pest-plugin-snapshots: ^1.0.0
- symfony/console: ^2.0.0 || ^3.0.0 || ^4.0.0 || ^5.0.0
- dev-main
- 4.0.0
- v3.x-dev
- 3.5.3
- 3.5.2
- 3.5.1
- 3.5.0
- 3.4.2
- 3.4.1
- 3.4.0
- 3.3.3
- 3.3.2
- 3.3.1
- 3.3.0
- 3.2.3
- 3.2.2
- 3.2.1
- 3.2.0
- 3.1.2
- 3.1.1
- 3.1.0
- 3.0.1
- 3.0.0
- v2.x-dev
- 2.68.0
- 2.67.1
- 2.67.0
- 2.66.0
- 2.65.2
- 2.65.1
- 2.65.0
- 2.64.0
- 2.63.3
- 2.63.2
- 2.63.1
- 2.63.0
- 2.62.0
- 2.61.0
- 2.60.1
- 2.60.0
- 2.59.1
- 2.59.0
- 2.58.6
- 2.58.5
- 2.58.4
- 2.58.3
- 2.58.2
- 2.58.1
- 2.58.0
- 2.57.1
- 2.57.0
- 2.56.0
- 2.55.0
- 2.54.1
- 2.54.0
- 2.53.2
- 2.53.1
- 2.53.0
- 2.52.1
- 2.52.0
- 2.51.2
- 2.51.1
- 2.51.0
- 2.50.0
- 2.49.1
- 2.49.0
- 2.48.0
- 2.47.2
- 2.47.1
- 2.47.0
- 2.46.1
- 2.46.0
- 2.45.0
- 2.44.0
- 2.43.6
- 2.43.5
- 2.43.4
- 2.43.3
- 2.43.2
- 2.43.1
- 2.43.0
- 2.42.3
- 2.42.2
- 2.42.1
- 2.42.0
- 2.41.0
- 2.40.0
- 2.39.3
- 2.39.2
- 2.39.1
- 2.39.0
- 2.38.1
- 2.38.0
- 2.37.1
- 2.37.0
- 2.36.5
- 2.36.4
- 2.36.3
- 2.36.2
- 2.36.1
- 2.36.0
- 2.35.0
- 2.34.0
- 2.33.2
- 2.33.1
- 2.33.0
- 2.32.2
- 2.32.1
- 2.32.0
- 2.31.5
- 2.31.4
- 2.31.3
- 2.31.2
- 2.31.1
- 2.31.0
- 2.30.4
- 2.30.3
- 2.30.2
- 2.30.1
- 2.30.0
- 2.29.0
- 2.28.9
- 2.28.8
- 2.28.7
- 2.28.6
- 2.28.5
- 2.28.4
- 2.28.3
- 2.28.2
- 2.28.1
- 2.28.0
- 2.27.0
- 2.26.0
- 2.25.2
- 2.25.1
- 2.25.0
- 2.24.2
- 2.24.1
- 2.24.0
- 2.23.1
- 2.23.0
- 2.22.0
- 2.21.0
- 2.20.1
- 2.20.0
- 2.19.2
- 2.19.1
- 2.19.0
- 2.18.0
- 2.17.1
- 2.17.0
- 2.16.2
- 2.16.1
- 2.16.0
- 2.15.0
- 2.14.1
- 2.14.0
- 2.13.0
- 2.12.3
- 2.12.2
- 2.12.1
- 2.12.0
- 2.11.1
- 2.11.0
- 2.10.0
- 2.9.2
- 2.9.1
- 2.9.0
- 2.8.0
- 2.7.0
- 2.6.5
- 2.6.4
- 2.6.3
- 2.6.2
- 2.6.1
- 2.6.0
- 2.5.2
- 2.5.1
- 2.5.0
- 2.4.2
- 2.4.1
- 2.4.0
- 2.3.0
- 2.2.2
- 2.2.1
- 2.2.0
- 2.1.0
- 2.0.0
- 1.37.0
- 1.36.0
- 1.35.0
- 1.34.0
- 1.33.0
- 1.32.1
- 1.32.0
- 1.31.0
- 1.30.0
- 1.29.1
- 1.29.0
- 1.28.1
- 1.28.0
- 1.27.0
- 1.26.2
- 1.26.1
- 1.26.0
- 1.25.3
- 1.25.2
- 1.25.1
- 1.25.0
- 1.24.0
- 1.23.0
- 1.22.0
- 1.21.0
- 1.20.0
- 1.19.0
- 1.18.1
- 1.18.0
- 1.17.0
- 1.16.0
- 1.15.0
- 1.14.0
- 1.13.0
- 1.12.0
- 1.11.1
- 1.11.0
- 1.10.1
- 1.10.0
- 1.9.2
- 1.9.1
- 1.9.0
- 1.8.0
- 1.7.2
- 1.7.1
- 1.7.0
- 1.6.0
- 1.5.0
- 1.4.1
- 1.4.0
- 1.3.0
- 1.2.0
- 1.1.0
- 1.0.1
- 1.0.0
- dev-dependabot/composer/league/openapi-psr7-validator-tw-0.22or-tw-0.24
- dev-dependabot/composer/league/openapi-psr7-validator-tw-0.22.0or-tw-0.24
- dev-dependabot/npm_and_yarn/axios-1.17.0
- dev-v4-capabilities
- dev-fix/international-mailbox-delivery-options
- dev-chore/capabilities-cleanup
- dev-chore/remove-dead-type-constants
- dev-fix/proposition-italy-mapping
- dev-fix/enable-dhl-europlus-for-eu
- dev-gh-readonly-queue/main/pr-477-b323f629a21fb2347481ae1d9cc7e089374afc3a
- dev-dependabot/composer/justinrainbow/json-schema-tw-5.2or-tw-6.0
- dev-dependabot/npm_and_yarn/axios-1.16.1
- dev-fix/insurance-micros-conversion
- dev-dependabot/composer/phpdocumentor/reflection-docblock-tw-5.0.0or-tw-6.0.0
- dev-fix/carrier-settings-include-all-enabled-carriers
- dev-feat/INT-1504-carrier-schema-cleanup
- dev-fix/INT-1261-jsonresponse-and-agecheck-compat
- dev-feat/int-951-per-migration-tracking
- dev-feat/INT-1261-carrier-model-refactor
- dev-feat/capabilities-contract-definitions
- dev-fix/preserve-original-product-weight-in-order
- dev-revert-394-feature/refactor-platform-naming-to-proposition
- dev-temp/demo
- dev-fix/allow-international-mailbox
- dev-feat/pickup-locations-display-config
- dev-feat/replace-ups-carrier-8-with-12-13
- dev-fix/correct-price-order-export
- dev-feat/address-widget-toggle
- dev-breaking/update-v3
- dev-feat/small-package-be-pickup
- dev-fix/webhook/process-webhook-when-received
- dev-feat/add-toggle-for-delivery-options-settings
- dev-fix/pdk-dpd-shipment-export
- dev-gh-readonly-queue/main/pr-290-4d1d6f3e5c4b4f2c1364185fcdcf370c96cdc674
- dev-feat-insurance-be
- dev-fix/disable-some-options-for-postnl-pickup
- dev-refactor/customs-declaration
- dev-feat/add-platform-alias-for-folder-names
- dev-fix/return-shipment-options
- dev-fix/fix-validation-schema
- dev-wip/php-8-rector
- dev-fix/set-default-country-of-origin
- dev-fix/order-status-digitalstamp-field-to-select
- dev-fix/fix-orders-without-weight
- dev-refactor/changed-order-status-digitalstamp-field
- dev-wip/improve-storage
- dev-wip/test-base-state-1
- dev-wip/test-base-state
- dev-wip/integration-tests
- dev-feat/check-subscription-permissions
- dev-fix/separate-logic-for-posting-single-note
- dev-feat/add-order-notes
- dev-feat/add-invoice
- dev-alpha
- dev-feat/currency-format
- dev-feat/add-eori-vat-to-contact-details
- dev-fix/always-return-int-as-package-type-id
- dev-feat/currency-service
- dev-fix/prevent-exporting-of-all-shipments-on-order
- dev-fix/fix-error-when-getting-pdk-version
- dev-feat/arrayable-flags
- dev-fix/pass-correct-print-positions-to-api
- dev-fix/add-physical-properties-to-shipment
- dev-doc-generator
- dev-feat/add-pdkorder-fulfilmentorder-adapter
- dev-feat/add-validation
This package is auto-updated.
Last update: 2026-06-04 16:56:16 UTC
README
The MyParcel PDK (Plugin Development Kit) is meant for developing entire plugins on PHP E-Commerce platforms. If you're just looking to connect to our API without creating an entire plugin, you should check out our php SDK.
Requirements
- PHP 7.4 – 8.5
- Composer
Documentation
For examples, guides and in-depth information, visit our Plugin Development Kit (PDK) documentation.
Support
Create an issue or contact us via our Developer Portal contact page.
Contributing
View our contribution guidelines for information on how to contribute to the PDK.
Prerequisites
- Node 18
- Yarn
- Docker
Installation
Create .env:
cp .env.template .env
Install Yarn dependencies:
yarn
Install Composer dependencies:
docker compose up php
Running tests
Run all tests:
docker compose run php composer test
Testing on a specific PHP version
The default PHP version is 7.4. To test on a different version, change PHP_VERSION in .env and rebuild:
docker compose build
docker compose run php composer test
Adding a shipment option
Shipment options are managed through the OrderOptionDefinitionInterface system. Each option is a single Definition class that declares all its keys (shipment, capabilities, carrier settings, product settings, allow, price). All models, views, and services build their attributes and form elements dynamically from these definitions.
To add a new option:
- Create a Definition class in
src/App/Options/Definition/extendingAbstractOrderOptionDefinition. Only two methods are required:getShipmentOptionsKey()— the PDK-internal key, derived fromStr::camel(RefShipmentShipmentOptions::attributeMap()['sdk_key'])getCapabilitiesOptionsKey()— the V2 capabilities key, fromRefCapabilitiesContractDefinitionsResponseOptionsOptionsV2::attributeMap()['capabilities_key']
- Register it in the
orderOptionDefinitionsarray inconfig/pdk-business-logic.php. - Optionally, add a deprecated constant to
ShipmentOptionsif platform integrations reference the key directly.
Everything else (carrier settings, product settings, allow/price toggles, validation, frontend form fields, API export/import) is derived automatically. Run yarn test:unit to verify the consistency tests pass.
If the option is not yet in the SDK types, update the SDK or regenerate the OpenAPI types first.
Using Claude Code? Run
/add-shipment-optionfor a guided step-by-step walkthrough that asks the right questions and generates the code.
Linting
We use Prettier to format .json, .yml, .md and .html files.
Make sure Prettier is enabled in your IDE and runs on the following files:
{**/*,*}.{md,html,yml,json}
Set up Git hooks to run Prettier on each commit, correcting any formatting issues.
yarn prepare
You can also run Prettier manually:
# Check formatting issues yarn lint # Fix formatting issues yarn lint:fix