question

tempo68 avatar image
1 Like"
tempo68 asked

Get Ad Fee For Order

I am looking for the ad fee for a specific order. I see that the GetTransactions api gives you back ad fees but there is no way to safely associate that to a specific order. I thought it would be included marketplaceFees array but it is not. There is a separate entry for the ad fees with a transaction type of NON_SALE_CHARGE but it is hard to associate that with an order.


One way would be to get the first AD_FEE transaction after the payment transaction for the order, but can I be sure that it will be the correct fee ALWAYS?

fees
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

sanjiv_developersupport avatar image
0 Likes"
sanjiv_developersupport answered

Hi @tempo68,

You can use the GetTransactions call of Finances API for getting the AD_FEE for a order.Please go through the link given below to more about the call.


Ref: https://developer.ebay.com/api-docs/sell/finances/resources/transaction/methods/getTransactions


You might want to take a look 'FeeAd' fees in GetAccount API. The fees are for sellers who sign up to create Promoted Listings campaigns:

Ref: https://developer.ebay.com/Devzone/XML/docs/Reference/eBay/types/AccountDetailEntryCodeType.html


Best Regards ,
eBay Developer Support

10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

ramohot0 avatar image
0 Likes"
ramohot0 answered

Hi @sanjiv_developersupport ,

I used https://apiz.ebay.com/sell/finances/v1/transaction?filter=orderId:{<order number>} endpoint to get the Fees associated with given order number. I only got fees for FINAL_VALUE_FEE_FIXED_PER_ORDER and FINAL_VALUE_FEE. But not for AD_FEE.

"orderLineItems": [
                {
                    "lineItemId": "**************",
                    "feeBasisAmount": {
                        "value": "17.01",
                        "currency": "USD"
                    },
                    "marketplaceFees": [
                        {
                            "feeType": "FINAL_VALUE_FEE_FIXED_PER_ORDER",
                            "amount": {
                                "value": "0.1",
                                "currency": "USD"
                            }
                        },
                        {
                            "feeType": "FINAL_VALUE_FEE",
                            "amount": {
                                "value": "1.61",
                                "currency": "USD"
                            }
                        }
                    ]
                }
            ],

Thinking that above order does not carry any AD_FEE, again I used https://apiz.ebay.com/sell/finances/v1/transaction?filter=transactionType:{NON_SALE_CHARGE} endpoint where I receive response like below

 {
            "transactionId": "FEE-********",
            "salesRecordReference": "0",
            "transactionType": "NON_SALE_CHARGE",
            "amount": {
                "value": "0.78",
                "currency": "USD"
            },
            "bookingEntry": "DEBIT",
            "transactionDate": "2021-05-10T12:40:35.000Z",
            "transactionStatus": "FUNDS_AVAILABLE_FOR_PAYOUT",
            "references": [
                {
                    "referenceId": "2*********23",
                    "referenceType": "ITEM_ID"
                }
            ],
            "feeType": "AD_FEE"
        },

In this response we can see AD_FEE, but there is no reference to the Order Number. Only the ItemId and transaction date. This implies that some order with above item id (i.e referenceId : 2*********23 ) should have AD_FEE.

I took all orders that contains Item Id 2*********23 and executed first endpoint (https://apiz.ebay.com/sell/finances/v1/transaction?filter=orderId:{<order number>}). But non of response returns AD_FEE.

We can guess that order number whose order date near to transaction date above is the owning order of this ad fee.

Is there a any better way of getting exact ad fee for particular order ?

· 1
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Hi @ramohot0,

I am able to see the OrderId as a reference object with referenceType: "ORDER_ID" inside the references list as shown in your second example response, does that field appear for you if you try now?

I've also noticed OrderId will only be there for "DEBIT" transactions, and "CREDIT" AD_FEE transactions (i.e. for refunded ad fees) will not have the associated OrderId.

Regards

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.