首页 > 解决方案 > 获取 ebay sdk 业务策略

问题描述

我是 eBay SDK 和 eBay 交易 API 的新手。如何使用 API 或 SDK 获取所有业务政策(付款、运输和退货政策)?我查看了文档,但还没有运气。

标签: c#ebay-apiebay-sdk

解决方案


在eBay Trading API中找到业务政策。从调用的输出中,您可以期待以下内容的简要说明。

检查返回容器的属性以获取经过身份验证的用户的首选项数据。在适用的情况下,存储数据(可能在表格中),或将其显示给用户,以便他们可以验证他们当前的偏好。

示例 C# 调用

public GetUserPreferencesCall GetEbayUserPreferences()
{
    if (this.Context == null) // context needs to be defined first
    {
        throw new NullReferenceException("ApiContext is not defined!");
    }
    GetUserPreferencesCall userPreferences = new GetUserPreferencesCall(Context);
    userPreferences.ShowSellerProfilePreferences = true;

    try { userPreferences.Execute(); }
    catch (Exception ex)
    {
        // handle exception
    }
    return userPreferences; 
}

推荐阅读