Trouble splitting orders via api v3

I am attempting to split an order in our “testing account” - an account we had set up and Ordoro imported some test orders for us.

Here is the URL I’m trying to split against:
https://api.ordoro.com/v3/order/M-900/split/

My data is:
{
“split_orders”: [
{
“lines”: [
{
“line_id”: 65899142,
“quantity”: 1
},
{
“line_id”: 65899143,
“quantity”: 0
}
]
},
{
“lines”: [
{
“line_id”: 65899142,
“quantity”: 2
},
{
“line_id”: 65899143,
“quantity”: 2
}
]
}
]
}

I’m specifying content-type of application/json, and I’m able to call the other “order” API’s successfully. Do you see anything I’m doing wrong?

Thank you!!

Hi there! Looks like you’ve got a trailing slash on your url, if you remove that, you should be good to go :slightly_smiling_face:

That did it. Thanks.

I have an additional question in regard to splitting orders.

Here’s the test scenario I’ve set up:

  • Order M-700 has three line items, qty’s 1, 1, and 2.
  • I am shipping in “3 separate shipments”, each only qty 1, so I expect a final split order awaiting fulfillment with a qty of 1 (where it was 2, before.)
  • I ran this test, and it shipped the first two shipments, but now it is failing on trying to split the final one.
  • In order, the orders currently are:
  • M-700-1 – this is the one with qty 2, awaiting fulfillment.
  • M-700-2 – this has been shipped.
  • M-700-3 – this has been shipped.- The error is when I’m trying to split M-700-1 so I can ship the “qty 1” against it.

Here is my API call. Can you see or explain why this is happening?

https://api.ordoro.com/v3/order/M-700-1/split

{

“split_orders”: [

{

“lines”: [

{

“line_id”: 72188682,

“quantity”: “1”

}

]

},

{

“lines”: [

{

“line_id”: 72188682,

“quantity”: 1

}

]

}

]

}

{

“response”: “400”,

“response_json”: “”

}"

Thanks,
John

I have an additional question in regard to splitting orders.

Here’s the test scenario I’ve set up:
• Order M-700 has three line items, qty’s 1, 1, and 2.
• I am shipping in “3 separate shipments”, each only qty 1, so I expect a final split order awaiting fulfillment with a qty of 1 (where it was 2, before.)
• I ran this test, and it shipped the first two shipments, but now it is failing on trying to split the final one.
o In order, the orders currently are:
 M-700-1 – this is the one with qty 2, awaiting fulfillment.
 M-700-2 – this has been shipped.
 M-700-3 – this has been shipped.
o The error is when I’m trying to split M-700-1 so I can ship the “qty 1” against it.

Here is my API call. Can you see or explain why this is happening?

https://api.ordoro.com/v3/order/M-700-1/split
{
“split_orders”: [
{
“lines”: [
{
“line_id”: 72188682,
“quantity”: “1”
}
]
},
{
“lines”: [
{
“line_id”: 72188682,
“quantity”: 1
}
]
}
]
}
{
“response”: “400”,
“response_json”: “”
}"

Thanks,
John

John,

Based on our experience, when you call the split endpoint, all iterations of the split have to be included in the body of the request. In addition to that , the sum or aggregation of the line level quantiles have to balance to the original order line quantities. And then just to save you some time, You cannot split a “split order”. :slight_smile: Good Luck…

Hi John, you should be able to successfully split an order that has already been split, and I confirmed that with the same scenario you described.

It looks like you are passing one of the quantity fields as a string when a number is expected. If you update it as below, you should get a successful response:

https://api.ordoro.com/v3/order/M-700-1/split
{
“split_orders”: [
{
“lines”: [
{
“line_id”: 72188682,
“quantity”: 1
}
]
},
{
“lines”: [
{
“line_id”: 72188682,
“quantity”: 1
}
]
}
]
}

Savanna, thank you very much. I had discovered what you are now showing me earlier this morning, and coerced the values to int and successfully split the order.

So to add my agreement to your response, you definitely can split an order that has been split.

This splitting has been a little complicated, especially because new line item id’s are created for the split order, which kind of orphans it from what’s in our system, but since the original order contains the original ID’s, I’m able to use the SKU to cross-ref to the split order line item ID’s, and distribute everything properly to keep up with what “new” id to ship against.

I think we’re finally at the point where we’re able to support multiple shipments successfully, so that’s awesome.

Thanks so much!

John

David, thank you for your input. I found that I was actually able to split a “split order,” but there are several complications to the whole thing that I’m sure have left us all scratching our heads. In this situation, it turns out I had passed a “quantity” as a string rather than an int. It was your comments below that caused me to notice this while I was trying to add the rest of the line items in.

Thanks so much,

John