Create Order by API

I am trying to create order by API with below detail and getting
Error Message : “{“error_message”: “Missing value”, “param”: “shipping_address”}”

URL : https://apiverson.ordoro.com/order
Request Body : { ‘order_id’ : ‘order-1234’, ‘cart’ : 100, ‘cart_order_id’ : ‘thats-some-funky-1234’, ‘order_date’: ‘2015-12-09T12:01:00.855700’, ‘shipping_address’ : { ‘name’ : ‘joe schmo’, ‘street1’ : ‘123 foo-bar ln’, ‘city’: ‘austin’, ‘state’ : ‘tx’, ‘zip’ : ‘78701’, ‘country’ : ‘USA’, ‘phone’ : ‘8675309’, ‘email’: ‘jenny@igotyournumber.com’}, ‘billing_address’ : { ‘name’ : ‘joe schmo’, ‘street1’ : ‘123 foo-bar ln’, ‘city’ : ‘austin’, ‘state’ : ‘tx’, ‘zip’ : ‘78701’, ‘country’ : ‘USA’, ‘phone’ : ‘4592222’, ‘email’ : ‘mrgattispizza@delivers.com’}, ‘lines’ : [ { ‘cart_orderitem_id’ : ‘abc.123’, ‘quantity’ : 2, ‘product’: { ‘sku’: ‘sku1’, ‘name’ : ‘special product name’, ‘price’ : 69.69, ‘weight’ : 1, ‘taxable’ : ‘false’, ‘cost’: 1.69, ‘amazon_extra_info’: { ‘pending_quantity’ : 4, ‘listing_id’ : ‘12356’, ‘asin’ : ‘55555’ } } }, { ‘cart_orderitem_id’ : ‘abc.456’, ‘quantity’ : 1, ‘product’ : { ‘sku’ : ‘sku2’, ‘name’ : ‘Plastic Toy’ , ‘price’ : 1.23, ‘weight’ : 2, ‘taxable’ : ‘false’, ‘cost’ : 3.45 } } ], ‘tags’ : [ { ‘text’ : ‘Unpaid’ , ‘color’ : ‘#FFFFFF’}, { ‘text’ : ‘Alert’, ‘color’ : ‘#C0C0C0’ } ], ‘product_amount’ : 100.1, ‘tax_amount’ : 1.23, ‘grand_total’ : 123.45 }

I am successfully able to create order with request body :
{“order_id”: “123456”, “billing_address”: {“name”: “Frank”}, “shipping_address”: {“name”: “John”}}

I tried with adding and removing some properties but always getting the same above mentioned error, so it seems it’s not giving proper error message.

Can you provide me a proper request body with all property values with which i can create order.

Hi Kevin,

Thanks for your question.

I apologize for the errors, after testing this, it appears that the error message may be misleading. Are you using the proper cart id?

Look forward to getting this fixed up.

Hello Sophie,

I am using Kentico 11 and As you suggested to pass proper cart id, After making call to https://api.ordoro.com/cart/ API, I am getting below response message.

{
“count”: 1,
“limit”: 10,
“offset”: 0,
“cart”: [
{
“_link”: “/cart/101924/”,
“name”: “Manual”,
“vendor”: “manual”,
“vendor_display”: “Manual”,
"id": 101924,
“is_demo”: false,
“worker_machinga”: null,
“archived_date”: null,
“v3_migration_date”: null,
“default_packing_list_id”: null,
“index”: 0,
“vendor_config”: {},
“proxy_requests”: false,
“cart_download_order_statuses”: {},
“autosync_activities”: [],
“autosync_enabled”: true
}
]
}

Now from above response I am reading cart ID Which is 101924 if i am not wrong and sending below request body but still getting error “error_message Missing value param shipping_address”.

{ ‘order_id’ : ‘order-1234’, ‘cart’ : 101924, ‘cart_order_id’ : ‘thats-some-funky-1234’, ‘order_date’: ‘2015-12-09T12:01:00.855700’, ‘shipping_address’ : { ‘name’ : ‘joe schmo’, ‘street1’ : ‘123 foo-bar ln’, ‘city’: ‘austin’, ‘state’ : ‘tx’, ‘zip’ : ‘78701’, ‘country’ : ‘USA’, ‘phone’ : ‘8675309’, ‘email’: ‘jenny@igotyournumber.com’}, ‘billing_address’ : { ‘name’ : ‘joe schmo’, ‘street1’ : ‘123 foo-bar ln’, ‘city’ : ‘austin’, ‘state’ : ‘tx’, ‘zip’ : ‘78701’, ‘country’ : ‘USA’, ‘phone’ : ‘4592222’, ‘email’ : ‘mrgattispizza@delivers.com’}, ‘lines’ : [ { ‘cart_orderitem_id’ : ‘abc.123’, ‘quantity’ : 2, ‘product’: { ‘sku’: ‘sku1’, ‘name’ : ‘special product name’, ‘price’ : 69.69, ‘weight’ : 1, ‘taxable’ : ‘false’, ‘cost’: 1.69, ‘amazon_extra_info’: { ‘pending_quantity’ : 4, ‘listing_id’ : ‘12356’, ‘asin’ : ‘55555’ } } }, { ‘cart_orderitem_id’ : ‘abc.456’, ‘quantity’ : 1, ‘product’ : { ‘sku’ : ‘sku2’, ‘name’ : ‘Plastic Toy’ , ‘price’ : 1.23, ‘weight’ : 2, ‘taxable’ : ‘false’, ‘cost’ : 3.45 } } ], ‘tags’ : [ { ‘text’ : ‘Unpaid’ , ‘color’ : ‘#FFFFFF’}, { ‘text’ : ‘Alert’, ‘color’ : ‘#C0C0C0’ } ], ‘product_amount’ : 100.1, ‘tax_amount’ : 1.23, ‘grand_total’ : 123.45 }

Do you see anything missing. cart_order_id and cart_orderitem_id are required or optional and Is there any predefine format for their value or any string allowed.

Thank you,

Kevin

Hi Kevin,

I used the exact body as payload except for changing the order_id and cart fields to suit my setup, and was able to create an order without problem. Are you using a duplicate order number?

cart_order_id, cart_orderitem_id would be specific to an imported order from a cart or sales channel, this would associate the order and it’s lines with the ids from the cart. These should not be required fields.

Sophie

Hey Sophie,

As I mentioned earlier I am using Kentico CMS and so far I have not configured anything related to cart on my ordoro account.

I have directly attempted to create order by calling API.

Even with below incomplete body request, it creates order and the same I am getting back by the API with orderid.

{“order_id”: “123456”, “billing_address”: {“name”: “Frank”}, “shipping_address”: {“name”: “John”}}

FYI, with additional parameter information in request body it gives error. As per your suggestion to pass proper cart id, and nothing related to cart configured on my ordoro set up I called https://api.ordoro.com/cart/

and I am getting below response.

{
“count”: 1,
“limit”: 10,
“offset”: 0,
“cart”: [
{
“_link”: “/cart/101924/”,
“name”: “Manual”,
“vendor”: “manual”,
“vendor_display”: “Manual”,
“id”: 101924,
“is_demo”: false,
“worker_machinga”: null,
“archived_date”: null,
“v3_migration_date”: null,
“default_packing_list_id”: null,
“index”: 0,
“vendor_config”: {},
“proxy_requests”: false,
“cart_download_order_statuses”: {},
“autosync_activities”: [],
“autosync_enabled”: true
}
]
}

I read id : 101924 from response and pass it as cartid in a API call to create order but no luck. I got the same error.

It seems as per your email, it worked for you when you change payload as per your cart setup.

So can you help to get clarity on cart, since i am using kentico what i have to setup for cart on ordoro account.

Hi,

Yes, the “Manual” cart is the id we associate with manual orders, so this is the cart setup that I referred to. I have a manual cart, and used the id in place of the dummy one in the payload from the examples.

I also changed the order id, as this is a unique field.

Hope this helps,

Sophie

Sophie can you provide the exact payload you used that you were successful with? The might help us to understand better what the difference is.

Sophie, Thanks for the explanation, however to make sure we don’t have any ambiguity can you provide the payload exactly that you used so that we can compare with what we have? Though I think we understand, I want to make sure there isn’t any room for misunderstanding.

Here is my updated payload with a change in cart and order_id:

{
    "billing_address": {
        "city": "austin",
        "country": "USA",
        "email": "mrgattispizza@delivers.com",
        "name": "joe schmo",
        "phone": "4592222",
        "state": "tx",
        "street1": "123 foo-bar ln",
        "zip": "78701"
    },
    "cart": <my-cart-id-integer-value>,
    "cart_order_id": "thats-some-funky-1234",
    "grand_total": 123.45,
    "lines": [
        {
            "cart_orderitem_id": "abc.123",
            "product": {
                "amazon_extra_info": {
                    "asin": "55555",
                    "listing_id": "12356",
                    "pending_quantity": 4
                },
                "cost": 1.69,
                "name": "special product name",
                "price": 69.69,
                "sku": "sku1",
                "taxable": "false",
                "weight": 1
            },
            "quantity": 2
        },
        {
            "cart_orderitem_id": "abc.456",
            "product": {
                "cost": 3.45,
                "name": "Plastic Toy",
                "price": 1.23,
                "sku": "sku2",
                "taxable": "false",
                "weight": 2
            },
            "quantity": 1
        }
    ],
    "order_date": "2015-12-09T12:01:00.855700",
    "order_id": "<myorder-id>",
    "product_amount": 100.1,
    "shipping_address": {
        "city": "austin",
        "country": "USA",
        "email": "jenny@igotyournumber.com",
        "name": "joe schmo",
        "phone": "8675309",
        "state": "tx",
        "street1": "123 foo-bar ln",
        "zip": "78701"
    },
    "tags": [
        {
            "color": "#FFFFFF",
            "text": "Unpaid"
        },
        {
            "color": "#C0C0C0",
            "text": "Alert"
        }
    ],
    "tax_amount": 1.23
}

I able to create order with below payload with manual cart:

{ “order_id” : “161”, “cart” : 101924, “order_date”: “6/12/2019 4:18:08 PM”, “shipping_address” : { “name” : “KevinSmith”, “street1” : “Office No.111”, “city”: “Chicago”, “state” : “Illinois”, “zip” : “60652”, “country” : “USA”, “phone” : “12653131231”, “email”: "test@test.com"}, “billing_address” : { “name” : “KevinSmith”, “street1” : “Office No.111”, “city” : “Chicago”, “state” : “Illinois”, “zip” : “60652”, “country” : “USA”, “phone” : “12653131231”, “email” : "test@test.com"}, “lines” : [{ “cart_orderitem_id” : “198”, “quantity” : 2, “product”: { “sku”: “5”, “name” : “product3”, “price” : 7.990000000, “weight” : 10.4, “taxable” : “false”, “cost”: 7.990000000 } },{ “cart_orderitem_id” : “199”, “quantity” : 2, “product”: { “sku”: “4”, “name” : “product0”, “price” : 7.990000000, “weight” : 10.4, “taxable” : “false”, “cost”: 7.990000000 } },{ “cart_orderitem_id” : “200”, “quantity” : 2, “product”: { “sku”: “2”, “name” : “product1”, “price” : 7.990000000, “weight” : 10.4, “taxable” : “false”, “cost”: 7.990000000 } }],“product_amount” : 47.940000000, “tax_amount” : 0, “grand_total” : 55.94 }

And order also listed under order at ordoro but when i click on order number to see order detail it for all order items quantity is ok but Item Price is 0. As below image.

Am i missing anything for item price?

Thank you,
Kevin

You should use item_price for the order lines.