Download the PHP package sashalenz/ebay-api without Composer

On this page you can find all versions of the php package sashalenz/ebay-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package ebay-api

eBay API SDK for Laravel

Latest Version on Packagist Total Downloads

A modern Laravel package for interacting with the eBay API. This package provides a clean, fluent interface for working with eBay's Sell and Commerce APIs using Laravel Data objects for type safety.

Features

Installation

You can install the package via composer:

You can publish the config file with:

OAuth Authentication

Application Token (Client Credentials)

Used for most Sell APIs and Commerce APIs. Configured automatically from .env:

User Token (Authorization Code Flow)

Required for Post-Order API and Identity API. You must implement OAuth flow in your app:

Note: The UserToken automatically refreshes when expired using the refresh token.

This is the contents of the published config file:

Configuration

Add your eBay API credentials to your .env file:

OAuth Scopes

The package uses OAuth 2.0 Client Credentials (Application Token) for authentication. By default, it uses the base scope https://api.ebay.com/oauth/api_scope, which provides access to most public and seller-specific APIs.

If you need specific scopes, you can customize them in your .env:

โš ๏ธ Important: Using too many scopes or invalid scopes will result in invalid_scope error. Start with the base scope first.

Available Environments

Available Marketplaces

The package supports all eBay marketplaces:

Usage

Automatic Data Mapping (Recommended)

The package automatically maps API responses to type-safe Data objects.
NEW: Client is auto-injected, no need to pass it manually!

Using the Facade

Using Dependency Injection

Sell API - Inventory Examples

Get a Single Inventory Item

Get All Inventory Items

Create or Update an Inventory Item (Builder Pattern)

Delete an Inventory Item

Create an Offer (Builder Pattern)

Bulk Operations

Commerce API - Taxonomy Examples

Get Default Category Tree ID

Get Category Suggestions

Get Category Tree

Get Category Subtree

Get Item Aspects For Category

Get Compatibility Properties

Get Compatibility Property Values

Get Expired Categories

Fetch Item Aspects

Sell API - Marketing Examples

Create a Promoted Listings Campaign

Manage Ads in Bulk

Create Item Promotion

Send Discount Offers to Interested Buyers

Available Request Classes

Sell API - Inventory Mapping (GraphQL)

AI-Powered Listing Creation (2/2):

Commerce API - Media

Image (3/3):

Video (3/3):

Document (4/4):

Sell API - Catalog

Product Search (2/2):

Example usage:

Sell API - Stores

Store Management (8/8):

Sell API - Inventory

InventoryItem (7/7):

ProductCompatibility (3/3):

InventoryItemGroup (3/3):

Location (7/7):

Listing (4/4):

Offer (11/11):

Sell API - Metadata

Marketplace Policies (16/16):

Compatibility Data (5/5):

Sales Tax (1/1):

Sell API - Feed

Order Tasks (3/3):

Inventory Tasks (3/3):

Generic Tasks (6/6):

Schedules (8/8):

Customer Service Metrics (3/3):

Sell API - Account

Fulfillment Policies (6/6):

Payment Policies (6/6):

Return Policies (6/6):

Custom Policies (4/4):

Sales Tax (4/4):

Programs (3/3):

Other (7/7):

Sell API - Account v2

Rate Tables (2/2):

Payout Settings (2/2):

Sell API - Fulfillment

Orders (3/3):

Shipping Fulfillment (3/3):

Payment Disputes (9/9):

Sell API - Logistics

Shipping Quotes (2/2):

Shipments (4/4):

Sell API - Finances

Payouts (3/3):

Transactions (2/2):

Funds Summary (1/1):

Transfers (1/1):

Sell API - Charity

Charitable Organizations (2/2):

Sell API - Catalog

Product Search (2/2):

Sell API - Notification

Configuration (2/2):

Destinations (5/5):

Subscriptions (11/11):

Topics (2/2):

Public Keys (1/1):

Sell API - Negotiation

Offers (2/2):

Sell API - Marketing

Campaigns (19/19):

Ads (16/16):

Ad Groups (6/6):

Keywords (6/6):

Negative Keywords (6/6):

Promotions (12/12):

Reports (9/9):

Email Campaign (8/8):

Sell API - Recommendation

Listing Recommendations (1/1):

Sell API - Analytics

Customer Service Metrics (1/1):

Seller Standards Profile (2/2):

Traffic Reports (1/1):

Sell API - Translation

Translation (1/1):

Sell API - Compliance

Listing Violations Summary (1/1):

Listing Violations (1/1):

Sell API - Identity

User Profile (1/1):

Post-Order API

โš ๏ธ All Post-Order API methods require User OAuth Token (not Application Token)

Cancellation Resource (7/7):

Case Management Resource (10/10):

Return Resource (20/20):

Inquiry Resource (5/5):

Commerce API - Taxonomy

Category Navigation (9/9):

Available Enums

The package provides 27 type-safe enums for API constants:

Core Enums

Inventory Enums

Offer Enums

Taxonomy Enums

Stores Enums

Media Enums

Feed Enums

Marketing Enums

Testing

The package includes a comprehensive test suite with 127 tests covering all 58 Request classes.

Running Tests

Test Coverage

Test Breakdown

Writing Tests

Use the provided factories and fixtures:

Error Handling

The package provides specific exceptions for different error scenarios:

Platform Notifications (Webhooks)

The package includes complete support for eBay Platform Notifications - SOAP-based push notifications sent by eBay when events occur on the platform.

Setup

  1. Publish and run migrations:

  2. Configure webhook URL in .env:

  3. Configure in eBay Seller Hub:
    • Go to eBay Developer Account
    • Set notification delivery URL: https://your-domain.com/ebay/notifications
    • Subscribe to desired events (ItemListed, ItemSold, OrderCreated, etc.)

Webhook Endpoint

The package automatically registers a webhook endpoint at the configured route (default: /ebay/notifications).

The controller:

Listening to Events

Listen to notification events in your EventServiceProvider:

Available Events

Event Handler Example

GDPR Compliance - Account Deletion

CRITICAL: Handle MarketplaceAccountDeletionEvent to comply with data protection regulations:

Querying Notifications

Signature Validation

For production, enable signature validation to verify notifications are from eBay:

The package validates:

Invalid signatures are logged but webhook still returns 200 to prevent eBay retries.

Manual Processing

Reprocess failed notifications:

Marketplace Account Deletion (GDPR Compliance)

In addition to Platform Notifications, eBay requires a separate HTTP endpoint for marketplace account deletion notifications. This is an additional GDPR compliance requirement.

Documentation: https://developer.ebay.com/marketplace-account-deletion

Setup

  1. Enable the endpoint in .env:

  2. Generate verification token (32-80 characters required):

Copy the generated token to EBAY_MAD_VERIFICATION_TOKEN in .env.

  1. Register endpoint in eBay Developer Portal:

How it Works

The endpoint handles two types of requests:

1. Verification Challenge (GET)

eBay sends a GET request with challenge_code parameter:

The controller automatically calculates and returns:

2. Deletion Notification (POST)

eBay sends a POST request when a user deletes their marketplace account:

Listening to Deletion Notifications

Register listener in your EventServiceProvider:

Event Handler Example

CRITICAL: You MUST delete or anonymize all user data to comply with GDPR:

Testing the Endpoint

1. Test verification challenge:

Expected response:

2. Test deletion notification (POST):

Expected response:

Queue Processing

Deletion notifications are processed asynchronously via queue jobs:

Database Storage

If EBAY_MAD_STORE_DB=true, notifications are stored in ebay_notifications table with:

Security Notes

  1. Verification Token:

    • Must be 32-80 characters
    • Keep it secure (never commit to version control)
    • Use strong random generation: openssl rand -base64 48
  2. HTTPS Required:

    • eBay only sends requests to HTTPS endpoints
    • Ensure your SSL certificate is valid
  3. Endpoint Validation:
    • eBay validates your endpoint before activation
    • Ensure verification token is configured before registering

Difference from Platform Notifications

Feature Platform Notifications Account Deletion
Protocol SOAP XML JSON HTTP
Events 10+ event types 1 event type only
Request Type POST only GET (challenge) + POST
Verification MD5 signature Challenge/response
Purpose Real-time events GDPR compliance

Both systems can coexist - use Platform Notifications for operational events and Account Deletion endpoint for GDPR compliance.

Post-Order API Examples

โš ๏ธ Important: Post-Order API requires User OAuth Token. Set it before making requests:

Returns Management

Cancellations

Cases (Disputes)

Inquiries

Data Mapping

This package automatically maps API responses to type-safe Data objects using Spatie Laravel Data.

Quick Examples

Testing

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Security Vulnerabilities

If you discover a security vulnerability within this package, please send an email to [email protected].

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of ebay-api with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
guzzlehttp/guzzle Version ^7.9
illuminate/contracts Version ^11.0|^12.0|^13.0
spatie/laravel-data Version ^4.4
spatie/laravel-package-tools Version ^1.16
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package sashalenz/ebay-api contains the following files

Loading the files please wait ...