deleteShippingZoneMethod method

Future<WooShippingZoneMethod> deleteShippingZoneMethod({
  1. required int zoneId,
  2. required int methodId,
})

Deletes an existing shipping zone method and returns the WooShippingZoneMethod object.

Related endpoint: https://woocommerce.github.io/woocommerce-rest-api-docs/#orders.

Implementation

Future<WooShippingZoneMethod> deleteShippingZoneMethod(
    {required int zoneId, required int methodId}) async {
  Map data = {
    'force': true,
  };
  _printToLog(
      'Deleting shipping zone method with zoneId : ' + zoneId.toString());
  _setApiResourceUrl(
      path: 'shipping/zones/' +
          zoneId.toString() +
          'methods/' +
          methodId.toString());
  final response = await delete(queryUri.toString(), data);
  return WooShippingZoneMethod.fromJson(response);
}