Cannot edit orders submitted to Veeqo via the API - I receive the error "Cannot update order Not found"

Any orders that I submit through the API are successfully created in Veeqo, but when I try to save any edits I receive the following error “Cannot update order Not found” How can I figure out what is causing this error? I really need to be able to edit orders when the shipping address is incorrect or when an order requires changes. I’d attach a copy of the error, but there is no place to include attachment.

Hey there @rpryor,

Could you copy the request you are making to the API and paste it in here, removing any personal information like names and addresses?

One thing that may be causing the issue is that you are using the order number as the order_id parameter, which differs from the internal Veeqo ID. When you create an order via the API the response contains an id field which is what you need to use as the order_id.

@fullsam Request(less any personal info) below. Please let us know what we might be doing wrong.

{
“order”: {
“channel_id”: “182623”,
“customer_attributes”: {
“email”: “xxxxxxxxxxxxxxx@marketplace”,
“phone”: “+19999999999”,
“mobile”: “+19999999999”,
“billing_addess_attributes”: {
“id”: “”,
“first_name”: “XXXX”,
“last_name”: “XXXXXXX”,
“company”: null,
“address1”: “99999 N Street”,
“address2”: null,
“city”: “City”,
“state”: “ST”,
“zip”: “99999-9999”,
“country”: “US”,
“phone”: “+19999999999”,
“email”: “xxxxxxxxxxxxxxx@marketplace”
}
},
“deliver_to_attributes”: {
“first_name”: “XXXX”,
“last_name”: “XXXXXXX”,
“company”: null,
“address1”: “99999 N Street”,
“address2”: null,
“city”: “City”,
“state”: “ST”,
“zip”: “99999-9999”,
“country”: “US”,
“phone”: “+19999999999”,
“email”: “xxxxxxxxxxxxxxx@marketplace”,
“id”: “”
},
“delivery_method_id”: “556937”,
“number”: “276201”,
“send_notification_email”: false,
“total_discounts”: “0.00”,
“line_items_attributes”: [
{
“sellable_id”: “175551159”,
“price_per_unit”: “0.0000”,
“quantity”: 1,
“tax_rate”: 0,
“taxless_discount_per_unit”: “0.0000”,
“additional_options”: “14367630688559”
}
],
“employee_note_attributes”: {
“text”: “Replacement control module - JC”
}
}
}

Also had a question on the “employee_note_attributes” as those are not showing as Internal Notes in the Veeqo UI.

Hey @thopkirk, thanks for the update.
Addresses are separate entities to orders. If you want to update the shipping address for an order you will need to create a new shipping address of that order’s customer. When an order is created, the customer ID is returned in the response (under the customer.id field). You can use that ID to target the shipping addresses endpoint to add a new shipping address for the customer. Make a POST request to https://api.veeqo.com/customers/<customer_id>/shipping_addresses with the shipping address in the body, like so:

{
    "shipping_address": {
        "first_name": "Name",
        "last_name": "Name",
        "company": "Veeqo",
        "address1": "100 Some Street",
        "address2": "Flat 5",
        "city": "Somewhere",
        "country": "US",
        "zip": "33333-3333",
        "email": "test@example.com",
        "phone": "123456789"
    }
}

This will create a new shipping address against the customer. The response will contain an id field, representing the internal ID of the address. You can then target the update order endpoint to update the deliver_to field and update the order’s shipping address.

{
    "customer_id": <customer_id>, 
    "deliver_to_id": <shipping_address_id>
}

employee_note_attributes should be an array of objects where each object has a text field. I noticed in your example that employee_note_attributes is just a plain object. It should like:

"employee_note_attributes": [
   {
       "text": "Replacement control module - JC"
   }
]

@fullsam Thanks for the feedback. Just to confirm, we aren’t trying to update the address through the API after the order has been created. We’re trying to use the Veeqo UI to make updates and can’t. Is that due to us not creating the customer, then creating the shipping address, then sending the deliver_to id during order creation?

Thanks for the clarification @thopkirk. Are you receiving a specific error in the Veeqo UI when you’re trying to update the address?

Hi @fullsam Yes, @rpryor had mentioned it in his initial post here.

@thopkirk I see, I mistook this message for an API error. Can I confirm that the message you posted above is the exact payload you are sending?

It appears as though billing_address_attributes has been mispelt as billing_addess_attributes in the payload. When I tried creating a test order using the example payload you provided I was able to reproduce the error. However when I corrected the spelling, the issue no longer appears.

Wow, cannot believe I did not catch that. Also can’t believe our devs missed it. At least it’s a simple issue to get resolved. Thanks!