Custom Integration Cart - Order added via API has odd prefix and is not found in UI

Hello,
We have been working with William and Kyle to set up a sandbox /Custom Integration account to allow some internal simulation Testing.

We have been following the procedures provided in this doc: https://github.com/ordoro/api-examples/wiki/Building-a-custom-e-commerce-integration

Below is a copy of an email I just sent to William with the specifics.
Essentially, we are having an issue creating Orders via the API for this custom cart.
Thanks for any help or insight you can provide.
Paul.

Hello William,
I have a question about using the API with the custom cart as indicated below.

Things don’t seem to be operating quite as expected.
Who would be the best person to ask about this?

  • Essentially, I have created a custom cart (name is “Sim Test Cart1”, cart ID “105246”), this worked.
  • I then tried creating an order in the custom cart. This told me that it was successful, but when I log into Ordoro it is not found.
  • Also If I try to create the same order a 2nd time, I get an error stating that the order already exists, but this time it has a “1-” prepended to the order number.

Not sure where to go from here?
I have copied the order details below:
{
"order_id": “4116”,
"cart": “105246”,
“order_date”: “2020-08-14 22:25:10”,
“shipping_address”: {
“name”: “Stephen Franklin”,
“street1”: “1916 N Verdugo Road”,
“street2”: “6”,
“city”: “Glendale”,
“state”: “CA”,
“zip”: “91208-2662”,
“country”: “US”,
“email”: “sef4pres@aol.com”,
“phone”: “8186067720”
},
“billing_address”: {
“name”: “Stephen Franklin”,
“street1”: “1916 N Verdugo Road”,
“street2”: “6”,
“city”: “Glendale”,
“state”: “CA”,
“zip”: “91208-2662”,
“country”: “US”,
“email”: “sef4pres@aol.com”,
“phone”: “8186067720”
},
“tags”: [
{
“text”: “POLY - Small”,
“color”: “#0000FF
},
{
“text”: “Single Item Order”,
“color”: “#0000FF
},
{
“text”: “Single Tee”,
“color”: “#0000FF
}
],
“product_amount”: “30”,
“tax_amount”: “0”,
“grand_total”: “34.1”
}

The error received after trying this again is:
Http Code: 400
{
"error_message": “An order with id ‘1-4116’ already exists”,
“param”: null
}

Logging into the Sandbox account, no orders are found.

Thanks for your assistance,
Paul

Hi,

It seems like you might be using the incorrect API? Which endpoint are you hitting?

The 1- is the index for the cart, all orders in Ordoro are prepended with the cart index. If you need reference to an internal order id, use cart_order_id, though this is not filterable.

This is the URL that was listed in the API documentation for adding an order:
https://apiverson.ordoro.com/order

You said that “1-” was the index for the cart. When I created the custom cart using “https://api.ordoro.com/cart/” the response did include an ‘index’ field, but the doc didn’t indicate that this is what we would need to use going fwd.

Can you suggest a resolution to why the order isn’t being shown in the Ordoro web interface?

Here is the output from when the cart was created:
{"_link": “/cart/105246/”, “name”: “Sim Test Cart1”, “vendor”: “custom_integration”, “vendor_display”: “Custom Integration”, “id”: 105246, “is_demo”: false, “worker_machinga”: null, “archived_date”: null, “v3_migration_date”: null, “default_packing_list_id”: null, “prevent_write_back_settings_adjustment”: false, “index”: 1, “vendor_config”: {}, “proxy_requests”: false, “cart_download_order_statuses”: {“order_statuses”: []}, “autosync_activities”: [], “autosync_enabled”: true}

It was created using the following POST parameters:
{
“type”: “custom_integration”,
“name”: " Sim Test Cart1 ",
“autosync_enabled”: false

}

We have reworked our process so that it is now conforming with the data being pulled from the API

We are seeing the same data now as when using Postman and have updated our process to use that output

Thanks

Dan

Oh, that looks like the right endpoint, but does not explain why the order did not come back from the API. The only thing I can think of that would do that is if you tried to create the order using the older order api https://api.ordoro.com/order/ If you post to this endpoint, it will miss the additional processing required for v3 of Ordoro and it will not be available to you via the v3 /order API.

I’m not sure what you mean by going fwd, but the orders created in Ordoro will have an index prepended, so if you need to retrieve these orders by order number, you will need to include that in your request.

I’m getting confused by the responses here. Are these the same people? @BigDaddyDan and @pcarew.

If you are getting the responses from postman using https://api.ordoro.com/order/ you are going to have some major problems using the Ordoro API.

I would strongly suggest that you update to use the correct endpoints, and I can tell by visiting your account that you are not using the correct endpoints right now.

Big Daddy Dan is different

We have reworked our process and am now getting the information being output from the API

Thanks for all your help

Dan

Hello Sophie,
I do not know who “@BigDaddyDan” is, it is not from our organization.

Best
Paul Carew

Hello Sophie,
When I try the ‘older’ API endpoint (https://api.ordoro.com/order/), I get an error:
{
“error_message”: “This API method is deprecated for v3 companies.”,
“param”: null
}

@BigDaddyDan, please stop using our thread, it is confusing our request for help.
Please start your own topic.
Best Rgards

Hello Sophie,
I also just tried retrieving all orders using:
https://apiverson.ordoro.com/order

This was the response:
Last Http Code: 200
Order: {
“limit”: 10,
“offset”: 0,
“count”: 0,
“order”: []
}

This implies that the account has zero orders, but when I go to create the original order (order 4116), it tells me that the order already exists:
{
“error_message”: “An order with id ‘1-4116’ already exists”,
“param”: null
}

Clearly a contradiction is going on somewhere.

yes, the issue I’m assuming happened is that you created the order using the old endpoint. this put the order into our system, but without doing the v3 processing that is required, it is not available for you to view in the account using the proper endpoint. Can you try to create a new order using the correct API and then retrieve it?

I’m sorry if we already did this step, the mixed threads confused me.


At this point it appears that three orders have been made using the incorrect API

Can you confirm that the correct API end point to use is: https://apiverson.ordoro.com/order

Are you able to go ahead and clear out/delete all existing orders for this sandbox account?

I will then create a new order using apiversion.ordoro.com/order (assuming that you confirm that this is the correct API endpoint to use.

Thank you
Paul

Hi,

Just create one with a new order number to test it out. If you need help managing the account, please contact the support team support@ordoro.com

Yes, you can use https://apiverson.ordoro.com/order or if it suits you better, https://api.ordoro.com/v3/order (they are essentially the same on our end), as is shown in the GET request of the integration wiki.

Here’s hopin’

I’ve created a new order (4116P3) which was reported as created, but doesn’t show up when I request all of the orders.

So, same result unfortunately

Paul.

Please provide the following

Request Details

something like POST /product/ or GET /purchase_order/#id/

if there is a relevant payload to attach, do that here too (just remember to obfuscate any private information like passwords or ids).

{
  "name": "stuff",
  "archive": true
}

Response Details

Body

{
  "whatever": "the response body was",
  "scrub_sensitive_info": true
}

Request ID

this can be found in the X-ORDORO-REQUEST-ID header and will help us trace the request through our logs

Please make sure your orders have lines as well.

“…Please make sure your orders have lines as well.”
Ok, I have some positive momentum here. I had been trying to create orders without line items, as our data sets had the line items separate. My plan had been to create the order and then come back and add the line items as a separate process.

Even though your system will report that an order is created without the line item(s), it won’t allow it to be found either through the API or via the web UI. It will however then block any future attempts to add/re-add that order.

By adding at least 1 line item, the order can now be discovered.

Question:

  • With a pre-existing order that has 1 line item, can I then come back and add additional line items via the API at a subsequent time?
    IE can I modify an order?

Paul.

Bump:
Question:

  • With a pre-existing order that has 1 line item, can I then come back and add additional line items via the API at a subsequent time?
    IE can I modify an order?

Yes, you can POST to the /order/<order_number>/line endpoint (if using the apiverson.ordordo.com endpoint, otherwise use /v3/order/<order_number>/line).

The body of the post can contain any of the following:

  • quantity (integer)
  • item_price (number)
  • total_price (number)
  • discount_amount (number)
  • product_name (string)
  • sku (string)
  • details (string)

sku is required and the sku must exist in Ordoro before POSTing the line