Laravel is an accessible and powerful PHP web application framework with an expressive and elegant syntax.
Caution
This is an work-in-progress eBay SDK in an alpha stage. Not all APIs have been fully tested or can be tested due to user, marketplace, country restrictions, or sandbox limitations. While the SDK should be usable, breaking changes may occur at any time, including minor releases.
A Laravel SDK for integrating with eBay APIs, featuring OAuth authentication, webhook notifications, event handling, and practical utilities for common workflows. The SDK supports both Modern REST APIs and Traditional (XML/SOAP) eBay APIs and is designed to evolve alongside eBay’s platform.
- Documentation Page
- OAuth Authorize with eBay
- Receive eBay Platform Notifications
- Handle Marketplace Account Deletions
- OAuth 2.0 authentication flow (authorization and callback).
- Support for Platform Notifications and Marketplace Account Deletions.
- Optional route and controller integration for OAuth, Marketplace and Webhooks.
- Support for Modern REST APIs and Traditional XML/SOAP APIs (XML-only).
- Dispatches Laravel events for all supported eBay notification types.
- PHP ≥ 8.2
- Laravel ≥ 11 | ≥ 12 | ≥ 13
Tip
We strongly recommend a task-scheduling enabled and queue-based Laravel setup to handle performance-intensive processes and, most importantly, to process eBay webhook notifications in a compliant and reliable manner (See Configuration).
Install the package via composer:
composer require rat.md/laravel-ebay-sdkPublish the configuration file with:
php artisan vendor:publish --tag="ebay-sdk-config"Visit the Documentation Page for more details
use Rat\eBaySDK\API\InventoryAPI\InventoryItem\GetInventoryItem;
use Rat\eBaySDK\Client;
$client = new Client();
$client->setRefreshToken($refreshToken);
$response = $client->execute(new GetInventoryItem('MyCustomSKU'));To run the test suite, you first need to provide your eBay Sandbox credentials. So, create an
.env.testing file in the package root directory with the following details:
EBAY_CLIENT_ID='<Your Sandbox Client ID>'
EBAY_CLIENT_SECRET='<Your Sandbox Client Secret>'
EBAY_REDIRECT_URI='<Your Sandbox Redirect URI>'
EBAY_DEV_ID='<Your Sandbox Dev ID>'
EBAY_API_ENVIRONMENT='sandbox'
EBAY_CACHING=false
EBAY_DEBUG=true
EBAY_LOCALE='<Your-Language>'
EBAY_COMPATIBILITY_LEVEL=1395
EBAY_SITE_ID=16If you're unsure about your EBAY_SITE_ID refer to src/Enums/SiteCode.php
or the official documentation page at developer.ebay.com
Install the required composer dependencies using:
composer installNow, generate a valid and working refresh token using Testbench:
./vendor/bin/testbench ebay:authorize --testingThis will output an authorization URL in the console.
- Open this URL in your browser
- Sign in using your Sandbox account (not your production one)
- Grant access for the requested scopes
- After successful authorization, you will be redirected to eBay's oAuth page
Once you see the success message, copy the full redirected URL and pass it back to the command (and Yes, the quotes matter. Especially on Windows, where everything breaks if you blink wrong.)
./vendor/bin/testbench ebay:authorize "https://auth2.ebay.com/..." --testingIf the .env.testing file exists, the command will automatically create or update your
PEST_EBAY_REFRESH_TOKEN=<token>, if not, the token will be printed to the console instead.
Once the refresh token is available, you can run the tests using:
./vendor/bin/pestWe provide an aggregated list of eBay API changes on our documentation page as well as via RSS feeds.
For changes specific to this Laravel package, please refer to the CHANGELOG.
Published under MIT License
Copyright © 2024 - 2026 Sam @ rat.md
This software is not an official eBay product and is not associated with, sponsored by, or endorsed by eBay Inc.