{"id":34000980,"url":"https://github.com/firstred/postnl-api-php","last_synced_at":"2026-04-02T01:29:15.929Z","repository":{"id":25222373,"uuid":"103435250","full_name":"firstred/postnl-api-php","owner":"firstred","description":"PostNL API PHP bindings","archived":false,"fork":false,"pushed_at":"2025-12-10T05:57:15.000Z","size":3992,"stargazers_count":27,"open_issues_count":4,"forks_count":36,"subscribers_count":8,"default_branch":"v2.0.x","last_synced_at":"2026-01-02T09:17:20.019Z","etag":null,"topics":["api","postnl","postnl-api-php","postnl-cif","rest-api","sdk","soap-api"],"latest_commit_sha":null,"homepage":"https://postnl-php.readthedocs.io","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/firstred.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2017-09-13T18:20:06.000Z","updated_at":"2025-12-10T05:54:42.000Z","dependencies_parsed_at":"2023-12-18T03:22:12.644Z","dependency_job_id":"6e77b204-8536-4968-9952-1bedeb2c0859","html_url":"https://github.com/firstred/postnl-api-php","commit_stats":{"total_commits":534,"total_committers":14,"mean_commits":"38.142857142857146","dds":0.08239700374531833,"last_synced_commit":"bd075899ac944abcd6077e19e8b8d6f613906a33"},"previous_names":[],"tags_count":72,"template":false,"template_full_name":null,"purl":"pkg:github/firstred/postnl-api-php","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firstred%2Fpostnl-api-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firstred%2Fpostnl-api-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firstred%2Fpostnl-api-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firstred%2Fpostnl-api-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/firstred","download_url":"https://codeload.github.com/firstred/postnl-api-php/tar.gz/refs/heads/v2.0.x","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firstred%2Fpostnl-api-php/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31293901,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T01:05:07.454Z","status":"ssl_error","status_checked_at":"2026-04-02T00:56:46.496Z","response_time":53,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","postnl","postnl-api-php","postnl-cif","rest-api","sdk","soap-api"],"created_at":"2025-12-13T09:40:55.973Z","updated_at":"2026-04-02T01:29:15.917Z","avatar_url":"https://github.com/firstred.png","language":"PHP","readme":"# Unofficial PostNL REST API PHP Bindings\n\n[![Latest Stable Version](https://poser.pugx.org/firstred/postnl-api-php/v)](https://packagist.org/packages/firstred/postnl-api-php)\n[![Total Downloads](https://poser.pugx.org/firstred/postnl-api-php/downloads)](https://packagist.org/packages/firstred/postnl-api-php)\n[![.github/workflows/test.yaml](https://github.com/firstred/postnl-api-php/actions/workflows/test.yaml/badge.svg)](https://github.com/firstred/postnl-api-php/actions/workflows/test.yaml)\n[![Documentation Status](https://readthedocs.org/projects/postnl-php/badge/?version=v2.0.x)](https://postnl-php.readthedocs.io/en/v2.0.x/)\n[![codecov](https://codecov.io/gh/firstred/postnl-api-php/branch/master/graph/badge.svg)](https://codecov.io/gh/firstred/postnl-api-php)\n[![license mit](https://poser.pugx.org/firstred/postnl-api-php/license.svg)](https://packagist.org/packages/firstred/postnl-api-php)\n[![PHP Version Require](https://poser.pugx.org/firstred/postnl-api-php/require/php)](https://packagist.org/packages/firstred/postnl-api-php)\n\n## About\n\nThis unofficial PHP library for the PostNL REST API aims to provide a simple way to connect your \napplication with PostNL. By abstracting away needless complexity when processing shipment \ninformation and increased fault-tolerance, you can get up and running with PostNL in minutes.  \nAt the lower level this library uses asynchronous communication and payload splitting for \nimproved performance.\n\n### Status\n\n| Service                                     | Status | Version |\n| ------------------------------------------- |--------| ------- |\n| **Addresses**                               |        |         |\n| Adrescheck Nationaal                        | N/A    | N/A     |\n| Adrescheck Basis Nationaal                  | N/A    | N/A     |\n| Adrescheck Internationaal                   | N/A    | N/A     |\n| Geo Adrescheck Nationaal                    | N/A    | N/A     |\n| **Creditworthiness \u0026 Business information** |        |         |\n| Bedrijfscheck Nationaal                     | N/A    | N/A     |\n| Kredietcheck Zakelijk                       | N/A    | N/A     |\n| **Send \u0026 Track**                            |        |         |\n| Barcode webservice                          | ✓      | 1.1     |\n| Labelling webservice                        | ✓      | 2.2     |\n| Confirming webservice                       | ✓      | 2.0     |\n| Shippingstatus webservice                   | ✓      | 2.0     |\n| Shipping webservice                         | ✓      | 2.0     |\n| **Delivery Options**                        |        |         |\n| Deliverydate webservice                     | ✓      | 2.2     |\n| Location webservice                         | ✓      | 2.1     |\n| Timeframe webservice                        | ✓      | 2.1     |\n| Checkout webservice                         | N/A \\* | 1.0     |\n| **Mail**                                    |        |         |\n| Bulkmail webservice                         | N/A    | N/A     |\n\n\\* `PostNL::getTimeframesAndNearestLocations` can be used as an alternative with more functionality: https://postnl-php.readthedocs.io/en/v1.4.x/quickstart.html#requesting-timeframes-location-and-delivery-date-at-once\n\n## Instructions\n\n- Clone this repo\n- Run `composer install` (Don't have composer? Visit https://getcomposer.org/)\n- Optionally run `composer require guzzlehttp/guzzle` to use Guzzle instead of cURL directly\n- You're good to go! A small example can be found in this README. Check out the full documentation for a [quick start guide](https://postnl-php.readthedocs.io/en/v1.2.x/quickstart.html).\n\n## Documentation\n\n### Example\n\nAllow a user to download a label using the default REST API\n\n```php\n\u003c?php\n\nuse Firstred\\PostNL\\PostNL;\nuse Firstred\\PostNL\\Entity\\Customer;\nuse Firstred\\PostNL\\Entity\\Address;\nuse Firstred\\PostNL\\Entity\\Shipment;\nuse Firstred\\PostNL\\Entity\\Dimension;\n\nrequire_once __DIR__.'/vendor/autoload.php';\n\n$customer = Customer::create([\n    'CollectionLocation' =\u003e '123456',\n    'CustomerCode'       =\u003e 'DEVC',\n    'CustomerNumber'     =\u003e '11223344',\n    'ContactPerson'      =\u003e 'Peter',\n    'Address'            =\u003e Address::create([\n        'AddressType' =\u003e '02',\n        'City'        =\u003e 'Hoofddorp',\n        'CompanyName' =\u003e 'PostNL',\n        'Countrycode' =\u003e 'NL',\n        'HouseNr'     =\u003e '42',\n        'Street'      =\u003e 'Siriusdreef',\n        'Zipcode'     =\u003e '2132WT',\n    ]),\n    'Email'              =\u003e 'info@voorbeeld.nl',\n    'Name'               =\u003e 'Michael',\n]);\n\n$apikey = 'YOUR_API_KEY_HERE';\n$sandbox = false;\n\n$postnl = new PostNL($customer, $apikey, $sandbox);\n\n$barcode = $postnl-\u003egenerateBarcodeByCountryCode('NL');\n\n$shipment = Shipment::create([\n    'Addresses'           =\u003e [\n        Address::create([\n            'AddressType' =\u003e '01',\n            'City'        =\u003e 'Utrecht',\n            'Countrycode' =\u003e 'NL',\n            'FirstName'   =\u003e 'Peter',\n            'HouseNr'     =\u003e '9',\n            'HouseNrExt'  =\u003e 'a bis',\n            'Name'        =\u003e 'de Ruijter',\n            'Street'      =\u003e 'Bilderdijkstraat',\n            'Zipcode'     =\u003e '3521VA',\n        ]),\n    ],\n    'Barcode'             =\u003e $barcode,\n    'Dimension'           =\u003e new Dimension(/* weight */ '2000'),\n    'ProductCodeDelivery' =\u003e '3085',\n]);\n\nheader('Content-Type: application/pdf');\nheader('Content-Disposition: attachment; filename=\"label.pdf\"');\necho base64_decode($postnl-\u003egenerateLabel(\n    /* The actual shipment */ $shipment, \n    /* The output format */ 'GraphicFile|PDF',\n    /* Immediately confirm the shipment */ true\n)\n    -\u003egetResponseShipments()[0]\n    -\u003egetLabels()[0]\n    -\u003egetContent()\n);\nexit;\n```\n\n### Full documentation\n\nThe full documentation can be found on this page: [https://postnl-php.readthedocs.io/](https://postnl-php.readthedocs.io/)\n\n#### Building the documentation\n\nGenerating the documentation consists of two steps:\n1. Generating the reference RST files of all PHP classes available in this library.\n2. Generating the HTML output which can be viewed with a browser.\n\n#### Generating the PHP classes reference\n\nGenerating the references depends on a pretty old library. Removing other dependencies first from `require-dev` may be the best workaround to install `abbadon1334/phpdoc-to-rst`.\n\n```\n  \"require-dev\": {\n  },\n```\n\nThen install the PHPdoc to RST tool.\n```bash\ncomposer require abbadon1334/phpdoc-to-rst -W\n```\n\nThis repository includes a simple PHP file which utilizes the above-mentioned tool to generate the reference RST files programmatically. It also moves around a few files to integrate the reference with the rest of the documentation.  \nSimply run (tested w/ PHP 8.2):\n\n```\nphp ./build-docs-reference.php\n```\n\n##### Generating the final HTML output\n\nThe documentation is automatically built and hosted on readthedocs.io. You can build a local HTML copy by [installing Sphinx](https://www.sphinx-doc.org/en/master/usage/installation.html) and running\n```bash\npip install -r docs/requirements.txt\n```\nto install the requirements, followed by\n```\nsphinx-build -b html docs builddir\n```\nto build the HTML output in the directory `builddir`.\n\n## License\n\nThis library has been licensed with the MIT license.\n\u003cdetails\u003e\n  \u003csummary\u003eFull license text\u003c/summary\u003e\n\nThe MIT License (MIT).\nCopyright (c) 2017-2023 Michael Dekker (https://github.com/firstred)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\u003c/details\u003e\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffirstred%2Fpostnl-api-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffirstred%2Fpostnl-api-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffirstred%2Fpostnl-api-php/lists"}