Skip to content
This repository has been archived by the owner on Apr 25, 2024. It is now read-only.

Getting "The data you sent was not accepted as valid" on valid Rate ID #66

Open
jousi592 opened this issue Oct 17, 2020 · 3 comments
Open

Comments

@jousi592
Copy link

jousi592 commented Oct 17, 2020

I am trying to test your transactions endpoint to purchase a label, however it keeps returning that my data was not valid.
Which is strange, because when I fetch the shipment by ID, I can clearly see that it contains the rate that I am trying to purchase.
Is there something I am missing?

This is what I am sending:
{ rate: 'a56493b1f836482e94b89fb9d6261267', label_file_type: 'PDF', async: false }
This is my implementation:

shippo_instance.transaction.create({
    rate: rate_id,
    label_file_type: "PDF",
    async: false
  }, async (error, transaction) => {
    if (error) return res.send(create_api_message("danger", error.message))

    try {
      const label = await shippo_instance.transaction.retrieve(transaction.object_id);
  
      res.send(label)
    } catch ({ message }) {
      res.send(create_api_message("danger", message))
    }
  });
@babyrusa
Copy link

Having the same issue too. I think the api mistakens this call with the Instant label call (https://goshippo.com/docs/reference/js#transactions-create-instant) but idk how to fix

@babyrusa
Copy link

@jousi592 have u figured out the fix for this?

@babyrusa
Copy link

after all this time, turned out I was missing sender/reciever name when creating shipment. So make sure to doube check your name and address. I pretended to enter a non-existing address but it worked too? I guess it does not care if we enter the wrong address

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants