API Quick Start

AfterShip Protection helps eCommerce businesses insure their packages against loss, theft, and damage.

This quick start guide will walk you through the three most common scenarios for using the AfterShip Protection API.


As a merchant, you can sell shipping protection to your customers, or cover the cost of protection yourself, to help protect your bottom line when things go wrong with a shipment. The API allows you to calculate the premium, add protection to orders, and check the status of an order's coverage.

preparing...

All endpoints are only accessible via HTTPS.

We have created a sandbox environment where you can test the Protection API. Any protection created in the sandbox environment will not be charged or take effect, but will still display on your AfterShip Protection admin. After creating coverage in the sandbox environment, you can file a test claim from the admin to check the resolution process.

Once testing is complete, you only need to modify the host to switch to the production environment. The table below shows the hosts and other details used for the sandbox and production environments.

ItemSandboxLive
API Hostsandbox-api.aftership.comapi.aftership.com
Charge for coverage❎ ✅ 
API KeySame as live

By sending the order subtotal and shipping fee (optional), we will calculate the premium for insuring the order. You can then display this premium to your customers on the checkout page or anywhere else you wish.

preparing...

Response

preparing...

After calling the API, open the AfterShip Protection admin to confirm that the coverage has been created successfully and its status is activate.

preparing...

You can create coverage using the 'Create Coverage' API without providing any tracking information. In this scenario, the coverage will be inactive until you ship the order and update the tracking information.

preparing...

After shipping the order, you can use the 'Update a coverage tracking info' API to update the tracking information and activate the coverage.

preparing...

This API allows you to void coverage only if its status is inactive. Once voided, you will not be charged for the coverage.

preparing...