Skip to content

Latest commit

 

History

History
193 lines (127 loc) · 10.6 KB

InventoryItemGroupApi.md

File metadata and controls

193 lines (127 loc) · 10.6 KB

ld\php\sdkEbayInventory\InventoryItemGroupApi

All URIs are relative to https://api.ebay.com/sell/inventory/v1.

Method HTTP request Description
createOrReplaceInventoryItemGroup() PUT /inventory_item_group/{inventoryItemGroupKey}
deleteInventoryItemGroup() DELETE /inventory_item_group/{inventoryItemGroupKey}
getInventoryItemGroup() GET /inventory_item_group/{inventoryItemGroupKey}

createOrReplaceInventoryItemGroup()

createOrReplaceInventoryItemGroup($contentLanguage, $inventoryItemGroupKey, $inventoryItemGroup): \ld\php\sdkEbayInventory\Model\BaseResponse

This call creates a new inventory item group or updates an existing inventory item group. It is up to sellers whether they want to create a complete inventory item group record right from the start, or sellers can provide only some information with the initial createOrReplaceInventoryItemGroup call, and then make one or more additional createOrReplaceInventoryItemGroup calls to complete the inventory item group record. Upon first creating an inventory item group record, the only required elements are the inventoryItemGroupKey identifier in the call URI, and the members of the inventory item group specified through the variantSKUs array in the request payload.

In the case of updating/replacing an existing inventory item group, this call does a complete replacement of the existing inventory item group record, so all fields (including the member SKUs) that make up the inventory item group are required, regardless of whether their values changed. So, when replacing/updating an inventory item group record, it is advised that the seller run a getInventoryItemGroup call for that inventory item group to see all of its current values/settings/members before attempting to update the record. And if changes are made to an inventory item group that is part of a live, multiple-variation eBay listing, these changes automatically update the eBay listing. For example, if a SKU value is removed from the inventory item group, the corresponding product variation will be removed from the eBay listing as well.

In addition to the required inventory item group identifier and member SKUs, other key information that is set with this call include:

  • Title and description of the inventory item group. The string values provided in these fields will actually become the listing title and listing description of the listing once the first SKU of the inventory item group is published successfully
  • Common aspects that inventory items in the qroup share
  • Product aspects that vary within each product variation
  • Links to images demonstrating the variations of the product, and these images should correspond to the product aspect that is set with the variesBy.aspectsImageVariesBy field

In addition to the authorization header, which is required for all eBay REST API calls, the createOrReplaceInventoryItemGroup 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.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure OAuth2 access token for authorization: api_auth
$config = ld\php\sdkEbayInventory\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new ld\php\sdkEbayInventory\Api\InventoryItemGroupApi(
    // 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
);
$contentLanguage = 'contentLanguage_example'; // string | This request header sets the natural language that will be provided in the field values of the request payload.
$inventoryItemGroupKey = 'inventoryItemGroupKey_example'; // string | Unique identifier of the inventory item group. This identifier is supplied by the seller. The <strong>inventoryItemGroupKey</strong> value for the inventory item group to create/update is passed in at the end of the call URI. This value cannot be changed once it is set.
$inventoryItemGroup = new \ld\php\sdkEbayInventory\Model\InventoryItemGroup(); // \ld\php\sdkEbayInventory\Model\InventoryItemGroup | Details of the inventory Item Group

try {
    $result = $apiInstance->createOrReplaceInventoryItemGroup($contentLanguage, $inventoryItemGroupKey, $inventoryItemGroup);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling InventoryItemGroupApi->createOrReplaceInventoryItemGroup: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
contentLanguage string This request header sets the natural language that will be provided in the field values of the request payload.
inventoryItemGroupKey string Unique identifier of the inventory item group. This identifier is supplied by the seller. The <strong>inventoryItemGroupKey</strong> value for the inventory item group to create/update is passed in at the end of the call URI. This value cannot be changed once it is set.
inventoryItemGroup \ld\php\sdkEbayInventory\Model\InventoryItemGroup Details of the inventory Item Group

Return type

\ld\php\sdkEbayInventory\Model\BaseResponse

Authorization

api_auth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

deleteInventoryItemGroup()

deleteInventoryItemGroup($inventoryItemGroupKey)

This call deletes the inventory item group for a given inventoryItemGroupKey value.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure OAuth2 access token for authorization: api_auth
$config = ld\php\sdkEbayInventory\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new ld\php\sdkEbayInventory\Api\InventoryItemGroupApi(
    // 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
);
$inventoryItemGroupKey = 'inventoryItemGroupKey_example'; // string | The unique identifier of an inventory item group. This value is assigned by the seller when an inventory item group is created. The <strong>inventoryItemGroupKey</strong> value for the inventory item group to delete is passed in at the end of the call URI.

try {
    $apiInstance->deleteInventoryItemGroup($inventoryItemGroupKey);
} catch (Exception $e) {
    echo 'Exception when calling InventoryItemGroupApi->deleteInventoryItemGroup: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
inventoryItemGroupKey string The unique identifier of an inventory item group. This value is assigned by the seller when an inventory item group is created. The <strong>inventoryItemGroupKey</strong> value for the inventory item group to delete is passed in at the end of the call URI.

Return type

void (empty response body)

Authorization

api_auth

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getInventoryItemGroup()

getInventoryItemGroup($inventoryItemGroupKey): \ld\php\sdkEbayInventory\Model\InventoryItemGroup

This call retrieves the inventory item group for a given inventoryItemGroupKey value. The inventoryItemGroupKey value is passed in at the end of the call URI.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure OAuth2 access token for authorization: api_auth
$config = ld\php\sdkEbayInventory\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new ld\php\sdkEbayInventory\Api\InventoryItemGroupApi(
    // 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
);
$inventoryItemGroupKey = 'inventoryItemGroupKey_example'; // string | The unique identifier of an inventory item group. This value is assigned by the seller when an inventory item group is created. The <strong>inventoryItemGroupKey</strong> value for the inventory item group to retrieve is passed in at the end of the call URI.

try {
    $result = $apiInstance->getInventoryItemGroup($inventoryItemGroupKey);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling InventoryItemGroupApi->getInventoryItemGroup: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
inventoryItemGroupKey string The unique identifier of an inventory item group. This value is assigned by the seller when an inventory item group is created. The <strong>inventoryItemGroupKey</strong> value for the inventory item group to retrieve is passed in at the end of the call URI.

Return type

\ld\php\sdkEbayInventory\Model\InventoryItemGroup

Authorization

api_auth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]