3

我正在尝试通过http://production.shippingapis.com/ShippingAPI.dll上的 USPS API 获取国际运费报价我有一个用户名和帐号,并且可以成功地使用 API 来获取国内运费报价。不过,我找不到国际费率报价的信息。

USPS 网站似乎无处可去,当然也无助于找到我需要的东西。

这是 USPS 开发指南 PDF 的链接。我没有看到任何有关国际运输的信息。 https://www.usps.com/webtools/_pdf/Development-Guide-v3-1.pdf

您在哪里可以获得有关获取 USPS 国际运费报价的信息?

4

1 回答 1

7

我认为有各种 API。查看 USPS.COM的电子商务 API 技术指南网站。我看到了这个费率计算器技术指南

调用的类型为:

http://production.shippingapis.com/ShippingAPI.dll?API=InitRateV2&XML= ...

那里有规格和样品电话。

这是一个示例请求:

<IntlRateV2Request USERID="xxx">
  <Package ID="1ST">
    <Pounds>15</Pounds>
    <Ounces>0</Ounces> 
    <Machinable>True</Machinable> 
    <MailType>Package</MailType>
    <GXG>
          <POBoxFlag>Y</POBoxFlag>
          <GiftFlag>Y</GiftFlag>
    </GXG>
    <ValueOfContents>200</ValueOfContents>
    <Country>Canada</Country>
    <Container>RECTANGULAR</Container>
    <Size>LARGE</Size>
    <Width>10</Width>
    <Length>15</Length>
    <Height>10</Height>
    <Girth>0</Girth>
    <CommercialFlag>N</CommercialFlag>
  </Package>
  <Package ID="2ND">
    <Pounds>0</Pounds>
    <Ounces>3</Ounces>
    <MailType>Envelope</MailType>
    <ValueOfContents>750</ValueOfContents>
    <Country>Algeria</Country>
    <Container></Container>
    <Size>REGULAR</Size>
    <Width></Width>
    <Length></Length>
    <Height></Height>
    <Girth></Girth>
    <CommercialFlag>N</CommercialFlag> 
  </Package>
</IntlRateV2Request> 

样本响应非常大并且在文档中,但看起来像

<IntlRateV2Response>
   <Package ID="1ST">
    <Prohibitions>An issue of a publication <!--2143 suppressed-->.</Prohibitions>  
    <Restrictions>Coins; banknotes; curren<!--1558 suppressed--> </Restrictions>  
    <Observations>1. Banknotes valued at <!--3059 suppressed-->.</Observations>  
    <CustomsForms>First-Class Mail Intern <!--358 suppressed-->)</CustomsForms>  
    <ExpressMail>Country Code: CA Recipro<!--2036 suppressed--> </ExpressMail>  
    <AreasServed>Please reference Express Mail for Areas Served.</AreasServed>  
    <AdditionalRestrictions>No Additional Restrictions Data found.</AdditionalRestrictions>  
      <Service ID="4">
        <Pounds>15</Pounds>  
      <Ounces>0</Ounces>  
      <Machinable>True</Machinable>  
      <MailType>Package</MailType>  
          <GXG>
        <POBoxFlag>Y</POBoxFlag>          <GiftFlag>Y</GiftFlag>  
      </GXG>
      <Container>RECTANGULAR</Container>  
      <Size>LARGE</Size>  
      <Width>10</Width>  
      <Length>15</Length>  
      <Height>10</Height>  
      <Girth>0</Girth>  
      <Country>CANADA</Country>  
      <Postage>112.50</Postage>  
         <ExtraServices>
            <ExtraService>
          <ServiceID>1</ServiceID>  
          <ServiceName>Insurance</ServiceName>  
          <Available>True</Available>  
          <Price>1.00</Price>  
        </ExtraService>
      </ExtraServices>
      <ValueOfContents>200.00</ValueOfContents>  
      <SvcCommitments>1 - 3 business days</SvcCommitments>  
      <SvcDescription>Global Express Guaranteed&lt;sup&gt;&amp;reg;&lt;/sup&gt; (GXG)**</SvcDescription>  
      <MaxDimensions>Max. length 46", width 35", height 46" and max. length plus girth combined 108"</MaxDimensions>  
      <MaxWeight>70</MaxWeight>  
   </Service> 
</Package>
</IntlRateV2Response>
于 2011-08-03T20:54:53.010 回答