{"id":17125253,"url":"https://github.com/baltpeter/internetmarke-php","last_synced_at":"2025-06-13T04:37:16.709Z","repository":{"id":62491450,"uuid":"86343331","full_name":"baltpeter/internetmarke-php","owner":"baltpeter","description":"A PHP wrapper for the Deutsche Post Internetmarke web service 1C4A (\"OneClickForApplikation\")","archived":false,"fork":false,"pushed_at":"2024-08-13T08:12:28.000Z","size":35,"stargazers_count":37,"open_issues_count":3,"forks_count":9,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-06-05T23:49:19.693Z","etag":null,"topics":["1c4a","deutsche-post","hacktoberfest","internetmarke","php","stamp"],"latest_commit_sha":null,"homepage":"","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/baltpeter.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2017-03-27T14:08:44.000Z","updated_at":"2025-05-02T08:18:54.000Z","dependencies_parsed_at":"2024-12-24T08:07:18.147Z","dependency_job_id":"dff61653-0e16-4917-9d07-de163fd6f600","html_url":"https://github.com/baltpeter/internetmarke-php","commit_stats":{"total_commits":16,"total_committers":6,"mean_commits":"2.6666666666666665","dds":0.5,"last_synced_commit":"142bcf920135664dec610544c6e325d866eb7de7"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/baltpeter/internetmarke-php","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baltpeter%2Finternetmarke-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baltpeter%2Finternetmarke-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baltpeter%2Finternetmarke-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baltpeter%2Finternetmarke-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/baltpeter","download_url":"https://codeload.github.com/baltpeter/internetmarke-php/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baltpeter%2Finternetmarke-php/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259582671,"owners_count":22880063,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["1c4a","deutsche-post","hacktoberfest","internetmarke","php","stamp"],"created_at":"2024-10-14T18:44:32.047Z","updated_at":"2025-06-13T04:37:16.663Z","avatar_url":"https://github.com/baltpeter.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# internetmarke-php – Simple PHP wrapper for the Internetmarke API\n\n\u003e Simple PHP wrapper for the 1C4A (“OneClickForApplikation”) web service for the Internetmarke provided by Deutsche Post (DPAG).\n\n![Ordering a stamp using internetmarke-php](https://static.bn.al/img/internetmarke-php-hero.svg)\n\nThis project’s main purpose is to be able to order Deutsche Post stamps directly from your own applications. The payment is handled via the Portokasse, a prepaid wallet service also by Deutsche Post.  \n\nThe web service by Deutsche Post is a custom SOAP API (see the WSDL here: https://internetmarke.deutschepost.de/OneClickForAppV3?wsdl). This project aims to abstract the SOAP nature away and provide a PHP API, while still adhering to the structure defined by DPAG.\nDo note that this is only a very thin wrapper around the SOAP API and the user still has to follow DPAG’s [specification](https://www.deutschepost.de/de/i/internetmarke-porto-drucken/downloads.html).\n\n## Requirements\n\nTo access the web service, you will need to register as a partner with DPAG. This can either be done via their [website](https://www.deutschepost.de/de/i/internetmarke-porto-drucken/geschaeftskunden.html) (German only) or by contacting pcf-1click@deutschepost.de. They ask you to fill out following [form](https://www.deutschepost.de/content/dam/dpag/images/i_i/Internetmarke/partnerwerden/dp-internetmarke-anmeldebogen-api-anbindung.pdf). So keep in mind to fill it out first. (German only).  \nThey will send you the documentation for the web service and create your personal credentials (consisting of: your partner ID, a secret key called `SCHLUESSEL_DPWN_MARKTPLATZ`, and a key phase which is usually `1`).\n\nIn addition, you will need to have an account for the [Portokasse service](https://portokasse.deutschepost.de/portokasse/#!/). This is a prepaid wallet from which your purchase totals will be deducted.  \nAfter registering, you can access the service with your username (email address) and password.\n\n## Installation\n\nThe package is available via Composer. To install the latest version from Packagist, run:\n\n```\ncomposer require baltpeter/internetmarke-php\n```\n\n## Basic Usage\n\nAll actions provided by the web service are implemented in the `baltpeter\\Internetmarke\\Service` class.\n\nThis example shows you how to order a single stamp for a domestic letter. Other actions and parameters are documented with phpDoc. For more examples, please refer to the [wiki](https://github.com/baltpeter/internetmarke-php/wiki/Examples).\n\n```php\n// The `PartnerInformation` object is used to authenticate you as a partner with DPAG.\n$partner_info = new \\baltpeter\\Internetmarke\\PartnerInformation('ABCDE', 1, 'yoursecretkey');\n// The `Service` object provides an interface for all actions in the web service.\n$service = new \\baltpeter\\Internetmarke\\Service($partner_info);\n\n// First, we need to get a token for our Portokasse user.\n$user_token = $service-\u003eauthenticateUser('portokasse@yourmailserver.tld', 'yourpassword')-\u003egetUserToken();\n\n// Next, we create an `OrderItem` which holds the details of the stamp we want to purchase.\n$order_item = new \\baltpeter\\Internetmarke\\OrderItem(1, null, null,\n    new \\baltpeter\\Internetmarke\\Position(1, 1, 1), 'FrankingZone');\n\n// Finally, we call `checkoutShoppingCartPdf()` which creates the order and actually\n// deducts the money from your Portokasse.\n// The last parameter in this example is the total cost in eurocents, which you have to calculate\n// manually. This value *has* to be correct, it is checked on the server side.\nvar_dump($service-\u003echeckoutShoppingCartPdf($user_token, 1, array($order_item), 80));\n```\n\nRunning this code will print a result similar to this:\n\n```php\nobject(stdClass)#10 (3) {\n  [\"link\"]=\u003e\n  string(111) \"https://internetmarke.deutschepost.de/PcfExtensionWeb/document?keyphase=0\u0026data=abcdefghijklmopqrstuvwxyz\"\n  [\"walletBallance\"]=\u003e\n  int(236725)\n  [\"shoppingCart\"]=\u003e\n  object(stdClass)#11 (2) {\n    [\"shopOrderId\"]=\u003e\n    string(9) \"12345678\"\n    [\"voucherList\"]=\u003e\n    object(stdClass)#12 (1) {\n      [\"voucher\"]=\u003e\n      array(1) {\n        [0]=\u003e\n        object(stdClass)#13 (1) {\n          [\"voucherId\"]=\u003e\n          string(20) \"A0011E78E1000001234A\"\n        }\n      }\n    }\n  }\n}\n```\n\nNote how we wrapped the `$order_item` in an array. If you want to order multiple stamps, just include more `OrderItem`s in that array.\n\nThe stamp in the linked PDF will look something like this:\n\n![The generated stamp](https://static.bn.al/img/internetmarke-php-stamp-example.png)\n\nAgain, please refer to the [wiki](https://github.com/baltpeter/internetmarke-php/wiki/Examples) for more examples.\n\n## License\n\ninternetmarke-php is licensed under the MIT license, see the `LICENSE` file for details. Pull requests are welcome!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbaltpeter%2Finternetmarke-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbaltpeter%2Finternetmarke-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbaltpeter%2Finternetmarke-php/lists"}