Order number with "/" API response "Internal server error"

I’ve got an issue with “/” in Order number.

the Order number’s string got “/” which cause the bad URL.

e.g. Order number “M-00588371/002” got “/” in it and when API create a URL to mark this order as Shipped or for other operations the URL string

“ var uriBuilder = new UriBuilder(APISettings.APIURL + $"/order/{OrderNumber}/mark_as_shipped"); ”



you can see this is the Bad URL as API think the Order number is “M-00588371” and after “/” are the actions and that’s why API return with “Order number Not Found” as response of above URL.

screenshot “Order Number with Bad API URL.png” for more details

When I search this Order number on Ordoro’s dashboard it converted the “/” in Order number to “%2F”

screenshot “Order Number and URL.png”

So, I tried the same method but it failed and API returned with “Internal Server Error” Message

screenshot “Internal Server Error.png”

Can you please confirm how to resolve issue?

Thank you

Screenshots uploaded to Google drive:

Can you please send an example of the request and response using CURL or a similar tool? That will help us eliminate the UriBuilder as a potential source of the problem. In the response you should see a header titled X-API-REQUEST-ID which should also include in your reply to help us diagnose any issues on our end.

Hi syrok.

Request URL: https://apiverson.ordoro.com:443/order/M-00588371/002/mark_as_shipped

In Response:

X-API-REQUEST-ID = 114e2b2d-4b14-4281-a78d-8fc467f1275a

screenshot: X-API-REQUEST-ID.png - Google Drive

Thank you

I found the request in our logs and it looks like things might be getting double encoded: /order/M-00588371%252F002/mark_as_shipped

Were you able to make the request using CURL?

Hi syork,

I tried it with cURL and it seems to be working fine.
as it return with following response
“{“error_message”: “A tracking for shipment ‘M-00588371/002-1’ already exists.”, “param”: null}”

Can you please guide me what I’m doing wrong in C# code? and how to resolve this issue?

Thank you

cURL response:

Ah, it appears that order has already been shipped. Once an order has been shipped it cannot be shipped again without first deleting any labels or tracking. Since this order was probably just marked as shipped or had tracking manually applied, you can use the DELETE /order/<order_number>/shipping_info endpoint to unship it.

Hi syrok,

that’s the response when request sent by cURL.

but if same request sent by C# (httpclient) code it return with “Internal server error” (see my first post with more details)

Can you please confirm what’s wrong in C# code as you can see the code snippet in previous post of mine.

Thank you

Unfortunately I cannot help you with your code. You can probably reach out on a C# specific programming forum to see why the request is getting encoded incorrectly.