ebay-api icon indicating copy to clipboard operation
ebay-api copied to clipboard

Defining multiple filters in a call to getTransactions (Finances API)

Open andy-todd-dev opened this issue 1 year ago • 1 comments

Describe the bug If I want to call 'getTransactions' from the Finances API I can't specify multiple filters. An example from the eBay docs: (https://developer.ebay.com/api-docs/sell/finances/resources/transaction/methods/getTransactions)

transactionId: the unique identifier of a monetary transaction. For a sales order, the orderId filter should be used instead. Only the monetary transaction defined by the identifier is returned.

Note: This filter cannot be used alone; the transactionType must also be specified when filtering by transaction ID.
Below is the proper syntax to use if filtering by a specific transaction ID: 
https://apiz.ebay.com/sell/finances/v1/transaction?filter=transactionId:{0*-0***0-3***3}&filter=transactionType:{SALE}

Code

ebayClient.sell.finances.sign.getTransactions({
  filter: "transactionType:{SALE}"
 //  transactionId... ??? how do I include this?
})

Would you like to work on this issue?

  • [ ] Yes
  • [ ] No
  • [x] Maybe

andy-todd-dev avatar Oct 08 '24 18:10 andy-todd-dev

I'll work on it. But for now you can use this Workaround:

const = new new eBayApi({
   // ...
  axiosConfig: { paramsSerializer: {indexes: null}} // remove the [] from params
})

ebayClient.sell.finances.sign.getTransactions({
  filter: ["transactionType:{SALE}"] // try array here and ignore the TS error
 //  transactionId... ??? how do I include this?
})
``

dantio avatar Oct 10 '24 17:10 dantio