ballerinax/ebay.recommendation Ballerina library

2.0.0

Overview

The eBay Recommendation connector lets Ballerina applications call the eBay Recommendation API to retrieve information that sellers can use to optimize their listings. It supports version v1.1.0 of the API, and currently exposes the find listing recommendations operation, which returns Promoted Listings ad recommendations and trending bid percentages for a seller's active listings.

Key features

  • Find Promoted Listings ad recommendations for all active listings or a chosen set of listing IDs
  • Retrieve the trending ad rate (bid percentage) for recommended listings
  • Page through large result sets using the limit and offset query parameters
  • Authenticate with an OAuth 2.0 refresh token grant or a bearer token

Setup guide

To use the eBay Recommendation connector, you need an eBay developer account and an OAuth access to the seller's inventory scope.

  1. Create an eBay developer account and a keyset (application) in the eBay Developer Program.

  2. Obtain a user access token or refresh token through the OAuth 2.0 authorization code grant, with the https://api.ebay.com/oauth/api_scope/sell.inventory scope.

  3. Note the client ID, client secret and refresh token, or the access token, to use when initializing the client.

Quickstart

To use the ebay.recommendation connector in your Ballerina application, update the .bal file as follows:

Step 1: Import the module

Copy
import ballerinax/ebay.recommendation;

Step 2: Instantiate a new connector

Create a Config.toml file with your credentials:

Copy
clientId = "<CLIENT_ID>"
clientSecret = "<CLIENT_SECRET>"
refreshToken = "<REFRESH_TOKEN>"

Then create a recommendation:Client using them:

Copy
configurable string clientId = ?;
configurable string clientSecret = ?;
configurable string refreshToken = ?;

final recommendation:Client ebay = check new ({
    auth: {
        clientId,
        clientSecret,
        refreshToken
    }
});

Step 3: Invoke the connector operation

Copy
public function main() returns error? {
    recommendation:PagedListingRecommendationCollection? _ = check ebay->findListingRecommendations(
        {xEBAYCMARKETPLACEID: "EBAY_US"},
        {listingIds: ["110501234567"]}
    );
}

Step 4: Run the Ballerina application

Copy
bal run

Examples

The eBay Recommendation connector provides practical examples illustrating usage in various scenarios. Explore these examples, covering the following use cases:

  1. Promoted listing picks - Review selected listings and report those recommended for a Promoted Listings campaign.
  2. Ad rate benchmark - Page through all active listings and compute the average trending ad rate.

Import

import ballerinax/ebay.recommendation;Copy

Other versions

See more...

Metadata

Released date: 1 day ago

Version: 2.0.0

License: Apache-2.0


Security

Direct vulnerabilities: No known direct vulnerabilities

Indirect vulnerabilities: 

Checked on 2026-11-21 via OSV.dev


Compatibility

Platform: any

Ballerina version: 2201.12.0

GraalVM compatible: Yes


Pull count

Total: 51

Current verison: 1


Weekly downloads


Source repository


Keywords

Vendor/eBay

Area/E-Commerce

Type/Connector


Contributors