# Get Rates

## Get Rates

<mark style="color:green;">`POST`</mark> `https://api-sandbox.shiplemon.com/v1/rates`

This method returns all the rates available in order to create a shipment

#### Request Body

| Name          | Type   | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| ------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| items         | array  | <p>This is an array that describes more details about the items that will be sent in the shipment and that you want to get rates for.<br><br>Each item in this array is an object in the following format (all the dimensions are in <em><strong>cm</strong></em> and the weight in <em><strong>grams</strong></em>)<br><br>For domestic and EU shipments the <code>value</code> parameter is optional.<br><br><code>{"weight":1000,</code><br><code>"height":20,</code><br><code>"width":20,</code><br><code>"length":20,</code><br><code>"value":20,</code><br><code>"notes":"nike air max"}</code></p>                                                                                                                                 |
| address\_from | object | <p>This object describes where the pickup of the item will happen. This is the starting point (point A) of the shipment.<br><br>This object requires the following details:<br><code>{"country": "GR","zip": "14451"}</code><br>OR<br><code>{"country": "AE","city": "Dubai"}</code><br><br>In cases where <strong>zip</strong> is available, zip is required. If country doesn't support zip code or postal code, then the <strong>city</strong> parameter is required.<br><br>Here's a list that we adhere to for zip rules per country:<br><https://cfg.weship.gr/countries-postal-rules.json><br><br>In the country parameter we accept the ALPHA-2 code format. You can find more here:<br><https://www.iban.com/country-codes>)</p> |
| address\_to   | object | The same format as the address\_from in order to define the destination of the shipment (point B)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |

{% tabs %}
{% tab title="200 " %}

```
```

{% endtab %}
{% endtabs %}

## Specific examples per language

{% tabs %}
{% tab title="cURL" %}

```
curl --location --request POST 'https://api-sandbox.shiplemon.com/v1/rates' \
--header 'x-api-key: <YOUR_API_KEY>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "address_from": {
        "country": "GR",
        "zip": "14451"
    },
    "address_to": {
        "country": "DE",
        "zip": "81667"
    },
    "items": [
        {
            "weight": 2000,
            "height": 10,
            "width": 10,
            "length": 10,
            "notes": "",
            "value": 20
        }
    ]
}'
```

{% endtab %}
{% endtabs %}

## Example data for request

* Weight : Weight of package in grams (int)
* Height : Height of package in cm (int)
* Width : Widht of package in cm (int)
* Lenght : Length of package in cm (int)
* Value : Value of package in designated currency (int)
* Currency : Designated currency. Supports all of ISO currency strings. Default is EUR

```
{
    "items": [
        {
            "weight": 3000,
            "height": 10,
            "width": 30,
            "length": 20,
            "notes": "Nike air max",
            "value": 10,
            "currency": "EUR"
        }
    ],
    "address_from": {
        "country": "GR",
        "zip": "11111",
        "name": "John Doe",
        "state": "I",
        "city": "Athens",
        "address": "Jane Street 1",
        "email": "john@mail.com",
        "phone": "+3000000000",
        "notes": ""
    },
    "address_to": {
        "name": "SG2",
        "country": "GR",
        "state": "I",
        "city": "Athens",
        "zip": "11111",
        "address": "Jane Street 2",
        "email": "mary@mail.com",
        "phone": "+3000000000"
    }
}
```

## Example response

Returns an array of rates for each carrier.

```
{
    "id": "dhl_N_eea60867-02d5-4795-b27d-87f85685465c",
    "friendly_name": null,
    "driver": "dhl",
    "provider": {
        "name": "DHL Express",
        "image": "https://static.shiplemon.com/providers/dhl.svg"
     },
     "service": {
        "code": "dhl_express_domestic",
        "name": "Domestic Express",
        "estimated_delivery_in_days": 4
      },
      "total_amount": 11.47,
      "total_without_tax_amount": 9.25,
      "tax_amount": 2.22,
      "currency": "EUR",
      "has_cash_on_delivery": false,
      "has_custom_credentials": false,
      "has_shipment_pickup_combined": false,
      "has_pickup": true,
      "transportation": "road",
      "has_mass_printing": true,
      "has_customs_invoice_upload": true,
      "has_insurance_ability": false,
      "has_saturday_delivery": false,
      "has_same_day_pickup": true,
      "pickup_slot_length_in_hours": 2,
      "pickup_same_day_latest_at": "17:00",
      "pickup_earliest_at": "13:00",
      "pickup_latest_at": "17:00",
      "metadata": {
        "items": [
          {
            "weight": 3000,
            "height": 10,
            "width": 30,
            "length": 20,
            "notes": "Nike air max",
            "value": 10,
            "currency": "EUR"
          }
         ],
        "address_from": {
          "country": "GR",
          "zip": "11111",
          "name": "John Doe",
          "state": "I",
          "city": "Athens",
          "address": "Jane Street 1",
          "email": "john@mail.com",
          "phone": "+3000000000",
          "notes": ""
        },
        "address_to": {
          "name": "SG2",
          "country": "GR",
          "state": "I",
          "city": "Athens",
          "zip": "11111",
          "address": "Jane Street 2",
          "email": "mary@mail.com",
          "phone": "+3000000000"
        }
      }
}
```
