Getting all orders shipped after a date

I am trying to synchronize orders with a channel, so the idea is to log a “last update” timestamp and request all orders shipped after that timestamp in order to update the orders on the channel as shipped.

I see in the docs that i could use a GET request to /v3/order with ‘shipped_after’ parameter, but it does not seem to do anything. It returns all orders regardless of status or ship date (none have been shipped from ordoro yet, but marked as shipped via api because they were shipped on our current solution)

Would same solution (assuming i can get it to work) work on dropshipped orders or would I need to also do a query with same timestamp in ‘dropshipped_after’ parameter?

you probably want to filter on status. if you want shipped_after you’ll need to look at status=shipped orders

Still not working.

If I set “status” => ‘shipped’ and “shipped_after” to one hour ago, it is returning all shipped orders regardless of when shipped.

Setting the status just removed the unshipped orders. shipped_after does nothing.

Have you taken a look at our documentation? Ordoro API Documentation

Can you post an example of your request using CURL or a similar tool? In the response you should see a header titled X-API-REQUEST-ID , please post it as well so we can find the request on our end and diagnose any issues.

Yes.

The documentation is thin for this endpoint. It doesn’t specify what is expected in the “shipped_after” field. I’ve tried different date formats all with same result; returning all orders including those in “awaiting_fulfillment” status.

	$updatedTS = time() - (60*60*1);
	// date('Y-m-d\TH:m:i.uO', $updatedTS)
	// date('Y-m-d\TH:m:i.uP', $updatedTS)
	$params = array(
		"status" => 'shipped',
		"shipped_after" => date('Y-m-d\TH:m:i.uO', $updatedTS),
		"sort" => 'ship_date',
	);

[x-api-request-id] => Array([0] => 6978e4c3-7b7a-4f21-a86f-bd80cff5ec61)

Solved my own problem. For reference to anybody who might one day have this same problem and find this post:

I am declaring the parameters in an array

	$params = array(
		"status" => 'shipped',
		"shipped_after" => date('Y-m-d\TH:m:i.uP', $updatedTS),
		"sort" => 'ship_date',
	);

$updatedTS being the timestamp of the most recent synched order.

The mistake was I was posting the parameters with CURLOPT_POSTFIELDS, ie:

$url = ‘https://api.ordoro.com/v3/order’;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_USERPWD, $this->clientId . ‘:’ . $this->clientSecret);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(‘content-type: application/json’));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($params));
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, ‘GET’);

This does not work. You MUST send the parameters encoded in the url for this endpoint. ie:

$url = ‘https://api.ordoro.com/v3/order’;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url . ‘?’ . http_build_query($params));
curl_setopt($ch, CURLOPT_USERPWD, $this->clientId . ‘:’ . $this->clientSecret);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(‘content-type: application/json’));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, ‘GET’);

Also note the datetime format I used above. Ordoro is inconsistent with what format they expect from one endpoint to another, but that is the correct format for this one.

@sophie I do have further questions though.

If an order is dropshipped, then I assume this function will not work and I need to seperately query with “dropshipped_after”?

normal orders have the shipped date in $response->order->shipping_info->ship_date

would drop ship orders return the ship date the same way? I see a “dropshipping_info” in the example in the api documentation, but there is nothing populated in that example. Would it be $response->order->dropshipping_info->dropship_date? I am just guessing here and have no idea unless I create a dropshipped order to see expected response.