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 parameters to query data.

getShippingMethods()

API Call

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

// Call API
List<WSShipping> shipping = await WooSignal.instance.getShippingMethods();

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"
                }
            ]
        }
    }
]