Customers


Overview

The customer API allows you to create, view, update, and delete individual, or a batch, of customers.


Create a customer

This API helps you to create a new customer.

createCustomer({})

Parameters

String email,
String firstName,
String lastName,
String userName,
Map<String, dynamic> billing,
Map<String, dynamic> shipping

API Call

// Initialize WooSignal
await WooSignal.instance.init(appKey: "your app key");

// Call Api
Customer customer = await WooSignal.instance.createCustomer({
      String email,
      String firstName,
      String lastName,
      String userName,
      Map<String, dynamic> billing,
      Map<String, dynamic> shipping,
      }).then( (customer) {
        print(customer);
    });

});

Response

Customer instance

Represents the following object - WooCommerce create a customer


Retrieve a customer

This API lets you retrieve and view a specific customer by ID.

retrieveCustomer({int id})

Parameters

int id

API Call

// Initialize WooSignal
await WooSignal.instance.init(appKey: "your app key");

// Call API
Customer customer = await WooSignal.instance.retrieveCustomer(id: "customer id");

Response

Customers instance

Represents the following object - WooCommerce retrieve a customer


List all customers

Returns customers back from WooCommerce, include parementers to query data.

getCustomers()

Parameters

int page,
int perPage,
String search,
List<int> exclude,
List<int> include,
int offset,
String order,
String orderBy,
bool hideEmpty,
int parent,
int product,
String email,
String slug,
String role

API Call

// Initialize WooSignal
await WooSignal.instance.init(appKey: "your app key");

// Call API
List<Customer> customers = await WooSignal.instance.getCustomers();

Response

List<Customer> instance

Represents the following object - WooCommerce list all customers


Update a customer

This API lets you make changes to a customer.

updateCustomer(int id, { data })

Parameters

Map<String, dynamic> data

API Call

// Initialize WooSignal
await WooSignal.instance.init(appKey: "your app key");

// Call API
Customer customer = await WooSignal.instance.updateCustomer("customer id", data: {});

Response

Customer instance

Represents the following object - WooCommerce update a customer


Delete a customer

This API helps you delete a customer.

deleteCustomer(int id, {bool force = false})

Parameters

bool force

API Call

// Initialize WooSignal
await WooSignal.instance.init(appKey: "your app key");

// Call API
Customer customer = await WooSignal.instance.deleteCustomer("customer id");

Response

Customer instance

Represents the following object - WooCommerce delete a customer


Batch update customers

This API helps you to batch create, update and delete multiple customers.

batchCustomers({ data })

Parameters

Map<String, dynamic> data

API Call

// Initialize WooSignal
await WooSignal.instance.init(appKey: "your app key");

// Call API
CustomerBatch customerBatch = await WooSignal.instance.batchCustomers(data: {});

Response

CustomerBatch instance

Represents the following object - WooCommerce batch update customers


Retrieve customer downloads

This API lets you retrieve customer downloads permissions.

retrieveCustomerDownloads({ @required int customerid })

Parameters

API Call

// Initialize WooSignal
await WooSignal.instance.init(appKey: "your app key");

// Call API
CustomerDownload customerDownload = await WooSignal.instance.retrieveCustomerDownloads(customerid: "customer id");

Response

CustomerDownload instance

Represents the following object - WooCommerce retrieve customer downloads