0

I keep getting this error when executing a transaction on rate object id's that were created a few days ago.

{
  "source": "USPS",
  "code": "",
  "text": "The selected shipment date must be within 7 days of 02/15/2017, 07:11PM CST."
}

Im integrating shippo with my Node.js web application. I am using shippo node.js library.

shippo.shipment.create({, function(err, shipment) {});

I built a basic store. When user gets to checkout section, I get rates from shippo. I display those rates to the user. The user chooses which rate he wants. I save the rate object id to a database.

shippo.transaction.create({, function(err, transaction) {});

I fulfill the order and print the shipping label. The application goes to the database and retrieves rate object id to execute the transaction with shippo. In return Im suppose to get a tracking # and label information, but instead I get the error.

I first thought that the rate object id only last 7 days and then expires on its own or something. When I checked the rate object id:

https://api.goshippo.com/rates/2a0b50cbc5184362a0ea2385b490bc7b

It shows object was created 2/18. Today is the 2/21. So that cant be. The error says "The selected shipment date must be within 7 days of 02/15/2017, 07:11PM CST."

What does it mean? Why did I get it?

It seems to only happen to rate object id's that were create 2+ days ago. If the rate object id was created yesterday, I could still execute the transaction no problem.

screenshot

  • which line is actually erroring? `shippo.transaction.create`? could be a problem with shippo itself, or something misconfigured in your account – Andy Ray Feb 22 '17 at 00:54
  • yes: shippo.transactoin.create. I attached a screenshot. It says the error source is : USPS. Im just hoping someone from Shippo can chime in. I was told by their support that I should ask my question here. – doodooface Feb 22 '17 at 01:12
  • Is this only happening for you on shipments that were created a day or two in the past? Generally, if you plan on shipping something, you would want to create the shipment and create the label on the same date. Otherwise you'll want to set your shipment date in the future (this is also called the submission_date in Shippo) https://support.goshippo.com/hc/en-us/articles/204914735-Is-my-label-still-valid-if-the-shipment-date-has-passed – mootrichard Feb 22 '17 at 01:26
  • @mootrichard yes only the rate objects from the past. I create the shipment object to get the rates, each rate has its own object id. Nothing is executed until I submit that rate object id with the transaction object. From there Shippo should respond with tracking # and other info. I submit the transaction object during shipping time because I will need the label and tracking # to put on the box after assembled. Im wondering if its because I got the rate a previous day, and on the day I execute it, the rate has changed causing this error. – doodooface Feb 22 '17 at 02:44
  • @mootrichard thank you for that link. It helped clear things up. – doodooface Feb 22 '17 at 02:49

1 Answers1

0

It looks like you are using a rate from the past (not the same day) that is causing this error to occur.

When you make a shipment at the /shipments/ endpoint, you are able to specify the submission_date when creating the shipment. If you do not specify the submission_date (you would generally only do this if you know the day you plan on shipping the item out), Shippo automatically sets the submission_date to the date the request is being made.

The reason that you are getting an error, is that you're using a rate for a shipment that has a submission_date in the past. Some carriers will only permit a submission date that is the current date, or some date in the future.

You can find more details here on the shipment object that might help.

mootrichard
  • 3,581
  • 13
  • 25