@datafire/ebay_sell_listing
Client library for Listing API
Installation and Usage
npm install --save @datafire/ebay_sell_listing
let ebay_sell_listing = require('@datafire/ebay_sell_listing').create({
access_token: "",
refresh_token: "",
client_id: "",
client_secret: "",
redirect_uri: ""
});
.then(data => {
console.log(data);
});
Description
Enables a seller adding an ad or item on a Partner's site to automatically create an eBay listing draft using the item details from the Partner's site.
Actions
oauthCallback
Exchange the code passed to your redirect URI for an access_token
ebay_sell_listing.oauthCallback({
"code": ""
}, context)
Input
Output
- output
object
- access_token
string
- refresh_token
string
- token_type
string
- scope
string
- expiration
string
oauthRefresh
Exchange a refresh_token for an access_token
ebay_sell_listing.oauthRefresh(null, context)
Input
This action has no parameters
Output
- output
object
- access_token
string
- refresh_token
string
- token_type
string
- scope
string
- expiration
string
createItemDraft
This call gives Partners the ability to create an eBay draft of a item for their seller using information from their site. This lets the Partner increase the exposure of items on their site and leverage the eBay user listing experience seamlessly. This experience provides guidance on pricing, aspects, etc. and recommendations that help create a listing that is complete and improves the exposure of the listing in search results. After the listing draft is created, the seller logs into their eBay account and uses the listing experience to finish the listing and publish the item on eBay.
ebay_sell_listing.createItemDraft({
"X-EBAY-C-MARKETPLACE-ID": ""
}, context)
Input
- input
object
- Content-Language
string
: Use this header to specify the natural language of the seller. For details, see Content-Language in HTTP request headers. Required: For EBAY_CA in French. (Content-Language = fr-CA) - X-EBAY-C-MARKETPLACE-ID required
string
: Use this header to specify an eBay marketplace ID. For a list of supported sites, see API Restrictions in the Listing API overview. - body ItemDraft
Output
Definitions
Amount
- Amount
object
: The type that defines the fields for the currency and a monetary amount.
- currency
string
: The three-letter ISO 4217 code representing the currency of the amount in the value field. Restriction: Only the currency of the marketplace is supported. For example, on the US marketplace the only currency supported is USD. For implementation help, refer to eBay API documentation - value
string
: The monetary amount, in the currency specified by the currency field.
Aspect
- Aspect
object
: The type that defines the fields for the item aspects.
- name
string
: The name of an aspect, such and Brand. - values
array
: A list of potential values for this aspect.
Charity
- Charity
object
: This type is used to identify the charitable organization that will receive a percentage of sale proceeds for each sale generated by the listing. This container also includes the donation percentage, which is the percentage of the sale proceeds that the charitable organization will get. In order to receive a percentage of the sales proceeds, the non-profit organization must be registered with the PayPal Giving Fund, which is a partner of eBay for Charity.
- charityId
string
: The eBay-assigned unique identifier of the charitable organization that will receive a percentage of the sales proceeds. The charitable organization must be reqistered with the PayPal Giving Fund in order to receive sales proceeds through eBay listings. This field is conditionally required if a seller is planning on donating a percentage of the sale proceeds to a charitable organization. The eBay-assigned unique identifier of a charitable organization can be found using the GetCharities call of the Trading API. In the GetCharities call response, this unique identifier is shown in the id attribute of the Charity container. - donationPercentage
string
: This field sets the percentage of the purchase price that the charitable organization (identified in the charityId field) will receive for each sale that the listing generates. This field is conditionally required if a seller is planning on donating a percentage of the sale proceeds to a charitable organization. This numeric value can range from 10 to 100, and in any 5 (percent) increments in between this range (e.g. 10, 15, 20...95,... 100). The seller would pass in 10 for 10 percent, 15 for 15 percent, 20 for 20 percent, and so on, all the way to 100 for 100 percent. Note: For this field, createItemDraft will only validate that a positive integer value is supplied, so the listing draft will still be successfully created (with no error or warning message) if a non-supported value is specified. However, if the seller attempted to publish this listing draft with an unsupported value, the charity information would just be dropped from the listing.
Error
- Error
object
: This type defines the fields that can be returned in an error.
- parameters
array
: An array of name/value pairs that describe details the error condition. These are useful when multiple errors are returned.
- category
string
: Identifies the type of erro. - domain
string
: Name for the primary system where the error occurred. This is relevant for application errors. - errorId
integer
: A unique number to identify the error. - inputRefIds
array
: An array of request elements most closely associated to the error.
- longMessage
string
: A more detailed explanation of the error. - message
string
: Information on how to correct the problem, in the end user's terms and language where applicable. - outputRefIds
array
: An array of request elements most closely associated to the error.
- subdomain
string
: Further helps indicate which subsystem the error is coming from. System subcategories include: Initialization, Serialization, Security, Monitoring, Rate Limiting, etc.
ErrorParameter
- ErrorParameter
object
- name
string
: The object of the error. - value
string
: The value of the object.
ItemDraft
- ItemDraft
object
: The type that defines the fields for the listing details.
- categoryId
string
: The ID of the leaf category associated with this item. A leaf category is the lowest level in that category and has no children. Note: If you submit both a category ID and an EPID, eBay determines the best category based on the EPID and uses that. The category ID will be ignored. - charity Charity
- condition
string
: An enumeration value representing the condition of the item, such as NEW. Note: In the US and Australian marketplaces, Condition ID 2000 now maps to an item condition of 'Certified Refurbished', but this item condition is only available for use for a select number of US and Australian sellers. Other sellers on these two marketplaces will get an error when attempting to create an item draft with the Listing API using the 'Manufacturer Refurbished' item condition. For all other marketplaces besides the US and Australia, Condition ID 2000 still maps to 'Manufacturer Refurbished'. Any US or Australian seller who is interested in eligibility requirements to list with 'Certified Refurbished' should see the Certified refurbished program page in Seller Center. For implementation help, refer to eBay API documentation - format
string
: The format of the listing. Valid Values: FIXED_PRICE and AUCTION For implementation help, refer to eBay API documentation - pricingSummary PricingSummary
- product Product
ItemDraftResponse
- ItemDraftResponse
object
: The type that defines the field for the createItemDraft response.
- itemDraftId
string
: The eBay generated ID of the listing draft. - sellFlowNativeUri
string
: The URI the Partner uses to send the seller to their listing draft that was created on the eBay site. From there the seller can change, update, and publish the item on eBay. This is returned when the seller is using a mobile app. - sellFlowUrl
string
: The web URL the Partner uses to send the seller to the listing draft that was created on the eBay site. From there the seller can change, update, and publish the item on eBay. This is returned when the seller is using mobile web (mweb) or the desktop web. Note: You must construct the URL using the URL returned in this field and a session token. For example: sellFlowUrl?id_token=session_token
PricingSummary
- PricingSummary
object
: The type that defines the fields for the price details for an item.
Product
- Product
object
: The type that defines the fields for the aspects of a product.
- aspects
array
: The list of item aspects that describe the item (such as size, color, capacity, model, brand, etc.)
- brand
string
: The name brand of the item, such as Nike, Apple, etc. - description
string
: The description of the item that was created by the seller. This field supports plain text or rich content within HTML tags. Note: Active content is not supported. Active content includes animation or video via JavaScript, Flash, plug-ins, or form actions. Max Length: 500,000 - epid
string
: An EPID is the eBay product identifier of a product from the eBay product catalog. Note: If you submit both a category ID and an EPID, eBay determines the best category based on the EPID and uses that. The category ID will be ignored. - imageUrls
array
: The image URLs of the item. The first URL will be the primary image, which appears on the View Item page in the eBay listing. The URL can be from the following: The eBay Picture Services (images previously uploaded). A server outside of eBay (self-hosted). For more details, see PictureURL and Introduction to Pictures in Listings. Maximum: 12 URLs (for most categories and marketplaces) Restrictions: You cannot mix self-hosted and EPS-hosted URLs in the same listing. All image URLs must be 'https'.
- title
string
: The seller-created title of the item. This should include unique characteristics of the item, such as brand, model, color, size, capacity, etc. For example: Levi's 501 size 10 black jeans