The Metadata API has operations that retrieve configuration details pertaining to the different eBay marketplaces. In addition to marketplace information, the API also has operations that get information that helps sellers list items on eBay.
PHP 7.2 and later.
To install the bindings via Composer, add the following to composer.json
:
{
"repositories": [
{
"type": "vcs",
"url": "https://github/zvps/ebay-sell-metadata-php-client.git"
}
],
"require": {
"zvps/ebay-sell-metadata-php-client": "*@dev"
}
}
Then run composer install
Download the files and include autoload.php
:
<?php
require_once('/path/to/OpenAPIClient-php/vendor/autoload.php');
Please follow the installation procedure and then run the following:
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: Client Credentials
$config = Ebay\Sell\Metadata\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new Ebay\Sell\Metadata\Api\CountryApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$country_code = 'country_code_example'; // string | This path parameter specifies the two-letter ISO 3166 country code for the country whose jurisdictions you want to retrieve. eBay provides sales tax jurisdiction information for Canada and the United States.Valid values for this path parameter are CA and US.
try {
$result = $apiInstance->getSalesTaxJurisdictions($country_code);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling CountryApi->getSalesTaxJurisdictions: ', $e->getMessage(), PHP_EOL;
}
All URIs are relative to https://api.ebay.com/sell/metadata/v1
Class | Method | HTTP request | Description |
---|---|---|---|
CountryApi | getSalesTaxJurisdictions | GET /country/{countryCode}/sales_tax_jurisdiction | |
MarketplaceApi | getAutomotivePartsCompatibilityPolicies | GET /marketplace/{marketplace_id}/get_automotive_parts_compatibility_policies | |
MarketplaceApi | getItemConditionPolicies | GET /marketplace/{marketplace_id}/get_item_condition_policies | |
MarketplaceApi | getListingStructurePolicies | GET /marketplace/{marketplace_id}/get_listing_structure_policies | |
MarketplaceApi | getNegotiatedPricePolicies | GET /marketplace/{marketplace_id}/get_negotiated_price_policies | |
MarketplaceApi | getProductAdoptionPolicies | GET /marketplace/{marketplace_id}/get_product_adoption_policies | |
MarketplaceApi | getReturnPolicies | GET /marketplace/{marketplace_id}/get_return_policies |
- AutomotivePartsCompatibilityPolicy
- AutomotivePartsCompatibilityPolicyResponse
- Error
- ErrorParameter
- Exclusion
- ItemCondition
- ItemConditionPolicy
- ItemConditionPolicyResponse
- ListingStructurePolicy
- ListingStructurePolicyResponse
- NegotiatedPricePolicy
- NegotiatedPricePolicyResponse
- ProductAdoptionPolicy
- ProductAdoptionPolicyResponse
- ReturnPolicy
- ReturnPolicyDetails
- ReturnPolicyResponse
- SalesTaxJurisdiction
- SalesTaxJurisdictions
- TimeDuration
- Type:
OAuth
- Flow:
accessCode
- Authorization URL:
https://auth.ebay.com/oauth2/authorize
- Scopes:
- https://api.ebay.com/oauth/api_scope/sell.inventory: View and manage your inventory and offers
- Type:
OAuth
- Flow:
application
- Authorization URL: ``
- Scopes:
- https://api.ebay.com/oauth/api_scope: View public data from eBay
To run the tests, use:
composer install
vendor/bin/phpunit
This PHP package is automatically generated by the OpenAPI Generator project:
- API version:
v1.4.1
- Package version:
5.0.0
- Package version:
- Build package:
org.openapitools.codegen.languages.PhpClientCodegen