x

BatchRetreiveOrders in sandbox

Is it possible to use BatchRetrieveOrders in Sandbox?
this is the code I'm using:

$body = new \SquareConnect\Model\BatchRetrieveOrdersRequest(); 
$body->setOrderIds(['CBASEO0b4bbWpum1aleKACATKzg']);
$result = $client->batchRetrieveOrders($location_id, $body);
var_dump($result);


I get this response:

object(SquareConnect\Model\BatchRetrieveOrdersResponse)#9 (2) { ["orders":protected]=> NULL ["errors":protected]=> NULL }

The order id I'm using came from an order placed in sandbox, from the URL on the redirect URL:
checkoutId=CBASEO0b4bbWpum1aleKACATKzg&session_id=123&transactionId=CMzyOm702NumugckHC1J63UjDb4F

I'm expecting to get an Order model back, but get NULL instead.
Suggestions?

497 Views
Message 1 of 2
Report
1 REPLY 1
Square Community Moderator

Hi @ourgourmetlife! Welcome to the Community.

 

I reached out to someone on our API team with your inquiry and this was their response:

 

After searching our internal logs, the order id they provided (CBASEO0b4bbWpum1aleKACATKzg) isn’t an order id - it’s a checkout id. Since they’re using create checkout, the checkout should have an order object with an id on it. In this case the order is actually CMzyOm702NumugckHC1J63UjDb4F1 for that checkout.

 

Hope this helps!

Ashley C
Community Moderator, Square
Sign in and click Mark as Best Answer if my reply answers your question.
450 Views
Message 2 of 2
Report