ebay.negotiation
Module ebay.negotiation
ballerinax/ebay.negotiation Ballerina library
Overview
This is a generated connector for eBay Negotiation API v1.1.0 OpenAPI Specification.
The Negotiations API provides capability to access sellers to proactively send discount offers to buyers who have shown an
"interest" in their listings.
By sending buyers discount offers on listings where they have shown an interest, sellers can increase the velocity of their sales.
There are various ways for a buyer to show interest in a listing. For example, if a buyer adds the listing to their Watch list,
or if they add the listing to their shopping cart and later abandon the cart, they are deemed to have shown an interest in the listing.
In the offers that sellers send, they can discount their listings by either a percentage off the listing price, or they can set a
new discounted price that is lower than the original listing price. For details about how seller offers work,
see "/api-docs/sell/static/marketing/offers-to-buyers.html" title="Selling Integration Guide">Sending offers to buyers.
Prerequisites
Before using this connector in your Ballerina application, complete the following:
- Create an eBay developer account
- Obtain tokens
- Follow this link to obtain tokens
- Add configurations to Config.toml
Clients
ebay.negotiation: Client
This is a generated connector for eBay Negotiation API v1.1.0 OpenAPI Specification The Negotiations API provides capability to access sellers to proactively send discount offers to buyers who have shown an "interest" in their listings. By sending buyers discount offers on listings where they have shown an interest, sellers can increase the velocity of their sales. There are various ways for a buyer to show interest in a listing. For example, if a buyer adds the listing to their Watch list, or if they add the listing to their shopping cart and later abandon the cart, they are deemed to have shown an interest in the listing. In the offers that sellers send, they can discount their listings by either a percentage off the listing price, or they can set a new discounted price that is lower than the original listing price. For details about how seller offers work, see "/api-docs/sell/static/marketing/offers-to-buyers.html" title="Selling Integration Guide">Sending offers to buyers.
Constructor
Gets invoked to initialize the connector
.
The connector initialization requires setting the API credentials.
Create a developer account and obtain tokens following this guide.
init (ClientConfig clientConfig, string serviceUrl)
- clientConfig ClientConfig - The configurations to be used when initializing the
connector
- serviceUrl string "https://api.ebay.com/sell/negotiation/v1" - URL of the target service
findEligibleItems
function findEligibleItems(string xEbayCMarketplaceId, string? 'limit, string? offset) returns PagedEligibleItemCollection|error?
This method evaluates a seller's current listings and returns the set of IDs that are eligible for a seller-initiated discount offer to a buyer. A listing ID is returned only when one or more buyers have shown an "interest" in the listing. If any buyers have shown interest in a listing, the seller can initiate a "negotiation" with them by calling sendOfferToInterestedBuyers, which sends all interested buyers a message that offers the listing at a discount. For details about how to create seller offers to buyers, see Sending offers to buyers.
Parameters
- xEbayCMarketplaceId string - The eBay marketplace on which you want to search for eligible listings. For a complete list of supported marketplaces, see Negotiation API requirements and restrictions.
- 'limit string? (default ()) - This query parameter specifies the maximum number of items to return from the result set on a page in the paginated response. Minimum: 1 Maximum: 200 Default: 10
- offset string? (default ()) - This query parameter specifies the number of results to skip in the result set before returning the first result in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 results from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0
Return Type
- PagedEligibleItemCollection|error? - Success
sendOfferToInterestedBuyers
function sendOfferToInterestedBuyers(string xEbayCMarketplaceId, CreateOffersRequest payload) returns SendOfferToInterestedBuyersCollectionResponse|error
This method sends eligible buyers offers to purchase items in a listing at a discount. When a buyer has shown interest in a listing, they become "eligible" to receive a seller-initiated offer to purchase the item(s). Sellers use findEligibleItems to get the set of listings that have interested buyers. If a listing has interested buyers, sellers can use this method (sendOfferToInterestedBuyers) to send an offer to the buyers who are interested in the listing. The offer gives buyers the ability to purchase the associated listings at a discounted price. For details about how to create seller offers to buyers, see Sending offers to buyers.
Parameters
- xEbayCMarketplaceId string - The eBay marketplace on which your listings with "eligible" buyers appear. For a complete list of supported marketplaces, see Negotiation API requirements and restrictions.
- payload CreateOffersRequest - Send offer to eligible items request.
Return Type
Records
ebay.negotiation: Amount
A complex type that describes the value of a monetary amount as represented by a global currency.
Fields
- currency string? - The base currency applied to the value field to establish a monetary amount. The currency is represented as a 3-letter ISO4217 currency code. For example, the code for the Canadian Dollar is CAD. Default: The default currency of the eBay marketplace that hosts the listing. For implementation help, refer to'https://developer.ebay.com/api-docs/sell/negotiation/types/bas:CurrencyCodeEnum'>eBay API documentation
- value string? - The monetary amount in the specified currency.
ebay.negotiation: ClientConfig
Provides a set of configurations for controlling the behaviours when communicating with a remote HTTP endpoint.
Fields
- auth BearerTokenConfig|OAuth2RefreshTokenGrantConfig - Configurations related to client authentication
- httpVersion string(default "1.1") - The HTTP version understood by the client
- http1Settings ClientHttp1Settings(default {}) - Configurations related to HTTP/1.x protocol
- http2Settings ClientHttp2Settings(default {}) - Configurations related to HTTP/2 protocol
- timeout decimal(default 60) - The maximum time to wait (in seconds) for a response before closing the connection
- forwarded string(default "disable") - The choice of setting
forwarded
/x-forwarded
header
- followRedirects FollowRedirects?(default ()) - Configurations associated with Redirection
- poolConfig PoolConfiguration?(default ()) - Configurations associated with request pooling
- cache CacheConfig(default {}) - HTTP caching related configurations
- compression Compression(default http:COMPRESSION_AUTO) - Specifies the way of handling compression (
accept-encoding
) header
- circuitBreaker CircuitBreakerConfig?(default ()) - Configurations associated with the behaviour of the Circuit Breaker
- retryConfig RetryConfig?(default ()) - Configurations associated with retrying
- cookieConfig CookieConfig?(default ()) - Configurations associated with cookies
- responseLimits ResponseLimitConfigs(default {}) - Configurations associated with inbound response size limits
- secureSocket ClientSecureSocket?(default ()) - SSL/TLS-related options
ebay.negotiation: CreateOffersRequest
This complex type contains the fields needed to create an offer to a buyer that is initiated by the seller.
Fields
- allowCounterOffer boolean? - If set to true, the buyer is allowed to make a counter-offer to the seller's offer. Note: Currently, you must set this field to false; counter-offers are not supported in this release. Default: false
- message string? - A seller-defined message related to the offer being made. This message is sent to the list of "interested" buyers. To increase the conversion rate of the offers a seller makes to buyers, eBay recommends you always add a customized message to your offers. Maximum length: 2,000 characters
- offerDuration TimeDuration? - A complex type that specifies a period of time using a specified time-measurement unit.
- offeredItems OfferedItem[]? - An array of objects where each object contains the details of an offer and the ID of the listing on which the offer is being made. Note that the service does not currently support the creation of multiple offers with a single call to sendOfferToInterestedBuyer. With this, each request can target only one listing at a time and you must populate this array with a single element that contains the details of one offer.
ebay.negotiation: EligibleItem
A listing that is eligible for a seller-initiated offer to a buyer. Listings are identified by a listingId value that is generated and assigned by eBay when a seller lists an item using the Trading API. Note: The Negotiation API does not currently support listings that are managed with the Inventory API.
Fields
- listingId string? - The unique eBay-assigned ID for an eBay listing. A listingId is assigned by eBay when a seller creates a listing with the Trading API.
ebay.negotiation: Error
This type defines the fields that can be returned in an error.
Fields
- 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 int? - A unique number to identify the error.
- inputRefIds string[]? - 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 string[]? - An array of request elements most closely associated to the error.
- parameters ErrorParameter[]? - An array of name/value pairs that describe details the error condition. These are useful when multiple errors are returned.
- subdomain string? - Further helps indicate which subsystem the error is coming from. System subcategories include: Initialization, Serialization, Security, Monitoring, Rate Limiting, etc.
ebay.negotiation: ErrorParameter
Fields
- name string? - The object of the error.
- value string? - The value of the object.
ebay.negotiation: Offer
A complex type that defines an offer that a seller makes to eligible buyers.
Fields
- allowCounterOffer boolean? - If set to true, the buyer is allowed to make a counter-offer to the seller's offer.
- buyer User? - This complex type identifies an eBay user.
- creationDate string? - The date and time when the seller's offer was created. The returned timestamp is formatted as an ISO 8601 string, which is based on the 24-hour Coordinated Universal Time (UTC) clock. Format: [YYYY]-[MM]-[DD]T[hh]:[mm]:[ss].[sss]Z Example: 2018-08-20T07:09:00.000Z
- initiatedBy string? - The eBay UserName of the user (seller) who initiated the offer.
- lastModifiedDate string? - The date and time when the offer was last modified. The returned timestamp is formatted as an ISO 8601 string.
- message string? - A seller-defined message related to the offer being made. This message is sent to the list of "interested" buyers along with the offer message from eBay.
- offerDuration TimeDuration? - A complex type that specifies a period of time using a specified time-measurement unit.
- offeredItems OfferedItem[]? - The list of items associated with the offer. Currently, the offer list is restricted to a single offer.
- offerId string? - A unique eBay-assigned identifier for the offer.
- offerStatus string? - The current state, or status, of an offer. Status states include PENDING, COUNTERED, ACCEPTED, and DECLINED. For implementation help, refer to'https://developer.ebay.com/api-docs/sell/negotiation/types/api:OfferStatusEnum'>eBay API documentation
- offerType string? - The type of offer being made. For implementation help, refer to'https://developer.ebay.com/api-docs/sell/negotiation/types/api:OfferTypeEnum'>eBay API documentation
- revision string? - A unique, eBay-assigned ID for the revision of the offer.
ebay.negotiation: OfferedItem
A complex type that defines the offer being made to an "interested" buyer.
Fields
- discountPercentage string? - This value denotes the percentage that the listing in the offer will be discounted from its original listed price. The seller can specify either the exact price of the discounted items with the price field or they can use this field to specify the percentage that the listing will be discounted, but not both. Minimum: 5 Required if you do not specify a price value.
- listingId string? - This value is a unique eBay-assigned ID that identifies the listing to which the offer pertains. A listingId value is generated by eBay when you list an item with the Trading API.
- price Amount? - A complex type that describes the value of a monetary amount as represented by a global currency.
- quantity int? - This integer value indicates the number of items in the eBay listing for which the offer is being made. The offer being made by the seller is an "all or nothing" offer, meaning the buyer must purchase the indicated quantity of items in order to receive the discount on the transaction. Default: 1
ebay.negotiation: PagedEligibleItemCollection
This complex type defines a collection of listings that are eligible for an offer to a buyer.
Fields
- eligibleItems EligibleItem[]? - A list of items that are eligible for a seller-initiated offer to a buyer. Each element in the list contains the listing ID of a listed item. These IDs represent the listings for which buyers have shown an interest.
- href string? - The URI of the current page of results from the result set.
- 'limit int? - The number of items returned on a single page from the result set. This value can be set in the request with the limit query parameter.
- next string? - The URI for the following page of results. This value is returned only if there is an additional page of results to display from the result set. Max length: 2048
- offset int? - The number of results skipped in the result set before listing the first returned result. This value can be set in the request with the offset query parameter. Note: The items in a paginated result set use a zero-based list where the first item in the list has an offset of 0.
- prev string? - The URI for the preceding page of results. This value is returned only if there is a previous page of results to display from the result set. Max length: 2048
- total int? - The total number of items retrieved in the result set. If no items match the search criteria, the server returns the HTTP status code 204 No Content.
ebay.negotiation: SendOfferToInterestedBuyersCollectionResponse
The response object returned from a SendOfferToInterestedBuyers request.
Fields
- offers Offer[]? - The offers container returns a list of the offers sent to buyers who have shown an interest in listings included in the offer.
ebay.negotiation: TimeDuration
A complex type that specifies a period of time using a specified time-measurement unit.
Fields
- unit string? - A time-measurement unit that specifies a singular period of time. A span of time is defined when you apply the value specified in the value field to the value specified for unit. Time-measurement units can be YEAR, MONTH, DAY, and so on. See TimeDurationUnitEnum for a complete list of possible time-measurement units. For implementation help, refer to'https://developer.ebay.com/api-docs/sell/negotiation/types/bas:TimeDurationUnitEnum'>eBay API documentation
- value int? - An integer that represents an amount of time, as measured by the time-measurement unit specified in the unit field.
ebay.negotiation: User
This complex type identifies an eBay user.
Fields
- maskedUsername string? - The masked user name is a user name that has certain characters hidden for privacy of the user.
Import
import ballerinax/ebay.negotiation;
Metadata
Released date: almost 3 years ago
Version: 1.1.0
License: Apache-2.0
Compatibility
Platform: any
Ballerina version: slbeta6
GraalVM compatible: Yes
Pull count
Total: 1
Current verison: 0
Weekly downloads
Keywords
Commerce/eCommerce
Cost/Freemium
Contributors
Dependencies