Help Instance Help

m8ty_client_customer

Customers information API is used to get a list of all users having access to the currently logged in user. Every product is assigned to a specific user.

Before you start

Check the documentation of the m8ty_client_customer library to get an idea about the available models and their properties.

Import all needed libraries

import 'package:dio/dio.dart'; import 'package:m8ty_client_customer/m8ty_client_customer.dart'; import 'package:m8ty_client_common/m8ty_client_common.dart'; import 'package:built_collection/built_collection.dart';

Client Setup

final client = M8tyClientCustomer(); client.setOAuthToken('ApiOAuth2', oauthToken);

API Surface

CustomerApi

Method

Description

retrieveCustomerOverview

Retrieve a list of all customers linked to the current user

retrieveCustomerById

Retrieve a specific customer by ID

retrieveCustomerAddresses

Get addresses of a given customer

How to perform different tasks

Here some examples how the dart client can be used

Get list of all customers

final client = M8tyClientCustomer(); client.setOAuthToken('ApiOAuth2', oauthToken); final api = client.getCustomerApi(); final Response<CustomersOfUserListModel> customers = await api.retrieveCustomerOverview( page: 1, size: 100, );

Get specific customer by id

final client = M8tyClientCustomer(); client.setOAuthToken('ApiOAuth2', oauthToken); final api = client.getCustomerApi(); final Response<CustomersOfUserListModel> customers = await api.retrieveCustomerById( customerId: "1234", page: 1, size: 100, );

Get customer addresses

final client = M8tyClientCustomer(); client.setOAuthToken('ApiOAuth2', oauthToken); final api = client.getCustomerApi(); try { final response = await api.retrieveCustomerAddresses( customerId: '1234', ); print('Addresses: ${response.data}'); } on DioException catch (e) { throw Exception( 'Request failed (status: ${e.response?.statusCode}): ${e.response?.data}', ); }
03 June 2026