question

mkonnekt avatar image
mkonnekt asked mkonnekt commented

Create order type not working

Hi,

I am not able to create a new orderType by calling the POST /v3/merchants/{mId}/order_types

I get blank / no content response header, body and response code as 0. Please help in resolving this issue.

I am passing the access token got using OAuth and merchant ID and my JSON is following. However, I am able to do GET on order_types using the same access token and merchant ID. { "id": "", "label": "my custom label", "taxable": true, "isDefault": false, "filterCategories": false, "isHidden": true, "hoursAvailable": "BUSINESS" }

OAuth
10 |2000

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

1 Answer

michael avatar image
michael answered mkonnekt commented

Are you sure you have the correct access_token and the correct content type .. I just posted to my merchant and everything worked fine. The only change I made was to not specify and empty id. Here is my request/response.

POST https://api.clover.com/v3/merchants/H...types?accesstoken=1c1d4531.... { "label": "my custom label", "taxable": true, "isDefault": false, "filterCategories": false, "isHidden": true, "hoursAvailable": "BUSINESS" }

response: { "id": "F6M4Y1A97YQ0T", "label": "my custom label", "taxable": true, "isDefault": true, "filterCategories": false, "isHidden": true, "hoursAvailable": "BUSINESS" }

3 comments
10 |2000

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

mkonnekt avatar image mkonnekt commented ·

Removing "id" didn't work. If I use the API token from Clover.com->Merchant->Setup->API Tokens, then I'm able to create a new orderType. However, on using the OAuth access token, new OrderType API returns response code 0 and no content in response body. Clover team, please help. I'm unable to create new OrderType using OAuth access token in the API. Whereas, I am able to use the same OAuth access token in all other APIs for this merchant.

0 Likes 0 ·
Mike M avatar image Mike M commented ·

Are you using the REST API Browser to send your api calls? If so, response 0 usually means a 401 Unauthorized. You can actually see the api request and response in Chrome's debug panel or via any proxy app like Charles.

If it works for you with an API Token via Merchant->Setup, then my guess is that your app doesn't have the correct permission set.

You can double check your permission set of your token via: https://sandbox.dev.clover.com/v3/acc... token here}

0 Likes 0 ·
mkonnekt avatar image mkonnekt commented ·

Thank you Mike. Yes I am using the REST API Browser which is the 401 Unauthorized error. My app currently does NOT have permission to "MODIFY" Merchant data. I only have "READ" permission for Merchant data. I will change that and try again. Thank you!

0 Likes 0 ·

Welcome to the
Clover Developer Community