{"id":19311793,"url":"https://github.com/salyangoz/yengec-cargo-php-sdk","last_synced_at":"2026-01-27T18:21:52.887Z","repository":{"id":160112283,"uuid":"633379290","full_name":"salyangoz/yengec-cargo-php-sdk","owner":"salyangoz","description":null,"archived":false,"fork":false,"pushed_at":"2025-02-03T22:14:21.000Z","size":117,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-03T23:22:53.067Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/salyangoz.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2023-04-27T11:24:23.000Z","updated_at":"2025-01-15T17:58:52.000Z","dependencies_parsed_at":"2023-10-12T01:30:00.556Z","dependency_job_id":"d361aa14-78b1-4b92-b8c8-0d3549ef4b80","html_url":"https://github.com/salyangoz/yengec-cargo-php-sdk","commit_stats":null,"previous_names":[],"tags_count":47,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salyangoz%2Fyengec-cargo-php-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salyangoz%2Fyengec-cargo-php-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salyangoz%2Fyengec-cargo-php-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salyangoz%2Fyengec-cargo-php-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/salyangoz","download_url":"https://codeload.github.com/salyangoz/yengec-cargo-php-sdk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240415216,"owners_count":19797599,"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":[],"created_at":"2024-11-10T00:30:17.622Z","updated_at":"2026-01-27T18:21:52.822Z","avatar_url":"https://github.com/salyangoz.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Yengec Cargo PHP SDK\n\nThis SDK is designed to be easily integrated into the Yengec Cargo API service.\n\n## Index\n- [Installation](#installation)\n- [Configuration](#configuration)\n- [Creating Shipment](#creating-shipment)\n- [Cargo Shipment Query](#cargo-shipment-query)\n\n## Installation\n\n```bash\ncomposer require yengec/yengec-cargo\n```\n\n## Configuration\n\nFirst of all, we need to specify our configuration settings to start the cargo service.\nI will use the `hepsijet` cargo and the `login` method of each service may be different. `Hepsijet` uses the simple authentication method.\n\nYou must start using the relevant method of the cargo service you want to use.\n\n\u003cdetails\u003e\n  \u003csummary\u003eAvailable Shipping Services\u003c/summary\u003e\n\n    - Yurtici\n    - Mng\n    - Ups\n    - Aras\n    - Ptt\n    - Surat\n    - Sendeo\n    - EasyShip\n    - UpsGlobal\n    - Hepsijet\n    - Fedex\n\n\u003e Note, each method should start with set. For example, `setHepsijet` etc.\n\u003c/details\u003e\n\n```php\nuse Carbon\\Carbon;\nuse Yengec\\Cargo\\Client;\nuse Yengec\\Cargo\\Requests\\Config;\nuse Yengec\\Cargo\\Requests\\Create\\Billing;\nuse Yengec\\Cargo\\Requests\\Create\\Order;\nuse Yengec\\Cargo\\Requests\\Create\\OrderCollection;\nuse Yengec\\Cargo\\Requests\\Create\\OrderItem;\nuse Yengec\\Cargo\\Requests\\Create\\OrderItemCollection;\nuse Yengec\\Cargo\\Requests\\Create\\OrderSender;\nuse Yengec\\Cargo\\Requests\\Create\\WareHouse;\nuse Yengec\\Cargo\\Requests\\RequestConfig;\n\n$cargoService = new Config();\n\n$cargoService-\u003esetHepsijet(\n    username: '******',\n    password: '******',\n    userCode: '******',\n    warehouseId: '***',\n    companyName: '*****',\n    companyAddressId: '****'\n);\n\n// here we specify in which environment the cargo service will run and the service itself.\n$requestConfig = new RequestConfig(\n    mode: 'test',\n    language: 'tr',\n    service: 'hepsijet',\n    config: $cargoService\n);\n```\n\n## Creating Shipment\n\n```php\n// Here we specify the products to be shipped.\n$orderItemCollection = new OrderItemCollection();\n\n$orderItemCollection-\u003eadd(new OrderItem(\n    productName: 'Yengeç Ürün',\n    quantity: 1,\n    weight: 1,\n    unitPrice: 100,\n    hsCode: '123456789',\n));\n\n// Now let's determine the contents of the cargoes.\n$orders =  new OrderCollection();\n\n$orders-\u003eadd(\n    new Order(\n        identity: 'ync-123', // Bu siparişin benzersiz kimliği\n        addressId: '123', // Sadece epsijet için zorunlu.\n        receiver: 'Yengeç', // Alıcı adı\n        address: 'Yengeç Adres', // Alıcı adresi\n        phone: '05555555555', // Alıcı telefonu\n        city: 'İstanbul', // Alıcı şehri\n        district: 'Kadıköy', // Alıcı ilçesi\n        email: 'yengec_test@yengec.co', // Alıcı emaili\n        shipAt: Carbon::createFromFormat('d/m/Y', '28/04/2023'), // Kargo gönderim tarihi\n        countryCode: 'TR', // Alıcı ülke kodu\n        currency: 'TRY', // Alıcı para birimi\n        total: 100, // Alıcı toplam tutarı\n        // exportMethod: 'KARGO', // Kargo gönderim yöntemi\n        method: 'HX_STD', // Kargo gönderim yöntemi. hepsijet için zorunlu.\n        exportReason: 'SATIS',\n        postalCode: '34700',\n        sender: new OrderSender(\n            name: 'Yengeç',\n            address: \"Yengeç Adres\",\n            city: \"İstanbul\",\n            district: \"Kadıköy\",\n            countryCode: \"TR\",\n            taxNumber: \"123456789\",\n            phone: \"05555555555\",\n            voec: \"123456789\",\n            pva: \"123456789\",\n            ioss: \"123456789\",\n        ),\n        orderItems: $orderItemCollection,\n        id: '123456789',\n        invoiceCode: '123456789',\n        shippingSlipDescription: 'Yengeç Kargo Açıklama',\n        billing: new Billing(\n            name: 'Yengeç',\n            phone: '05555555555',\n            address: 'Yengeç Adres',\n            postCode: '34700',\n            district: 'Kadıköy',\n            city: 'İstanbul',\n            country: 'Türkiye',\n        ),\n        cargoPrice: 10,\n        duty: 0,\n        wareHouse: new WareHouse(\n            country: \"Türkiye\",\n            city: \"İstanbul\",\n            district: \"Kadıköy\",\n            address: \"Yengeç Adres\",\n            phone: \"05555555555\",\n        )\n    )\n);\n\n// Let's create the cargos now.\n\n$client = new Client($requestConfig);\n\n\n$create = $client-\u003ecreate(\n    $requestConfig,\n    $orders\n);\n\n// Example response\n/**\n * \"identity\" =\u003e \"ync-123\"\n * \"status\" =\u003e \"created\"\n * \"message\" =\u003e \"ok\"\n * \"error_code\" =\u003e null\n * \"tracking_code\" =\u003e null\n * \"tracking_url\" =\u003e null\n * \"deci\" =\u003e null\n * \"parcel\" =\u003e null\n * \"label\" =\u003e \u003cbarkod\u003e\n * \"recepiet\" =\u003e null\n */\n\n```\n\n## Cargo Shipment Query\n\n```php\nuse Yengec\\Cargo\\Client;\nuse Yengec\\Cargo\\Requests\\Config;\nuse Yengec\\Cargo\\Requests\\Query\\OrderCollection;\nuse Yengec\\Cargo\\Requests\\RequestConfig;\n\n$id = 'YNC123456789';\n\n$cargoService = new Config();\n$cargoService-\u003esetHepsijet(\n    username: '******',\n    password: '******',\n    userCode: '******',\n    warehouseId: '***',\n    companyName: '*****',\n    companyAddressId: '****'\n);\n\n$requestConfig = new RequestConfig(\n    mode: 'test',\n    language: 'tr',\n    service: 'hepsijet',\n    config: $cargoService\n);\n\n$client = new Client($requestConfig);\n$queryOrders = new OrderCollection();\n\n$queryOrders-\u003eadd(orderIdentity: $id);\n\n$query = $client-\u003equery(\n    requestConfig: $requestConfig,\n    orders: $queryOrders\n);\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsalyangoz%2Fyengec-cargo-php-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsalyangoz%2Fyengec-cargo-php-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsalyangoz%2Fyengec-cargo-php-sdk/lists"}