Customers

Customers endpoint wrapper class

Possible requests:

  • get_by_query: get customers that respect passed in query parameters

  • get_by_id: get customer with given customer ID

  • get_by_email: get customer with given email

  • get_by_creation_date: get customers created at specific date

  • get_by_creation_dates: get customers created between specific dates

class loyverse.endpoints.customers.Customers(api: loyverse.api.Api)
get_by_query(customer_ids: list = None, email: str = None, created_at_min: datetime.datetime = None, created_at_max: datetime.datetime = None, updated_at_min: datetime.datetime = None, updated_at_max: datetime.datetime = None, limit: int = 250, cursor: str = None) → dict

Retrieves customers that respect the specific query criteria passed in. A detailed description of the query parameters is available here.

Parameters
  • customer_ids (list) – filter customers by customer id

  • email (str) – filter customer by email

  • created_at_min (datetime) – filter customers created after this date (includes timezone info)

  • created_at_max (datetime) – filter customers created before this date (includes timezone info)

  • updated_at_min (datetime) – filter customers updated after this date (includes timezone info)

  • updated_at_max (datetime) – filter customers updated before this date (includes timezone info)

  • limit (int) – maximum number of customers to return per request (1 to 250)

  • cursor (str) – token to get continuation of return list for requests exceeding limits

Returns

formatted customers information (JSON)

Return type

response (dict)

get_by_id(customer_id: str) → dict

Retrieves the customer information for specific customer ID

Parameters

customer_id (str) – string uniquely identifying the customer to be retrieved

Returns

formatted customer information (JSON)

Return type

response (dict)

get_by_email(email: str) → dict

Retrieves the customer information for a user with the specific email

Parameters

email (str) – email identifying the customer to be retrieved

Returns

formatted customer information (JSON)

Return type

response (dict)

get_by_creation_date(date: datetime.datetime) → dict

Retrieve customers information for a specific creation date

Parameters

date (datetime) – datetime object representing day in question (including time zone info)

Returns

formatted customers information (JSON)

Return type

response (dict)

get_by_creation_dates(start_date: datetime.datetime, end_date: datetime.datetime = None) → dict

Retrieve customers information for a creation date range

Parameters
  • start_date (datetime) – datetime object representing starting day in question (including time zone info)

  • end_date (datetime) – datetime object for end-date (default: UTC now)

Returns

formatted customers information (JSON)

Return type

response (dict)