The order is unable to be created with this channel type

Hi,

I’m trying to create an order via the API with the following input.

Request Body:
{
“order”: {
“channel_id”: 52720,
“customer_id”: 50231737,
“send_notification_email”: true,
“line_items_attributes”: [
{
“price_per_unit”: “75.000”,
“taxless_discount_per_unit”: “0.00”,
“quantity”: “1”,
“tax_rate”: 0.2,
“sellable_id”: 19359804,
“additional_options”: “This thing is a thing”
}
],
“additional_order_level_taxless_discount”: “19.50”,
“delivery_method_id”: 206074,
“delivery_cost”: “2.00”,
“total_tax”: “35.54”,
“total_discounts”: “49.5”,
“payment_attributes”: {
“payment_type”: “paypal”,
“reference_number”: “PPP1234”
},
“deliver_to_attributes”: {
“customer_id”: 50231737,
“first_name”: “Jabbar”,
“last_name”: “Daomilang”,
“address1”: “Tech Hub”,
“address2”: “221 High Street”,
“city”: “Swansea”,
“company”: “AppTradies”,
“country”: “GB”,
“state”: null,
“zip”: “SA1 1NW”,
“phone”: null
},
“customer_note_attributes”: {
“text”: “Please tell Sam to look after this puppy. --This is a customer note–”
},
“employee_notes_attributes”: [
{
“text”: “Package contains a dog. Use suitable box. --This is an internal note–”
}
]
}
}

Response: 400 Bad Request {“error_messages”:“The order is unable to be created with this channel type”}

Could you let me know what I am missing? Note that the product (or sellable_id) that I’m passing is related to the channel_id. I’ve also tried all my channels/stores available but I got the same response. All the channels/stores are active.

Thanks for your help.
Jabbar

Hey @jab.daomilang,

This error is returned when you attempt to create an order with a channel where the type is not direct or retail. So in your channel_id parameter, you will need to change that to a Direct channel (you can create it at https://app.veeqo.com/channels if one does not exist already)

Hope this helps.

Hi @calvin,

Thanks for your response. What does that mean with my existing channels that are not direct or retail? What we’re really trying to achieve is creating an order that are related to the Shopify channel.

Thanks.

Hey @jab.daomilang!

Integrated channels such as Shopify can only be used as the source for orders created through that particular remote channel.

So in this case, the best option will be to create a direct channel named something like “Shopify API Orders” and use this for the channel_id of those orders.

Hope this helps

That’s really helpful @calvin . Thank you very much.