Home
Find the answer to your question
The code sample was created by
giving a WSDL web reference to Business Policies Management WSDL
http://developer.ebay.com/webservices/business-policies/latest/SellerProfilesManagementService.wsdl
Add a web service reference to the eBay Business Policies Management WSDL (Please use the latest version of the WSDL)
http://developer.ebay.com/webservices/business-policies/latest/SellerProfilesManagementService.wsdl
Create a custom service by overriding the GetWebRequest method
CustomBusinessPoliciesManagement.cs |
|
Call the custom service and make the addSellerProfile API as follows to create Shipping Profile
Program.cs
using System;
using System.Collections.Generic;
using System.Text;
using BusinessPoliciesManagement_API_Sample.com.ebay.developer;
namespace BusinessPoliciesManagement_API_Sample
{
class Program
{
static void Main(string[] args)
{
try
{
CustomBusinessPoliciesManagement service = new CustomBusinessPoliciesManagement();
service.Url = @"http://svcs.sandbox.ebay.com/services/selling/v1/SellerProfilesManagementService";
AddSellerProfileRequest request = new AddSellerProfileRequest();
ReturnPolicyProfile retProfile = new ReturnPolicyProfile();
retProfile.profileName = "ReturnPolicy-ReturnsAccepted";
retProfile.profileTypeSpecified = true;
retProfile.profileType = ProfileType.RETURN_POLICY;
CategoryGroup category = new CategoryGroup();
category.@default = true;
category.name = "ALL";
CategoryGroup[] categoryArray = { category };
retProfile.categoryGroups = categoryArray;
ReturnPolicyInfo retInfo = new ReturnPolicyInfo();
retInfo.returnsAcceptedOption = "ReturnsAccepted";
retInfo.refundOption = "MoneyBack";
retInfo.returnsWithinOption = "Days_14";
retInfo.shippingCostPaidByOption = "Buyer";
retInfo.description = "Return Policy description comes here...";
retProfile.returnPolicyInfo = retInfo;
request.returnPolicyProfile = retProfile;
AddSellerProfileResponse response = new AddSellerProfileResponse();
response = service.addSellerProfile(request);
if (response.ack == AckValue.Success)
{
Console.WriteLine("Ack: " + response.ack.ToString());
Console.WriteLine("Return Profile Details:");
Console.WriteLine("Profile Name: " + response.returnPolicyProfile.profileId);
Console.WriteLine("Profile ID: " + response.returnPolicyProfile.profileName);
}
else
{
foreach (ErrorData error in response.errorMessage)
{
Console.WriteLine("Error ID: " + error.errorId);
Console.WriteLine("Error Message: " + error.message);
}
}
}
catch (Exception ex)
{
throw ex;
}
Console.ReadLine();
}
}
}