ballerinax/ebay.finances Ballerina library

2.0.0

Overview

The eBay Finances connector lets Ballerina applications retrieve a seller's payouts, funds, billing activity and monetary transaction details from the eBay Finances API. It supports version v1.19.1 of the API, which is used by sellers to reconcile what eBay has paid out against the individual sales, refunds, fees and transfers behind each payout.

Key features

  • Retrieve seller payouts, and look up a single payout by its ID
  • Search monetary transactions by date, type or payout, and summarise them for a period
  • Review the funds available, processing and on hold in the seller's account
  • Inspect order-level earnings, including gross amounts, expenses and refunds
  • Access billing activity such as the fees eBay charged, and the details of a transfer

Setup guide

To use the connector, you need an eBay developer account and a user access token that grants the sell.finances scope.

  1. Sign up for the eBay Developers Program and sign in.

  2. Open the Application Keys page and create a keyset for the Production environment. Note the App ID (Client ID) and the Cert ID (Client Secret).

  3. Under User Tokens for the keyset, add an OAuth redirect URL (RuName) for your application.

  4. Direct the seller to eBay's consent page using the RuName and the scopes https://api.ebay.com/oauth/api_scope/sell.finances and, for order earnings, https://api.ebay.com/oauth/api_scope/sell.finances.earnings.read.

  5. Exchange the authorization code returned to your redirect URL for a user token at https://api.ebay.com/identity/v1/oauth2/token, and keep the refresh token from the response.

Note: Finances API calls made on behalf of EU and UK sellers also require a digital signature. See eBay's Digital Signatures for APIs guide.

Quickstart

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

Step 1: Import the module

Copy
import ballerinax/ebay.finances;

Step 2: Create a Config.toml file

Copy
clientId = "<Client ID>"
clientSecret = "<Client Secret>"
refreshToken = "<Refresh Token>"

Step 3: Create a client

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

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

Step 4: Invoke an operation

Copy
public function main() returns error? {
    finances:PayoutSummaryResponse _ = check ebay->getPayoutSummary({xEBAYCMARKETPLACEID: "EBAY_US"});
}

Examples

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

  1. Payout reconciliation report - Lists recent payouts and totals the credits and debits of the transactions behind each one.
  2. Seller fee audit - Combines the funds summary, a transaction summary and the billing activity for a date range to show where fees went.

Import

import ballerinax/ebay.finances;Copy

Other versions

See more...

Metadata

Released date: about 18 hours ago

Version: 2.0.0

License: Apache-2.0


Security

Direct vulnerabilities: No known direct vulnerabilities

Indirect vulnerabilities: 

Checked on 2026-11-20 via OSV.dev


Compatibility

Platform: any

Ballerina version: 2201.12.0

GraalVM compatible: Yes


Pull count

Total: 50

Current verison: 1


Weekly downloads


Source repository


Keywords

Vendor/eBay

Area/Finance & Accounting

Type/Connector


Contributors