Marketing API v1.22.3 eBay Docs
The Marketing API supports three eBay marketing features - Promoted Listings, Promotions Manager, and Store Email Campaigns. Used separately or together, these three marketing features can increase views and sales of the seller's items.
Promoted Listings is an eBay advertising service that increases the visibility of items included in a seller's ad campaigns. For more information on Promoted Listings, see the Promoted Listings Playbook.
Discounts manager is a free service that gives sellers the ability to offer price discounts on their items. For more information on Discounts manager, see the Discounts Manager section of the Selling Integration Guide.
Email Store Campaigns allow eBay store sellers to create and send email campaigns to subscribers, followers, and past customers who’ve signed up to receive newsletters from a seller’s store. For more information on email campaigns, see the Store Email Campaigns section of the Selling Integration Guide.
NOTE
The Marketing API works with listings that have been created with the Trading API as well as listings that are managed with the Inventory API.
Ad
BulkCreateAdsByInventoryReference eBay Docs
This method adds multiple listings that are managed with the Inventory API to an existing Promoted Listings campaign.
For general strategy campaigns using the Cost Per Sale (CPS) model, bulk ads may be directly created for the listing.
For each listing specified in the request, this method:
- Creates an ad for the listing.
- Sets the bid percentage (also known as the ad rate) for the ads created.
- Associates the ads created with the specified campaign.
To create ads for a listing, specify their inventoryReferenceId and inventoryReferenceType, plus the bidPercentage for the ad in the payload of the request. Specify the campaign to which you want to associate the ads using the campaign_id path parameter.
NOTE
This method only applies to the Cost Per Sale (CPS) funding model; it does not apply to the Cost Per Click (CPC) funding model.
use Rat\eBaySDK\API\MarketingAPI\Ad\BulkCreateAdsByInventoryReference;
use Rat\eBaySDK\Client;
$client = app(Client::class);
$request = new BulkCreateAdsByInventoryReference(
campaignId: (string) $campaignId,
payload: (array) $payload
);
$response = $client->execute($request);BulkCreateAdsByListingId eBay Docs
This method adds multiple listings to an existing Promoted Listings campaign using listingId values generated by the Trading API or Inventory API, or using values generated by an ad group ID.
For general strategy campaigns using the Cost Per Sale (CPS) funding model, bulk ads may be directly created for the listing.
For each listing ID specified in the request, this method:
- Creates an ad for the listing.
- Sets the bid percentage (also known as the ad rate) for the ad.
- Associates the ad with the specified campaign.
To create an ad for a listing, specify its listingId, plus the bidPercentage for the ad in the payload of the request. Specify the campaign to associate the ads with using the campaign_id path parameter. Listing IDs are generated by eBay when a seller creates listings with the Trading API.
You can specify a maximum of 500 listings per call and each campaign can have ads for a maximum of 50,000 items. Be aware when using this call that each variation in a multiple-variation listing creates an individual ad.
For manual targeting priority strategy campaigns using the Cost Per Click (CPC) funding model, an ad group must be created first. If no ad group has been created for the campaign, ads cannot be created.
NOTE
Ad groups are not required when adding listings to a smart targeting campaign.
For the ad group specified in the request, this method associates the ad with the specified ad group.
To create an ad for an ad group, specify the name of the ad group plus the defaultBid for the ad in the payload of the request. Specify the campaign to associate the ads with using the campaign_id path parameter. Ad groups are generated using the createAdGroup method.
You can specify one or more ad groups per campaign.
use Rat\eBaySDK\API\MarketingAPI\Ad\BulkCreateAdsByListingId;
use Rat\eBaySDK\Client;
$client = app(Client::class);
$request = new BulkCreateAdsByListingId(
campaignId: (string) $campaignId,
payload: (array) $payload
);
$response = $client->execute($request);BulkDeleteAdsByInventoryReference eBay Docs
This method works with listings created with the Inventory API.
The method deletes a set of ads, as specified by a list of inventory reference IDs, from the specified campaign. Inventory reference IDs are seller-defined IDs that are used with the Inventory API.
Pass the campaign_id as a path parameter and populate the payload with a list of inventoryReferenceId and inventoryReferenceType pairs that you want to delete.
Get the campaign IDs for a seller by calling getCampaigns and call getAds to get a list of the seller's inventory reference IDs.
NOTE
This method only applies to the Cost Per Sale (CPS) funding model; it does not apply to the Cost Per Click (CPC) funding model.
use Rat\eBaySDK\API\MarketingAPI\Ad\BulkDeleteAdsByInventoryReference;
use Rat\eBaySDK\Client;
$client = app(Client::class);
$request = new BulkDeleteAdsByInventoryReference(
campaignId: (string) $campaignId,
payload: (array) $payload
);
$response = $client->execute($request);BulkDeleteAdsByListingId eBay Docs
This method works with listing IDs created with either the Trading API or the Inventory API.
The method deletes a set of ads, as specified by a list of listingID values from a Promoted Listings campaign. A listing ID value is generated by eBay when a seller creates a listing with either the Trading API and Inventory API.
Pass the campaign_id as a path parameter and populate the payload with the set of listing IDs that you want to delete.
Get the campaign IDs for a seller by calling getCampaigns and call getAds to get a list of the seller's inventory reference IDs.
NOTE
This method only applies to the Cost Per Sale (CPS) funding model; it does not apply to the Cost Per Click (CPC) funding model.
When using the CPC funding model, use the bulkUpdateAdsStatusByListingId method to change the status of ads to ARCHIVED.
use Rat\eBaySDK\API\MarketingAPI\Ad\BulkDeleteAdsByListingId;
use Rat\eBaySDK\Client;
$client = app(Client::class);
$request = new BulkDeleteAdsByListingId(
campaignId: (string) $campaignId,
payload: (array) $payload
);
$response = $client->execute($request);BulkUpdateAdsBidByInventoryReference eBay Docs
This method works with listings created with either the Trading API or the Inventory API. The method updates the bidPercentage values for a set of ads associated with the specified campaign.
Specify the campaign_id as a path parameter and supply a set of listing IDs with their associated updated bidPercentage values in the request body. An eBay listing ID is generated when a listing is created with the Trading API.
Get the campaign IDs for a seller by calling getCampaigns and call getAds to get a list of the seller's inventory reference IDs.
NOTE
This method only applies to the Cost Per Sale (CPS) funding model; it does not apply to the Cost Per Click (CPC) funding model.
use Rat\eBaySDK\API\MarketingAPI\Ad\BulkUpdateAdsBidByInventoryReference;
use Rat\eBaySDK\Client;
$client = app(Client::class);
$request = new BulkUpdateAdsBidByInventoryReference(
campaignId: (string) $campaignId,
payload: (array) $payload
);
$response = $client->execute($request);BulkUpdateAdsBidByListingId eBay Docs
This method works with listings created with either the Trading API or the Inventory API. The method updates the bidPercentage values for a set of ads associated with the specified campaign.
Specify the campaign_id as a path parameter and supply a set of listing IDs with their associated updated bidPercentage values in the request body. An eBay listing ID is generated when a listing is created with the Trading API.
Get the campaign IDs for a seller by calling getCampaigns and call getAds to get a list of the seller's inventory reference IDs.
NOTE
This method only applies to the Cost Per Sale (CPS) funding model; it does not apply to the Cost Per Click (CPC) funding model.
use Rat\eBaySDK\API\MarketingAPI\Ad\BulkUpdateAdsBidByListingId;
use Rat\eBaySDK\Client;
$client = app(Client::class);
$request = new BulkUpdateAdsBidByListingId(
campaignId: (string) $campaignId,
payload: (array) $payload
);
$response = $client->execute($request);BulkUpdateAdsStatus eBay Docs
NOTE
This method is only available for select partners who have been approved for the priority strategy program.
This method works with listings created with either the Trading API or the Inventory API.
This method updates the status of ads in bulk.
Specify the campaign_id you want to update as a URI parameter, and configure the adGroupStatus in the request payload.
use Rat\eBaySDK\API\MarketingAPI\Ad\BulkUpdateAdsStatus;
use Rat\eBaySDK\Client;
$client = app(Client::class);
$request = new BulkUpdateAdsStatus(
campaignId: (string) $campaignId,
payload: (array) $payload
);
$response = $client->execute($request);BulkUpdateAdsStatusByListingId eBay Docs
NOTE
This method is only available for select partners who have been approved for the eBay priority strategy program.
This method works with listings created with either the Trading API or the Inventory API.
The method updates the status of ads in bulk, based on listing ID values.
Specify the campaign_id as a path parameter and supply a set of listing IDs with their updated adStatus values in the request body. An eBay listing ID is generated when a listing is created with the Trading API.
Get the campaign IDs for a seller by calling getCampaigns and call getAds to retrieve a list of seller inventory reference IDs.
use Rat\eBaySDK\API\MarketingAPI\Ad\BulkUpdateAdsStatusByListingId;
use Rat\eBaySDK\Client;
$client = app(Client::class);
$request = new BulkUpdateAdsStatusByListingId(
campaignId: (string) $campaignId,
payload: (array) $payload
);
$response = $client->execute($request);CreateAdByListingId eBay Docs
This method adds a listing to an existing Promoted Listings campaign using a listingId value generated by the Trading API or Inventory API, or using a value generated by an ad group ID.
For general strategy campaigns using the Cost Per Sale (CPS) funding model, an ad may be directly created for the listing.
For the listing ID specified in the request, this method:
- Creates an ad for the listing.
- Sets the bid percentage (also known as the ad rate) for the ad.
- Associates the ad with the specified campaign.
To create an ad for a listing, specify its listingId, plus the bidPercentage for the ad in the payload of the request. Specify the campaign to associate the ad with using the campaign_id path parameter. Listing IDs are generated by eBay when a seller creates listings with the Trading API.
For manual targeting priority strategy campaigns using the Cost Per Click (CPC) funding model, an ad group must be created first. If no ad group has been created for the campaign, ads cannot be created.
NOTE
Ad groups are not required when adding listings to a smart targeting campaign.
For the ad group specified in the request, this method associates the ad with the specified ad group.
To create an ad for an ad group, specify the name of the ad group in the payload of the request. Specify the campaign to associate the ads with using the campaign_id path parameter. Ad groups are generated using the createAdGroup method.
You can specify one or more ad groups per campaign.
This call has no response payload. If the ad is successfully created, a 201 Created HTTP status code and the getAd URI of the ad are returned in the location header.
use Rat\eBaySDK\API\MarketingAPI\Ad\CreateAdByListingId;
use Rat\eBaySDK\Client;
$client = app(Client::class);
$request = new CreateAdByListingId(
campaignId: (string) $campaignId,
payload: (array) $payload
);
$response = $client->execute($request);CreateAdsByInventoryReference eBay Docs
This method adds a listing that is managed with the Inventory API to an existing Promoted Listings campaign.
For general strategy campaigns using the Cost Per Sale (CPS) funding model, an ad may be directly created for the listing.
For each listing specified in the request, this method:
- Creates an ad for the listing.
- Sets the bid percentage (also known as the ad rate) for the ads created.
- Associates the created ad with the specified campaign.
To create an ad for a listing, specify its inventoryReferenceId and inventoryReferenceType, plus the bidPercentage for the ad in the payload of the request. Specify the campaign to associate the ad with using the campaign_id path parameter.
NOTE
This method only applies to the Cost Per Sale (CPS) funding model; it does not apply to the Cost Per Click (CPC) funding model.
use Rat\eBaySDK\API\MarketingAPI\Ad\CreateAdsByInventoryReference;
use Rat\eBaySDK\Client;
$client = app(Client::class);
$request = new CreateAdsByInventoryReference(
campaignId: (string) $campaignId,
payload: (array) $payload
);
$response = $client->execute($request);DeleteAd eBay Docs
This method removes the specified ad from the specified campaign.
Pass the ID of the ad to delete with the ID of the campaign associated with the ad as path parameters to the call.
Call getCampaigns to get the current list of the seller's campaign IDs.
NOTE
This method only applies to the Cost Per Sale (CPS) funding model; it does not apply to the Cost Per Click (CPC) funding model.
When using the CPC funding model, use the bulkUpdateAdsStatusByListingId method to change the status of ads to ARCHIVED.
use Rat\eBaySDK\API\MarketingAPI\Ad\DeleteAd;
use Rat\eBaySDK\Client;
$client = app(Client::class);
$request = new DeleteAd(
campaignId: (string) $campaignId,
adId: (string) $adId
);
$response = $client->execute($request);DeleteAdsByInventoryReference eBay Docs
This method works with listings that are managed with the Inventory API.
The method deletes ads using a list of seller-defined inventory reference IDs, used with the Inventory API, that are associated with the specified campaign ID.
Specify the campaign ID (as a path parameter) and a list of inventoryReferenceId and inventoryReferenceType pairs to be deleted.
Call getCampaigns to get a list of the seller's current campaign IDs.
NOTE
This method only applies to the Cost Per Sale (CPS) funding model; it does not apply to the Cost Per Click (CPC) funding model.
When using the CPC funding model, use the bulkUpdateAdsStatusByInventoryReference method to change the status of ads to ARCHIVED.
use Rat\eBaySDK\API\MarketingAPI\Ad\DeleteAdsByInventoryReference;
use Rat\eBaySDK\Client;
$client = app(Client::class);
$request = new DeleteAdsByInventoryReference(
campaignId: (string) $campaignId,
payload: (array) $payload
);
$response = $client->execute($request);GetAd eBay Docs
This method retrieves the specified ad from the specified campaign.
In the request, supply the campaign_id and ad_id as path parameters.
use Rat\eBaySDK\API\MarketingAPI\Ad\GetAd;
use Rat\eBaySDK\Client;
$client = app(Client::class);
$request = new GetAd(
campaignId: (string) $campaignId,
adId: (array) $adId
);
$response = $client->execute($request);GetAds eBay Docs
This method retrieves Promoted Listings ads that are associated with listings created with either the Trading API or the Inventory API.
The method retrieves ads related to the specified campaign. Specify the Promoted Listings campaign to target with the campaign_id path parameter.
Because of the large number of possible results, you can use query parameters to paginate the result set by specifying a limit, which dictates how many ads to return on each page of the response. You can also specify how many ads to skip in the result set before returning the first result using the offset path parameter.
use Rat\eBaySDK\API\MarketingAPI\Ad\GetAds;
use Rat\eBaySDK\Client;
$client = app(Client::class);
$request = new GetAds(
campaignId: (string) $campaignId,
listingIds: (string) $listingIds = null,
adGroupIds: (string) $adGroupIds = null,
adStatus: (string) $adStatus = null,
limit: (int) $limit = 10,
offset: (int) $offset = 0
);
$response = $client->execute($request);GetAdsByInventoryReference eBay Docs
This method retrieves Promoted Listings ads associated with listings that are managed with the Inventory API from the specified campaign.
Supply the campaign_id as a path parameter and use query parameters to specify the inventory_reference_id and inventory_reference_type pairs.
In the Inventory API, an inventory reference ID is either a seller-defined SKU value or an inventoryItemGroupKey (a seller-defined ID for an inventory item group, which is an entity that's used in the Inventory API to create a multiple-variation listing). To indicate a listing managed by the Inventory API, you must always specify both an inventory_reference_id and the associated inventory_reference_type.
NOTE
This method only applies to the Cost Per Sale (CPS) funding model; it does not apply to the Cost Per Click (CPC) funding model.
use Rat\eBaySDK\API\MarketingAPI\Ad\GetAdsByInventoryReference;
use Rat\eBaySDK\Client;
$client = app(Client::class);
$request = new GetAdsByInventoryReference(
campaignId: (string) $campaignId,
inventoryReferenceType: (string) $inventoryReferenceType,
inventoryReferenceId: (string) $inventoryReferenceId,
);
$response = $client->execute($request);UpdateBid eBay Docs
This method updates the bid percentage (also known as the "ad rate") for the specified ad in the specified campaign.
In the request, supply the campaign_id and ad_id as path parameters, and supply the new bidPercentage value in the payload of the call.
Call getCampaigns to retrieve a seller's current campaign IDs and call getAds to get their ad IDs.
NOTE
This method only applies to the Cost Per Sale (CPS) funding model; it does not apply to the Cost Per Click (CPC) funding model.
use Rat\eBaySDK\API\MarketingAPI\Ad\UpdateBid;
use Rat\eBaySDK\Client;
$client = app(Client::class);
$request = new UpdateBid(
campaignId: (string) $campaignId,
adId: (string) $adId,
payload: (array) $payload,
);
$response = $client->execute($request);AdGroup
CreateAdGroup eBay Docs
This method adds an ad group to an existing priority strategy campaign that uses manual targeting.
To create an ad group for a campaign, specify the defaultBid for the ad group in the payload of the request. Then specify the campaign to which the ad group should be associated using the campaign_id path parameter.
Each campaign can have one or more associated ad groups.
use Rat\eBaySDK\API\MarketingAPI\AdGroup\CreateAdGroup;
use Rat\eBaySDK\Client;
$client = app(Client::class);
$request = new CreateAdGroup(
campaignId: (string) $campaignId,
payload: (array) $payload,
);
$response = $client->execute($request);GetAdGroup eBay Docs
This method retrieves the details of a specified ad group, such as the ad group’s default bid and status.
In the request, specify the campaign_id and ad_group_id as path parameters.
use Rat\eBaySDK\API\MarketingAPI\AdGroup\GetAdGroup;
use Rat\eBaySDK\Client;
$client = app(Client::class);
$request = new GetAdGroup(
campaignId: (string) $campaignId,
adGroupId: (string) $adGroupId,
);
$response = $client->execute($request);GetAdGroups eBay Docs
This method retrieves ad groups for the specified campaigns.
Each campaign can only have one ad group.
In the request, supply the campaign_ids as path parameters.
use Rat\eBaySDK\API\MarketingAPI\AdGroup\GetAdGroups;
use Rat\eBaySDK\Client;
$client = app(Client::class);
$request = new GetAdGroups(
campaignId: (string) $campaignId,
adGroupStatus: (string) $adGroupStatus,
limit: (int) $limit = 10,
offset: (int) $offset = 0,
);
$response = $client->execute($request);SuggestBids eBay Docs
This method allows sellers to retrieve the suggested bids for input keywords and match type.
use Rat\eBaySDK\API\MarketingAPI\AdGroup\SuggestBids;
use Rat\eBaySDK\Client;
$client = app(Client::class);
$request = new SuggestBids(
campaignId: (string) $campaignId,
adGroupId: (string) $adGroupId,
payload: (array) $payload,
);
$response = $client->execute($request);SuggestKeywords eBay Docs
This method allows sellers to retrieve a list of keyword ideas to be targeted for Promoted Listings campaigns.
use Rat\eBaySDK\API\MarketingAPI\AdGroup\SuggestKeywords;
use Rat\eBaySDK\Client;
$client = app(Client::class);
$request = new SuggestKeywords(
campaignId: (string) $campaignId,
adGroupId: (string) $adGroupId,
payload: (array) $payload,
);
$response = $client->execute($request);UpdateAdGroup eBay Docs
This method updates the ad group associated with a campaign.
With this method, you can modify the default bid for the ad group, change the state of the ad group, or change the name of the ad group. Pass the ad_group_id you want to update as a URI parameter, and configure the adGroupStatus and defaultBid in the request payload.
use Rat\eBaySDK\API\MarketingAPI\AdGroup\UpdateAdGroup;
use Rat\eBaySDK\Client;
$client = app(Client::class);
$request = new UpdateAdGroup(
campaignId: (string) $campaignId,
adGroupId: (string) $adGroupId,
payload: (array) $payload,
);
$response = $client->execute($request);AdReport
GetReport eBay Docs
This call downloads the report as specified by the report_id path parameter.
Call createReportTask to schedule and generate a Promoted Listings report. All date values are returned in UTC format (yyyy-MM-ddThh:mm:ss.sssZ).
NOTE
The reporting of some data related to sales and ad-fees may require a 72-hour (maximum) adjustment period which is often referred to as the Reconciliation Period. Such adjustment periods should, on average, be minimal. However, at any given time, the payments tab may be used to view those amounts that have actually been charged.
CAUTION
For ad_report and ad_report_task methods, the API call limit is subject to a per user quota. These API calls can only be executed a maximum of 200 times per hour for each seller/user. If the number of calls per hour exceeds this limit, any new calls will be blocked for the next hour.
use Rat\eBaySDK\API\MarketingAPI\AdReport\GetReport;
use Rat\eBaySDK\Client;
$client = app(Client::class);
$request = new GetReport(
reportId: (string) $reportId,
);
$response = $client->execute($request);AdReportMetadata
GetReportMetadata eBay Docs
This call retrieves information that details the fields used in each of the Promoted Listings reports. Use the returned information to configure the different types of Promoted Listings reports. You can retrieve metadata for all report types,funding models and channels, or you can filter based on funding model and/or channel.
NOTE
The reporting of some data related to sales and ad-fees may require a 72-hour (maximum) adjustment period which is often referred to as the Reconciliation Period. Such adjustment periods should, on average, be minimal. However, at any given time, the payments tab may be used to view those amounts that have actually been charged.
use Rat\eBaySDK\API\MarketingAPI\AdReportMetadata\GetReportMetadata;
use Rat\eBaySDK\Client;
$client = app(Client::class);
$request = new GetReportMetadata(
fundingModel: (string) $fundingModel = null,
channel: (string) $channel = null,
);
$response = $client->execute($request);GetReportMetadataForReportType eBay Docs
This call retrieves metadata that details the fields used by a specific Promoted Listings report type. Use the report_type path parameter to indicate metadata to retrieve.
This method does not use a request payload.
NOTE
The reporting of some data related to sales and ad-fees may require a 72-hour (maximum) adjustment period which is often referred to as the Reconciliation Period. Such adjustment periods should, on average, be minimal. However, at any given time, the payments tab may be used to view those amounts that have actually been charged.
use Rat\eBaySDK\API\MarketingAPI\AdReportMetadata\GetReportMetadataForReportType;
use Rat\eBaySDK\Enums\ReportType;
use Rat\eBaySDK\Client;
$client = app(Client::class);
$request = new GetReportMetadataForReportType(
reportType: ReportType::ACCOUNT_PERFORMANCE_REPORT,
fundingModel: (string) $fundingModel = null,
channel: (string) $channel = null,
);
$response = $client->execute($request);AdReportTask
CreateReportTask eBay Docs
This method creates a report task, which generates a Promoted Listings report based on the values specified in the call.
The report is generated based on the criteria you specify, including the report type, the report's dimensions and metrics, the report's start and end dates, the listings to include in the report, and more. Metrics are the quantitative measurements in the report while dimensions specify the attributes of the data included in the reports.
When creating a report task, you can specify the items you want included in the report. The items you specify, using either listingId or inventoryReference values, must be in a Promoted Listings campaign for them to be included in the report.
For details on the required and optional fields for each report type, see Promoted Listings reporting.
This call returns the URL to the report task in the Location response header, and the URL includes the report-task ID.
Reports often take time to generate and it's common for this call to return an HTTP status of 202, which indicates the report is being generated. Call getReportTasks (or getReportTask with the report-task ID) to determine the status of a Promoted Listings report. When a report is complete, eBay sets its status to SUCCESS and you can download it using the URL returned in the reportHref field of the getReportTask call. Report files are tab-separated value gzip files with a file extension of .tsv.gz.
NOTE
The reporting of some data related to sales and ad-fees may require a 72-hour (maximum) adjustment period which is often referred to as the Reconciliation Period. Such adjustment periods should, on average, be minimal. However, at any given time, the payments tab may be used to view those amounts that have actually been charged.
NOTE
This call fails if you don't submit all the required fields for the specified report type. Fields not supported by the specified report type are ignored. Call getReportMetadata to retrieve a list of the fields you need to configure for each Promoted Listings report type.
CAUTION
For ad_report and ad_report_task methods, the API call limit is subject to a per user quota. These API calls can only be executed a maximum of 200 times per hour for each seller/user. If the number of calls per hour exceeds this limit, any new calls will be blocked for the next hour.
CAUTION
The data threshold for a single report is currently 1 million records; if this threshold is exceeded, the report will fail.
use Rat\eBaySDK\API\MarketingAPI\AdReportTask\CreateReportTask;
use Rat\eBaySDK\Client;
$client = app(Client::class);
$request = new CreateReportTask(
payload: (array) $payload,
);
$response = $client->execute($request);DeleteReportTask eBay Docs
This call deletes the report task specified by the report_task_id path parameter. This method also deletes any reports generated by the report task.
Report task IDs are generated by eBay when you call createReportTask. Get a complete list of a seller's report-task IDs by calling getReportTasks.
CAUTION
For ad_report and ad_report_task methods, the API call limit is subject to a per user quota. These API calls can only be executed a maximum of 200 times per hour for each seller/user. If the number of calls per hour exceeds this limit, any new calls will be blocked for the next hour.
use Rat\eBaySDK\API\MarketingAPI\AdReportTask\DeleteReportTask;
use Rat\eBaySDK\Client;
$client = app(Client::class);
$request = new DeleteReportTask(
reportTaskId: (string) $reportTaskId,
);
$response = $client->execute($request);GetReportTask eBay Docs
This call returns the details of a specific Promoted Listings report task, as specified by the report_task_id path parameter.
The report task includes the report criteria (such as the report dimensions, metrics, and included listing) and the report-generation rules (such as starting and ending dates for the specified report task).
Report-task IDs are generated by eBay when you call createReportTask. Get a complete list of a seller's report-task IDs by calling getReportTasks.
CAUTION
For ad_report and ad_report_task methods, the API call limit is subject to a per user quota. These API calls can only be executed a maximum of 200 times per hour for each seller/user. If the number of calls per hour exceeds this limit, any new calls will be blocked for the next hour.
use Rat\eBaySDK\API\MarketingAPI\AdReportTask\GetReportTask;
use Rat\eBaySDK\Client;
$client = app(Client::class);
$request = new GetReportTask(
reportTaskId: (string) $reportTaskId,
);
$response = $client->execute($request);GetReportTasks eBay Docs
This method returns information on all the existing report tasks related to a seller.
Use the report_task_statuses query parameter to control which reports to return. You can paginate the result set by specifying a limit, which dictates how many report tasks to return on each page of the response. Use the offset parameter to specify how many reports to skip in the result set before returning the first result.
CAUTION
For ad_report and ad_report_task methods, the API call limit is subject to a per user quota. These API calls can only be executed a maximum of 200 times per hour for each seller/user. If the number of calls per hour exceeds this limit, any new calls will be blocked for the next hour.
use Rat\eBaySDK\API\MarketingAPI\AdReportTask\GetReportTasks;
use Rat\eBaySDK\Client;
$client = app(Client::class);
$request = new GetReportTasks(
reportTaskStatuses: (string) $reportTaskStatuses = null,
limit: (int) $limit = 10,
offset: (int) $offset = 0,
);
$response = $client->execute($request);Campaign
CloneCampaign eBay Docs
This method clones (makes a copy of) the specified campaign's campaign criterion. The campaign criterion is a container for the fields that define the criteria for a rule-based campaign.
To clone a campaign, supply the campaign_id as a path parameter in your call. There is no request payload.
The ID of the newly-cloned campaign is returned in the Location response header.
Requirement: In order to clone a campaign, the campaignStatus must be ENDED and the campaign must define a set of selection rules (it must be a rules-based campaign).
NOTE
This method only applies to the Cost Per Sale (CPS) funding model; it does not apply to the Cost Per Click (CPC) funding model.
use Rat\eBaySDK\API\MarketingAPI\Campaign\CloneCampaign;
use Rat\eBaySDK\Client;
$client = app(Client::class);
$request = new CloneCampaign(
campaignId: (string) $campaignId,
payload: (array) $payload,
);
$response = $client->execute($request);CreateCampaign eBay Docs
This method can be used to create a Promoted Listings general, priority, or offsite campaign.
A Promoted Listings campaign is the structure in which you place the ads or ad group for the listings you wish to promote.
NOTE
Campaigns can only contain ads for a maximum of 50,000 items.
General strategy campaigns utilize a Cost Per Sale (CPS) funding model. Sellers can set the ad rate and bidding strategies that are right for their business through the adRateStrategy, biddingStrategy, bidPercentage fields. For more information on general strategy campaigns, see Promoted Listings general strategy campaign flow.
Priority strategy campaigns utilize a Cost per Click (CPC) funding model. Sellers can create a daily budget through the budget container and choose what channel that their ads appear on. In addition, priority strategy campaigns give sellers the ability to create ad groups and specify keywords to ensure their ads reach their intended audience. For more information on priority strategy campaigns, see Promoted listings priority strategy campaign flow.
Promoted Offsite campaigns give sellers the ability to create their own advertising campaign and promote their eBay listing in leading external search channels. For more information on Promoted Offsite campaigns, see Promoted Offsite.
NOTE
Sellers can use the getAdvertisingEligibility method of the Account API v1 to determine their eligibility status for eBay advertising programs.
To create a basic campaign, supply:
- The user-defined campaign name
- The start date (and optionally the end date) of the campaign
- The eBay marketplace on which the campaign is hosted
- Details on the campaign funding model
For details on creating Promoted Listings campaigns and how to select the items to be included in your campaigns, see Promoted Listings campaign creation.
use Rat\eBaySDK\API\MarketingAPI\Campaign\CreateCampaign;
use Rat\eBaySDK\Client;
$client = app(Client::class);
$request = new CreateCampaign(
payload: (array) $payload,
);
$response = $client->execute($request);DeleteCampaign eBay Docs
This method deletes the campaign specified by the campaign_id query parameter.
NOTE
You can only delete campaigns that have ended.
use Rat\eBaySDK\API\MarketingAPI\Campaign\DeleteCampaign;
use Rat\eBaySDK\Client;
$client = app(Client::class);
$request = new DeleteCampaign(
campaignId: (string) $campaignId,
);
$response = $client->execute($request);EndCampaign eBay Docs
This method ends an active (RUNNING) or paused campaign. Specify the campaign you want to end by supplying its campaign ID in a query parameter.
use Rat\eBaySDK\API\MarketingAPI\Campaign\EndCampaign;
use Rat\eBaySDK\Client;
$client = app(Client::class);
$request = new EndCampaign(
campaignId: (string) $campaignId,
);
$response = $client->execute($request);FindCampaignByAdReference eBay Docs
This method retrieves the campaigns containing the listing that is specified using either a listing ID, or an inventory reference ID and inventory reference type pair. The request accepts either a listing_id, or an inventory_reference_id and inventory_reference_type pair, as used in the Inventory API.
eBay listing IDs are generated by either the Trading API or the Inventory API when you create a listing.
An inventory reference ID can be either a seller-defined SKU or inventoryItemGroupKey, as specified in the Inventory API.
NOTE
This method only applies to the Cost Per Sale (CPS) funding model; it does not apply to the Cost Per Click (CPC) funding model.
use Rat\eBaySDK\API\MarketingAPI\Campaign\FindCampaignByAdReference;
use Rat\eBaySDK\Client;
$client = app(Client::class);
$request = new FindCampaignByAdReference(
listingId: (string) $listingId = null,
inventoryReferenceId: (string) $inventoryReferenceId = null,
inventoryReferenceType: (string) $inventoryReferenceType = null,
);
$response = $client->execute($request);GetCampaign eBay Docs
This method retrieves the details of a single campaign, as specified with the campaign_id query parameter.
This method returns all the details of a campaign (including the campaign's the selection rules), except the for the listing IDs or inventory reference IDs included in the campaign. These IDs are returned by getAds.
use Rat\eBaySDK\API\MarketingAPI\Campaign\GetCampaign;
use Rat\eBaySDK\Client;
$client = app(Client::class);
$request = new GetCampaign(
campaignId: (string) $campaignId,
);
$response = $client->execute($request);GetCampaignByName eBay Docs
This method retrieves the details of a single campaign, as specified with the campaign_name query parameter. Note that the campaign name you specify must be an exact, case-sensitive match of the name of the campaign you want to retrieve.
use Rat\eBaySDK\API\MarketingAPI\Campaign\GetCampaignByName;
use Rat\eBaySDK\Client;
$client = app(Client::class);
$request = new GetCampaignByName(
campaignName: (string) $campaignName,
);
$response = $client->execute($request);GetCampaigns eBay Docs
This method retrieves the details for all of the seller's defined campaigns. Request parameters can be used to retrieve a specific campaign, such as the campaign's name, the start and end date, the channel, the status, and the funding model (i.e., Cost Per Sale (CPS) or Cost Per Click (CPC)).
You can filter the result set by a campaign name, end date range, start date range, campaign channel, or campaign status. You can also paginate the records returned from the result set using the limit query parameter, and control which records to return using the offset parameter
use Rat\eBaySDK\API\MarketingAPI\Campaign\GetCampaigns;
use Rat\eBaySDK\Client;
$client = app(Client::class);
$request = new GetCampaigns(
campaignStatus: (string) $campaignStatus = null,
startDateRange: (string) $startDateRange = null,
endDateRange: (string) $endDateRange = null,
campaignName: (string) $campaignName = null,
fundingStrategy: (string) $fundingStrategy = null,
channels: (string) $channels = null,
campaignTargetingTypes: (string) $campaignTargetingTypes = null,
limit: (int) $limit = 10,
offset: (int) $offset = 0,
);
$response = $client->execute($request);LaunchCampaign eBay Docs
This method launches a priority strategy campaign created using the setupQuickCampaign method that is in DRAFT status. This changes the campaign status to RUNNING or SCHEDULED, based on its specified start date. Specify the campaign you wish to launch by supplying its campaign_id as a path parameter in the call URI.
use Rat\eBaySDK\API\MarketingAPI\Campaign\LaunchCampaign;
use Rat\eBaySDK\Client;
$client = app(Client::class);
$request = new LaunchCampaign(
campaignId: (string) $campaignId,
);
$response = $client->execute($request);PauseCampaign eBay Docs
This method pauses an active (RUNNING) campaign.
You can restart the campaign by calling resumeCampaign, as long as the campaign's end date is in the future.
NOTE
The listings associated with a paused campaign cannot be added into another campaign.
use Rat\eBaySDK\API\MarketingAPI\Campaign\PauseCampaign;
use Rat\eBaySDK\Client;
$client = app(Client::class);
$request = new PauseCampaign(
campaignId: (string) $campaignId,
);
$response = $client->execute($request);ResumeCampaign eBay Docs
This method resumes a paused campaign, as long as its end date is in the future. Supply the campaign_id for the campaign you want to restart as a query parameter in the request.
use Rat\eBaySDK\API\MarketingAPI\Campaign\ResumeCampaign;
use Rat\eBaySDK\Client;
$client = app(Client::class);
$request = new ResumeCampaign(
campaignId: (string) $campaignId,
);
$response = $client->execute($request);SetupQuickCampaign eBay Docs
This method allows the seller to expedite the creation of a priority strategy campaign.
Sellers only need to provide basic campaign information, such as the user-defined campaign name, the start date (and optionally the end date) of the campaign, the daily budget amount of the campaign, and the eBay marketplace where the campaign will be hosted. The seller must also identify the items they want to place in the campaign by adding the listing id of each item in the listingIds array of the request.
Using the provided listingIds, eBay creates ad groups for the campaign and organizes the listings into the appropriate ad group. eBay then adds keywords to each ad group and assigns each keyword a suggested bid.
By default, campaigns created using setupQuickCampaign utilize a FIXED keyword bidding strategy which means that a seller manually assigns and adjusts keyword bids for their CPC campaign.
Alternatively, once the campaign has been created, sellers may opt to utilize a DYNAMIC bidding strategy which means that eBay will manage a campaign's keyword bids and automatically update them daily to the suggested bid.
For additional information about FIXED and DYNAMIC bidding strategies, refer to updateBiddingStrategy.
Campaigns created using this method will be in DRAFT status upon creation.
The location response header returned contains the getCampaign URI to retrieve the newly created campaign that is in draft status. Sellers should make this call to review and approve the campaign before they use the launchCampaign method to start the campaign.
NOTE
General strategy ad campaigns are not supported.
use Rat\eBaySDK\API\MarketingAPI\Campaign\SetupQuickCampaign;
use Rat\eBaySDK\Client;
$client = app(Client::class);
$request = new SetupQuickCampaign(
payload: (array) $payload,
);
$response = $client->execute($request);SuggestBudget eBay Docs
NOTE
This method is only supported for Promoted Offsite campaigns. Sellers can use the getAdvertisingEligibility method of the Account API v1 to determine if they are eligible for offsite campaigns.
This method allows sellers to retrieve the suggested budget for an offsite campaign.
use Rat\eBaySDK\API\MarketingAPI\Campaign\SuggestBudget;
use Rat\eBaySDK\Client;
$client = app(Client::class);
$request = new SuggestBudget(
marketplaceId: (string) $marketplaceId,
);
$response = $client->execute($request);SuggestItems eBay Docs
NOTE
This method is only available for select partners who have been approved for the eBay priority strategy program. For information about how to request access to this program, refer to Priority Strategy Access Requests in the Promoted Listings Playbook. To determine if a seller qualifies for priority strategy, use the getAdvertisingEligibility method in Account API.
This method allows sellers to obtain ideas for listings, which can be targeted for Promoted Listings campaigns.
use Rat\eBaySDK\API\MarketingAPI\Campaign\SuggestItems;
use Rat\eBaySDK\Client;
$client = app(Client::class);
$request = new SuggestItems(
campaignId: (string) $campaignId,
categoryIds: (string) $categoryIds = null,
limit: (int) $limit = 10,
offset: (int) $offset = 0,
);
$response = $client->execute($request);SuggestMaxCpc eBay Docs
NOTE
This method is only supported for smart targeting priority strategy campaigns. Sellers can use the getAdvertisingEligibility method of the Account API v1 to determine if they are eligible for a priority strategy campaign.
This method allows sellers to retrieve the suggested maximum cost-per-click value for a smart targeting campaign. This value is required when creating a smart targeting campaign and indicates the maximum amount for which the eBay suggested bid can be adjusted.
use Rat\eBaySDK\API\MarketingAPI\Campaign\SuggestMaxCpc;
use Rat\eBaySDK\Client;
$client = app(Client::class);
$request = new SuggestMaxCpc(
payload: (array) $payload,
);
$response = $client->execute($request);UpdateAdRateStrategy eBay Docs
This method updates the ad rate strategy for an existing rules-based general strategy ad campaign that uses the Cost Per Sale (CPS) funding model.
Specify the campaign_id as a path parameter. You can retrieve the campaign IDs for a seller by calling the getCampaigns method.
NOTE
This method only applies to the CPS funding model; it does not apply to the Cost Per Click (CPC) funding model.
use Rat\eBaySDK\API\MarketingAPI\Campaign\UpdateAdRateStrategy;
use Rat\eBaySDK\Client;
$client = app(Client::class);
$request = new UpdateAdRateStrategy(
campaignId: (string) $campaignId,
payload: (array) $payload,
);
$response = $client->execute($request);UpdateBiddingStrategy eBay Docs
This method allows sellers to change the bidding strategy for a specified Cost Per Click (CPC) campaign that uses manual targeting. Available bidding strategies are:
FIXED
When using a fixed bidding strategy, sellers manually assign and adjust keyword bids for the CPC campaign.DYNAMIC
When using a dynamic bidding strategy, eBay will manage a campaign's keyword bids and automatically update them daily to the suggested bid.
NOTE
For a CPC campaign using dynamic bidding, sellers can continue to manually add keywords for the campaign, but they are no longer able to manually adjust their associated bid values. In order to manually adjust bid values, sellers must use the FIXED bidding strategy.
In addition, this method allows sellers to modify the maxCPC value of a smart targeting campaign.
NOTE
This method only applies to the Cost Per Click (CPC) funding model; it does not apply to the Cost Per Sale (CPS) funding model.
use Rat\eBaySDK\API\MarketingAPI\Campaign\UpdateBiddingStrategy;
use Rat\eBaySDK\Client;
$client = app(Client::class);
$request = new UpdateBiddingStrategy(
campaignId: (string) $campaignId,
payload: (array) $payload,
);
$response = $client->execute($request);UpdateCampaignBudget eBay Docs
NOTE
This method is only available for select partners who have been approved for the eBay priority < strategy program. For information about how to request access to this program, refer to Priority Strategy Access Requests in the Promoted Listings Playbook. To determine if a seller qualifies for priority strategy, use the getAdvertisingEligibility method in Account API.
This method updates the daily budget for a priority strategy campaign that uses the Cost Per Click (CPC) funding model.
A click occurs when an eBay user finds and clicks on the seller’s listing (within the search results) after using a keyword that the seller has created for the campaign. For each ad in an ad group in the campaign, each click triggers a cost, which gets subtracted from the campaign’s daily budget. If the cost of the clicks exceeds the daily budget, the Promoted Listings campaign will be paused until the next day.
Specify the campaign_id as a path parameter. You can retrieve the campaign IDs for a seller by calling the getCampaigns method.
NOTE
The daily budget for a campaign can only be updated 15 times per day. If this limit is exceeded, an error will occur and you will be blocked from updating the budget until the next day.
use Rat\eBaySDK\API\MarketingAPI\Campaign\UpdateCampaignStrategy;
use Rat\eBaySDK\Client;
$client = app(Client::class);
$request = new UpdateCampaignStrategy(
campaignId: (string) $campaignId,
payload: (array) $payload,
);
$response = $client->execute($request);UpdateCampaignIdentification eBay Docs
This method can be used to change the name of a campaign, as well as modify the start or end dates. Specify the campaign_id you want to update as a URI parameter, and configure the campaignName and startDate in the request payload.
If you want to change only the end date of the campaign, specify the current campaign name, set endDate as desired, and set startDate to the actual start date of the campaign. This applies if the campaign status is RUNNING or PAUSED. You can retrieve the startDate using the getCampaign method.
Note that if you do not set a new end date in this call, any current endDate value will be set to null. To preserve the currently-set end date, you must specify the value again in your request.
use Rat\eBaySDK\API\MarketingAPI\Campaign\UpdateCampaignIdentification;
use Rat\eBaySDK\Client;
$client = app(Client::class);
$request = new UpdateCampaignIdentification(
campaignId: (string) $campaignId,
payload: (array) $payload,
);
$response = $client->execute($request);EmailCampaign
CreateEmailCampaign eBay Docs
This method creates a new email campaign. An eBay store owner can create six different types of email campaigns: Welcome, New products & collections, Coupon, Sale event + markdown, Order discount, and Volume pricing.
A successful createEmailCampaign request returns the emailCampaignId assigned to the new email campaign.
The fields emailCampaignType, audienceCodes, itemSelectMode, subject, and personalizedMessage are required for all email campaign types.
Specific email campaign types have required values for additional fields. For more information on the email campaign types, see the Store Email Campaigns section of the Selling Integration Guide.
use Rat\eBaySDK\API\MarketingAPI\EmailCampaign\CreateEmailCampaign;
use Rat\eBaySDK\Client;
$client = app(Client::class);
$request = new CreateEmailCampaign(
marketplaceId: (string) $marketplaceId,
payload: (array) $payload,
);
$response = $client->execute($request);DeleteEmailCampaign eBay Docs
This method deletes the email campaign specified by the email_campaign_id path parameter.
use Rat\eBaySDK\API\MarketingAPI\EmailCampaign\DeleteEmailCampaign;
use Rat\eBaySDK\Client;
$client = app(Client::class);
$request = new DeleteEmailCampaign(
emailCampaignId: (string) $emailCampaignId,
);
$response = $client->execute($request);GetAudiences eBay Docs
This method retrieves all available email newsletter audiences for the email campaign type specified by the emailCampaignType path parameter.
Use the optional limit and offset path parameters to paginate the results and to control which records are returned, respectively.
use Rat\eBaySDK\API\MarketingAPI\EmailCampaign\GetAudiences;
use Rat\eBaySDK\Client;
$client = app(Client::class);
$request = new GetAudiences(
emailCampaignType: (string) $emailCampaignType,
limit: (int) $limit = 100,
offset: (int) $offset = 0,
);
$response = $client->execute($request);GetEmailCampaign eBay Docs
This method returns the details of a single email campaign specified by the email_campaign_id path parameter.
use Rat\eBaySDK\API\MarketingAPI\EmailCampaign\GetEmailCampaign;
use Rat\eBaySDK\Client;
$client = app(Client::class);
$request = new GetEmailCampaign(
emailCampaignId: (string) $emailCampaignId,
);
$response = $client->execute($request);GetEmailCampaigns eBay Docs
This method retrieves a list of email campaigns from a seller's eBay store.
use Rat\eBaySDK\API\MarketingAPI\EmailCampaign\GetEmailCampaigns;
use Rat\eBaySDK\Client;
$client = app(Client::class);
$request = new GetEmailCampaigns(
q: (string) $q,
sort: (string) $sort,
limit: (int) $limit = 10,
offset: (int) $offset = 0,
);
$response = $client->execute($request);GetEmailPreview eBay Docs
This method returns a preview of the email sent by the email campaign indicated by the email_campaign_id path parameter.
If this call is executed successfully, the response returns a content field that contains the raw HTML code of the email campaign that can then be rendered anywhere.
NOTE
The eBay listings in the email are sorted according to the email campaign sort criteria. The individual listings can change over time, as well.
The result of the email preview call can be treated as a snapshot of the email campaign taken at the date and time of the renderDate value found in the results of the call.
use Rat\eBaySDK\API\MarketingAPI\EmailCampaign\GetEmailPreview;
use Rat\eBaySDK\Client;
$client = app(Client::class);
$request = new GetEmailPreview(
emailCampaignId: (string) $emailCampaignId,
);
$response = $client->execute($request);GetEmailReport eBay Docs
This method returns the seller's email campaign performance report for a time period specified by the startDate and endDate path parameters. The maximum date range for a report retrieved by this method is one year.
The email report returns a list of metrics, such as the number of times an email report has been opened and resulted in clicks.
use Rat\eBaySDK\API\MarketingAPI\EmailCampaign\GetEmailReport;
use Rat\eBaySDK\Client;
$client = app(Client::class);
$request = new GetEmailReport(
startDate: (string) $startDate,
endDate: (string) $endDate,
);
$response = $client->execute($request);UpdateEmailCampaign eBay Docs
This method lets users update an existing email campaign. Pass the emailCampaignId in the request URL and specify the changes to field values in the request payload.
use Rat\eBaySDK\API\MarketingAPI\EmailCampaign\UpdateEmailCampaign;
use Rat\eBaySDK\Client;
$client = app(Client::class);
$request = new UpdateEmailCampaign(
emailCampaignId: (string) $emailCampaignId,
payload: (array) $payload,
);
$response = $client->execute($request);ItemPriceMarkdown
NOTE
As of July 8th 2024, promotions are now being referred to as discounts on Seller Hub and eBay help ages. Sell Marketing API documentation has been updated to reflect this product name change, but note that no API interface changes have been made.
CreateItemPriceMarkdownPromotion eBay Docs
This method creates an item price markdown discount (know simply as a "markdown discount") where a discount amount is applied directly to the items included in the discount. Discounts can be specified as either a monetary amount or a percentage off the standard sales price. eBay highlights discounted items by placing teasers for the items throughout the online sales flows.
Unlike an item discount, a markdown discount does not require the buyer meet a "threshold" before the offer takes effect. With markdown discounts, all the buyer needs to do is purchase the item to receive the discount benefit.
CAUTION
There are some restrictions for which listings are available for price markdown discounts. For details, see Discounts Manager requirements and restrictions.
In addition, we recommend you list items at competitive prices before including them in your markdown discounts. For an extensive list of pricing recommendations, see the Growth tab in Seller Hub.
There are two ways to enable items for markdown discounts:
- Key-based discounts select items using either the listing IDs or inventory reference IDs of the items you want to discount. 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.
- Rule-based discounts select items using a list of eBay category IDs or seller Store category IDs. Rules can further constrain items being discounted by minimum and maximum prices, brands, and item conditions.
New discounts must be created in either a DRAFT or a SCHEDULED state. Use the DRAFT state when you are initially creating a discount and you want to be sure it's correctly configured before scheduling it to run. When you create a discount, the promotionId is returned in the Location response header. Use this ID to reference the discount in subsequent requests (such as to schedule a discount that's in a DRAFT state).
TIP
Refer to Discounts Manager in the Selling Integration Guide for details and examples showing how to create and manage seller discounts.
Markdown discounts are available on all eBay marketplaces. For more information, see Discounts Manager requirements and restrictions.
use Rat\eBaySDK\API\MarketingAPI\ItemPriceMarkdown\CreateItemPriceMarkdownPromotion;
use Rat\eBaySDK\Client;
$client = app(Client::class);
$request = new CreateItemPriceMarkdownPromotion(
payload: (array) $payload,
);
$response = $client->execute($request);DeleteItemPriceMarkdownPromotion eBay Docs
This method deletes the item price markdown discount specified by the promotion_id path parameter. Call getPromotions to retrieve the IDs of a seller's discounts.
You can delete any discount with the exception of those that are currently active (RUNNING). To end a running discount, call updateItemPriceMarkdownPromotion and adjust the endDate field as appropriate.
use Rat\eBaySDK\API\MarketingAPI\ItemPriceMarkdown\DeleteItemPriceMarkdownPromotion;
use Rat\eBaySDK\Client;
$client = app(Client::class);
$request = new DeleteItemPriceMarkdownPromotion(
promotionId: (string) $promotionId,
);
$response = $client->execute($request);GetItemPriceMarkdownPromotion eBay Docs
This method returns the complete details of the item price markdown discounnt that's indicated by the promotion_id path parameter.
use Rat\eBaySDK\API\MarketingAPI\ItemPriceMarkdown\GetItemPriceMarkdownPromotion;
use Rat\eBaySDK\Client;
$client = app(Client::class);
$request = new GetItemPriceMarkdownPromotion(
promotionId: (string) $promotionId,
);
$response = $client->execute($request);UpdateItemPriceMarkdownPromotion eBay Docs
This method updates the specified item price markdown discount with the new configuration that you supply in the payload of the request. Specify the discount you want to update using the promotion_id path parameter. Call getPromotions to retrieve the IDs of a seller's discounts.
When updating a discount, supply all the fields that you used to configure the original discount (and not just the fields you are updating). eBay replaces the specified discount 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 discount you're updating:
DRAFTorSCHEDULEDdiscounts: You can update any of the parameters in these discounts that have not yet started to run, including the discountRules.RUNNINGdiscounts: You can change the endDate and the item's inventory but you cannot change the discount or the start date.ENDEDdiscounts: Nothing can be changed.
use Rat\eBaySDK\API\MarketingAPI\ItemPriceMarkdown\UpdateItemPriceMarkdownPromotion;
use Rat\eBaySDK\Client;
$client = app(Client::class);
$request = new UpdateItemPriceMarkdownPromotion(
promotionId: (string) $promotionId,
payload: (array) $payload
);
$response = $client->execute($request);ItemPromotion
NOTE
As of July 8th 2024, promotions are now being referred to as discounts on Seller Hub and eBay help ages. Sell Marketing API documentation has been updated to reflect this product name change, but note that no API interface changes have been made.
CreateItemPromotion eBay Docs
This method creates an item discount, where the buyer receives a discount when they meet the specific buying criteria. Known here as "threshold discounts", these discounts trigger when a threshold is met.
eBay highlights discounted items by placing teasers for the discounted items throughout the online buyer flows.
Discounts are specified as either a monetary amount or a percentage off the standard sales price of a listing, letting you offer deals such as "Buy 1 Get 1" and "Buy $50, get 20% off".
Volume pricing discounts increase the value of the discount as the buyer increases the quantity ´ they purchase.
Coded Coupons provide unique codes that a buyer can use during checkout to receive a discount. The seller can specify the number of times a buyer can use the coupon and the maximum amount across all purchases that can be discounted using the coupon. The coupon code can also be made public (appearing on the seller's Offer page, search pages, the item listing, and the checkout page) or private (only on the seller's Offer page, but the seller can include the code in email and social media).
NOTE
Coded Coupons are currently available in the US, UK, DE, FR, IT, ES, and AU marketplaces.
There are two ways to add items to a threshold discount:
- Key-based discounts select items using either the listing IDs or inventory reference IDs of the items you want to discount. 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 be discounted.
- Rule-based discounts select items using a list of eBay category IDs or seller Store category IDs. Rules can further constrain the items being discounted by minimum and maximum prices, brands, and item conditions.
You must create a new discount in either a DRAFT or SCHEDULED state. Use the DRAFT state when you are initially creating a discount and you want to be sure it's correctly configured before scheduling it to run. When you create a discount, the promotion ID is returned in the Location response header. Use this ID to reference the discount in subsequent requests.
TIP
Refer to the Selling Integration Guide for details and examples showing how to create and manage threshold discounts using the Discounts Manager.
use Rat\eBaySDK\API\MarketingAPI\ItemPromotion\CreateItemPromotion;
use Rat\eBaySDK\Client;
$client = app(Client::class);
$request = new CreateItemPromotion(
payload: (array) $payload,
);
$response = $client->execute($request);DeleteItemPromotion eBay Docs
This method deletes the threshold discount specified by the promotion_id path parameter. Call getPromotions to retrieve the IDs of a seller's discounts.
You can delete any discount with the exception of those that are currently active (RUNNING). To end a running threshold discount, call updateItemPromotion and adjust the endDate field as appropriate.
use Rat\eBaySDK\API\MarketingAPI\ItemPromotion\DeleteItemPromotion;
use Rat\eBaySDK\Client;
$client = app(Client::class);
$request = new DeleteItemPromotion(
promotionId: (string) $promotionId,
);
$response = $client->execute($request);GetItemPromotion eBay Docs
This method returns the complete details of the threshold discount specified by the promotion_id path parameter. Call getPromotions to retrieve the IDs of a seller's discounts.
use Rat\eBaySDK\API\MarketingAPI\ItemPromotion\GetItemPromotion;
use Rat\eBaySDK\Client;
$client = app(Client::class);
$request = new GetItemPromotion(
promotionId: (string) $promotionId,
);
$response = $client->execute($request);UpdateItemPromotion eBay Docs
This method updates the specified threshold discount with the new configuration that you supply in the request. Indicate the discount you want to update using the promotion_id path parameter.
Call getPromotions to retrieve the IDs of a seller's discounts.
When updating a discount, supply all the fields that you used to configure the original discount (and not just the fields you are updating). eBay replaces the specified discount 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 will fail.
The parameters you are allowed to update with this request depend on the status of the discount you're updating:
DRAFTorSCHEDULEDdiscounts: You can update any of the parameters in these discounts that have not yet started to run, including the discountRules.RUNNINGorPAUSEDdiscounts: You can change the endDate and the item's inventory but you cannot change the discount or the start date.ENDEDdiscounts: Nothing can be changed.
TIP
When updating a RUNNING or PAUSED discount, set the status field to SCHEDULED for the update request. When the discount is updated, the previous status (either RUNNING or PAUSED) is retained.
use Rat\eBaySDK\API\MarketingAPI\ItemPromotion\UpdateItemPromotion;
use Rat\eBaySDK\Client;
$client = app(Client::class);
$request = new UpdateItemPromotion(
promotionId: (string) $promotionId,
payload: (array) $payload
);
$response = $client->execute($request);Keyword
NOTE
These methods are only available for select partners who have been approved for the eBay priority strategy program. For information about how to request access to this program, refer to Priority Strategy Access Requests in the Promoted Listings Playbook. To determine if a seller qualifies for priority strategy, use the getAdvertisingEligibility method in Account API.
BulkCreateKeyword eBay Docs
This method adds keywords, in bulk, to an existing priority strategy ad group in a campaign that uses manual targeting.
This method also sets the CPC rate for each keyword, depending on the selected bidding strategy, as follows:
FIXED: If the seller provides a keyword bid, that bid value will be used.
If no bid is provided, the adgroup's default bid value will be used.DYNAMIC: The eBay suggested bid will be used.
If the seller passes in a value, a warning will be returned.
In the request, supply the campaign_id as a path parameter.
use Rat\eBaySDK\API\MarketingAPI\Keyword\BulkCreateKeyword;
use Rat\eBaySDK\Client;
$client = app(Client::class);
$request = new BulkCreateKeyword(
campaignId: (string) $campaignId,
payload: (array) $payload
);
$response = $client->execute($request);BulkUpdateKeyword eBay Docs
This method updates the bids and statuses of keywords, in bulk, for an existing priority strategy campaign.
In the request, supply the campaign_id as a path parameter.
use Rat\eBaySDK\API\MarketingAPI\Keyword\BulkUpdateKeyword;
use Rat\eBaySDK\Client;
$client = app(Client::class);
$request = new BulkUpdateKeyword(
campaignId: (string) $campaignId,
payload: (array) $payload
);
$response = $client->execute($request);CreateKeyword eBay Docs
This method creates keywords using a specified campaign ID for an existing priority strategy campaign that uses manual targeting.
In the request, supply the campaign_id as a path parameter.
Call the suggestKeywords method to retrieve a list of keyword ideas to be targeted for priority strategy campaigns, and call the getCampaigns method to retrieve a list of current campaign IDs for a seller.
use Rat\eBaySDK\API\MarketingAPI\Keyword\CreateKeyword;
use Rat\eBaySDK\Client;
$client = app(Client::class);
$request = new CreateKeyword(
campaignId: (string) $campaignId,
payload: (array) $payload
);
$response = $client->execute($request);GetKeyword eBay Docs
This method retrieves details on a specific keyword from an ad group within a priority strategy campaign that uses the Cost Per Click (CPC) funding model.
In the request, specify the campaign_id and keyword_id as path parameters.
use Rat\eBaySDK\API\MarketingAPI\Keyword\GetKeyword;
use Rat\eBaySDK\Client;
$client = app(Client::class);
$request = new GetKeyword(
campaignId: (string) $campaignId,
keywordId: (string) $keywordId,
);
$response = $client->execute($request);GetKeywords eBay Docs
This method can be used to retrieve all of the keywords for ad groups in priority strategy campaigns that use the Cost Per Click (CPC) funding model.
In the request, specify the campaign_id as a path parameter. If one or more ad_group_ids are passed in the request body, the keywords for those ad groups will be returned. If ad_group_ids are not passed in the response body, the call will return all the keywords in the campaign.
use Rat\eBaySDK\API\MarketingAPI\Keyword\GetKeywords;
use Rat\eBaySDK\Client;
$client = app(Client::class);
$request = new GetKeywords(
campaignId: (string) $campaignId,
adGroupId: (string) $adGroupId = null,
keywordStatus: (string) $keywordStatus = null,
limit: (int) $limit = 10,
offset: (int) $offset = 0,
);
$response = $client->execute($request);UpdateKeyword eBay Docs
This method updates keywords using a campaign ID and keyword ID for an existing priority strategy campaign.
In the request, specify the campaign_id and keyword_id as path parameters.
use Rat\eBaySDK\API\MarketingAPI\Keyword\UpdateKeyword;
use Rat\eBaySDK\Client;
$client = app(Client::class);
$request = new UpdateKeyword(
campaignId: (string) $campaignId,
keywordId: (string) $keywordId,
payload: (array) $payload
)
$response = $client->execute($request);NegativeKeyword
NOTE
These methods are only available for select partners who have been approved for the eBay priority strategy program. For information about how to request access to this program, refer to Priority Strategy Access Requests in the Promoted Listings Playbook. To determine if a seller qualifies for priority strategy, use the getAdvertisingEligibility method in Account API.
BulkCreateNegativeKeyword eBay Docs
This method adds negative keywords, in bulk, to an existing ad group in a priority strategy campaign that uses manual targeting.
Specify the campaignId and adGroupId in the request body, along with the negativeKeywordText and negativeKeywordMatchType.
use Rat\eBaySDK\API\MarketingAPI\NegativeKeyword\BulkCreateNegativeKeyword;
use Rat\eBaySDK\Client;
$client = app(Client::class);
$request = new BulkCreateNegativeKeyword(
payload: (array) $payload
);
$response = $client->execute($request);BulkUpdateNegativeKeyword eBay Docs
This method updates the statuses of existing negative keywords, in bulk.
Specify the negativeKeywordId and negativeKeywordStatus in the request body.
use Rat\eBaySDK\API\MarketingAPI\NegativeKeyword\BulkUpdateNegativeKeyword;
use Rat\eBaySDK\Client;
$client = app(Client::class);
$request = new BulkUpdateNegativeKeyword(
payload: (array) $payload
);
$response = $client->execute($request);CreateNegativeKeyword eBay Docs
This method adds a negative keyword to an existing ad group in a priority strategy campaign that uses manual targeting.
Specify the campaignId and adGroupId in the request body, along with the negativeKeywordText and negativeKeywordMatchType.
use Rat\eBaySDK\API\MarketingAPI\NegativeKeyword\CreateNegativeKeyword;
use Rat\eBaySDK\Client;
$client = app(Client::class);
$request = new CreateNegativeKeyword(
payload: (array) $payload
);
$response = $client->execute($request);GetNegativeKeyword eBay Docs
This method retrieves details on a specific negative keyword.
In the request, specify the negative_keyword_id as a path parameter.
use Rat\eBaySDK\API\MarketingAPI\NegativeKeyword\GetNegativeKeyword;
use Rat\eBaySDK\Client;
$client = app(Client::class);
$request = new GetNegativeKeyword(
negativeKeywordId: (string) $negativeKeywordId,
);
$response = $client->execute($request);GetNegativeKeywords eBay Docs
This method can be used to retrieve all of the negative keywords for ad groups in priority strategy campaigns that use the Cost Per Click (CPC) funding model.
The results can be filtered using the campaign_ids, ad_group_ids, and negative_keyword_status query parameters.
use Rat\eBaySDK\API\MarketingAPI\NegativeKeyword\GetNegativeKeywords;
use Rat\eBaySDK\Client;
$client = app(Client::class);
$request = new GetNegativeKeywords(
adGroupIds: (string) $adGroupIds = null,
campaignIds: (string) $campaignIds = null,
negativeKeywordStatus: (string) $negativeKeywordStatus = null,
limit: (int) $limit = 10,
offset: (int) $offset = 0,
);
$response = $client->execute($request);UpdateNegativeKeyword eBay Docs
This method updates the status of an existing negative keyword.
Specify the negative_keyword_id as a path parameter, and specify the negativeKeywordStatus in the request body.
use Rat\eBaySDK\API\MarketingAPI\NegativeKeyword\UpdateNegativeKeyword;
use Rat\eBaySDK\Client;
$client = app(Client::class);
$request = new UpdateNegativeKeyword(
negativeKeywordId: (string) $negativeKeywordId,
payload: (array) $payload
)
$response = $client->execute($request);Promotion
NOTE
As of July 8th 2024, promotions are now being referred to as discounts on Seller Hub and eBay help pages. Sell Marketing API documentation has been updated to reflect this product name change, but note that no API interface changes have been made.
GetListingSet eBay Docs
This method returns the set of listings associated with the promotion_id specified in the path parameter. Call getPromotions to retrieve the IDs of a seller's discounts.
The listing details are returned in a paginated set and you can control and results returned using the following query parameters: limit, offset, q, sort, and status.
- Maximum associated listings returned: 200
- Default number of listings returned: 200
use Rat\eBaySDK\API\MarketingAPI\Promotion\GetListingSet;
use Rat\eBaySDK\Client;
$client = app(Client::class);
$request = new GetListingSet(
promotionId: (string) $promotionId,
q: (string) $q = null,
status: (string) $status = null,
sort: (string) $sort = null,
limit: (int) $limit = 200,
offset: (int) $offset = 0
)
$response = $client->execute($request);GetPromotions eBay Docs
This method returns a list of a seller's undeleted discounts.
The call returns up to 200 currently-available discounts on the specified marketplace. While the response body does not include the discount's discountRules or inventoryCriterion containers, it does include the promotionHref (which you can use to retrieve the complete details of the discount).
Use query parameters to sort and filter the results by the number of discounts to return, the discount state or type, and the eBay marketplace. You can also supply keywords to limit the response to the discounts that contain that keywords in the title of the discount.
Maximum returned: 200
use Rat\eBaySDK\API\MarketingAPI\Promotion\GetPromotions;
use Rat\eBaySDK\Client;
$client = app(Client::class);
$request = new GetPromotions(
marketplaceId: (string) $marketplaceId,
q: (string) $q = null,
promotionStatus: (string) $promotionStatus = null,
promotionType: (string) $promotionType = null,
sort: (string) $sort = null,
limit: (int) $limit = 200,
offset: (int) $offset = 0
)
$response = $client->execute($request);PausePromotion eBay Docs
This method pauses a currently-active (RUNNING) threshold discount and changes the state of the discount from RUNNING to PAUSED. Pausing a discount makes the discount temporarily unavailable to buyers and any currently-incomplete transactions will not receive the offer until the discount is resumed. Also, discount teasers are not displayed when a discount is paused.
Pass the ID of the discount you want to pause using the promotion_id path parameter. Call getPromotions to retrieve the IDs of the seller's discounts.
NOTE
You can only pause threshold discounts (you cannot pause markdown discounts).
use Rat\eBaySDK\API\MarketingAPI\Promotion\PausePromotion;
use Rat\eBaySDK\Client;
$client = app(Client::class);
$request = new PausePromotion(
promotionId: (string) $promotionId,
)
$response = $client->execute($request);ResumePromotion eBay Docs
This method restarts a threshold discount that was previously paused and changes the state of the discount from PAUSED to RUNNING. Only discounts that have been previously paused can be resumed. Resuming a discount reinstates the teasers and any transactions that were in motion before the discount was paused will again be eligible for the discount.
Pass the ID of the discount you want to resume using the promotion_id path parameter. Call getPromotions to retrieve the IDs of the seller's discounts.
use Rat\eBaySDK\API\MarketingAPI\Promotion\ResumePromotion;
use Rat\eBaySDK\Client;
$client = app(Client::class);
$request = new ResumePromotion(
promotionId: (string) $promotionId,
)
$response = $client->execute($request);PromotionReport
NOTE
As of July 8th 2024, promotions are now being referred to as discounts on Seller Hub and eBay help pages. Sell Marketing API documentation has been updated to reflect this product name change, but note that no API interface changes have been made.
GetPromotionReports eBay Docs
This method generates a report that lists the seller's running, paused, and ended discounts for the specified eBay marketplace. The result set can be filtered by the discount status and the number of results to return. You can also supply keywords to limit the report to discounts that contain the specified keywords.
Specify the eBay marketplace for which you want the report run using the marketplace_id query parameter. Supply additional query parameters to control the report as needed.
use Rat\eBaySDK\API\MarketingAPI\PromotionReport\GetPromotionReports;
use Rat\eBaySDK\Client;
$client = app(Client::class);
$request = new GetPromotionReports(
marketplaceId: (string) $marketplaceId,
q: (string) $q = null,
promotionStatus: (string) $promotionStatus = null,
promotionType: (string) $promotionType = null,
limit: (int) $limit = 200,
offset: (int) $offset = 0
)
$response = $client->execute($request);PromotionReport
NOTE
As of July 8th 2024, promotions are now being referred to as discounts on Seller Hub and eBay help pages. Sell Marketing API documentation has been updated to reflect this product name change, but note that no API interface changes have been made.
GetPromotionSummaryReport eBay Docs
This method generates a report that summarizes the seller's discounts for the specified eBay marketplace. The report returns information on RUNNING, PAUSED, and ENDED discounts (deleted reports are not returned) and summarizes the seller's campaign performance for all discounts on a given site.
For information about summary reports, see Reading the item discount Summary report.
use Rat\eBaySDK\API\MarketingAPI\PromotionReport\GetPromotionSummaryReport;
use Rat\eBaySDK\Client;
$client = app(Client::class);
$request = new GetPromotionSummaryReport(
marketplaceId: (string) $marketplaceId,
)
$response = $client->execute($request);