# List Shipping Rates

GET https://services.leadconnectorhq.com/store/shipping-zone/{shippingZoneId}/shipping-rate

The "List Shipping Rate" API allows to retrieve a list of shipping rate.

## Authentication

Send `Authorization: Bearer <token>` using:

- **Sub-Account token: OAuth access token or Private Integration Token.** No scopes required.

## Parameters

### Header Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `Version` | string | Yes | API Version |

### Path Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `shippingZoneId` | string | Yes | ID of the item that needs to be returned |

### Query Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `altId` | string | Yes | Location Id or Agency Id |
| `altType` | string | Yes |  |
| `limit` | number | No | The maximum number of items to be included in a single page of results |
| `offset` | number | No | The starting index of the page, indicating the position from which the results should be retrieved. |

## OpenAPI Specification

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "HighLevel API",
    "version": "2021-04-15"
  },
  "servers": [
    {
      "url": "https://services.leadconnectorhq.com"
    }
  ],
  "paths": {
    "/store/shipping-zone/{shippingZoneId}/shipping-rate": {
      "get": {
        "summary": "List Shipping Rates",
        "operationId": "listShippingRates",
        "description": "The \"List Shipping Rate\" API allows to retrieve a list of shipping rate.",
        "parameters": [
          {
            "name": "Version",
            "in": "header",
            "required": true,
            "description": "API Version",
            "schema": {
              "type": "string",
              "enum": [
                "2021-04-15"
              ]
            }
          },
          {
            "name": "shippingZoneId",
            "required": true,
            "in": "path",
            "description": "ID of the item that needs to be returned",
            "schema": {
              "example": "6578278e879ad2646715ba9c",
              "type": "string"
            }
          },
          {
            "name": "altId",
            "required": true,
            "in": "query",
            "description": "Location Id or Agency Id",
            "schema": {
              "example": "6578278e879ad2646715ba9c",
              "type": "string"
            }
          },
          {
            "name": "altType",
            "required": true,
            "in": "query",
            "schema": {
              "enum": [
                "location"
              ],
              "type": "string"
            }
          },
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "description": "The maximum number of items to be included in a single page of results",
            "schema": {
              "default": 0,
              "example": 20,
              "type": "number"
            }
          },
          {
            "name": "offset",
            "required": false,
            "in": "query",
            "description": "The starting index of the page, indicating the position from which the results should be retrieved.",
            "schema": {
              "default": 0,
              "example": 0,
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListShippingRateResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestDTO"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedDTO"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnprocessableDTO"
                }
              }
            }
          }
        },
        "security": [
          {
            "Location-Access": []
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearer": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Sub-Account (OR) Private Integration Token of Sub-Account.",
        "type": "http"
      },
      "Location-Access": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Sub-Account (OR) Private Integration Token of Sub-Account.",
        "type": "http"
      },
      "Agency-Access": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Agency (OR) Private Integration Token of Agency.",
        "type": "http"
      }
    },
    "schemas": {
      "ListShippingRateResponseDto": {
        "type": "object",
        "properties": {
          "total": {
            "type": "number",
            "description": "Total number of items",
            "example": 20
          },
          "data": {
            "description": "An array of items",
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "altId": {
                  "type": "string",
                  "description": "Location Id or Agency Id",
                  "example": "6578278e879ad2646715ba9c"
                },
                "altType": {
                  "type": "string",
                  "enum": [
                    "location"
                  ]
                },
                "name": {
                  "type": "string",
                  "description": "Name of the shipping zone",
                  "example": "North zone"
                },
                "description": {
                  "type": "string",
                  "description": "Delivery description",
                  "example": "Ships next day"
                },
                "currency": {
                  "type": "string",
                  "description": "The currency of the amount of the rate / handling fee",
                  "example": "USD"
                },
                "amount": {
                  "type": "number",
                  "description": "The amount of the shipping rate if it is normal rate (0 means free ). Fixed Handling fee if it is a carrier rate (it will add to the carrier rate).",
                  "example": 99.99
                },
                "conditionType": {
                  "type": "string",
                  "description": "Type of condition to provide the conditional pricing",
                  "enum": [
                    "none",
                    "price",
                    "weight"
                  ],
                  "example": "price"
                },
                "minCondition": {
                  "type": "number",
                  "description": "Minimum condition for applying this price. set 0 or null if there is no minimum",
                  "example": 99.99
                },
                "maxCondition": {
                  "type": "number",
                  "description": "Maximum condition for applying this price. set 0 or null if there is no maximum",
                  "example": 99.99
                },
                "isCarrierRate": {
                  "type": "boolean",
                  "description": "is this a carrier rate",
                  "example": true
                },
                "shippingCarrierId": {
                  "type": "string",
                  "description": "Shipping carrier id",
                  "example": "655b33a82209e60b6adb87a5"
                },
                "percentageOfRateFee": {
                  "type": "number",
                  "description": "Percentage of rate fee if it is a carrier rate.",
                  "example": 10.99
                },
                "shippingCarrierServices": {
                  "description": "An array of items",
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "description": "Name of the shipping carrier service",
                        "example": "Priority Mail Express International"
                      },
                      "value": {
                        "type": "string",
                        "description": "Value of the shipping carrier service",
                        "example": "PriorityMailExpressInternational"
                      }
                    },
                    "required": [
                      "name",
                      "value"
                    ],
                    "title": "ShippingCarrierServiceDto"
                  }
                },
                "_id": {
                  "type": "string",
                  "description": "The unique identifier for the product.",
                  "example": "655b33a82209e60b6adb87a5"
                },
                "shippingZoneId": {
                  "type": "string",
                  "description": "The unique identifier for the shipping zone.",
                  "example": "655b33a82209e60b6adb87a5"
                },
                "createdAt": {
                  "type": "string",
                  "description": "created at",
                  "example": "2023-12-12T09:27:42.355Z"
                },
                "updatedAt": {
                  "type": "string",
                  "description": "updated at",
                  "example": "2023-12-12T09:27:42.355Z"
                }
              },
              "required": [
                "altId",
                "altType",
                "name",
                "currency",
                "amount",
                "conditionType",
                "minCondition",
                "maxCondition",
                "shippingCarrierId",
                "_id",
                "shippingZoneId",
                "createdAt",
                "updatedAt"
              ],
              "title": "ShippingRateSchema"
            }
          }
        },
        "required": [
          "total",
          "data"
        ],
        "title": "ListShippingRateResponseDto"
      },
      "BadRequestDTO": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "number",
            "example": 400
          },
          "message": {
            "type": "string",
            "example": "Bad Request"
          }
        },
        "title": "BadRequestDTO"
      },
      "UnauthorizedDTO": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "number",
            "example": 401
          },
          "message": {
            "type": "string",
            "example": "Invalid token: access token is invalid"
          },
          "error": {
            "type": "string",
            "example": "Unauthorized"
          }
        },
        "title": "UnauthorizedDTO"
      },
      "UnprocessableDTO": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "number",
            "example": 422
          },
          "message": {
            "example": [
              "Unprocessable Entity"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "error": {
            "type": "string",
            "example": "Unprocessable Entity"
          }
        },
        "title": "UnprocessableDTO"
      }
    }
  }
}
```

## HighLevel SDK Examples

**Node.js** (`@gohighlevel/api-client`)

```javascript
import HighLevel from '@gohighlevel/api-client';

const ghl = new HighLevel({
  privateIntegrationToken: '<PRIVATE_INTEGRATION_TOKEN>'
});

const response = await ghl.store.listShippingRates('<SHIPPINGZONEID>', { altId: '<ALTID>', altType: '<ALTTYPE>' });
console.log(response);
```

**Python** (`gohighlevel-api-client`)

```python
from highlevel import HighLevel

client = HighLevel(
    private_integration_token='<PRIVATE_INTEGRATION_TOKEN>'
)

response = await client.store.list_shipping_rates('<SHIPPINGZONEID>', altId='<ALTID>', altType='<ALTTYPE>')
print(response)
```

**PHP** (`gohighlevel/api-client`)

```php
<?php
require_once 'vendor/autoload.php';

use HighLevel\HighLevel;
use HighLevel\HighLevelConfig;

$config = new HighLevelConfig([
    'privateIntegrationToken' => '<PRIVATE_INTEGRATION_TOKEN>'
]);
$ghl = new HighLevel($config);

$response = $ghl->store->listShippingRates('<SHIPPINGZONEID>', ['altId' => '<ALTID>', 'altType' => '<ALTTYPE>']);
echo json_encode($response, JSON_PRETTY_PRINT);
```

## Code Examples

**cURL**

```bash
curl -L -X GET 'https://services.leadconnectorhq.com/store/shipping-zone/<shippingZoneId>/shipping-rate?altId=<ALTID>&altType=<ALTTYPE>' \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Version: 2021-04-15'
```

**Node.js**

```javascript
const options = {
  method: 'GET',
  headers: {
    Authorization: 'Bearer <TOKEN>',
    Version: '2021-04-15'
  }
};

try {
  const response = await fetch('https://services.leadconnectorhq.com/store/shipping-zone/<shippingZoneId>/shipping-rate?altId=<ALTID>&altType=<ALTTYPE>', options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

**Python**

```python
import requests

url = "https://services.leadconnectorhq.com/store/shipping-zone/{shippingZoneId}/shipping-rate"

headers = {
    "Authorization": "Bearer <TOKEN>",
    "Version": "2021-04-15"
}

params = {
    "altId": "<ALTID>",
    "altType": "<ALTTYPE>"
}

response = requests.get(url, params=params, headers=headers)
print(response.json())
```

**PHP**

```php
<?php
$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => 'https://services.leadconnectorhq.com/store/shipping-zone/<shippingZoneId>/shipping-rate?altId=<ALTID>&altType=<ALTTYPE>',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => [
    'Authorization: Bearer <TOKEN>',
    'Version: 2021-04-15',
  ],
]);

$response = curl_exec($curl);
curl_close($curl);
echo $response;
```

**Java**

```java
HttpResponse<String> response = Unirest
  .get("https://services.leadconnectorhq.com/store/shipping-zone/<shippingZoneId>/shipping-rate?altId=<ALTID>&altType=<ALTTYPE>")
  .header("Authorization", "Bearer <TOKEN>")
  .header("Version", "2021-04-15")
  .asString();
```

**Go**

```go
package main

import (
  "fmt"
  "net/http"
  "io"
)

func main() {
  url := "https://services.leadconnectorhq.com/store/shipping-zone/<shippingZoneId>/shipping-rate?altId=<ALTID>&altType=<ALTTYPE>"
  req, _ := http.NewRequest("GET", url, nil)
  req.Header.Add("Authorization", "Bearer <TOKEN>")
  req.Header.Add("Version", "2021-04-15")

  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := io.ReadAll(res.Body)
  fmt.Println(string(body))
}
```

**Ruby**

```ruby
require 'uri'
require 'net/http'

url = URI("https://services.leadconnectorhq.com/store/shipping-zone/<shippingZoneId>/shipping-rate?altId=<ALTID>&altType=<ALTTYPE>")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = "Bearer <TOKEN>"
request["Version"] = "2021-04-15"

response = http.request(request)
puts response.read_body
```

**PowerShell**

```powershell
$headers = @{
  "Authorization" = "Bearer <TOKEN>"
  "Version" = "2021-04-15"
}

$response = Invoke-RestMethod -Uri 'https://services.leadconnectorhq.com/store/shipping-zone/<shippingZoneId>/shipping-rate?altId=<ALTID>&altType=<ALTTYPE>' -Method 'GET' -Headers $headers
$response | ConvertTo-Json
```
