ShippingLocationDetails

ShippingLocationDetails

本文介绍了XML eBay交易API-具有多个运输选项的addItem的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想通过那里的Trading API在eBay上列出一些商品,但是他们的API非常复杂,我需要一些帮助。

I want to list some item on eBay via there Trading API, but their API is very complicated and I need some help.

我可以通过以下方式在eBay上列出商品API很好,但我似乎无法弄清楚如何拥有一个以上的运输选项,就像我在eBay上的 addItem 页面

I can list items on eBay via the API very well but I can't seem to figure out how to have more than one shipping option as I can do on the eBay addItem page

这是我需要通过API在eBay上设置的运输设置

Here is the shipping setting I need to have on eBay via the APIhttp://i.cubeupload.com/F4oURU.png

这是我的xml

<?xml version="1.0" encoding="utf-8"?>
<AddItemsRequest xmlns="urn:ebay:apis:eBLBaseComponents">
<ErrorLanguage>en_US</ErrorLanguage>
<AddItemRequestContainer>
<MessageID>100</MessageID>
<Item>
<StartPrice currencyID=\"CAD\">223.96</StartPrice>
<CategoryMappingAllowed>true</CategoryMappingAllowed>
<ConditionID>1000</ConditionID>
<Country>CA</Country>
<Currency>CAD</Currency>
<Title>TEST</Title>
<Description>DEscription</Description>
<DispatchTimeMax>3</DispatchTimeMax>
<ListingDuration>Days_7</ListingDuration>
<ListingType>FixedPriceItem</ListingType>
<PaymentMethods>PayPal</PaymentMethods>
<PayPalEmailAddress>  [--  myPayPalEmail --]  </PayPalEmailAddress>
<PictureDetails>
<Item.PictureDetails.PictureURL>
http://www.jccayer.com/productphoto/2793-22-1_ep1.jpg
</Item.PictureDetails.PictureURL>
<PictureURL>http://www.jccayer.com/productphoto/2793-22-1_ep1.jpg</PictureURL>
</PictureDetails>
<PostalCode>K0A1M0</PostalCode>
<PrimaryCategory>
<CategoryID>279</CategoryID>
</PrimaryCategory>
<Quantity>6</Quantity>
<ReturnPolicy>
<ReturnsAcceptedOption>ReturnsAccepted</ReturnsAcceptedOption>
<RefundOption>MoneyBack</RefundOption>
<ReturnsWithinOption>Days_30</ReturnsWithinOption>
<Description>Text description of return policy details</Description>
<ShippingCostPaidByOption>Buyer</ShippingCostPaidByOption>
</ReturnPolicy>
<ShippingDetails>
<ShippingType>Flat</ShippingType>
<ShippingServiceOptions>
<ShippingService>CA_UPSStandardCanada</ShippingService>
<ShippingServiceCost>21.50</ShippingServiceCost>
<ShippingServiceAdditionalCost>5.00</ShippingServiceAdditionalCost>
<ShippingServicePriority>1</ShippingServicePriority>
</ShippingServiceOptions>
<InternationalShippingServiceOption>
<ShippingService>CA_UPSStandardUnitedStates</ShippingService>
<ShippingServiceCost>50.50</ShippingServiceCost>
<ShippingServiceCost>10.00</ShippingServiceCost>
<ShipToLocation></ShipToLocation>
<ShippingServicePriority>2</ShippingServicePriority>
</InternationalShippingServiceOption>
</ShippingDetails>
<Site>Canada</Site>
</Item>
</AddItemRequestContainer>
<RequesterCredentials>
<eBayAuthToken>[INSERT YOUR OWN AUTH TOKEN]</eBayAuthToken>
</RequesterCredentials>
</AddItemsRequest>

有人知道我如何匹配该图片上的设置吗?

Does anyone have an idea how I can match those setting on that picture?

推荐答案

这将引导您完成在eBay上指定商品运输详细信息所需的XML。

This walks you through the XML needed to specify shipping details for an item on eBay.

卖家使用的运输成本模型为 Flat 模型。卖家通过 UPS Standard Canada 在加拿大境内提供国内运输,第一项收费为 CAD($)15.99 ,其他每项收费 $ 6.00 。该物品也可以国际运输,为此提供两种服务。第一项国际服务仅使用 UPS Standard United States 运送到美国,第一项的费用为 $ 21.08 $ 8.00 强>每增加一个。第二项服务的第一项费用为 $ 69.32 ,其他各项费用为 $ 29.00 UPS Worldwide Expedited 已使用,并将运往以下地点。

The shipping cost model used by the seller is the Flat model. The seller offers domestic shipping within Canada via UPS Standard Canada at a charge of CAD($)15.99 for the first item and $6.00 for each additional. The item can also be shipped internationally and two services are offered for this. The first international service only ships to the United States using UPS Standard United States and costs $21.08 for the first item and $8.00 for each additional. The second service costs $69.32 for the first item and $29.00 for each additional. UPS Worldwide Expedited is used and will ship to the following locations.


  • N。和美国

  • 墨西哥

  • 德国

  • 欧洲

  • 法国

  • 英国

  • 日本

  • 亚洲

  • 台湾

  • 澳大利亚

  • N. and S. America
  • Mexico
  • Germany
  • Europe
  • France
  • United Kingdom
  • Japan
  • Asia
  • Taiwan
  • Australia

运输信息在您的请求的 ShippingDetails 元素中指定。这是 ShippingDetailsType 类型,并且完整的字段列表位于。

Shipping information is specified in the ShippingDetails element of your request. This is of the type ShippingDetailsType and a complete list of fields is available here.

<ShippingDetails>
    <!-- Domestic and international shipping details will be added here -->
</ShippingDetails>

我们可以添加到 ShippingDetails 中的第一条信息是运输模型卖方在这种情况下使用的是 Flat

The first piece of information we can add to ShippingDetails is the shipping model that the seller is using which in this case is Flat.

<ShippingType>Flat</ShippingType>

可以输入许多不同的值作为 ShippingType 和完整列表可在找到。

There are many different values that could be entered as the ShippingType and a complete list can be found here.

我们现在可以转到请求的国内运输部分。您最多可以指定4种国内运输服务。每个服务都是一个 ShippingServiceOptions 元素,并且是 ShippingServiceOptionsType 类型。您可以在获得完整的字段列表。

We can now move onto the domestic shipping part of the request. You can specify up to a maximum of 4 domestic shipping services. Each service is a ShippingServiceOptions element and is of the type ShippingServiceOptionsType. A complete list of fields is available here.

<ShippingServiceOptions>
    <!-- Shipping costs and options related to a
         domestic shipping service will be added here -->
</ShippingServiceOptions>

控制卖方在查看商品和结帐页面中显示国内运输服务的顺序可以指定优先级。优先级为1的服务将出现在顶部,优先级为4的服务将出现在底部。请注意,在此示例中,只有一项国内运输服务,因此优先级是可选的,但将其包括在内也没有害处。

To control the order in which the domestic shipping services will appear in the View Item and Checkout page the seller can specify a priority. A service with a priority of 1 will appear at the top and a service with value of 4 will appear at the bottom. Note that in this example there is only one domestic shipping service so the priority is optional but it does no harm to include it.

<ShippingServicePriority>1</ShippingServicePriority>

指定运输服务的成本是通过 ShippingServiceCost 元素完成的。由于此卖家也要为其他商品收费,因此还需要指定 ShippingServiceAdditionalCost 元素。

Specifying the cost of the shipping service is done with the ShippingServiceCost element. Since this seller is also charging for additional items the ShippingServiceAdditionalCost element needs to be specified as well.

<ShippingServiceCost>15.99</ShippingServiceCost>
<ShippingServiceAdditionalCost>6.00</ShippingServiceAdditionalCost>

通过表示将使用 UPS Standard Canada > ShippingService 元素。

Indicating that UPS Standard Canada will be used is done through the ShippingService element.

<ShippingService>CA_UPSStandardCanada</ShippingService>

请注意,您实际上并未指定 UPS Standard Canada ,而是使用值* CA_UPSStandardCanada *。获得正确的使用值超出了本示例的范围,但可以概括如下。

Note that you do not actually specify UPS Standard Canada but instead use the value *CA_UPSStandardCanada*. Obtaining the correct value to use is outside the scope of this example but can be summarised as follows.


  • 调用 GeteBayDetails ,其中 DetailName 设置为 ShippingServiceDetails

  • 在响应中,迭代每个 ShippingServiceDetails 元素并检查是否存在 ValidForSellingFlow

  • 如果存在 ValidForSellingFlow ,请读取 ShippingService 的值。

  • 更多信息可以在。

  • Make a call to GeteBayDetails with DetailName set to ShippingServiceDetails.
  • In the response iterate through each ShippingServiceDetails element and check for the existence of ValidForSellingFlow.
  • If ValidForSellingFlow exists read in the value of ShippingService.
  • More information can be found here.

我们现在可以开始第一个国际运输服务了。您最多可以指定5种国际运输服务。每个服务都是一个 InternationalShippingServiceOption 元素,其类型为 InternationalShippingServiceOptionsType 。可以在获得完整的字段列表。

We can now begin the first of the international shipping services. You can specify up to a maximum of 5 international shipping services. Each service is a InternationalShippingServiceOption element that is of the type InternationalShippingServiceOptionsType. A complete list of fields is available here.

<InternationalShippingServiceOption>
    <!-- Shipping costs and options related to an
         international shipping service will be added here -->
</InternationalShippingServiceOption>

同样,卖方可以为每种运输服务指定优先级,为此,我们将输入1请注意,仅在相同类型的运输服务之间比较优先级。这意味着,即使我们为国内和国际运输服务都设置了优先级1,也不会在确定它们出现的顺序时将它们相互比较。

Again the seller can specify a priority for each shipping service and for this we will enter a value of 1. Note that priorities are only compared between shipping services of the same type. This means that even though we have set a priority of 1 for both a domestic and international shipping service they will not be compared to each other when determining the order that they will appear.

<ShippingServicePriority>1</ShippingServicePriority>

我们现在可以添加使用此服务的费用。

We can now add the costs for using this service.

<ShippingServiceCost>21.08</ShippingServiceCost>
<ShippingServiceAdditionalCost>8.00</ShippingServiceAdditionalCost>

UPS标准美国。再次注意,我们实际上并未指定 UPS标准美国,而是使用在调用 GeteBayDetails 时检索到的值。

UPS Standard United States is also added. Notice again that we don't actually specify UPS Standard United States but instead use a value that was retrieved when calling GeteBayDetails.

<ShippingService>CA_UPSStandardUnitedStates</ShippingService>

卖方已指定此国际运输服务将仅运往美国。通过 ShipToLocation 元素指示卖方将运送到的位置或区域。

The seller has specified that this international shipping service will only ship to the United States. Indicating which location or region that the seller will ship to is done via the ShipToLocation element.

<ShipToLocation>US</ShipToLocation>

再次,我们实际上并未指定美国,而是使用值 US 。获得正确的使用值也不在本示例的范围内,但可以总结如下。

Once again we don't actually specify United States but instead use the value US. Obtaining the correct value to use is also outside the scope of this example but can be summarised as follows.


  • 调用 DetailName 设置为 ShippingLocationDetails 的GeteBayDetails

  • 在响应中循环遍历每个 ShippingLocationDetails 元素并读取 ShippingLocation 的值。

  • 更多信息,请参见。

  • Make a call to GeteBayDetails with DetailName set to ShippingLocationDetails.
  • In the response iterate through each ShippingLocationDetails element and read in the value of ShippingLocation.
  • More information can be found here.

构建第二个国际运输服务所遵循的步骤与第一个相同。请注意,我们将优先级设置为2,因为卖方希望它出现在第一个国际运输服务下方。此外,还指定了几个 ShipToLocation 元素来指示卖方将使用此服务运送到的许多区域。

Building the second international shipping service follows the same steps as the first. Notice that we set a priority of 2 as the seller wants it to appear below the first international shipping service. In addition several ShipToLocation elements have been specified to indicate the many regions that the seller will ship to with this service.

<InternationalShippingServiceOption>
    <ShippingServicePriority>2</ShippingServicePriority>
    <ShippingServiceCost>69.32</ShippingServiceCost>
    <ShippingServiceAdditionalCost>29.00</ShippingServiceAdditionalCost>
    <ShippingService>CA_UPSWorldWideExpedited</ShippingService>
    <ShipToLocation>Americas</ShipToLocation>
    <ShipToLocation>TW</ShipToLocation>
    <ShipToLocation>Asia</ShipToLocation>
    <ShipToLocation>AU</ShipToLocation>
    <ShipToLocation>MX</ShipToLocation>
    <ShipToLocation>DE</ShipToLocation>
    <ShipToLocation>FR</ShipToLocation>
    <ShipToLocation>Europe</ShipToLocation>
    <ShipToLocation>GB</ShipToLocation>
    <ShipToLocation>JP</ShipToLocation>
</InternationalShippingServiceOption>

将所有片段放在一起将产生以下XML。

Putting together all the pieces results in the following XML.

<ShippingDetails>
    <ShippingType>Flat</ShippingType>
    <ShippingServiceOptions>
        <ShippingServicePriority>1</ShippingServicePriority>
        <ShippingServiceCost>15.99</ShippingServiceCost>
        <ShippingServiceAdditionalCost>6.00</ShippingServiceAdditionalCost>
        <ShippingService>CA_UPSStandardCanada</ShippingService>
    </ShippingServiceOptions>
    <InternationalShippingServiceOption>
        <ShippingServicePriority>1</ShippingServicePriority>
        <ShippingServiceCost>21.08</ShippingServiceCost>
        <ShippingServiceAdditionalCost>8.00</ShippingServiceAdditionalCost>
        <ShippingService>CA_UPSStandardUnitedStates</ShippingService>
        <ShipToLocation>US</ShipToLocation>
    </InternationalShippingServiceOption>
    <InternationalShippingServiceOption>
        <ShippingServicePriority>2</ShippingServicePriority>
        <ShippingServiceCost>69.32</ShippingServiceCost>
        <ShippingServiceAdditionalCost>29.00</ShippingServiceAdditionalCost>
        <ShippingService>CA_UPSWorldWideExpedited</ShippingService>
        <ShipToLocation>Americas</ShipToLocation>
        <ShipToLocation>TW</ShipToLocation>
        <ShipToLocation>Asia</ShipToLocation>
        <ShipToLocation>AU</ShipToLocation>
        <ShipToLocation>MX</ShipToLocation>
        <ShipToLocation>DE</ShipToLocation>
        <ShipToLocation>FR</ShipToLocation>
        <ShipToLocation>Europe</ShipToLocation>
        <ShipToLocation>GB</ShipToLocation>
        <ShipToLocation>JP</ShipToLocation>
    </InternationalShippingServiceOption>
</ShippingDetails>

使用这些运输详细信息的示例清单可以在。请注意,该项目可能不再存在。

An example listing using these shipping details can be found here. Note that this item may no longer exist.

这篇关于XML eBay交易API-具有多个运输选项的addItem的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-15 07:41