The problem is always I am getting an error like
Exception when calling OrdersApi->createOrder:[HTTP/2 401] {“errors”: [{“code”: “UNAUTHORIZED”,“detail”: “This request could not be authorized.”,“category”: “AUTHENTICATION_ERROR”}]} which obviously is an authentication issue.
That error normally happens if the credentials and base path URL aren’t configured correctly to the environment you are targeting. Is this in production or sandbox you are trying to create the order?
Were did you get the link to that page? The information on the page isn’t correct. It has you get the application ID but the code sample is asking for the access token. The getting started for orders is in the Create Orders of our Documentation site.
What is that code sample in that page for then?
OK, trying to explain in depth. I am trying to create an order within Square from a woocommerce website that is connected already with square. So when a order is placed through the website, everything goes pretty well, transaction showing up on square account dashboard, BUT NOT AS AN ORDER, SO I NEED TO CREATE THE ORDER BASED UPON THE ORDER FROM THE WEBSITE.
That code looks like it’s from our deprecated SDKs. Was there a public site that provided the link to the page?
If the payment is showing in the Transactions section of the Dashboard from a completed payment from the WooCommerce integration you unfortunately won’t be able to add an order_id to the payment because one is already associated to the payment. At this time only orders that have a fulfillment and have been fully paid for will show in the Orders section of the Dashboard.
Right, but a fulfillment is also required for it to show in the Orders section of the Dashboard. If the WooCommerce isn’t creating the order with the fulfillment then it won’t show in Orders.
The order can be updated with a fulfillment with UpdateOrder if it’s not completed. I believe that all the orders from the WooCommerce integration are completed if you aren’t using delay capture. I you are using delay capture you would need to get the order from the payment and add a fulfillment then capture the payment.
Yes indeed all orders through WC are completed and look for a solution to populate the Orders in Square with orders from WC and not sure where should I start.
Unfortunately this is a limitation with the WooCommerce integration and they will need to add fulfillments to orders to have them all show in the Orders section of the Dashboard.
The order created is hard coded not taken from a user input, also I am able to retrieve the orders using the API, but for no reason they don’t show up on Square dashboard. I do not know what to do. Yes it has fulfillment.