# Shipping Insurance

Shipping insurance can be purchased for any `Shipment` by
specifying the value of the shipment's contents. The cost is 1.0% of the declared value, with a
minimum charge of $1.00. All claims are processed and paid within 10 days.

To obtain insurance, first `Buy a Shipment`,
then make the insurance call before the carrier begins handling the package.

---

## Insure a Shipment

### Example: POST /shipments/:id/insure

#### cURL

```shell
curl -X POST https://api.easypost.com/v2/shipments/shp_.../insure \
  -u "EASYPOST_API_KEY": \
  -H 'Content-Type: application/json' \
  -d '{
    "amount": "200"
  }'
```

#### Go

```go
package example

import (
	"fmt"

	"github.com/EasyPost/easypost-go/v5"
)

func insure() {
	client := easypost.New("EASYPOST_API_KEY")

	shipment, _ := client.InsureShipment("shp_...", "100.00")

	fmt.Println(shipment)
}
```

#### Java

```java
package shipments;

import com.easypost.exception.EasyPostException;
import com.easypost.model.Shipment;
import com.easypost.service.EasyPostClient;

import java.util.HashMap;

public class Insure {
    public static void main(String[] args) throws EasyPostException {
        EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");

        HashMap<String, Object> params = new HashMap<String, Object>();
        params.put("amount", 100);

        Shipment shipment = client.shipment.insure("shp_...", params);

        System.out.println(shipment);
    }
}
```

#### C#

```csharp
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using EasyPost;
using Newtonsoft.Json;

namespace EasyPostExamples
{
    public class Examples
    {
        public static async Task Main()
        {
            var client = new EasyPost.Client(new EasyPost.ClientConfiguration("EASYPOST_API_KEY"));

            EasyPost.Models.API.Shipment shipment = await client.Shipment.Insure("shp_...", 200);

            Console.WriteLine(JsonConvert.SerializeObject(shipment, Formatting.Indented));
        }
    }
}
```

#### Node.js

```javascript
const EasyPostClient = require('@easypost/api');

const client = new EasyPostClient('EASYPOST_API_KEY');

(async () => {
  const shipment = await client.Shipment.insure('shp_...', 100);

  console.log(shipment);
})();
```

#### PHP

```php
<?php

$client = new \EasyPost\EasyPostClient('EASYPOST_API_KEY');

$shipment = $client->shipment->insure(
    'shp_...',
    ['amount' => 100]
);

echo $shipment;
```

#### Python

```python
import easypost

client = easypost.EasyPostClient("EASYPOST_API_KEY")

shipment = client.shipment.insure("shp_...", amount=100)

print(shipment)
```

#### Ruby

```ruby
require 'easypost'

client = EasyPost::Client.new(api_key: 'EASYPOST_API_KEY')

shipment = client.shipment.insure('shp_...', amount: 100)

puts shipment
```