# Shipping Rate

{% hint style="info" %}
Shipping Rate task is available only on Advanced Shopify plan or higher.
{% endhint %}

With this task you can create your custom shipping rates returned on checkout shipping step. Task allows creating complex logic to calculate shipping rate based on:

* cart items&#x20;
* shipping address
* customer (Shopify Script Editor required)

Incoming request has following format:&#x20;

```
  {
    "rate": {
      "origin": {
        "country": "CA",
        "postal_code": "K2P1L4",
        "province": "ON",
        "city": "Ottawa",
        "name": null,
        "address1": "150 Elgin St.",
        "address2": "",
        "address3": null,
        "phone": "16135551212",
        "fax": null,
        "email": null,
        "address_type": null,
        "company_name": "Jamie D's Emporium"
      },
      "destination": {
        "country": "CA",
        "postal_code": "K1M1M4",
        "province": "ON",
        "city": "Ottawa",
        "name": "Bob Norman",
        "address1": "24 Sussex Dr.",
        "address2": "",
        "address3": null,
        "phone": null,
        "fax": null,
        "email": null,
        "address_type": null,
        "company_name": null
      },
      "items": [
        {
          "name": "Short Sleeve T-Shirt",
          "sku": "",
          "quantity": 1,
          "grams": 1000,
          "price": 1999,
          "vendor": "Jamie D's Emporium",
          "requires_shipping": true,
          "taxable": true,
          "fulfillment_service": "manual",
          "properties": null,
          "product_id": 48447225880,
          "variant_id": 258644705304
        }
      ],
      "currency": "USD",
      "locale": "en"
    }
  }
```

You can access this payload through `request` object:

```
{{request.body.rate | log }}
```

Above line outputs payload to logs.

You can now parse available information to calculate additional shipping rates returned on checkout shipping step.

Example response would look like this:&#x20;

```
{% json response %}
  {
    "body": {
      "rates": [
        {
          "service_name": "canadapost-overnight",
          "service_code": "ON",
          "total_price": "1295",
          "description": "This is the fastest option by far",
          "currency": "CAD",
          "min_delivery_date": "2013-04-12 14:48:45 -0400",
          "max_delivery_date": "2013-04-12 14:48:45 -0400"
        }
      ]
    }
  }
{% endjson %}
```

On checkout you should see:<br>

<figure><img src="https://295845546-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MQfDsLur3-X4nSbZ6jH%2Fuploads%2FKgx64Q88h6taR4hjcl1c%2Fimage.png?alt=media&#x26;token=71e2c03e-d788-45d4-8833-7722021e450b" alt=""><figcaption></figcaption></figure>
