{"id":15293835,"url":"https://github.com/hkonnet/laravel-ebay","last_synced_at":"2025-05-07T19:07:59.955Z","repository":{"id":56984904,"uuid":"93044715","full_name":"hkonnet/laravel-ebay","owner":"hkonnet","description":"This package for laravel framework to access Ebay.","archived":false,"fork":false,"pushed_at":"2020-09-03T09:37:04.000Z","size":24,"stargazers_count":40,"open_issues_count":11,"forks_count":41,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-04-18T10:12:25.685Z","etag":null,"topics":["ebay","ebay-sdk","laravel-5-package","laravel-package","php"],"latest_commit_sha":null,"homepage":null,"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/hkonnet.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":"2017-06-01T10:16:22.000Z","updated_at":"2024-05-11T11:05:48.000Z","dependencies_parsed_at":"2022-08-21T12:20:22.284Z","dependency_job_id":null,"html_url":"https://github.com/hkonnet/laravel-ebay","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hkonnet%2Flaravel-ebay","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hkonnet%2Flaravel-ebay/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hkonnet%2Flaravel-ebay/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hkonnet%2Flaravel-ebay/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hkonnet","download_url":"https://codeload.github.com/hkonnet/laravel-ebay/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252940883,"owners_count":21828766,"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":["ebay","ebay-sdk","laravel-5-package","laravel-package","php"],"created_at":"2024-09-30T16:53:26.259Z","updated_at":"2025-05-07T19:07:59.880Z","avatar_url":"https://github.com/hkonnet.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Laravel Ebay\n\n[![Latest Stable Version](https://poser.pugx.org/hkonnet/laravel-ebay/v)](//packagist.org/packages/hkonnet/laravel-ebay)\n[![Total Downloads](https://poser.pugx.org/hkonnet/laravel-ebay/downloads)](//packagist.org/packages/hkonnet/laravel-ebay)\n[![Monthly Downloads](https://poser.pugx.org/hkonnet/laravel-ebay/d/monthly)](//packagist.org/packages/hkonnet/laravel-ebay)\n[![License](https://poser.pugx.org/hkonnet/laravel-ebay/license)](//packagist.org/packages/hkonnet/laravel-ebay)\n\nThis package is based on [Ebay SDK](https://github.com/davidtsadler/ebay-sdk-php) written by David T. Sadler. \nThis package will organize all the configuration according to laravel and make you use the SDK with out doing any exceptional work or configurations. \n\n## Getting Started\n\nFollow the instruction to install and use this package.\n\n### Prerequisites\n\nThis is package use [**Ebay Php SDK**](http://devbay.net/)\n\n### Installing\n\nAdd Laravel-Ebay to your composer file via the composer require command:\n\n\n```bash\n$ composer require hkonnet/laravel-ebay\n```\n\nOr add it to `composer.json` manually:\n\n```json\n\"require\": {\n    \"hkonnet/laravel-ebay\": \"^1.2\"\n}\n```\n\nRegister the service provider by adding it to the providers key in config/app.php. Also register the facade by adding it to the aliases key in config/app.php.\n\n**Laravel 5.1 or greater**\n```php\n'providers' =\u003e [\n    ...\n    Hkonnet\\LaravelEbay\\EbayServiceProvider::class, \n],\n\n'aliases' =\u003e [\n    ...\n    'Ebay' =\u003e Hkonnet\\LaravelEbay\\Facade\\Ebay::class,\n]\n```\n**Laravel 5**\n```php\n'providers' =\u003e [\n    ...\n    'Hkonnet\\LaravelEbay\\EbayServiceProvider', \n],\n\n'aliases' =\u003e [\n    ...\n    'Ebay' =\u003e 'Hkonnet\\LaravelEbay\\Facade\\Ebay',\n]\n```\n\nNext to get started, you'll need to publish all vendor assets:\n\n```bash\n$ php artisan vendor:publish --provider=\"Hkonnet\\LaravelEbay\\EbayServiceProvider\"\n```\nThis will create a config/ebay.php file in your app that you can modify to set your configuration.\n\n###Configuration\nAfter installation, you will need to add your ebay settings. Following is the code you will find in config/ebay.php, which you should update accordingly.\n\n```php\nreturn [\n    'mode' =\u003e env('EBAY_MODE', 'sandbox'),\n\n    'siteId' =\u003e env('EBAY_SITE_ID','0'),\n\n    'sandbox' =\u003e [\n        'credentials' =\u003e [\n            'devId' =\u003e env('EBAY_SANDBOX_DEV_ID'),\n            'appId' =\u003e env('EBAY_SANDBOX_APP_ID'),\n            'certId' =\u003e env('EBAY_SANDBOX_CERT_ID'),\n        ],\n        'authToken' =\u003e env('EBAY_SANDBOX_AUTH_TOKEN'),\n        'oauthUserToken' =\u003e env('EBAY_SANDBOX_OAUTH_USER_TOKEN'),\n    ],\n    'production' =\u003e [\n        'credentials' =\u003e [\n            'devId' =\u003e env('EBAY_PROD_DEV_ID'),\n            'appId' =\u003e env('EBAY_PROD_APP_ID'),\n            'certId' =\u003e env('EBAY_PROD_CERT_ID'),\n        ],\n        'authToken' =\u003e env('EBAY_PROD_AUTH_TOKEN'),\n        'oauthUserToken' =\u003e env('EBAY_PROD_OAUTH_USER_TOKEN'),\n    ]\n];\n```\n\n## Usage\n\nFollowing are few examples for using this package.\n\n### Ex 1: Get the official eBay time\n\nFollowing are the two ways you can do it\n\n**Method 1:**\n\n```php\nuse \\Hkonnet\\LaravelEbay\\EbayServices;\nuse \\DTS\\eBaySDK\\Shopping\\Types;\n  \n// Create the service object.\n$ebay_service = new EbayServices();\n$service = $ebay_service-\u003ecreateShopping();\n\n// Create the request object.\n$request = new Types\\GeteBayTimeRequestType();\n\n// Send the request to the service operation.\n$response = $service-\u003egeteBayTime($request);\n\n// Output the result of calling the service operation.\nprintf(\"The official eBay time is: %s\\n\", $response-\u003eTimestamp-\u003eformat('H:i (\\G\\M\\T) \\o\\n l jS Y'));\n```\n\n**Method 2:**\n\n\u003e **Tip:** If you prefer to use **DTS** library class you need to pass the configuration.\n\n```php\nuse \\DTS\\eBaySDK\\Shopping\\Services;\nuse \\DTS\\eBaySDK\\Shopping\\Types;\n\n$config = Ebay::getConfig();\n\n// Create the service object.\n$service = new Services\\ShoppingService($config);\n\n// Create the request object.\n$request = new Types\\GeteBayTimeRequestType();\n\n// Send the request to the service operation.\n$response = $service-\u003egeteBayTime($request);\n\n// Output the result of calling the service operation.\nprintf(\"The official eBay time is: %s\\n\", $response-\u003eTimestamp-\u003eformat('H:i (\\G\\M\\T) \\o\\n l jS Y'));\n```\n\n### Ex 2: Find items by keyword\n\nThis example will call the findItemsByKeywords operation\n\n**Method 1:**\n```php\nuse \\Hkonnet\\LaravelEbay\\EbayServices;\nuse \\DTS\\eBaySDK\\Finding\\Types;\n  \n// Create the service object.\n    $ebay_service = new EbayServices();\n    $service = $ebay_service-\u003ecreateFinding();\n\n// Assign the keywords.\n    $request = new Types\\FindItemsByKeywordsRequest();\n    $request-\u003ekeywords = 'Harry Potter';\n\n// Ask for the first 25 items.\n    $request-\u003epaginationInput = new Types\\PaginationInput();\n    $request-\u003epaginationInput-\u003eentriesPerPage = 25;\n    $request-\u003epaginationInput-\u003epageNumber = 1;\n\n// Ask for the results to be sorted from high to low price.\n    $request-\u003esortOrder = 'CurrentPriceHighest';\n\n    $response = $service-\u003efindItemsByKeywords($request);\n\n    // Output the response from the API.\n    if ($response-\u003eack !== 'Success') {\n        foreach ($response-\u003eerrorMessage-\u003eerror as $error) {\n            printf(\"Error: %s \u003cbr\u003e\", $error-\u003emessage);\n        }\n    } else {\n        foreach ($response-\u003esearchResult-\u003eitem as $item) {\n            printf(\"(%s) %s:%.2f \u003cbr\u003e\", $item-\u003eitemId, $item-\u003etitle, $item-\u003esellingStatus-\u003ecurrentPrice-\u003evalue);\n        }\n    }\n\n```\n\n**Method 2:**\n```php\nuse DTS\\eBaySDK\\Finding\\Services\\FindingService;\nuse \\DTS\\eBaySDK\\Finding\\Types;\n  \n// Create the service object.\n    $config = Ebay::getConfig();\n    $service = new FindingService($config);\n\n// Assign the keywords.\n    $request = new Types\\FindItemsByKeywordsRequest();\n    $request-\u003ekeywords = 'Harry Potter';\n\n// Ask for the first 25 items.\n    $request-\u003epaginationInput = new Types\\PaginationInput();\n    $request-\u003epaginationInput-\u003eentriesPerPage = 25;\n    $request-\u003epaginationInput-\u003epageNumber = 1;\n\n// Ask for the results to be sorted from high to low price.\n    $request-\u003esortOrder = 'CurrentPriceHighest';\n\n    $response = $service-\u003efindItemsByKeywords($request);\n\n    // Output the response from the API.\n    if ($response-\u003eack !== 'Success') {\n        foreach ($response-\u003eerrorMessage-\u003eerror as $error) {\n            printf(\"Error: %s \u003cbr\u003e\", $error-\u003emessage);\n        }\n    } else {\n        foreach ($response-\u003esearchResult-\u003eitem as $item) {\n            printf(\"(%s) %s:%.2f \u003cbr\u003e\", $item-\u003eitemId, $item-\u003etitle, $item-\u003esellingStatus-\u003ecurrentPrice-\u003evalue);\n        }\n    }\n\n```\n\n### Ex 3. Get my ebay selling\n\n```php\nuse \\DTS\\eBaySDK\\Constants;\nuse \\DTS\\eBaySDK\\Trading\\Types;\nuse \\DTS\\eBaySDK\\Trading\\Enums;\nuse \\Hkonnet\\LaravelEbay\\EbayServices;\n\n/**\n * Create the service object.\n */\n$ebay_service = new EbayServices();\n$service = $ebay_service-\u003ecreateTrading();\n\n/**\n * Create the request object.\n */\n$request = new Types\\GetMyeBaySellingRequestType();\n\n/**\n * An user token is required when using the Trading service.\n */\n$request-\u003eRequesterCredentials = new Types\\CustomSecurityHeaderType();\n$authToken = Ebay::getAuthToken();\n$request-\u003eRequesterCredentials-\u003eeBayAuthToken = $authToken;\n\n/**\n * Request that eBay returns the list of actively selling items.\n * We want 10 items per page and they should be sorted in descending order by the current price.\n */\n$request-\u003eActiveList = new Types\\ItemListCustomizationType();\n$request-\u003eActiveList-\u003eInclude = true;\n$request-\u003eActiveList-\u003ePagination = new Types\\PaginationType();\n$request-\u003eActiveList-\u003ePagination-\u003eEntriesPerPage = 10;\n$request-\u003eActiveList-\u003eSort = Enums\\ItemSortTypeCodeType::C_CURRENT_PRICE_DESCENDING;\n$pageNum = 1;\n\ndo {\n    $request-\u003eActiveList-\u003ePagination-\u003ePageNumber = $pageNum;\n    \n    /**\n     * Send the request.\n     */\n    $response = $service-\u003egetMyeBaySelling($request);\n    \n    /**\n     * Output the result of calling the service operation.\n     */\n    echo \"==================\\nResults for page $pageNum\\n==================\\n\";\n    if (isset($response-\u003eErrors)) {\n        foreach ($response-\u003eErrors as $error) {\n            printf(\n                \"%s: %s\\n%s\\n\\n\",\n                $error-\u003eSeverityCode === Enums\\SeverityCodeType::C_ERROR ? 'Error' : 'Warning',\n                $error-\u003eShortMessage,\n                $error-\u003eLongMessage\n            );\n        }\n    }\n    if ($response-\u003eAck !== 'Failure' \u0026\u0026 isset($response-\u003eActiveList)) {\n        foreach ($response-\u003eActiveList-\u003eItemArray-\u003eItem as $item) {\n            printf(\n                \"(%s) %s: %s %.2f\\n\",\n                $item-\u003eItemID,\n                $item-\u003eTitle,\n                $item-\u003eSellingStatus-\u003eCurrentPrice-\u003ecurrencyID,\n                $item-\u003eSellingStatus-\u003eCurrentPrice-\u003evalue\n            );\n        }\n    }\n    $pageNum += 1;\n} while (isset($response-\u003eActiveList) \u0026\u0026 $pageNum \u003c= $response-\u003eActiveList-\u003ePaginationResult-\u003eTotalNumberOfPages);\n\n```\n\u003e **Note:**\n\u003e - There are lots for more example available at [Ebay SDK Examples](https://github.com/davidtsadler/ebay-sdk-examples).\n\u003e - Follow above examples but read the Important note below.\n\n## Important Note\nUsing method 1 in both examples we did\n```php\nuse \\Hkonnet\\LaravelEbay\\EbayServices;\n// Create the service object.\n$ebay_service = new EbayServices();\n$service = $ebay_service-\u003ecreateFinding();\n```  \nto get service object..\n\nFollowing methods are available to create services using `EbayServices` class.\n\n* createAccount(array $args = [])\n* createAnalytics(array $args = [])\n* createBrowse(array $args = [])\n* createBulkDataExchange(array $args = [])\n* createBusinessPoliciesManagement(array $args = [])\n* createFeedback(array $args = [])\n* createFileTransfer(array $args = [])\n* createFinding(array $args = [])\n* createFulfillment(array $args = [])\n* createHalfFinding(array $args = [])\n* createInventory(array $args = [])\n* createMarketing(array $args = [])\n* createMerchandising(array $args = [])\n* createMetadata(array $args = [])\n* createOrder(array $args = [])\n* createPostOrder(array $args = [])\n* createProduct(array $args = [])\n* createProductMetadata(array $args = [])\n* createRelatedItemsManagement(array $args = [])\n* createResolutionCaseManagement(array $args = [])\n* createReturnManagement(array $args = [])\n* createShopping(array $args = [])\n* createTrading(array $args = [])\n\nThese services methods can be used to get appropriate service object to perform operations on Ebay.\n\n## Author\n\n* **Haroon Khan** - *Initial work* - [hkonnet](https://github.com/hkonnet)\n\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details\n\n## Acknowledgments\n\n* [David T. Sadler](https://github.com/davidtsadler)  for his awesome Ebay SDK.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhkonnet%2Flaravel-ebay","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhkonnet%2Flaravel-ebay","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhkonnet%2Flaravel-ebay/lists"}