Shipping Methods


Overview

The shipping methods API allows you to retrieve a batch of results.


List all shipping methods

Returns shipping methods back from WooCommerce, include parementers to query data.

getShippingMethods()

API Call

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

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

    wcStore.getShippingMethods().then( (shippingMethods) {
        print(shippingMethods[0].name);
    });

});

Response

List<WSShipping> instance

Represents the following object

[
    {
        "parent_id": 2,
        "name": "USA",
        "locations": [
            {
                "code": "US",
                "type": "country"
            },
            {
                "code": "33025",
                "type": "postcode"
            }
        ],
        "methods": {
            "flat_rate": [
                {
                    "id": 4,
                    "title": "Flat rate",
                    "method_id": "flat_rate",
                    "cost": "4.99",
                    "class_cost": "0",
                    "calculation_type": "class",
                    "taxable": true,
                    "shipping_classes": [
                        {
                            "id": "57",
                            "cost": "2.99*2"
                        }
                    ]
                }
            ]
        }
    },
    {
        "parent_id": 1,
        "name": "App Shipping",
        "locations": [
            {
                "code": "GB",
                "type": "country"
            },
            {
                "code": "US",
                "type": "country"
            }
        ],
        "methods": {
            "free_shipping": [
                {
                    "id": 1,
                    "title": "Free shipping",
                    "method_id": "free_shipping",
                    "cost": "0"
                }
            ],
            "flat_rate": [
                {
                    "id": 2,
                    "title": "Delivery 1st class",
                    "method_id": "flat_rate",
                    "cost": "2.99",
                    "class_cost": "10",
                    "calculation_type": "class",
                    "taxable": true,
                    "shipping_classes": [
                        {
                            "id": "58",
                            "cost": "5"
                        },
                        {
                            "id": "57",
                            "cost": "2"
                        }
                    ]
                },
                {
                    "id": 6,
                    "title": "Best delivery",
                    "method_id": "flat_rate",
                    "cost": "20",
                    "class_cost": "0",
                    "calculation_type": "class",
                    "taxable": true,
                    "shipping_classes": [
                        {
                            "id": "58",
                            "cost": "3.99"
                        }
                    ]
                }
            ],
            "local_pickup": [
                {
                    "id": 5,
                    "title": "Local pickup",
                    "method_id": "local_pickup",
                    "taxable": false,
                    "cost": "0"
                }
            ]
        }
    }
]