API Quick Start
AfterShip Protection helps eCommerce businesses to insure their package against losses and damages.
You can create policies with the Protection API to help your users insure their packages with an insurance fee and claim the insurance amount during losses and damages.
This quickstart guide intends to walk you through 3 common scenarios to let you know how to use the Protection API to seamlessly manage the policies and claims.
1. What is Protection API?
Protection is a shipping insurance for consumers and merchants. As a merchant, you can obtain coverage for your logistics services to reduce the loss of goods due to your logistics, and you can sell this service to your consumers to provide them with additional protection.
You can create and query policies, make claims and check the progress of claims through the APIs.
2. API Endpoint
All endpoints are only accessible via HTTPS
.
3. API Model Flow
4. Common scenarios
Scenario 1. Create policy
preparing...
While creating a policy, we need:
1. Original Address
The original address of the package, such as storehouse or dropshipping address, is required to help the insurer track the logistics of the package.
2. Destination Address
The destination address of the package (customer’s address) is required to help the insurer track the logistics of the package.
3. Product Information
Product Information of the package, including sku, quantity, name and price is required to display it on the Protection Admin Portal.
4. Protection Insured fee
Protection Insured fee or the ‘“Premium” for the package, which is used to verify the price calculated on the developer’s side.
Scenario 2. Create claim
preparing...
For creating a claim, the policy needs to be active. You can update the claim in the processing flow, but you can't create a new claim against this policy.
For processing a claim request, we need:
1. Commodity
The commodity in the package for verifying the claim request.
2. Type
The claim type you want to apply for, such as:
- Stolen
- Damaged
- LostInTransit
3. Loss Date
The loss date will always be the date of application.
Scenario 3. Query policy
preparing...
When you need to check the policy status, you can query the policy entity with the policyId.
The response for the policy entity will look like this:
preparing...
Scenario 4. Query claim
preparing...
When you need to check the claim status, you can query the claim entity with the ClaimId.
The response for the claim entity will look like this:
preparing...