Skip to content

Latest commit

 

History

History
268 lines (177 loc) · 19.6 KB

ItemPriceMarkdownApi.md

File metadata and controls

268 lines (177 loc) · 19.6 KB

macropage\SDKs\ebay\rest\marketing\ItemPriceMarkdownApi

All URIs are relative to https://api.ebay.com/sell/marketing/v1, except if the operation defines another base path.

Method HTTP request Description
createItemPriceMarkdownPromotion() POST /item_price_markdown
deleteItemPriceMarkdownPromotion() DELETE /item_price_markdown/{promotion_id}
getItemPriceMarkdownPromotion() GET /item_price_markdown/{promotion_id}
updateItemPriceMarkdownPromotion() PUT /item_price_markdown/{promotion_id}

createItemPriceMarkdownPromotion()

createItemPriceMarkdownPromotion($contentType, $itemPriceMarkdown): object

This method creates an item price markdown promotion (know simply as a "markdown promotion") where a discount amount is applied directly to the items included the promotion. Discounts can be specified as either a monetary amount or a percentage off the standard sales price. eBay highlights promoted items by placing teasers for the items throughout the online sales flows.

Unlike an <a href="/api-docs/sell/marketing/resources/item_promotion/methods/createItemPromotion">item promotion, a markdown promotion does not require the buyer meet a "threshold" before the offer takes effect. With markdown promotions, all the buyer needs to do is purchase the item to receive the promotion benefit.

<p class="tablenote">Important: There are some restrictions for which listings are available for price markdown promotions. For details, see <a href="/api-docs/sell/marketing/static/overview.html#PM-requirements">Promotions Manager requirements and restrictions.

In addition, we recommend you list items at competitive prices before including them in your markdown promotions. For an extensive list of pricing recommendations, see the Growth tab in Seller Hub.

There are two ways to add items to markdown promotions:

  • Key-based promotions select items using either the listing IDs or inventory reference IDs of the items you want to promote. Note that if you use inventory reference IDs, you must specify both the inventoryReferenceId and the associated inventoryReferenceType of the item(s) you want to include the promotion.
  • Rule-based promotions select items using a list of eBay category IDs or seller Store category IDs. Rules can further constrain items in a promotion by minimum and maximum prices, brands, and item conditions.

New promotions must be created in either a DRAFT or a SCHEDULED state. Use the DRAFT state when you are initially creating a promotion and you want to be sure it's correctly configured before scheduling it to run. When you create a promotion, the promotion ID is returned in the Location response header. Use this ID to reference the promotion in subsequent requests (such as to schedule a promotion that's in a DRAFT state).

<p class="tablenote">Tip: Refer to <a href="/api-docs/sell/static/marketing/promotions-manager.html">Promotions Manager in the Selling Integration Guide for details and examples showing how to create and manage seller promotions.

Markdown promotions are available on all eBay marketplaces. For more information, see <a href="/api-docs/sell/marketing/static/overview.html#PM-requirements">Promotions Manager requirements and restrictions.

Example

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


// Configure OAuth2 access token for authorization: api_auth
$config = macropage\SDKs\ebay\rest\marketing\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Configure OAuth2 access token for authorization: api_auth
$config = macropage\SDKs\ebay\rest\marketing\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new macropage\SDKs\ebay\rest\marketing\Api\ItemPriceMarkdownApi(
    // 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
);
$contentType = 'contentType_example'; // string | This header indicates the format of the request body provided by the client. Its value should be set to <b>application/json</b>. <br><br> For more information, refer to <a href=\"/api-docs/static/rest-request-components.html#HTTP\" target=\"_blank \">HTTP request headers</a>.
$itemPriceMarkdown = new \macropage\SDKs\ebay\rest\marketing\Model\ItemPriceMarkdown(); // \macropage\SDKs\ebay\rest\marketing\Model\ItemPriceMarkdown | This type defines the fields that describe an item price markdown promotion.

try {
    $result = $apiInstance->createItemPriceMarkdownPromotion($contentType, $itemPriceMarkdown);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ItemPriceMarkdownApi->createItemPriceMarkdownPromotion: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
contentType string This header indicates the format of the request body provided by the client. Its value should be set to <b>application/json</b>. <br><br> For more information, refer to <a href=&quot;/api-docs/static/rest-request-components.html#HTTP&quot; target=&quot;_blank &quot;>HTTP request headers</a>.
itemPriceMarkdown \macropage\SDKs\ebay\rest\marketing\Model\ItemPriceMarkdown This type defines the fields that describe an item price markdown promotion. [optional]

Return type

object

Authorization

api_auth, 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]

deleteItemPriceMarkdownPromotion()

deleteItemPriceMarkdownPromotion($promotionId)

This method deletes the item price markdown promotion specified by the promotion_id path parameter. Call <a href="/api-docs/sell/marketing/resources/promotion/methods/getPromotions">getPromotions to retrieve the IDs of a seller's promotions.

You can delete any promotion with the exception of those that are currently active (RUNNING). To end a running promotion, call <a href="/api-docs/sell/marketing/resources/item_price_markdown/methods/updateItemPriceMarkdownPromotion">updateItemPriceMarkdownPromotion and adjust the endDate field as appropriate.

Example

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


// Configure OAuth2 access token for authorization: api_auth
$config = macropage\SDKs\ebay\rest\marketing\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Configure OAuth2 access token for authorization: api_auth
$config = macropage\SDKs\ebay\rest\marketing\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new macropage\SDKs\ebay\rest\marketing\Api\ItemPriceMarkdownApi(
    // 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
);
$promotionId = 'promotionId_example'; // string | This path parameter takes a concatenation of the ID of the promotion you want to delete plus the marketplace ID on which the promotion is hosted. Concatenate the two values by separating them with an \"at sign\" (<b>@</b>). <br><br>The ID of the promotion (<b>promotionId</b>) is a unique eBay-assigned value that's generated when the promotion is created. The Marketplace ID is the ENUM value of eBay marketplace where the promotion is hosted.<br><br> Use the <a href=\"/api-docs/sell/marketing/resources/promotion/methods/getPromotions\">getPromotions</a> method to retrieve promotion Ids. See <a href=\"/api-docs/sell/marketing/types/ba:MarketplaceIdEnum\">MarketplaceIdEnum</a> for supported Marketplace ID values.<br><br><b>Example:</b> <code>1********5@EBAY_US</code>

try {
    $apiInstance->deleteItemPriceMarkdownPromotion($promotionId);
} catch (Exception $e) {
    echo 'Exception when calling ItemPriceMarkdownApi->deleteItemPriceMarkdownPromotion: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
promotionId string This path parameter takes a concatenation of the ID of the promotion you want to delete plus the marketplace ID on which the promotion is hosted. Concatenate the two values by separating them with an &quot;at sign&quot; (<b>@</b>). <br><br>The ID of the promotion (<b>promotionId</b>) is a unique eBay-assigned value that's generated when the promotion is created. The Marketplace ID is the ENUM value of eBay marketplace where the promotion is hosted.<br><br> Use the <a href=&quot;/api-docs/sell/marketing/resources/promotion/methods/getPromotions&quot;>getPromotions</a> method to retrieve promotion Ids. See <a href=&quot;/api-docs/sell/marketing/types/ba:MarketplaceIdEnum&quot;>MarketplaceIdEnum</a> for supported Marketplace ID values.<br><br><b>Example:</b> <code>1********5@EBAY_US</code>

Return type

void (empty response body)

Authorization

api_auth, 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]

getItemPriceMarkdownPromotion()

getItemPriceMarkdownPromotion($promotionId): \macropage\SDKs\ebay\rest\marketing\Model\ItemPriceMarkdown

This method returns the complete details of the item price markdown promotion that's indicated by the promotion_id path parameter.

Call <a href="/api-docs/sell/marketing/resources/promotion/methods/getPromotions">getPromotions to retrieve the IDs of a seller's promotions.

Example

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


// Configure OAuth2 access token for authorization: api_auth
$config = macropage\SDKs\ebay\rest\marketing\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Configure OAuth2 access token for authorization: api_auth
$config = macropage\SDKs\ebay\rest\marketing\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new macropage\SDKs\ebay\rest\marketing\Api\ItemPriceMarkdownApi(
    // 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
);
$promotionId = 'promotionId_example'; // string | This path parameter takes a concatenation of the ID of the promotion you want to retrieve plus the marketplace ID on which the promotion is hosted. Concatenate the two values by separating them with an \"at sign\" (<b>@</b>). <br><br>The ID of the promotion (<b>promotionId</b>) is a unique eBay-assigned value that's generated when the promotion is created. The Marketplace ID is the ENUM value of eBay marketplace where the promotion is hosted.<br><br> Use the <a href=\"/api-docs/sell/marketing/resources/promotion/methods/getPromotions\">getPromotions</a> method to retrieve promotion Ids. See <a href=\"/api-docs/sell/marketing/types/ba:MarketplaceIdEnum\">MarketplaceIdEnum</a> for supported Marketplace ID values.<br><br><b>Example:</b> <code>1********5@EBAY_US</code>

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

Parameters

Name Type Description Notes
promotionId string This path parameter takes a concatenation of the ID of the promotion you want to retrieve plus the marketplace ID on which the promotion is hosted. Concatenate the two values by separating them with an &quot;at sign&quot; (<b>@</b>). <br><br>The ID of the promotion (<b>promotionId</b>) is a unique eBay-assigned value that's generated when the promotion is created. The Marketplace ID is the ENUM value of eBay marketplace where the promotion is hosted.<br><br> Use the <a href=&quot;/api-docs/sell/marketing/resources/promotion/methods/getPromotions&quot;>getPromotions</a> method to retrieve promotion Ids. See <a href=&quot;/api-docs/sell/marketing/types/ba:MarketplaceIdEnum&quot;>MarketplaceIdEnum</a> for supported Marketplace ID values.<br><br><b>Example:</b> <code>1********5@EBAY_US</code>

Return type

\macropage\SDKs\ebay\rest\marketing\Model\ItemPriceMarkdown

Authorization

api_auth, 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]

updateItemPriceMarkdownPromotion()

updateItemPriceMarkdownPromotion($promotionId, $contentType, $itemPriceMarkdown): object

This method updates the specified item price markdown promotion with the new configuration that you supply in the payload of the request. Specify the promotion you want to update using the promotion_id path parameter. Call <a href="/api-docs/sell/marketing/resources/promotion/methods/getPromotions">getPromotions to retrieve the IDs of a seller's promotions.

When updating a promotion, supply all the fields that you used to configure the original promotion (and not just the fields you are updating). eBay replaces the specified promotion with the values you supply in the update request and if you don't pass a field that currently has a value, the update request fails.

The parameters you are allowed to update with this request depend on the status of the promotion you're updating:

  • DRAFT or SCHEDULED promotions: You can update any of the parameters in these promotions that have not yet started to run, including the discountRules.
  • RUNNING promotions: You can change the endDate and the item's inventory but you cannot change the promotional discount or the promotion's start date.
  • ENDED promotions: Nothing can be changed.

Example

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


// Configure OAuth2 access token for authorization: api_auth
$config = macropage\SDKs\ebay\rest\marketing\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Configure OAuth2 access token for authorization: api_auth
$config = macropage\SDKs\ebay\rest\marketing\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new macropage\SDKs\ebay\rest\marketing\Api\ItemPriceMarkdownApi(
    // 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
);
$promotionId = 'promotionId_example'; // string | This path parameter takes a concatenation of the ID of the promotion you want to update plus the marketplace ID on which the promotion is hosted. Concatenate the two values by separating them with an \"at sign\" (<b>@</b>). <br><br>The ID of the promotion (<b>promotionId</b>) is a unique eBay-assigned value that's generated when the promotion is created. The Marketplace ID is the ENUM value of eBay marketplace where the promotion is hosted.<br><br> Use the <a href=\"/api-docs/sell/marketing/resources/promotion/methods/getPromotions\">getPromotions</a> method to retrieve promotion Ids. See <a href=\"/api-docs/sell/marketing/types/ba:MarketplaceIdEnum\">MarketplaceIdEnum</a> for supported Marketplace ID values.<br><br><b>Example:</b> <code>1********5@EBAY_US</code>
$contentType = 'contentType_example'; // string | This header indicates the format of the request body provided by the client. Its value should be set to <b>application/json</b>. <br><br> For more information, refer to <a href=\"/api-docs/static/rest-request-components.html#HTTP\" target=\"_blank \">HTTP request headers</a>.
$itemPriceMarkdown = new \macropage\SDKs\ebay\rest\marketing\Model\ItemPriceMarkdown(); // \macropage\SDKs\ebay\rest\marketing\Model\ItemPriceMarkdown | This type defines the fields that describe an item price markdown promotion.

try {
    $result = $apiInstance->updateItemPriceMarkdownPromotion($promotionId, $contentType, $itemPriceMarkdown);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ItemPriceMarkdownApi->updateItemPriceMarkdownPromotion: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
promotionId string This path parameter takes a concatenation of the ID of the promotion you want to update plus the marketplace ID on which the promotion is hosted. Concatenate the two values by separating them with an &quot;at sign&quot; (<b>@</b>). <br><br>The ID of the promotion (<b>promotionId</b>) is a unique eBay-assigned value that's generated when the promotion is created. The Marketplace ID is the ENUM value of eBay marketplace where the promotion is hosted.<br><br> Use the <a href=&quot;/api-docs/sell/marketing/resources/promotion/methods/getPromotions&quot;>getPromotions</a> method to retrieve promotion Ids. See <a href=&quot;/api-docs/sell/marketing/types/ba:MarketplaceIdEnum&quot;>MarketplaceIdEnum</a> for supported Marketplace ID values.<br><br><b>Example:</b> <code>1********5@EBAY_US</code>
contentType string This header indicates the format of the request body provided by the client. Its value should be set to <b>application/json</b>. <br><br> For more information, refer to <a href=&quot;/api-docs/static/rest-request-components.html#HTTP&quot; target=&quot;_blank &quot;>HTTP request headers</a>.
itemPriceMarkdown \macropage\SDKs\ebay\rest\marketing\Model\ItemPriceMarkdown This type defines the fields that describe an item price markdown promotion. [optional]

Return type

object

Authorization

api_auth, 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]