All URIs are relative to https://api.ebay.com/sell/inventory/v1
Method | HTTP request | Description |
---|---|---|
createOrReplaceProductCompatibility | PUT /inventory_item/{sku}/product_compatibility | |
deleteProductCompatibility | DELETE /inventory_item/{sku}/product_compatibility | |
getProductCompatibility | GET /inventory_item/{sku}/product_compatibility |
SapientPro\EbayInventorySDK\Models\BaseResponse createOrReplaceProductCompatibility($body, $contentLanguage, $sku)
This call is used by the seller to create or replace a list of products that are compatible with the inventory item. The inventory item is identified with a SKU value in the URI. Product compatibility is currently only applicable to motor vehicle parts and accessory categories, but more categories may be supported in the future.
In addition to the authorization
header, which is required for all eBay REST API calls, the createOrReplaceProductCompatibility call also requires the Content-Language
header, that sets the natural language that will be used in the field values of the request payload. For US English, the code value passed in this header should be en-US
. To view other supported Content-Language
values, and to read more about all supported HTTP headers for eBay REST API calls, see the <a href="/api-docs/static/rest-request-components.html#HTTP">HTTP request headers topic in the Using eBay RESTful APIs document.
<?php
use SapientPro\EbayInventorySDK\Configuration;
use SapientPro\EbayInventorySDK\Api\ProductCompatibilityApi;
use SapientPro\EbayInventorySDK\Models\Compatibility;
// Configure OAuth2 access token for authorization: api_auth
$config = Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new ProductCompatibilityApi(
сonfig: $config
);
$body = Compatibility::fromArray([]); // SapientPro\EbayInventorySDK\Models\Compatibility | Details of the compatibility
$contentLanguage = "contentLanguage_example"; // string | This request header sets the natural language that will be provided in the field values of the request payload.
$sku = "sku_example"; // string | A SKU (stock keeping unit) is an unique identifier defined by a seller for a product
try {
$result = $apiInstance->createOrReplaceProductCompatibility($body, $contentLanguage, $sku);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling ProductCompatibilityApi->createOrReplaceProductCompatibility: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
body | SapientPro\EbayInventorySDK\Models\Compatibility | Details of the compatibility | |
contentLanguage | \SapientPro\EbayInventorySDK\Enums\LocaleEnum | This request header sets the natural language that will be provided in the field values of the request payload. | |
sku | string | A SKU (stock keeping unit) is an unique identifier defined by a seller for a product |
SapientPro\EbayInventorySDK\Models\BaseResponse
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
deleteProductCompatibility($sku)
This call is used by the seller to delete the list of products that are compatible with the inventory item that is associated with the compatible product list. The inventory item is identified with a SKU value in the URI. Product compatibility is currently only applicable to motor vehicle parts and accessory categories, but more categories may be supported in the future.
<?php
use SapientPro\EbayInventorySDK\Configuration;
use SapientPro\EbayInventorySDK\Api\ProductCompatibilityApi;
// Configure OAuth2 access token for authorization: api_auth
$config = Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new ProductCompatibilityApi(
сonfig: $config
);
$sku = "sku_example"; // string | A SKU (stock keeping unit) is an unique identifier defined by a seller for a product
try {
$apiInstance->deleteProductCompatibility($sku);
} catch (Exception $e) {
echo 'Exception when calling ProductCompatibilityApi->deleteProductCompatibility: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
sku | string | A SKU (stock keeping unit) is an unique identifier defined by a seller for a product |
void (empty response body)
- Content-Type: Not defined
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]
SapientPro\EbayInventorySDK\Models\Compatibility getProductCompatibility($sku)
This call is used by the seller to retrieve the list of products that are compatible with the inventory item. The SKU value for the inventory item is passed into the call URI, and a successful call with return the compatible vehicle list associated with this inventory item. Product compatibility is currently only applicable to motor vehicle parts and accessory categories, but more categories may be supported in the future.
<?php
use SapientPro\EbayInventorySDK\Configuration;
use SapientPro\EbayInventorySDK\Api\ProductCompatibilityApi;
use SapientPro\EbayInventorySDK\Models\Compatibility;
// Configure OAuth2 access token for authorization: api_auth
$config = Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new ProductCompatibilityApi(
сonfig: $config
);
$sku = "sku_example"; // string | A SKU (stock keeping unit) is an unique identifier defined by a seller for a product
try {
$result = $apiInstance->getProductCompatibility($sku);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling ProductCompatibilityApi->getProductCompatibility: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
sku | string | A SKU (stock keeping unit) is an unique identifier defined by a seller for a product |
SapientPro\EbayInventorySDK\Models\Compatibility
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]