USPS - 如何通过 API 获取国际运费?

发布于 2024-11-27 22:11:03 字数 483 浏览 4 评论 0原文

我正在尝试通过 USPS API 获取国际运费报价 http://product.shippingapis.com/ShippingAPI .dll 我有用户名和帐号,可以成功使用 API 进行国内汇率报价。但我找不到国际汇率报价的信息。

USPS 网站似乎无处可去,而且肯定无法帮助找到我需要的东西。

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

我可以在哪里找到有关获取 USPS 国际运费报价的信息吗?

I am trying to get international shipping rate quotes via the USPS API at http://production.shippingapis.com/ShippingAPI.dll I have a username and account number and can use the API successfully for domestic rate quotes. I can't find the info for international rate quotes though.

The USPS site seems to go nowhere and certainly isn't helping find what I need.

Here is a link the the USPS development Guide PDF. I do not see anything about international shipping. https://www.usps.com/webtools/_pdf/Development-Guide-v3-1.pdf

Do you where I can the info about getting USPS international shipping rate quotes?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

み青杉依旧 2024-12-04 22:11:03

我认为有各种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<sup>&reg;</sup> (GXG)**</SvcDescription>  
      <MaxDimensions>Max. length 46", width 35", height 46" and max. length plus girth combined 108"</MaxDimensions>  
      <MaxWeight>70</MaxWeight>  
   </Service> 
</Package>
</IntlRateV2Response>

There are various API's I think. Looking at the Ecommerce API Technical Guides Website for USPS.COM. I see this Rate Calulator techinical guide:

The call is of the type :

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

And there are specs and sample calls there.

this is a sample request:

<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> 

A sample response is quite large and is in the docs, but look something like

<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<sup>&reg;</sup> (GXG)**</SvcDescription>  
      <MaxDimensions>Max. length 46", width 35", height 46" and max. length plus girth combined 108"</MaxDimensions>  
      <MaxWeight>70</MaxWeight>  
   </Service> 
</Package>
</IntlRateV2Response>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文