question

Warwick Price avatar image
Warwick Price asked Jeffrey Blattman answered

Trying to pull data from my own Clover POS using node

Hi there, I asked this question as a reply to an older thread, but figured I'd ask the same question here.

My wife and I own a retail store and use Clover. I'm also a developer and need to pull item and order data from my clover data for reports I need to generate. I'm currently doing this by downloading the item/order exports. It's my understanding that because I'm trying to pull data from my own Clover, I don't need to use OAuth, instead I just need my mId and API Token.

My app is written using NestJS, which is basically nodeJS using typescript. I'm trying to test my integration in Postman. I'm pointing the url to https://api.clover.com. I'm using the 13 digit mId from the Setup > Merchants page (the one on the left not the 12 digit code on the right). I then have created my own API Token (under Business Operations). Using a Postman collection from one of the Clover Tutorials here's what I get:


1665946941887.png

The response I get back is:

Error: Invalid character in header content ["Authorization"]

Can anyone see what's wrong with this?

Thanks

REST API
1665946941887.png (24.3 KiB)
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

·
Jeffrey Blattman avatar image
Jeffrey Blattman answered

Looks okay to me. I don't use Postman regularly though so still be some quirk in that. Here's a curl request I was just messing with that works...

curl --request POST \
  --url https://apidev1.dev.clover.com/v3/merchants/GARENZRPEFZ6E/orders \
  --header 'Authorization: Bearer XXX' \
  --header 'Content-Type: application/json' \
  --data '{
"total": 1234,
"employee": { "id": "PDR0VXXPXVM90" },
"title":  "Test Order"
}'

I was also using the merchant-generated token here, so should be similar.



10 |2000

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

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