{"id":16171240,"url":"https://github.com/loevgaard/consignor-shipment-server-php-sdk","last_synced_at":"2025-04-07T07:49:23.238Z","repository":{"id":62518588,"uuid":"121353288","full_name":"loevgaard/consignor-shipment-server-php-sdk","owner":"loevgaard","description":"A library for making requests to the Consignor Shipment Server API.","archived":false,"fork":false,"pushed_at":"2020-04-16T13:39:02.000Z","size":24,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-13T11:52:31.778Z","etag":null,"topics":["consignor","library","php","sdk","sdk-php"],"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/loevgaard.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}},"created_at":"2018-02-13T07:42:37.000Z","updated_at":"2020-04-16T13:37:39.000Z","dependencies_parsed_at":"2022-11-02T14:31:17.496Z","dependency_job_id":null,"html_url":"https://github.com/loevgaard/consignor-shipment-server-php-sdk","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loevgaard%2Fconsignor-shipment-server-php-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loevgaard%2Fconsignor-shipment-server-php-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loevgaard%2Fconsignor-shipment-server-php-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loevgaard%2Fconsignor-shipment-server-php-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/loevgaard","download_url":"https://codeload.github.com/loevgaard/consignor-shipment-server-php-sdk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247615481,"owners_count":20967182,"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":["consignor","library","php","sdk","sdk-php"],"created_at":"2024-10-10T03:21:17.354Z","updated_at":"2025-04-07T07:49:23.219Z","avatar_url":"https://github.com/loevgaard.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Consignor Shipment Server PHP SDK\n\n[![Latest Version on Packagist][ico-version]][link-packagist]\n[![Software License][ico-license]](LICENSE)\n[![Build Status][ico-travis]][link-travis]\n[![Coverage Status][ico-scrutinizer]][link-scrutinizer]\n[![Quality Score][ico-code-quality]][link-code-quality]\n\nA library for making requests to the [Consignor Shipment Server](https://consignor.zendesk.com/hc/da/categories/115000066814-Consignor-Shipment-Server) API.\n\n## Install\n\nVia Composer\n\n```bash\n$ composer require loevgaard/consignor-shipment-server-php-sdk\n```\n\n## Usage\nHere is the example also used on [Consignors own page](https://consignor.zendesk.com/hc/da/articles/115002124314-Sample-Code-PHP). It submits a shipment and saves the labels as PDF's.\n\n```php\n\u003c?php\nrequire_once 'vendor/autoload.php';\n\n$actor = '63';\n$key = 'sample';\n$env = \\Loevgaard\\Consignor\\ShipmentServer\\Client\\Client::ENV_DEV;\n$client = new \\Loevgaard\\Consignor\\ShipmentServer\\Client\\Client($actor, $key, [], null, null, $env);\n\n$data = [\n    'Kind' =\u003e 1,\n    'ActorCSID' =\u003e $actor,\n    'ProdConceptID' =\u003e 1032,\n\n    'Addresses' =\u003e [\n        [\n            'Kind' =\u003e 2,\n            'Name1' =\u003e 'Test sender',\n            'Street1' =\u003e 'Test Address',\n            'PostCode' =\u003e '0580',\n            'City' =\u003e 'Oslo',\n            'CountryCode' =\u003e 'NO'],\n        [\n            'Kind' =\u003e 1,\n            'Name1' =\u003e 'Ola Testmann',\n            'Street1' =\u003e 'Test Address 1',\n            'PostCode' =\u003e '0580',\n            'City' =\u003e 'Oslo',\n            'CountryCode' =\u003e 'NO'\n        ]\n    ],\n\n    'Lines' =\u003e [\n        [\n            'PkgWeight' =\u003e 5000,\n            'Pkgs' =\u003e [\n                [\n                    'ItemNo' =\u003e 1\n                ]\n            ]\n        ]\n    ]\n];\n\n$options = [\n    'Labels' =\u003e 'PDF'\n];\n\n$request = new \\Loevgaard\\Consignor\\ShipmentServer\\Request\\SubmitShipmentRequest($data, $options);\n\n/** @var \\Loevgaard\\Consignor\\ShipmentServer\\Response\\SubmitShippingResponse $response */\n$response = $client-\u003edoRequest($request);\n\nif ($response-\u003ewasSuccessful()) {\n    echo \"The request was successful, labels saved in: \".getcwd().\"\\n\";\n    $response-\u003esaveLabels('label-', getcwd());\n} else {\n    echo \"The request was not successful\\n\";\n    print_r($response-\u003egetErrors());\n}\n```\n\n### Framework integration\nThere is a Symfony bundle available that integrates this SDK:\n- [Consignor Shipment Server Bundle](https://github.com/loevgaard/consignor-shipment-server-bundle)\n\n## Testing\n\n```bash\n$ composer test\n```\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE) for more information.\n\n[ico-version]: https://img.shields.io/packagist/v/loevgaard/consignor-shipment-server-php-sdk.svg?style=flat-square\n[ico-license]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square\n[ico-travis]: https://img.shields.io/travis/loevgaard/consignor-shipment-server-php-sdk/master.svg?style=flat-square\n[ico-scrutinizer]: https://img.shields.io/scrutinizer/coverage/g/loevgaard/consignor-shipment-server-php-sdk.svg?style=flat-square\n[ico-code-quality]: https://img.shields.io/scrutinizer/g/loevgaard/consignor-shipment-server-php-sdk.svg?style=flat-square\n\n[link-packagist]: https://packagist.org/packages/loevgaard/consignor-shipment-server-php-sdk\n[link-travis]: https://travis-ci.org/loevgaard/consignor-shipment-server-php-sdk\n[link-scrutinizer]: https://scrutinizer-ci.com/g/loevgaard/consignor-shipment-server-php-sdk/code-structure\n[link-code-quality]: https://scrutinizer-ci.com/g/loevgaard/consignor-shipment-server-php-sdk","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Floevgaard%2Fconsignor-shipment-server-php-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Floevgaard%2Fconsignor-shipment-server-php-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Floevgaard%2Fconsignor-shipment-server-php-sdk/lists"}