Tag: USPS Rate Quote API

USPS Rate V4 This mail service requires Ground Transportation Only.

In March 2014 USPS required a set of new tags if wanting a quote for Parcel Post (now being called Standard Post).

To get rate quotes for Parcel Post, and Standard Post you need to make 3 changes.

  1. You need a tag of <Container> Within <Container> you also need a new tag of <ContentType>
  2. You need a new tag of <GroundOnly> immediately after <Container>
  3. You need a new tag of <Revision> right after the <RateV4Request> header.

A properly formatted RateV4Request for Parcel / Standard Post is below. Bold Entries are what are required as of 7 March 2014 to quote USPS Parcel Post. Note Parcel is acceptable (in place of Standard Post) until July 2014. You may also omit the Content tags if shipping LARGE packages (ones too large for Priority Mail). See the USPS Webtool API docs for the required values. I’m writing this up because I added the Content and GroundOnly tags and fought for hours until I realized the Revision tags was also required as the Error Message of:

This mail service requires Ground Transportation Only. HelpContext 1000440

was not very informative.

USPS RateV4Request for Standard Post and Parcel Post

<RateV4Request USERID="xxxxxx" PASSWORD="xxxx">
<Revision>2</Revision>
<Package ID="0">
<Service>STANDARD POST</Service>
<ZipOrigination>10001</ZipOrigination>
<ZipDestination>21201</ZipDestination>
<Pounds>6</Pounds>
<Ounces>2</Ounces>
<Container>RECTANGULAR</Container>
<Size>REGULAR</Size>
<Content><ContentType>HAZMAT</ContentType></Content>
<GroundOnly>TRUE</GroundOnly>

<Machinable>TRUE</Machinable>
….

USPS Web Tools API Issue with Regional Rate Boxes

If you’re programming for the USPS Web Tools for the Regional Rate A, B and C boxes and get the error:
REGIONALRATEBOXA is an invalid container type for a REGULAR package and PRIORITY service.

You need to change the Service to PRIORITY COMMERCIAL. This isn’t in the documentation and no-one at the technical support center will know the answer. It took three weeks of fighting this error to figure it out.

Sample with error:
<RateV4Request USERID="SECRET" PASSWORD="xxxxxxxxx">
<Package ID="0">
<Service>PRIORITY</Service>
<ZipOrigination>20852</ZipOrigination>
<ZipDestination>53110</ZipDestination>
<Pounds>15</Pounds><Ounces>11</Ounces>
<Container>REGIONALRATEBOXA</Container>
<Size>REGULAR</Size>
<Machinable>True</Machinable>
</Package>
</RateV4Request>

<RateV4Response>
<Package ID="0">
<Error>
<Number>-2147219407</Number>
<Source>DomesticRatesV4;clsRateV4.ValidateContainer;RateEngineV4.ProcessRequest</Source>
<Description>REGIONALRATEBOXA is an invalid container type for a REGULAR package and PRIORITY service.</Description>
<HelpFile></HelpFile>
<HelpContext>1000440</HelpContext>
</Error>
</Package>
</RateV4Response>


If done with priority commercial will get a price:
<RateV4Request USERID="SECRET" PASSWORD="xxxxxxxxx">
<Package ID="0">
<Service>PRIORITY COMMERCIAL</Service>
<ZipOrigination>20852</ZipOrigination>
<ZipDestination>53110</ZipDestination>
<Pounds>15</Pounds><Ounces>11</Ounces>
<Container>REGIONALRATEBOXA</Container>
<Size>REGULAR</Size>
<Machinable>True</Machinable>
</Package>
</RateV4Request>


Solves the problem with these two related errors as well:
REGIONALRATEBOXB is an invalid container type for a REGULAR package and PRIORITY service.
REGIONALRATEBOXC is an invalid container type for a REGULAR package and PRIORITY service.