Refunds


Overview

The refunds API allows you to create, view, and delete individual refunds.


Create a order note

This API helps you to create a new refund for an order.

createRefund({})

Parameters

@required String amount,
@required int orderId,

API Call

// CONFIG FOR WOOSIGNAL
var wsConfig = {
"appKey":"your app key",
"debugMode":true
};

// CREATING AN INSTANCE
WooSignal.getInstance(config: wsConfig).then( (wcStore) {

    wcStore.createRefund({
      String amount,
      int orderId,
    }).then( (orderNote) {
        print(orderNote.toJson());
    });
});

Response

Refund instance

Represents the following object - WooCommerce create a refund


Retrieve a refund

This API lets you retrieve and view a specific refund from an order.

retrieveRefund({})

Parameters

@required int orderId,
@required int refundId,
String dp,

API Call

// CONFIG FOR WOOSIGNAL
var wsConfig = {
"appKey":"your app key",
"debugMode":true
};

// CREATING AN INSTANCE
WooSignal.getInstance(config: wsConfig).then( (wcStore) {

  wcStore.retrieveRefund({
    int orderId,
    int refundId,
    String dp,
  }).then( (orderNote) {
      print(orderNote.toJson());
  });
});

Response

Refund instance

Represents the following object - WooCommerce retrieve a refund


List all refunds

This API helps you to view all the refunds from an order.

getRefunds(int orderId)

Parameters

String context,
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,
int dp

API Call

// CONFIG FOR WOOSIGNAL
var wsConfig = {
"appKey":"your app key",
"debugMode":true
};

// CREATING AN INSTANCE
WooSignal.getInstance(config: wsConfig).then( (wcStore) {

  wcStore.getRefunds(int id).then( (refunds) {
      print(refunds.toString());
  });
});

Response

List<Refund> instance

Represents the following object - WooCommerce list all refunds


Delete a refund

This API helps you delete an order refund.

deleteRefund(int orderId, int refundId)

Parameters

int orderId,
int refundId

API Call

// CONFIG FOR WOOSIGNAL
var wsConfig = {
"appKey":"your app key",
"debugMode":true
};

// CREATING AN INSTANCE
WooSignal.getInstance(config: wsConfig).then( (wcStore) {

  wcStore.deleteRefund({
    int orderId,
    int refundId,
  }).then( (refunds) {
      print(refunds.toString());
  });
});

Response

List<Refund> instance

Represents the following object - WooCommerce delete a refund