> For the complete documentation index, see [llms.txt](https://dev.ucommerce.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dev.ucommerce.net/readme/headless/reference/shipping-methods.md).

# Shipping Methods

## Prerequisites

* `access_token` from [Headless API Authentication](/readme/headless/headless-api-authentication.md)
* `cultureCode`, e.g. `en-US` (string)
* `countryId` from [Countries](/readme/headless/reference/countries.md)
* `priceGroupId` from the cart or from [Price Groups](/readme/headless/reference/price-groups.md)

## Get Shipping Methods

### Optional Parameters

* `maxItems`, limits the number of results returned. in [Pagination](/readme/headless/pagination.md)
* `nextPagingToken`, required to fetch the next page. Read more in [Pagination](/readme/headless/pagination.md)

### Request

```bash
curl -D- -X GET <base_url>/api/v1/shipping-methods?cultureCode=<cultureCode>&countryId=<countryId>&priceGroupId=<priceGroupId> \
    -H 'Authorization: Bearer <ACCESS_TOKEN>'
    -H 'Content-Type: application/json' \
```

### Response

```json
{
   "nextPagingToken": null,
   "shippingMethods": [
        {
           "description": "{description}",
           "displayName": "{displayName}",
           "id": "{id}",
           "imageUrl": "{imageUrl}",
           "name": "{name}",
           "price": {
           "amount": "{amount}",
           "currency": "{currency}"
           }
        },
        {
           "description": "{description}",
           "displayName": "{displayName}",
           "id": "{id}",
           "imageUrl": "{imageUrl}",
           "name": "{name}",
           "price": {
           "amount": "{amount}",
           "currency": "{currency}"
           }
        },
        {
           "description": "{description}",
           "displayName": "{displayName}",
           "id": "{id}",
           "imageUrl": "{imageUrl}",
           "name": "{name}",
           "price": {
           "amount": "{amount}",
           "currency": "{currency}"
           }
        }
       ]
}
```

## Error Handling

| Error              | Description                                                         |
| ------------------ | ------------------------------------------------------------------- |
| BadRequest (400)   | No shipping methods are found for the given price group or country. |
| Unauthorized (401) | The token is expired.                                               |
| Forbidden (403)    | The token does not have access to this endpoint.                    |

Error Response Example

```json
{
"errors":
    [
        {
            "error-description": "Shipping methods not found on the given context.",
            "error": "BadRequest"
        }
    ]
}
```

## Related Articles

{% content-ref url="/pages/OKRcu1Dp3gn5Y38w55HD" %}
[Error Handling](/readme/headless/error-handling.md)
{% endcontent-ref %}
