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

**URL:** <https://forums.ordoro.com/t/order-number-with-api-response-internal-server-error/681>\
**Category:** Bug Reports\
**Created:** [April 7, 2021, 8:18am UTC](https://forums.ordoro.com/t/order-number-with-api-response-internal-server-error/681 "2021-04-07T08:18:46Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Usman](https://avatars.discourse-cdn.com/v4/letter/u/b487fb/32.png) [@Usman](https://forums.ordoro.com/u/Usman)\
**Post date:** [April 7, 2021, 8:18am UTC](https://forums.ordoro.com/t/order-number-with-api-response-internal-server-error/681/1 "2021-04-07T08:18:46Z")

</div>

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"); ”

Becomes

[https://apiverson.ordoro.com:443/order/M-00588371/002/mark\_as\_shipped](https://apiverson.ordoro.com:443/order/M-00588371/002/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:  
[https://drive.google.com/drive/folders/1ny-\_ULLxCSwn2Nw9MfEkDQKN0UHwTKla?usp=sharing](https://drive.google.com/drive/folders/1ny-_ULLxCSwn2Nw9MfEkDQKN0UHwTKla?usp=sharing)

---

<div class="post-metadata">

**Author:** ![syork](https://yyz1.discourse-cdn.com/flex029/user_avatar/forums.ordoro.com/syork/32/61_2.png) [@syork](https://forums.ordoro.com/u/syork)\
**Post date:** [April 7, 2021, 2:28pm UTC](https://forums.ordoro.com/t/order-number-with-api-response-internal-server-error/681/2 "2021-04-07T14:28:27Z")

</div>

Hi,  
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.

---

<div class="post-metadata">

**Author:** ![Usman](https://avatars.discourse-cdn.com/v4/letter/u/b487fb/32.png) [@Usman](https://forums.ordoro.com/u/Usman)\
**Post date:** [April 8, 2021, 2:06pm UTC](https://forums.ordoro.com/t/order-number-with-api-response-internal-server-error/681/3 "2021-04-08T14:06:50Z")

</div>

> [@syork](#):
>
> X-API-REQUEST-ID

Hi syrok.

Request URL: [https://apiverson.ordoro.com:443/order/M-00588371/002/mark\_as\_shipped](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](https://drive.google.com/file/d/1tJbMcPJXttHB3l42Rub2nKuzlJH3NUO0/view?usp=sharing)

Thank you

---

<div class="post-metadata">

**Author:** ![syork](https://yyz1.discourse-cdn.com/flex029/user_avatar/forums.ordoro.com/syork/32/61_2.png) [@syork](https://forums.ordoro.com/u/syork)\
**Post date:** [April 8, 2021, 3:53pm UTC](https://forums.ordoro.com/t/order-number-with-api-response-internal-server-error/681/4 "2021-04-08T15:53:34Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Usman](https://avatars.discourse-cdn.com/v4/letter/u/b487fb/32.png) [@Usman](https://forums.ordoro.com/u/Usman)\
**Post date:** [April 9, 2021, 10:41am UTC](https://forums.ordoro.com/t/order-number-with-api-response-internal-server-error/681/5 "2021-04-09T10:41:10Z")

</div>

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}”

 ![C# code snippet](https://canada1.discourse-cdn.com/flex029/uploads/ordoro/original/1X/f052f22da139ce5d5833654f5d0c4127063b1386.png)

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

Thank you

---

<div class="post-metadata">

**Author:** ![Usman](https://avatars.discourse-cdn.com/v4/letter/u/b487fb/32.png) [@Usman](https://forums.ordoro.com/u/Usman)\
**Post date:** [April 9, 2021, 10:41am UTC](https://forums.ordoro.com/t/order-number-with-api-response-internal-server-error/681/6 "2021-04-09T10:41:42Z")

</div>

cURL response:

 ![cURL Request_Response](https://canada1.discourse-cdn.com/flex029/uploads/ordoro/original/1X/3c730c95fbb73860976f1f869ef4853c6faacd40.png)

---

<div class="post-metadata">

**Author:** ![syork](https://yyz1.discourse-cdn.com/flex029/user_avatar/forums.ordoro.com/syork/32/61_2.png) [@syork](https://forums.ordoro.com/u/syork)\
**Post date:** [April 9, 2021, 2:05pm UTC](https://forums.ordoro.com/t/order-number-with-api-response-internal-server-error/681/7 "2021-04-09T14:05:44Z")

</div>

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](https://devapiverson.docs.apiary.io/#reference/order/orderordernumbershippinginfo/delete) to unship it.

---

<div class="post-metadata">

**Author:** ![Usman](https://avatars.discourse-cdn.com/v4/letter/u/b487fb/32.png) [@Usman](https://forums.ordoro.com/u/Usman)\
**Post date:** [April 9, 2021, 4:15pm UTC](https://forums.ordoro.com/t/order-number-with-api-response-internal-server-error/681/8 "2021-04-09T16:15:08Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![syork](https://yyz1.discourse-cdn.com/flex029/user_avatar/forums.ordoro.com/syork/32/61_2.png) [@syork](https://forums.ordoro.com/u/syork)\
**Post date:** [April 9, 2021, 4:18pm UTC](https://forums.ordoro.com/t/order-number-with-api-response-internal-server-error/681/9 "2021-04-09T16:18:44Z")

</div>

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.
