Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid Child Element – Pricing Rate #5

Open
nathanaelphilip opened this issue Dec 29, 2020 · 2 comments
Open

Invalid Child Element – Pricing Rate #5

nathanaelphilip opened this issue Dec 29, 2020 · 2 comments

Comments

@nathanaelphilip
Copy link

nathanaelphilip commented Dec 29, 2020

Code:

const rate = await usps.pricingRateV4({
      ZipOrigination: '36801', // move to env?
      ZipDestination: '70525',
      Pounds: 5,
      Ounces: 1,
      Container: '',
      Service: 'First Class'
})

Error:

The element 'Package' has invalid child element 'Container'. List of possible elements expected: 'Service'.

I can’t seem to shake it. I’v tried different combinations.

@Sparticuz
Copy link
Owner

I've never used this function since rewriting it. The USPS might have updated their API since MadisonReed's last commit. I will look at this, but have no ETA. I would appreciate a PR with a test to fix.

@Sparticuz
Copy link
Owner

I have no idea what's going on with this api. My code looks correct, but I'm still getting the error. If someone contacts the USPS about this, let me know. Here is the latest updated code with types from https://www.usps.com/business/web-tools-apis/rate-calculator-api_files/rate-calculator-api.htm

https://github.com/Sparticuz/usps-webtools-promise/tree/pricing-rate

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

No branches or pull requests

2 participants