Kryptronic Software Support Forum

You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.

#1 06-01-2010 11:39:52

jensme
Member
Registered: 04-29-2010
Posts: 392

Step-by-Step on setting up USPS APIs?

I keep getting standard carrier information instead of USPS info.

Offline

 

#2 06-01-2010 12:35:46

susan2go
Member
Registered: 04-19-2010
Posts: 81

Re: Step-by-Step on setting up USPS APIs?

If you've set up your USPS correctly, you have to change the delivery method to USPS for each product. 

The USPS API is very easy to set up if you have a USPS username and password and the directions in the User's Guide are very clear and easy to follow.

Offline

 

#3 06-01-2010 14:29:59

jensme
Member
Registered: 04-29-2010
Posts: 392

Re: Step-by-Step on setting up USPS APIs?

Thank you - I figured it out with the user's guide (it hasn't been useful for much else, so I didn't think to check it).

However, it doesn't seem to be offering a First Class rate.  Anyone know how to do that?

Offline

 

#4 06-01-2010 15:55:48

susan2go
Member
Registered: 04-19-2010
Posts: 81

Re: Step-by-Step on setting up USPS APIs?

I have the same problem with no 1st class - only Priority Mail.  Most of what we sell ships in boxes (and ships UPS) so it doesn't apply.  We do mail free samples and I got around that problem by setting up a custom shipping method for samples charging 0.50 each to ship them.  Since you sell cards, that may be an option for you too. It was easy to do by cloning the default shipping method and changing the rate to 0.50 instead of 10.00.  Of course, I gave it a unique name.

I went through usps.php and ECOM_Ship.php and can't find the problem.  Maybe someone can help us both with that.

I set up a trial account with Intershipper and they do return 1st class rates, Unfortunately, they return 1st class rates on things that are too large for 1st class. sad  Intershipper would have been very expensive for us so I canceled our account.  I just wanted to see what they returned.

Offline

 

#5 06-01-2010 16:08:29

Dave
Member
Registered: 07-05-2003
Posts: 11233

Re: Step-by-Step on setting up USPS APIs?

First class is only available on items which weigh less than 15 ounces. If your products weigh less than that make sure you have the correct decimal value for ounces in the product details in admin.

Offline

 

#6 06-01-2010 16:13:21

susan2go
Member
Registered: 04-19-2010
Posts: 81

Re: Step-by-Step on setting up USPS APIs?

Dave, I'm using fractional pounds such as .15.  Are you saying they need to be in whole once fractions such as 0.0625, 0.125, 0.1875, etc.?

Offline

 

#7 06-01-2010 16:23:58

jensme
Member
Registered: 04-29-2010
Posts: 392

Re: Step-by-Step on setting up USPS APIs?

Same question.  Mine weigh a single ounce, which I show as .0625.  Will that not work?

Offline

 

#8 06-01-2010 16:45:45

susan2go
Member
Registered: 04-19-2010
Posts: 81

Re: Step-by-Step on setting up USPS APIs?

I just set up a test product that weighs 0.0625 with dims of 5 x 5 x 0.0625 and no joy on 1st class.  Is this a bug?

Last edited by susan2go (06-01-2010 16:46:16)

Offline

 

#9 06-01-2010 17:42:40

dh783
Member
From: Avondale, Arizona
Registered: 04-06-2005
Posts: 6233
Website

Re: Step-by-Step on setting up USPS APIs?

Do you have the method activated at System Dashboard > Store > Shipping > Realtime Services?

John

Offline

 

#10 06-01-2010 17:50:21

susan2go
Member
Registered: 04-19-2010
Posts: 81

Re: Step-by-Step on setting up USPS APIs?

Oh, I see that now!  It was set for "false."  How did I miss those 2 paragraphs on page 122 of the manual... .)

Yep, it works, but it is charging $1.22 to mail a sample that fits in an envelope.  I wonder why?

Last edited by susan2go (06-01-2010 17:54:41)

Offline

 

#11 06-01-2010 17:53:36

jensme
Member
Registered: 04-29-2010
Posts: 392

Re: Step-by-Step on setting up USPS APIs?

Okay.  Another problem.

It looks like it's giving you the rates WITH delivery confirmation - which I don't want to offer.  How do I allow essentially letter-sending?  A $0.44 stamp, basically?

Offline

 

#12 06-01-2010 18:18:14

susan2go
Member
Registered: 04-19-2010
Posts: 81

Re: Step-by-Step on setting up USPS APIs?

According to the API documentation, there are 3 types of 1st class:

<Service/> <FirstCl.../> <Size/> <Container/> <Machinable/> Dimensions <Girth/> <ShipDate/> Max. Weight
First Class Letter Ignored Ignored Required Ignored Ignored Ignored 3.5 oz.
First Class Flat Ignored Ignored Required Ignored Ignored Ignored 13 oz.
First Class Parcel Ignored Ignored Ignored Ignored Ignored Ignored 13 oz.

Machinable is a required field for a 1st class letter rate it seems.  I haven't tried turning on debug to see what is going on.

This is the xml required for a 1st class letter:

<RateV3Request USERID="xxx">
<Package ID="1ST">
<Service>FIRST CLASS</Service>
<FirstClassMailType>LETTER</FirstClassMailType>
<ZipOrigination>44106</ZipOrigination>
<ZipDestination>20770</ZipDestination>
<Pounds>0</Pounds>
<Ounces>3.5</Ounces>
<Size>REGULAR</Size>
<Machinable>true</Machinable>
</Package>

It may be easier to crate a custom shipping method for 1st class letters.

Last edited by susan2go (06-01-2010 18:22:39)

Offline

 

#13 06-01-2010 18:21:10

jensme
Member
Registered: 04-29-2010
Posts: 392

Re: Step-by-Step on setting up USPS APIs?

You are all so much smarter than me.  I don't even know what you're talking about!!!  Though it looks like it might be XML.

Offline

 

#14 06-01-2010 18:39:17

susan2go
Member
Registered: 04-19-2010
Posts: 81

Re: Step-by-Step on setting up USPS APIs?

jensme wrote:

You are all so much smarter than me.  I don't even know what you're talking about!!!  Though it looks like it might be XML.

Honey, I've been doing this stuff forever it seems.  You're a relative newb. Being a webmonkey is only impressive in places like this. smile

I couldn't see the xml output in the debugger, but I feel sure that the cart has no way to discern if you are sending a machinable letter so I imagine USPS is returning 1st class parcel rate, the only first class rate that does not require the machinable field.  I could be wrong, but this is the logical conclusion.

Offline

 

#15 06-01-2010 18:59:26

jensme
Member
Registered: 04-29-2010
Posts: 392

Re: Step-by-Step on setting up USPS APIs?

I've been doing it for 15 years.  Still don't know what the hell you're talking about.  But I am little more than a glorified designer who can take free code and turn it into something else.

Sometimes.

Any idea how I could tell it it's machinable?

Offline

 

#16 06-01-2010 19:41:21

susan2go
Member
Registered: 04-19-2010
Posts: 81

Re: Step-by-Step on setting up USPS APIs?

I found this in usps.php

$machinable = 'True';

I tried changing it to
$machineable = 'true';

I even hardcoded "LETTER" into the code and still got the same result:

if ($service == 'First Class') {
                    $xml .= '<FirstClassMailType>' . 'LETTER' . '</FirstClassMailType>';
               }

So I have not a clue why this is happening.

I went to the USPS site and tried mailing the same item in all the different 1st class envelope sizes and none of them came to what the cart calculated: $1.22.

Eureka: I tried mailing a package weighing 1 oz and the result:

First-Class MailŪ Package [More info about First-Class MailŪ Package]
    1 day    $1.22

So, in my case, the script is returning the value for a First-Class Mail package and obviously the script is not coding the package as a letter.

Last edited by susan2go (06-01-2010 20:25:03)

Offline

 

Board footer