Get Insurance Quote
curl --request GET \
--url 'https://api.production.orderprotection.com/v1/quote/insurance?store_url={store_url}'import requests
url = "https://api.production.orderprotection.com/v1/quote/insurance?store_url={store_url}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.production.orderprotection.com/v1/quote/insurance?store_url={store_url}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.production.orderprotection.com/v1/quote/insurance?store_url={store_url}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.production.orderprotection.com/v1/quote/insurance?store_url={store_url}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.production.orderprotection.com/v1/quote/insurance?store_url={store_url}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.production.orderprotection.com/v1/quote/insurance?store_url={store_url}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"id": "clz1sc3z8039p8ruxx7mrob50",
"automaticallyAddToCart": true,
"mandatoryOp": false,
"rules": [
{
"id": "cm7b0iepj0007wbgxv6q91iaj",
"min": 0,
"max": 5000,
"terms": {
"paidBy": "customer",
"customer": {
"amount": 10,
"type": "fixed"
}
}
},
{
"id": "cm7b0ieoo0005wbgx3790q9ex",
"min": 5000,
"max": 6000,
"terms": {
"paidBy": "brand",
"brand": {
"amount": 5,
"type": "fixed"
}
}
}
],
"variants": null
}{
"message": "The store_url parameter is invalid. The value must be a valid hostname without protocol or path (e.g., 'store.website.com' is valid, but 'https://store.website.com' is not).",
"error": "store_url must be a valid hostname",
"statusCode": 400
}{
"message": "Store not found",
"statusCode": 404
}Quote
Get Insurance Quote
Retrieves insurance pricing rules.
GET
/
v1
/
quote
/
insurance?store_url=
{store_url}
Get Insurance Quote
curl --request GET \
--url 'https://api.production.orderprotection.com/v1/quote/insurance?store_url={store_url}'import requests
url = "https://api.production.orderprotection.com/v1/quote/insurance?store_url={store_url}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.production.orderprotection.com/v1/quote/insurance?store_url={store_url}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.production.orderprotection.com/v1/quote/insurance?store_url={store_url}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.production.orderprotection.com/v1/quote/insurance?store_url={store_url}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.production.orderprotection.com/v1/quote/insurance?store_url={store_url}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.production.orderprotection.com/v1/quote/insurance?store_url={store_url}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"id": "clz1sc3z8039p8ruxx7mrob50",
"automaticallyAddToCart": true,
"mandatoryOp": false,
"rules": [
{
"id": "cm7b0iepj0007wbgxv6q91iaj",
"min": 0,
"max": 5000,
"terms": {
"paidBy": "customer",
"customer": {
"amount": 10,
"type": "fixed"
}
}
},
{
"id": "cm7b0ieoo0005wbgx3790q9ex",
"min": 5000,
"max": 6000,
"terms": {
"paidBy": "brand",
"brand": {
"amount": 5,
"type": "fixed"
}
}
}
],
"variants": null
}{
"message": "The store_url parameter is invalid. The value must be a valid hostname without protocol or path (e.g., 'store.website.com' is valid, but 'https://store.website.com' is not).",
"error": "store_url must be a valid hostname",
"statusCode": 400
}{
"message": "Store not found",
"statusCode": 404
}A range of pricing rules is returned, and the logic to determine which rule to use should be handled on the client side.
The
store_url is the URL of the store to get insurance quote for, e.g. docs.orderprotection.com.
Example
If the subtotal (the price before add-ons and shipping) is$1,000, and one of the pricing rules specifies a minimum of $0 and a maximum of $5,000, this rule should be applied to calculate the price of Order Protection, as the subtotal falls within the specified range.
Notes
-
The amounts in pricing rules are always in
USD. If the subtotal is in a different currency, the amount should be converted to the cart’s currency using the current exchange rate. -
The
rulesarray is sorted byminin ascending order. -
If the pricing rule has a type of
brand, Order Protection should not be added to the cart.
Path Parameters
URL of the store to get insurance quote for
Response
Successfully retrieved insurance quote
Example:
"clz1sc3z8039p8ruxx7mrob50"
Order Protection should automatically be added to the cart if this is true
Example:
true
Order Protection should always be added to the cart
Example:
false
Show child attributes
Show child attributes
Example:
null

