Skip to content
View in the app

A better way to browse. Learn more.

Loyverse Town

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Google Script Error

Featured Replies

Hello,
Can't connect to Loyverse API with Google Script. Same info works fine with Postman.

GOOGLE SCRIPT

function loyverseJSON() {
  var url = "https://api.loyverse.com/v1.0/receipts";
  var options = {
    "Method": "get",
    "Headers": {
       "Accept": "application/json",
       "Content-Type": "application/json",
       "Authorization": "Bearer XXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
       },
    "Body": {
      "created_at_min" : "2023-05-18T00:00:00.000Z",
      "limit" : 20
    }
  }
  var response = UrlFetchApp.fetch(url, options);
  Logger.log(response);
 }


ERROR
Exception: Request failed for https://api.loyverse.com returned code 401. Truncated server response: {"errors":[{"code":"UNAUTHORIZED","details":"Access token is not valid."}]}

Thanks

Hello. Could you check if your access token is correct or not expired?

  • Author

Hello, access token not expired. Added another and both don't work. Postman works fine.

  • Author

Thanks Ki this works!

function loyverseJSON() {
 var url = "https://api.loyverse.com/v1.0/receipts?created_at_min=2023-05-26T00:00:00.000Z&limit=2";

 var options =
 {
  "method": "get", //<-
  "headers": //<-
  {
  "Accept": "application/json",
  "Content-Type": "application/json",
  "Authorization": "Bearer XXXXXXXXXXXXXXXXXXXXXXXX"
  }
 }

 var response = UrlFetchApp.fetch(url, options);
 Logger.log(response); 
}

Edited by fsandovalsk

That's great to hear!

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.