question

bhampton avatar image
bhampton asked David Marginian Deactivated commented

need help getting authorization code in production

i am trying to get an authorization code so i can get an oauth2 token in prod. i am using this url, https://sandbox.dev.clover.com/oauth/authorize?client_id={APP_ID}. i use this in sandbox, pick a merchant and get my callback url with the auth code. In prod, i select a merchant and get this error: {"message":"Site URL not configured for developer app {MY APP_ID}"}.


what should i do to configure a site URL? I do not see the REST configuration option, how do i get it to show up?


In sandbox i see it:

  • App Type

edit

Android (Station, Mobile, Mini, Flex, Station 2018, Mini(2nd Generation)), REST Clients

· Requested Permissions

edit

Read and Write: Customers, Employees, Inventory, Merchant, Orders, Payments

Ecommerce

· REST Configuration

edit

Site URL: http://localhost:8080

Default OAuth Response: CODE

· Ecommerce Settings

edit

Set your integration type and what type of payments you'll take

· Android APKs


In production i don't see it.

  • App Type

edit

Android (Mobile, Mini, Station 2018, Mini(2nd Generation))

  • Requested Permissions

edit

Read and Write: Customers, Employees, Inventory, Merchant, Orders, Payments

Ecommerce

  • Ecommerce Settings

edit

Set your integration type and what type of payments you'll take


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.

David Marginian avatar image
David Marginian Deactivated answered bhampton commented

You need to select "REST Clients -> Web".

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

bhampton avatar image bhampton commented ·

I log into clover dashboard and select developer account. I don't see the REST Clients option. where am i supposed to look.

0 Likes 0 ·
David Marginian avatar image David Marginian ♦♦ bhampton commented ·
App type ... what is your app id?
0 Likes 0 ·
bhampton avatar image bhampton bhampton commented ·
nevermind, i found it.
0 Likes 0 ·
bhampton avatar image bhampton bhampton commented ·

B7JKX5ERQC3J4, i edited the rest config to use http://localhost:8080 and oauth response is code. still getting the error message.

0 Likes 0 ·
Show more comments
bhampton avatar image
bhampton answered David Marginian Deactivated commented

this is an urgent issue in prod. please provide assistance. using this site url, http://localhost:8080. is this the wrong port for prod?

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.

David Marginian avatar image David Marginian ♦♦ commented ·
I am sorry, using a site url of localhost doesn't make a whole lot of sense in prod, unless you have a server running on the merchant/client's machine. Also, it isn't clear what the actual issue is. If you need more assistance you should provide your app id and clearly describe what the problem is.
0 Likes 0 ·
bhampton avatar image bhampton David Marginian ♦♦ commented ·

i have a nodejs lambda that regularly makes a call to the clover api to get locked orders for a merchant in production. here's the object sent to the httpRequest module which makes the http get request to clover api.

{

hostname: "api.clover.com",

path: "/v3/merchants/MID/orders?filter=state=locked&filter=modifiedTime>1655323889000&expand=lineItems,payments,customers&orderBy=modifiedTime%20ASC",

headers: {

Authorization: "Bearer XXX",

},

}


this call started failing last thursday. I'm getting a 401 unauthorized error. i suspect this is because i need to send a new oauth2 token to replace XXX in the header. i follow the steps in the clover doc to obtain a new oauth2 token. there is a step to that requires me to get an authorizatoin code for an unauthorized merchant. i follow the steps and it fails because i cannot get the authorization code. i thought to get the code i had to set up a rest configuration for my app. app id is B7JKX5ERQC3J. mentioned it in reply above. this is how we have it setup in sandbox and it works fine.
1655326257679.png

0 Likes 0 ·
1655326257679.png (160.3 KiB)
David Marginian avatar image David Marginian ♦♦ bhampton commented ·

Your posts don't make a lot of sense, a few things:

1) Why do you think this just stopped working? We don't deactivate tokens, so, were you using a merchant token or something and perhaps someone deleted that token?

2) A site url of localhost doesn't make a lot of sense in production. In sandbox, yes, of course it works because you are running a server locally that can handle the redirect. In production I wouldn't expect your merchant is running a server on the machine they are using to access the dashboard.

3) If you have some sort of set-up where you install a server to respond to the oauth redirect on your merchant's machine then you will need to submit your URL change for review via the big green "Submit for Review" button at the bottom of your developer dashboard. Once the change is approved on our end you will need to login to your developer dashboard again and publish the change.

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