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

[Bug]: can't pass in endshipperId parameter when buying a shipment #478

Closed
stevensecreti opened this issue Sep 27, 2024 · 5 comments · Fixed by #479
Closed

[Bug]: can't pass in endshipperId parameter when buying a shipment #478

stevensecreti opened this issue Sep 27, 2024 · 5 comments · Fixed by #479
Labels
triage Issue is being researched

Comments

@stevensecreti
Copy link

Software Version

7.5.2

Language Version

Typescript 5.6.2, NodeJS 20.11.0, npm 10.8.1

Operating System

N/A, issue recreated on Windows 11, latest MacOS

What happened?

  1. Began following endshipper guide here while building peer-to-peer platform https://docs.easypost.com/guides/endshipper-guide
  2. Followed setup instructions, went to pass endshipperId to EasyPost Node.js module, Shipment.buy call
    3.Typescript error: Expected 2-3 arguments, but got 4.ts(2554)

Our Code:

image
image

EasyPost Node.JS Module Code:

  • Shipment.d.ts:
    image

What was expected?

According to this guide, we should be able to pass the endshipper id (received from EasyPost) here, when buying a shipment.

Sample Code

const client = new EasyPost(process.env.EASYPOST_API_KEY as string);
client.addRequestHook(logOutgoingRequest);
client.addResponseHook(logResponse);
return client;


const boughtShipment: Shipment = await client.Shipment.buy(
	shipment.id,
	rate,
	insurance,
	endshipperId,
	//TODO: Contact EasyPost and Figure out how to pass in endshipperId here
);

Relevant logs

None, typescript error.
@stevensecreti stevensecreti added the triage Issue is being researched label Sep 27, 2024
@HottieHotton
Copy link

Hey Eng, Braxton here from Technical Support! The customer originally reached out to Support about this, and it looks like this should work but we may not be mapping it correctly somehow.

I can confirm the user is on the latest version of the NodeJS library as well! Let me know if you have any questions on my end!

@nwithan8
Copy link
Contributor

The function is set up to accept an optional EndShipper ID, but the TypeScript documentation is outdated. Functionally, it should work, unless TypeScript violations are halting your application from compiling.

We are patching the TypeScript definition currently.

@stevensecreti
Copy link
Author

@nwithan8 do you have an ETA on when a release with these changes is created?

@nwithan8
Copy link
Contributor

nwithan8 commented Oct 1, 2024

@nwithan8 do you have an ETA on when a release with these changes is created?

We are drafting up a release currently, hope to get it out either today or tomorrow.

@nwithan8
Copy link
Contributor

nwithan8 commented Oct 3, 2024

@stevensecreti v7.5.3 is now available and features the fixed TypeScript definition.

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

Successfully merging a pull request may close this issue.

3 participants