question

mybmr avatar image
mybmr asked mybmr commented

Create order type REST API is not working on USA clover, same API is working fine on Sandbox

We are trying to create ORDER TYPE for merchant using Rest API but it's giving 401 unauthorised error although app has all required permissions

"elements": [ {
        "name": "PAYMENTS_W"
      }, {
        "name": "EMPLOYEES_W"
      }, {
        "name": "EMPLOYEES_R"
      }, {
        "name": "ORDERS_R"
      }, {
        "name": "MERCHANT_R"
      }, {
        "name": "CUSTOMERS_R"
      }, {
        "name": "INVENTORY_R"
      }, {
        "name": "INVENTORY_W"
      }, {
        "name": "CUSTOMERS_W"
      }, {
        "name": "MERCHANT_W"
      }, {
        "name": "ORDERS_W"
      }, {
        "name": "PAYMENTS_R"
      }
    ]


API Request :
curl --location 'https://api.clover.com/v3/merchants/NZMFXVBWMQQD1/order_types' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer 3df1c38cef***55528ebc20c6efd****' \
--data '{"taxable":"false","isDefault":"true","filterCategories":"false","isHidden":"false","isDeleted":"false","label":"Invoice"}'

Merchant Id : NZMFXVBWM****


Response : {"message":"401 Unauthorized"}

OrdersREST APIMerchant
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

·
parquet76 avatar image
parquet76 answered mybmr commented

https://docs.clover.com/docs/401-unauthorized

You probably modified the permissions AFTER the merchant installed your app. The merchant would need to re-install for the new permissions to take affect.

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

mybmr avatar image mybmr commented ·
We have the same permissions from past few years and it's not modified.
0 Likes 0 ·
parquet76 avatar image parquet76 mybmr commented ·

So, all that matters is when the app was last installed. If that was prior to a permissions change the apps token won't have all the permissions.

0 Likes 0 ·
mybmr avatar image mybmr parquet76 commented ·

When Merchant Installed the application, we had all the permissions for the order as shown above and we were able to generate the token. We have double verified about permission and token from our end. Even though we have all the permissions when the merchant installed the app we are still getting a 401 unauthorized error when trying to create an order type. What can be the cause of 401 unathorized error message when our app has all the permissions and the correct token?

0 Likes 0 ·
Show more comments

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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