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]: USPS buy Pickup API call throwing error "Invalid name. Please check for any special characters." #303

Closed
k0m09dx opened this issue Mar 9, 2024 · 4 comments
Labels
need info Waiting on further information or response

Comments

@k0m09dx
Copy link

k0m09dx commented Mar 9, 2024

Software Version

7.1.0

Language Version

17

Operating System

Ubuntu Linux

What happened?

  1. Create Pickup Request for USPS.
  2. From the response object select the respective Carrier and Service name to make buy Pickup api call.
  3. Getting error as "Invalid name. Please check for any special characters."
    ...

What was expected?

Expected that Error objects should specify that the error property name for that the API call is failing instead of the generic fallback of "Invalid name. Please check for any special characters."

Sample Code

Map<String, Object> requestPayload =  new HashMap<>();
requestPayload.put("carrier", "USPS");
requestPayload.put("service", "NextDay");

client.pickup.buy(pickupId, requestPayload);

Relevant logs

CODE = PICKUP.BUY.FAILED
MESSAGE = Invalid name. Please check for any special characters.

StackTrace:
com.easypost.exception.API.BadRequestError: Invalid name. Please check for any special characters.
	at com.easypost.http.Requestor.handleAPIError(Requestor.java:676)
	at com.easypost.http.Requestor.httpRequest(Requestor.java:610)
	at com.easypost.http.Requestor.request(Requestor.java:504)
	at com.easypost.http.Requestor.request(Requestor.java:448)
	at com.easypost.service.PickupService.buy(PickupService.java:121)
@k0m09dx k0m09dx added the triage Issue is being researched label Mar 9, 2024
@Justintime50
Copy link
Member

Hey @k0m09dx, thanks for writing in. Is the carrier and service provided above the only thing present in the requestPayload? What is the pickupId you are using? Are there any additional pieces of sample code you could share that hasn't been yet that may help us in reproducing this issue?

@k0m09dx
Copy link
Author

k0m09dx commented Mar 11, 2024

Hi @Justintime50 I followed the steps mentioned in the Doc .FYR: https://www.easypost.com/docs/api/java#buy-a-pickup.
Language: Java(17).
you can try the same with below Id
Environment: test
Pickup Id: pickup_2861e54ae5ba413baa9ce785f4ca634b
Shipment Id: shp_9e76a9a04e234b4a8248d6f61da3c55b

@Justintime50
Copy link
Member

What happens if you try with a new shipment that has a corrected address "name" field? It appears there is a 2 in the name field which may be leading to this error with USPS? See Koushik2 Mondal in the response. Let me know if that works as expected once corrected.

@nwithan8 nwithan8 added need info Waiting on further information or response and removed triage Issue is being researched labels Mar 18, 2024
@k0m09dx
Copy link
Author

k0m09dx commented May 2, 2024

Sorry for the delayed response. the above issue fixed.

@k0m09dx k0m09dx closed this as completed May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need info Waiting on further information or response
Projects
None yet
Development

No branches or pull requests

3 participants