question

georgeono avatar image
georgeono asked georgeono commented

Creating an order

Hi,

I am trying to create an order using the REST API and am posting this:

{ "customers":[{ "id":"abcd...." }] }

I receive a 200 OK with body:

{ "href": "...", "id": "...", "currency": "USD", "taxRemoved": false, "isVat": false, "manualTransaction": false, "groupLineItems": true, "testMode": false, "createdTime": 1474831712000, "clientCreatedTime": 1474831712000, "modifiedTime": 1474831711000 }

Unfortunately, when I try to query the order API using modifiedTime, the order is not retrieved. Any idea why this happens?

Also, when I GET the specific order, it is retrieved with 200 OK, but the customer is not attached. Is there something more I should add to the customer list when POSTing?

Thank you, George

Orders
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

georgeono avatar image
georgeono answered georgeono commented

I've reread the documentation and there is the indication that:

Please note, this basic Order object will be treated as unfinished if the Order’s state is null. Before the order has first been set to “open”, it will only be possible to GET the individual order by its id, but it will not otherwise be included in the merchant’s order list, it will also not appear in the Orders app.

Thanks, George

1 comment
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

georgeono avatar image georgeono commented ·

What remains is the customer part. Any directions there?

0 Likes 0 ·
jim-patel avatar image
jim-patel answered

You have to add the customer by updating the order. You can't add a customer to an order on creation.

10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Welcome to the
Clover Developer Community