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.

Using API with Python

Featured Replies

Hi,

I use Python to access loyverse data using loyverse API and the "requests" Python package.

I successfully get items, customers, receipts, and so on and convert them into dataframes for further analysis.

However, I struggle with the POST method when trying to update information.

I try to set the points balance to 10 (for example) for a particular customer that already exists and I know its id.

my code is:

urlheaders = {"Authorization": "Bearer {mytoken}", "Content-Type": "application/json"}

url = "https://api.loyverse.com/v1.0/customers"

params = {"id": 'cf2b73d4-db71-45cf-9c28-11609d52c24b', "total_points": 10}

response = requests.put(url, headers=urlheaders, params=params)

But I always get response 405 and no update is done.

Can someone help? Thanks!

 

 

For updating all fields obligated, please send complete object. 

{
  "id": "string",
  "name": "string",
  "email": "string",
  "phone_number": "string",
  "address": "string",
  "city": "string",
  "region": "string",
  "postal_code": "string",
  "country_code": "string",
  "customer_code": "string",
  "note": "string",
  "total_points": 0
}

Edited by Jay Rock

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.