Skip to content

Latest commit

 

History

History
127 lines (92 loc) · 6.81 KB

ShopListingInventoryApi.md

File metadata and controls

127 lines (92 loc) · 6.81 KB

Swagger\Client\ShopListingInventoryApi

All URIs are relative to https://openapi.etsy.com

Method HTTP request Description
getListingInventory GET /v3/application/listings/{listing_id}/inventory
updateListingInventory PUT /v3/application/listings/{listing_id}/inventory

getListingInventory

\Swagger\Client\Model\ListingInventoryWithAssociations getListingInventory($listing_id, $show_deleted, $includes)

General ReleaseReport bug

This endpoint is ready for production use.

Retrieves the inventory record for a listing. Listings you did not edit using the Etsy.com inventory tools have no inventory records. This endpoint returns SKU data if you are the owner of the inventory records being fetched.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: api_key
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('x-api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-api-key', 'Bearer');
// Configure OAuth2 access token for authorization: oauth2
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

$apiInstance = new Swagger\Client\Api\ShopListingInventoryApi(
    // 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
);
$listing_id = 56; // int | The numeric ID for the [listing](/documentation/reference#tag/ShopListing) associated to this transaction.
$show_deleted = true; // bool | A boolean value for inventory whether to include deleted products and their offerings. Default value is false.
$includes = "includes_example"; // string | An enumerated string that attaches a valid association. Default value is null.

try {
    $result = $apiInstance->getListingInventory($listing_id, $show_deleted, $includes);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ShopListingInventoryApi->getListingInventory: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
listing_id int The numeric ID for the listing associated to this transaction.
show_deleted bool A boolean value for inventory whether to include deleted products and their offerings. Default value is false. [optional]
includes string An enumerated string that attaches a valid association. Default value is null. [optional]

Return type

\Swagger\Client\Model\ListingInventoryWithAssociations

Authorization

api_key, oauth2

HTTP request headers

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

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

updateListingInventory

\Swagger\Client\Model\ListingInventory updateListingInventory($listing_id, $body)

General ReleaseReport bug

This endpoint is ready for production use.

Updates the inventory for a listing identified by a listing ID. The update fails if the supplied values for product sku, offering quantity, and/or price are incompatible with values in `*_on_property_*` fields. When setting a price, assign a float equal to amount divided by divisor as specified in the Money resource.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: api_key
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('x-api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-api-key', 'Bearer');
// Configure OAuth2 access token for authorization: oauth2
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

$apiInstance = new Swagger\Client\Api\ShopListingInventoryApi(
    // 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
);
$listing_id = 56; // int | The numeric ID for the [listing](/documentation/reference#tag/ShopListing) associated to this transaction.
$body = new \Swagger\Client\Model\ListingIdInventoryBody(); // \Swagger\Client\Model\ListingIdInventoryBody | 

try {
    $result = $apiInstance->updateListingInventory($listing_id, $body);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ShopListingInventoryApi->updateListingInventory: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
listing_id int The numeric ID for the listing associated to this transaction.
body \Swagger\Client\Model\ListingIdInventoryBody [optional]

Return type

\Swagger\Client\Model\ListingInventory

Authorization

api_key, oauth2

HTTP request headers

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

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