question

tg avatar image
tg asked tg commented

400 Response '"name" must be specified' when creating Order Type

I am able to successfully create an order type using just basic data without issue

{'label': 'my custom label', 'hoursAvailable': 'BUSINESS', 'isDefault': False, 'isHidden': True, 'taxable': True, 'filterCategories': False}

but when I try to go a step further and use set some of the newer attributes I get a 400 response with {'message': '"name" must be specified'}

{'label': 'Special Order Type', 'hoursAvailable': 'CUSTOM', 'taxable': True, 'isDefault': False, 'isHidden': True, 'labelKey': 'com.clover.order.type.table', 'systemOrderTypeId': 'TABLE-TYPE', 'customerIdMethod': 'NAME', 'filterCategories': False}

The data I am passing appears to fit the model in the API explorer, and there is no mention of a 'name' for Order Type

Any help would be awesome!

Orders
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.

voski avatar image voski commented ·

Will you try not setting hoursAvailable and see what response you get?

0 Likes 0 ·

1 Answer

Duane Moore avatar image
Duane Moore answered tg commented

When you specify 'hoursAvailable' as CUSTOM, you need to specify the hours to go with it. Take a look at this sample request, which was captured when using the Clover web dashboard (a useful way to generate a valid request):

{"isDefault":false,"label":"Delivery","taxable":true,"filterCategories":false,"isHidden":false,"minOrderAmount":0,"maxOrderAmount":0,"fee":0,"avgOrderTime":0,"hoursAvailable":"CUSTOM","hours":{"name":"Order Type hours","monday":[{"start":900,"end":1700}],"tuesday":[{"start":900,"end":1700}],"wednesday":[{"start":900,"end":1700}],"thursday":[{"start":900,"end":1700}],"friday":[{"start":900,"end":1700}],"saturday":[{"start":900,"end":1700}],"sunday":[]}}

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.

tg avatar image tg commented ·

Thanks Duane, great reminder to look at the web dashboard for example requests

0 Likes 0 ·

Welcome to the
Clover Developer Community