Orders


Overview

The orders API allows you to view individual or a batch of products.


Create a new Order in WooCommerce

This method can be used to create new orders in WooCommerce

createOrder()

Parameters

OrderWC orderWC, // Create an instance of OrderWC and set all the parameters in the object

API Call

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

// Call API
OrderWC orderWC = OrderWC();
orderWC.setPaid = true;
orderWC.lineItems = [];
...

Order order = await WooSignal.instance.createOrder(orderWC);

Response

Order instance

Represents the following object - WooCommerce order created

List all orders

Returns orders back from WooCommerce, include parameters to query data.

getOrders()

Parameters

int page,
int perPage,
String search,
String after,
String before,
List<int> exclude,
List<int> include,
int offset,
String order,
String orderBy,
List<int> parent,
List<int> parentExclude,
List<String> status,    // Options: any, pending, processing, on-hold, completed, cancelled, refunded, failed and trash. Default is any.
int customer,
int product,
int dp

API Call

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

// Call API
List<Order> orders = await WooSignal.instance.getOrders();

Response

List<Order> instance

Represents the following object - WooCommerce list all orders

Retrieve a order by it's ID

getOrders()

Parameters

int id,

String dp, // (Optional) Number of decimal points to use in each resource.

API Call

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

// Call API
Order order = await WooSignal.instance.retrieveOrder(id: "order id");

Response

Order instance

Represents the following object - WooCommerce retrieve order


Delete an order

This API helps you delete an order.

deleteOrder(int id)

Parameters

int id,
bool force = true

API Call

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

// Call API
Order order = await WooSignal.instance.deleteOrder("order id");

Response

Order instance

Represents the following object - WooCommerce orders


Batch update orders

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

batchOrders({ data })

Parameters

int id,
bool force = true

API Call

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

// Call API
OrderBatch orderBatch = await WooSignal.instance.batchOrders({});

Response

OrderBatch instance

Represents the following object - WooCommerce order batch