WooTaxRateApi extension
WooCommerce Tax Rate API Extension
This extension provides comprehensive tax rate management capabilities for WooCommerce stores. It enables creation, retrieval, updating, and deletion of tax rates with extensive filtering and sorting options to help store owners manage complex tax configurations.
Key Features
- Tax Rate Management: Full CRUD operations for tax rates
- Advanced Filtering: Filter by tax class, geographical location, and more
- Flexible Sorting: Sort tax rates by various attributes
- Geographical Targeting: Support for country, state, city, and postal code rules
- Pagination Support: Handle large datasets with page-based navigation
Example Usage
// Get all tax rates
final taxRates = await wooCommerce.getTaxRates();
// Get tax rates for a specific tax class
final standardRates = await wooCommerce.getTaxRates(
taxClass: 'standard',
orderBy: WooTaxRateOrderBy.rate,
);
// Create a new tax rate
final newTaxRate = WooTaxRate(
country: 'US',
state: 'CA',
rate: '8.25',
name: 'California Sales Tax',
);
final created = await wooCommerce.createTaxRate(newTaxRate);
- on
Methods
-
batchUpdateTaxRates(
WooTaxRateBatchRequest request, {bool? useFaker}) → Future< WooTaxRateBatchResponse> -
Available on WooCommerce, provided by the WooTaxRateApi extension
Performs batch operations on tax rates. -
createTaxRate(
WooTaxRate taxRate, {bool? useFaker}) → Future< WooTaxRate> -
Available on WooCommerce, provided by the WooTaxRateApi extension
Creates a new tax rate in the WooCommerce store. -
deleteTaxRate(
int taxRateId, {bool? useFaker}) → Future< void> -
Available on WooCommerce, provided by the WooTaxRateApi extension
Deletes a tax rate from the WooCommerce store. -
getTaxRate(
int id, {bool? useFaker}) → Future< WooTaxRate> -
Available on WooCommerce, provided by the WooTaxRateApi extension
Retrieves a specific tax rate by ID from the WooCommerce store. -
getTaxRates(
{WooContext context = WooContext.view, int page = 1, int perPage = 10, int? offset, WooSortOrder order = WooSortOrder.desc, WooTaxRateOrderBy orderBy = WooTaxRateOrderBy.date, String? taxClass, bool? useFaker}) → Future< List< WooTaxRate> > -
Available on WooCommerce, provided by the WooTaxRateApi extension
Retrieves a list of tax rates from the WooCommerce store. -
updateTaxRate(
WooTaxRate taxRate, {bool? useFaker}) → Future< WooTaxRate> -
Available on WooCommerce, provided by the WooTaxRateApi extension
Updates an existing tax rate in the WooCommerce store.