Skip to content

Configuration

The SDK ships with a configuration file that allows you to define your eBay OAuth credentials, client settings, webhook behavior, and OAuth scopes. This page describes each section of the configuration.

To publish the configuration file:

sh
php artisan vendor:publish --tag=ebay-sdk-config

The configuration is located at:

sh
config/ebay-sdk.php

OAuth / API Credentials

These values configure the OAuth client used by the SDK to authenticate with eBay. These values must match the settings in the eBay Developer Portal, regarding the used Target environment, of course.

php
'credentials' => [
    'client_id'     => env('EBAY_CLIENT_ID', null),
    'client_secret' => env('EBAY_CLIENT_SECRET', null),
    'redirect_uri'  => env('EBAY_REDIRECT_URI', null),
    'dev_id'        => env('EBAY_DEV_ID', null),
    'environment'   => env('EBAY_API_ENVIRONMENT', 'sandbox'),
],
KeyValue
client_idYour eBay App’s Client ID (App ID)
client_secretYour eBay App’s Client Secret (Cert ID)
redirect_uriYour configured Redirect URI or RuName
dev_idYour eBay App’s Dev ID (used for traditional calls only)
environmentTarget API environment: sandbox or production

Client / Authentication Options

These options control request behavior, token caching, debugging, and localization.

php
'options' => [
    'caching' => (bool) env('EBAY_CACHING', true),
    'debug'   => (bool) env('EBAY_DEBUG', false),
    'locale'  => env('EBAY_LOCALE', 'en-US'),
],
KeyValue
cachingEnables automatic token caching
debugLogs request and response data
localeSets the Content-Language header sent to eBay APIs

Traditional API (XML/SOAP) Settings

These settings are only relevant for eBay’s legacy “Traditional” APIs (XML/SOAP). They define the default request parameters and headers used for Trading API calls. All values can be overridden on a per-request basis using the corresponding set<Name>() methods on the individual request classes.

php
'traditional' => [
    'compatibility_level'   => env('EBAY_COMPATIBILITY_LEVEL', '1395'),
    'error_language'        => str_replace('-', '_', env('EBAY_LOCALE', 'en_US')),
    'error_handling'        => 'BestEffort',
    'site_id'               => env('EBAY_SITE_ID', 0),
    'warning_level'         => 'Low'
],
KeyValue
compatibility_leveleBay API schema version
error_languageLanguage for XML/SOAP error messages
error_handlingPartial-failure strategy
site_ideBay marketplace ID
warning_levelVerbosity for warning messages

OAuth Route Configuration

This section controls whether the SDK should register its default OAuth routes and which middleware should be attached to them.

CAUTION

The default OAuth routes are for demonstration only and should not be used in a productive environment. We highly recommend your own setup to match your application’s security and UX requirements.

php
'oauth' => [
    'routes' => false,
    'middleware' => [
        'web',
        'auth',
        'throttle:30,1',
        //'can:request_token',
    ],
],
KeyValue
routesPrevents the SDK from automatically registering OAuth routes.
middlewareMiddleware stack applied to the built-in OAuth routes.

Webhook Configuration

Controls the webhook handling for the eBay Platform Notifications (push).

TIP

We strongly recommend enabling the async queue worker if your event listeners perform expensive operations (such as additional HTTP or API calls). Otherwise, eBay may retry and resend the same notification when your endpoint takes too long to return a response.

php
'webhook' => [
    'routes' => false,
    'token'  => env('EBAY_WEBHOOK_TOKEN', ''),
    'async'  => false,
    'queue'  => 'default',
],
KeyPurpose
routesEnables the built-in webhook endpoint
tokenOptional shared secret for request validation
asyncDispatch notifications via queue instead of synchronous processing
queueQueue name used when async mode is enabled

Authorization Code Grant Scopes (User Token)

These scopes are requested during the OAuth user authorization flow. Please refer to your eBay Developer Portal for the available scopes.

TIP

The OAuth scopes define which permissions your application requests from the user during authorization. Only request the scopes you actually need. Over-scoping increases the chance of user rejection and review friction.

php
'authorization_scopes' => [
    'https://api.ebay.com/oauth/api_scope',
    'https://api.ebay.com/oauth/api_scope/sell.account',
    'https://api.ebay.com/oauth/api_scope/sell.inventory',
],

Client Credentials Grant Scopes (Application Token)

These scopes apply to application-based authentication (no user context). Please refer to your eBay Developer Portal for the available scopes.

php
'credential_scopes' => [
    'https://api.ebay.com/oauth/api_scope',
],

This software is not an official eBay product and is not associated with, sponsored by, or endorsed by eBay Inc.