eBay Trading API restocking fee not displaying on listings - c#

I am using the eBay Trading API with C# .NET SDK
I created a ReturnPolicyType
ReturnPolicyType policy=new ReturnPolicyType();
I set the policy properties and everything seems to work except the restocking fee
policy.RestockingFeeValue = "Percent_15";
And:
policy.RestockingFeeValueOption = "Percent_15";
I've also tried "15%" instead of "Percent_15"
but neither of them show the restocking fee on the listing
I've also asked the question on eBay's developer forums but they are pretty vacant of activity.
My full return policy code is below
ReturnPolicyType policy=new ReturnPolicyType();
policy.Refund="MoneyBack";
policy.ReturnsWithinOption="Days_30";
policy.ShippingCostPaidBy = "Buyer";
policy.RestockingFeeValue = "15%";
policy.RestockingFeeValueOption = "Percent_15";
policy.Description = "Returns are welcome on all items other than those sold on an 'AS - IS' basis. Buyers returning items shipped outside of the US will be responsible for all customs fees as well. Please read and fully understand the terms of our policy in advance if you wish to request a return.";
policy.ReturnsAcceptedOption="ReturnsAccepted";
policy.ShippingCostPaidByOption="Buyer";
The rest of the return policy displays as expected on the listing

To obtain the list of currently supported values, call GeteBayDetails with DetailName set to ReturnPolicyDetails. Then, look for the list of restocking fee percentage values in the ReturnPolicyDetails.RestockingFeeValue containers in the response.
https://developer.ebay.com/devzone/xml/docs/reference/ebay/types/ReturnPolicyType.html

I fetched an item listed using our old listing method and looked through the API call log to see the XML format of the existing listing.
I noticed a tag SellerReturnProfile inside of a tag SellerProfiles
I was able to populate the tags in the additem call like so
item.SellerProfiles = new SellerProfilesType();
var returnpolicy = new SellerReturnProfileType();
returnpolicy.ReturnProfileID = 63410125011;
returnpolicy.ReturnProfileName = "Returns Accepted,Buyer,30 Days,Money Default";
item.SellerProfiles.SellerReturnProfile = returnpolicy;
I had to list shipping profiles and payment profiles in the same way. It seems like if you list one seller profile the other 2 become required. In this case, the return profile was already defined in eBay as our default return profile.
They can be found in Account Settings -> Business Policies, but the id number has to be found with a getitem call on an existing item with the profile set.
It seems like the other call method ReturnPolicyType() might be depreciated as per these two sources
Business Policies Opt-In out soon to be enforced
Mapping Business Policies Management API Fields to Trading API Fields
Any seller who is opted into Business Policies will not be able to use the legacy fields at all, for Payment, Returns or Shipping in any new listing. If legacy fields are passed into the request, they will be ignored and dropped and the seller may get a warning message to that effect.
and
If you pass in Business Policies profile IDs and the legacy fields, the legacy fields will be ignored and dropped.

Related

How to get sitelink extension metrics with the new google ads api V10

I need help with getting metrics for sitelink extensions. I have tried this query but no results are returned. I can see 6 sitelink extensions in the UI.
SELECT campaign.name, feed_item.attribute_values, metrics.clicks, metrics.impressions, metrics.ctr , segments.interaction_on_this_extension, segments.placeholder_type FROM feed_item WHERE segments.date BETWEEN '2022-04-10' AND '2022-05-10' ORDER BY metrics.clicks DESC LIMIT 10
The sitelinks in the Ads account you are querying might have been migrated to Asset-based extensions. Any metrics collected after the migration will be attributed to the assets, not the feed items. You could try setting the date range of your query further back into the past to confirm that hypothesis.
There doesn't seem to be a report type that would allow you to both get assets' attribute and corresponding metrics at the same time, so it looks like you'll have to use a combination of the asset_field_type_view and asset resources to get all of the data you require.

How to create isolations between clients in an app

Hi I’m learning Blazor and I’m creating a backend & frontend app ( Blazor web assembly)
It works well, but my question is related to security.
I have user, business customer, and invoice. It's a very simple app
And user Id is a GUID and the others (business customer and invoice) are int & sequential (increment by 1 like 1,2, 3 and …)
Each user can not see the other user’s data and must not has access to them
this app has 2 parts, an API backend, and a Blazor frontend.
lets add some data like :
And End users can use the API only too without using frontend
I have in Invoice Repository:
Task<Invoice> GetInvoicesListAsync(int businessId);
and after verification users can access its invoices List
if we have a verified enduser like “Alex” (in the second row pf user table), can be retrieve the data that its not belong to him
Because BusinessId is sequential and when he knows his business Id is 99 , he can retrieve invoices for business 100,101,102 and … just with some trying
like :
var lst = await GetInvoicesListAsync(101);
my questions are:
1- How we can stop that? Do I need to enforce enduser to enter UserId as well for security into the API params like this :
Task<Invoice> GetInvoicesListAsync(Guid userId, int businessId);
2- If I add userId then is that has impact on the performance? because in this case I need to do Inner join with user table too and if we have complex database then it has big impact on the performance
3- what is your advice
thanks
Answers as point list:
No, you don't. The method GetInvoicesListAsync(int businessId) is good enough from a security point of view. You need to extract the list of business per user and check if the requested business is in the list, or more simply add a where / join condition filtering the invoices on the businesses of the user.
inner join is not a problem if you have the right indexes. Use your DB explain query plan to verify that your query is using index and do not execute any full table scan
when your user call the API you need to verify the user (valid token or cookie) and to obtain teh list of the business associated, so you don't need to receive this info from the API parameters. This is the biggest concern from a security point of view. The rule for secure API is "hey API, what's my name?"

Find All Available Meeting Rooms using Microsoft.Office.Interop.Outlook

I was developing one application where I want to retrieve the available rooms from the "All Rooms" of the outlook address book. I am able to retrieve all the room entries from "All Rooms" Address Entry List. And then able to search for individual room's availability by calling AddressEntry.GetFreeBusy().
But the problem I am facing is the time performance of the code. If the number of rooms is high(let's say 500) then the time take to search availability of the room(worst case scenario where available room locates near to last of the list) is very high.
Microsoft.Office.Interop.Outlook.Application app = new Microsoft.Office.Interop.Outlook.Application()
var allRooms = app.Session.AddressLists["All Rooms"].Cast<Microsoft.Office.Interop.Outlook.AddressEntry>().ToLis();
DateTime today = DateTime.Today;
foreach(var room in allRooms)
{
//the below function will return the room status in a string of 1&0 for an interval of 1 min
string status = room.GetFreeBusy(today, 1, true); //sequentially calling this method is costly. What improvement can I do here?
//process the status and make some if free for certain time period add to list of available list
}
The GetFreeBusy method accepts three parameters and the default value for the MinPerChar parameter is 30 minutes. But your code only checks the first minute of the appointment. You need to go over the whole duration of your meeting (at least 30 minutes). Take a look at the similar forum thread.
If you are a .Net Developer then use Microsoft Graph APIs for this purpose. I used
POST /me/calendar/getSchedule
POST /users/{id|userPrincipalName}/calendar/getSchedule
from to achieve this. You can login as your userid and use ME option or you can use application mode login to login and use {id|userPrincipalName} to get calendar details for a room.
This link provides the basics on how to login and have good examples for Graph in general.
https://developer.microsoft.com/en-us/graph/graph-explorer
Ref:
https://learn.microsoft.com/en-us/graph/api/calendar-getschedule?view=graph-rest-1.0&tabs=http

How to get the Install & Testing Note of a Task or Defect Item

I'm developing a win forms application using AxosoftAPI.NET. I've implemented functionality to search for Items like Tasks, Defects, Incidents and Projects.
I can also check whether an Item has attachments. Now I need to know how to check if an Item (Task or Defect) has an Install or Testing Note attached to it. I searched in Axosoft's developers website but couldn't find anything helpful. How can I achieve this in C# using AxosoftAPI.NET?
Install and Testing Notes are not standard fields in Axosoft so are most likely Custom Fields that were added by your team. All custom fields should be returned when getting items, however large text fields, are only returned when getting a single item, rather then getting lists of items.
From the developer.axosoft.com page regarding the GET multiple and specifying the columns parameter :
(comma seperated string) Containins the names of the columns to return for each item. Defaults to all columns. However, please note that for performance reasons long text fields (such as 'Description') are not returned by this API call. To get the values of long text fields, use the GET /defects/{id} call to retrieve a single item.

How to select library items that belong to a taxonomy in Ektron

I'm using Ektron CMS version 8.5 SP2.
I have some items in a taxonomy. Some are actual pages, some are library items (documents like Word files and PDFs).
Let's say there are 3 pages and 2 library items for a total of 5 items in my taxonomy.
I use the following code...
ContentManager cManager = new Ektron.Cms.Framework.Content.ContentManager();
Ektron.Cms.Content.ContentTaxonomyCriteria ctCriteria = new Ektron.Cms.Content.ContentTaxonomyCriteria();
ctCriteria.AddFilter(1707, true); // hard coded taxonomy ID
List<ContentData> list = cManager.GetList(ctCriteria);
Label1.Text = list.Count.ToString();
When this code runs, the count of items in the list is 3. If I output the actual list, I can see it's only the pages in the taxonomy, not the 2 library items.
It seems that the ContentManager.getList() function does not get library items, even when those items have been added to the taxonomy. I can confirm that in the admin workarea, the library items are visible in the taxonomy.
For clarification, this is a problem with retrieving items that have already been added to the taxonomy.
Does anyone know how I can retirieve a list of all items in a taxonomy, including any library items in there.
Note: If I add the files to the Document Managment System instead of the library, it works perfectly. But in the live system, I have hundreds of items in the library and I'm hoping theres' a way to view them via a taxonomy without having to move them all into the DMS.
I have posted this question on the Ektron developers forum as well, but I've had no reply. I'm hoping somebody here can help.
Cheers.
A follow up to my comment from the other day on #nedlud's answer, I felt like this deserved its own answer though.
According to the Framework API docs:
If intent is to retrieve CMS items that have been categorized in Taxonomies, use TaxonomyItemManager.
But as already noted in the comments, the TaxonomyItemData objects returned by this API have a number of empty properties such as QuickLink and Html. I've found that using the TaxonomyManager, one can successfully query for items assigned to particular taxonomy categories.
Here's a brief snippet using the Framework API (version >= 8.5); this feels reminiscent of working with the older (version <= 8.0) taxonomy API wherein one would create a TaxonomyRequest and get an object structure back that encapsulated not only the taxonomy iteself, but the items categorized into that taxonomy:
//e.g. for a single-level taxonomy
long taxRoot = 1707; //from OP's question
TaxonomyManager taxManager = new TaxonomyManager();
//GetTree overload supplying includeItems parameter
TaxonomyData taxTree = taxManager.GetTree(taxRoot, includeItems: true);
foreach(TaxonomyItemData taxItem in taxTree.TaxonomyItems)
{
//these should print true
Response.Write(!String.IsNullOrEmpty(taxItem.QuickLink));
Response.Write(!String.IsNullOrEmpty(taxItem.Html));
}
I'm currently refactoring some version 8.0 code into version 8.6 and converting to the Framework API. Until Ektron fixes the (bug?) of TaxonomyItemManager returning TaxonomyItemData with null properties, I'll be using the above method + LINQ for the sorting/filtering/etc.
I would look at the TaxonomyItemManager rather than the ContentManager.
Thanks to #maddoxej suggestion of using the TaxonomyItemManager, I have working solution code...
TaxonomyItemCriteria criteria = new TaxonomyItemCriteria();
criteria.AddFilter(TaxonomyItemProperty.TaxonomyId, CriteriaFilterOperator.EqualTo, 1707);
TaxonomyItemManager taxonomyItemManager = new TaxonomyItemManager();
List<TaxonomyItemData> taxonomyItemList = taxonomyItemManager.GetList(criteria);
Label1.Text = taxonomyItemList.Count.ToString();
This code now shows the expected count of "5", and I can display all the itmes :)
So many "manager" classes in Ektron.

Categories

Resources