Order is not showing up in dashboard

My site is in php and i use square checkout. I used CheckoutApi and createCheckout() with CreateCheckoutRequest() body. Then completed payment with prebuilt checkout page from square. After completing payment, redirected to redirect_url. I can see the transaction in square dashboard with complete order details in transaction menu. But I am not able to see that order in orders menu. So I can’t send that order to shipstation. Can you pls let me know what should i do to see that order in orders menu

Thanks

Hi @Sparky welcome to the forums!

For an order to show up in the dashboard it needs to be paid for and have a fulfillment. Please make sure to include a fulfillment, or else it will not show. Example: https://developer.squareup.com/docs/orders-api/order-ahead-usecase#add-fulfillment-information-to-create-a-pickup-order

I added fulfilments in createCheckout() body and now it is showing order in order menu. But I need to save shipping address in Order. Since I am using prebuilt checkout page from square, I added shipping address from retrieveCustomer() in fulfilment in updateOrder(). But when I called updateOrder(), it gives error “”[HTTP/1.1 400 Bad Request] {“errors”: [{“code”: “VERSION_MISMATCH”,“detail”: “Supplied version 0 does not match the current version 4 of order eCSMORPww9irHs230kuXXXXRZY.”,“field”: “order.version”,“category”: “INVALID_REQUEST_ERROR”}]}
"
This is the code used:
$body = new \SquareConnect\Model\UpdateOrderRequest([
“idempotency_key”=> “9859ddc2-1b67-4e3d-a2c7-1397c40fac37”,
“order”=> [
“location_id”=> “4YXKW0JR4GNTZ”,
“fulfillments”=> [
[
“shipment_details”=> [
“recipient”=> [
“address”=> [
“address_line_1”=> $result[‘customer’][‘address’][‘address_line_1’],
“locality”=> $result[‘customer’][‘address’][‘locality’],
“administrative_district_level_1”=> $result[‘customer’][‘address’][‘administrative_district_level_1’],
“country”=> $result[‘customer’][‘address’][‘country’],
“postal_code”=> $result[‘customer’][‘address’][‘postal_code’],
“first_name”=> $result[‘customer’][‘given_name’]
],
] ] ]]
] ]);

$apiResponse = $apiInstance->updateOrder(“4YXKW0JR4GNTZ”,$result[‘transaction’][‘order_id’], $body);

Pls let me know how can i update shipping address in Order Menu in Redirect_url function
Thanks

You must have the correct order version and pass it. The best option for this would be to retrieve the order first (BatchRetrieveOrders), and then just update the parts you want to add/edit (shipment_details), and then call the UpdateOrder endpoint. This will make sure you have all the correct and up-to-date order information.

It worked. Thanks a lot for quick and detailed response

1 Like